harperdb 4.7.0-alpha.8 → 4.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,439 @@
1
+ function W3(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(o,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Zw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rx={exports:{}},xd={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bN;function Q3(){if(bN)return xd;bN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var l=null;if(i!==void 0&&(l=""+i),r.key!==void 0&&(l=""+r.key),"key"in r){i={};for(var u in r)u!=="key"&&(i[u]=r[u])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:l,ref:r!==void 0?r:null,props:i}}return xd.Fragment=t,xd.jsx=n,xd.jsxs=n,xd}var xN;function J3(){return xN||(xN=1,rx.exports=Q3()),rx.exports}var c=J3();function rA(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=rA(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function oA(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=rA(e))&&(o&&(o+=" "),o+=t);return o}const _N=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wN=oA,Yw=(e,t)=>n=>{var o;if(t?.variants==null)return wN(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,l=Object.keys(r).map(m=>{const p=n?.[m],g=i?.[m];if(p===null)return null;const v=_N(p)||_N(g);return r[m][v]}),u=n&&Object.entries(n).reduce((m,p)=>{let[g,v]=p;return v===void 0||(m[g]=v),m},{}),f=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((m,p)=>{let{class:g,className:v,...x}=p;return Object.entries(x).every(b=>{let[S,C]=b;return Array.isArray(C)?C.includes({...i,...u}[S]):{...i,...u}[S]===C})?[...m,g,v]:m},[]);return wN(e,l,f,n?.class,n?.className)},eB=Yw(`inline-flex
10
+ items-center
11
+ justify-center
12
+ gap-2
13
+ whitespace-nowrap
14
+ rounded-lg
15
+ text-sm
16
+ transition-[color,box-shadow]
17
+ disabled:pointer-events-none
18
+ disabled:opacity-50
19
+ [&_svg]:pointer-events-none
20
+ [&_svg:not([class*='size-'])]:size-4
21
+ [&_svg]:shrink-0
22
+ ring-ring/10
23
+ dark:ring-ring/20
24
+ dark:outline-ring/40
25
+ outline-ring/50
26
+ focus-visible:ring-1
27
+ focus-visible:outline-1
28
+ focus-visible:ring-purple-200
29
+ aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",submit:"bg-gradient-to-r from-blue-100 from-0% to-blue to-100% hover:bg-gradient-to-r hover:from-blue text-primary-foreground shadow-sm",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",positive:"bg-green text-white shadow-xs hover:bg-green/90",positiveOutline:"border bg-transparent border-green border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40",destructiveOutline:"border bg-transparent border-destructive border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40",defaultOutline:"border bg-transparent border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4 text-md",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),Xw="-",tB=e=>{const t=rB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const u=l.split(Xw);return u[0]===""&&u.length!==1&&u.shift(),iA(u,t)||nB(l)},getConflictingClassGroupIds:(l,u)=>{const f=n[l]||[];return u&&o[l]?[...f,...o[l]]:f}}},iA=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?iA(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Xw);return t.validators.find(({validator:l})=>l(i))?.classGroupId},SN=/^\[(.+)\]$/,nB=e=>{if(SN.test(e)){const t=SN.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rB=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const r in n)O_(n[r],o,r,t);return o},O_=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:CN(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(oB(r)){O_(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,l])=>{O_(l,CN(t,i),n,o)})})},CN=(e,t)=>{let n=e;return t.split(Xw).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},oB=e=>e.isThemeGetter,iB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=o.get(i))!==void 0)return r(i,l),l},set(i,l){n.has(i)?n.set(i,l):r(i,l)}}},A_="!",I_=":",sB=I_.length,aB=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const i=[];let l=0,u=0,f=0,m;for(let b=0;b<r.length;b++){let S=r[b];if(l===0&&u===0){if(S===I_){i.push(r.slice(f,b)),f=b+sB;continue}if(S==="/"){m=b;continue}}S==="["?l++:S==="]"?l--:S==="("?u++:S===")"&&u--}const p=i.length===0?r:r.substring(f),g=lB(p),v=g!==p,x=m&&m>f?m-f:void 0;return{modifiers:i,hasImportantModifier:v,baseClassName:g,maybePostfixModifierPosition:x}};if(t){const r=t+I_,i=o;o=l=>l.startsWith(r)?i(l.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const r=o;o=i=>n({className:i,parseClassName:r})}return o},lB=e=>e.endsWith(A_)?e.substring(0,e.length-1):e.startsWith(A_)?e.substring(1):e,cB=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const r=[];let i=[];return o.forEach(l=>{l[0]==="["||t[l]?(r.push(...i.sort(),l),i=[]):i.push(l)}),r.push(...i.sort()),r}},uB=e=>({cache:iB(e.cacheSize),parseClassName:aB(e),sortModifiers:cB(e),...tB(e)}),dB=/\s+/,fB=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:i}=t,l=[],u=e.trim().split(dB);let f="";for(let m=u.length-1;m>=0;m-=1){const p=u[m],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:S}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let C=!!S,E=o(C?b.substring(0,S):b);if(!E){if(!C){f=p+(f.length>0?" "+f:f);continue}if(E=o(b),!E){f=p+(f.length>0?" "+f:f);continue}C=!1}const j=i(v).join(":"),N=x?j+A_:j,T=N+E;if(l.includes(T))continue;l.push(T);const k=r(E,C);for(let A=0;A<k.length;++A){const I=k[A];l.push(N+I)}f=p+(f.length>0?" "+f:f)}return f};function mB(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sA(t))&&(o&&(o+=" "),o+=n);return o}const sA=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=sA(e[o]))&&(n&&(n+=" "),n+=t);return n};function hB(e,...t){let n,o,r,i=l;function l(f){const m=t.reduce((p,g)=>g(p),e());return n=uB(m),o=n.cache.get,r=n.cache.set,i=u,u(f)}function u(f){const m=o(f);if(m)return m;const p=fB(f,n);return r(f,p),p}return function(){return i(mB.apply(null,arguments))}}const An=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},aA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pB=/^\d+\/\d+$/,gB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vB=/\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$/,yB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oc=e=>pB.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),Is=e=>!!e&&Number.isInteger(Number(e)),ox=e=>e.endsWith("%")&&ut(e.slice(0,-1)),qi=e=>gB.test(e),_B=()=>!0,wB=e=>vB.test(e)&&!yB.test(e),cA=()=>!1,SB=e=>bB.test(e),CB=e=>xB.test(e),EB=e=>!Ne(e)&&!Te(e),RB=e=>ru(e,fA,cA),Ne=e=>aA.test(e),ja=e=>ru(e,mA,wB),ix=e=>ru(e,OB,ut),EN=e=>ru(e,uA,cA),jB=e=>ru(e,dA,CB),wh=e=>ru(e,hA,SB),Te=e=>lA.test(e),_d=e=>ou(e,mA),NB=e=>ou(e,AB),RN=e=>ou(e,uA),TB=e=>ou(e,fA),kB=e=>ou(e,dA),Sh=e=>ou(e,hA,!0),ru=(e,t,n)=>{const o=aA.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},ou=(e,t,n=!1)=>{const o=lA.exec(e);return o?o[1]?t(o[1]):n:!1},uA=e=>e==="position"||e==="percentage",dA=e=>e==="image"||e==="url",fA=e=>e==="length"||e==="size"||e==="bg-size",mA=e=>e==="length",OB=e=>e==="number",AB=e=>e==="family-name",hA=e=>e==="shadow",IB=()=>{const e=An("color"),t=An("font"),n=An("text"),o=An("font-weight"),r=An("tracking"),i=An("leading"),l=An("breakpoint"),u=An("container"),f=An("spacing"),m=An("radius"),p=An("shadow"),g=An("inset-shadow"),v=An("text-shadow"),x=An("drop-shadow"),b=An("blur"),S=An("perspective"),C=An("aspect"),E=An("ease"),j=An("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...T(),Te,Ne],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[Te,Ne,f],L=()=>[oc,"full","auto",...P()],V=()=>[Is,"none","subgrid",Te,Ne],ie=()=>["auto",{span:["full",Is,Te,Ne]},Is,Te,Ne],se=()=>[Is,"auto",Te,Ne],ue=()=>["auto","min","max","fr",Te,Ne],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...P()],K=()=>[oc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],U=()=>[e,Te,Ne],re=()=>[...T(),RN,EN,{position:[Te,Ne]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",TB,RB,{size:[Te,Ne]}],W=()=>[ox,_d,ja],B=()=>["","none","full",m,Te,Ne],J=()=>["",ut,_d,ja],ge=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[ut,ox,RN,EN],fe=()=>["","none",b,Te,Ne],ze=()=>["none",ut,Te,Ne],Ve=()=>["none",ut,Te,Ne],Ye=()=>[ut,Te,Ne],He=()=>[oc,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qi],breakpoint:[qi],color:[_B],container:[qi],"drop-shadow":[qi],ease:["in","out","in-out"],font:[EB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qi],shadow:[qi],spacing:["px",ut],text:[qi],"text-shadow":[qi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oc,Ne,Te,C]}],container:["container"],columns:[{columns:[ut,Ne,Te,u]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:k()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Is,"auto",Te,Ne]}],basis:[{basis:[oc,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,oc,"auto","initial","none",Ne]}],grow:[{grow:["",ut,Te,Ne]}],shrink:[{shrink:["",ut,Te,Ne]}],order:[{order:[Is,"first","last","none",Te,Ne]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,_d,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Te,ix]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ox,Ne]}],"font-family":[{font:[NB,Ne,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:[r,Te,Ne]}],"line-clamp":[{"line-clamp":[ut,"none",Te,ix]}],leading:[{leading:[i,...P()]}],"list-image":[{"list-image":["none",Te,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",Te,ja]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[ut,"auto",Te,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ne]}],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",Te,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Is,Te,Ne],radial:["",Te,Ne],conic:[Is,Te,Ne]},kB,jB]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,Te,Ne]}],"outline-w":[{outline:["",ut,_d,ja]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,Sh,wh]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",g,Sh,wh]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[ut,ja]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",v,Sh,wh]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[ut,Te,Ne]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"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":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Te,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ne]}],filter:[{filter:["","none",Te,Ne]}],blur:[{blur:fe()}],brightness:[{brightness:[ut,Te,Ne]}],contrast:[{contrast:[ut,Te,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,Sh,wh]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",ut,Te,Ne]}],"hue-rotate":[{"hue-rotate":[ut,Te,Ne]}],invert:[{invert:["",ut,Te,Ne]}],saturate:[{saturate:[ut,Te,Ne]}],sepia:[{sepia:["",ut,Te,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ne]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[ut,Te,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[ut,Te,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,Te,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,Te,Ne]}],"backdrop-invert":[{"backdrop-invert":["",ut,Te,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[ut,Te,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[ut,Te,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,Te,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",Te,Ne]}],ease:[{ease:["linear","initial",E,Te,Ne]}],delay:[{delay:[ut,Te,Ne]}],animate:[{animate:["none",j,Te,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Te,Ne]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ze()}],"rotate-x":[{"rotate-x":ze()}],"rotate-y":[{"rotate-y":ze()}],"rotate-z":[{"rotate-z":ze()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:Ye()}],"skew-x":[{"skew-x":Ye()}],"skew-y":[{"skew-y":Ye()}],transform:[{transform:[Te,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:He()}],"translate-x":[{"translate-x":He()}],"translate-y":[{"translate-y":He()}],"translate-z":[{"translate-z":He()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Te,Ne]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Te,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[ut,_d,ja,ix]}],stroke:[{stroke:["none",...U()]}],"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"]}},$B=hB(IB);function Me(...e){return $B(oA(e))}var sx={exports:{}},rt={};/**
30
+ * @license React
31
+ * react.production.js
32
+ *
33
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
34
+ *
35
+ * This source code is licensed under the MIT license found in the
36
+ * LICENSE file in the root directory of this source tree.
37
+ */var jN;function MB(){if(jN)return rt;jN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v($){return $===null||typeof $!="object"?null:($=g&&$[g]||$["@@iterator"],typeof $=="function"?$:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function C($,H,W){this.props=$,this.context=H,this.refs=S,this.updater=W||x}C.prototype.isReactComponent={},C.prototype.setState=function($,H){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,H,"setState")},C.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function E(){}E.prototype=C.prototype;function j($,H,W){this.props=$,this.context=H,this.refs=S,this.updater=W||x}var N=j.prototype=new E;N.constructor=j,b(N,C.prototype),N.isPureReactComponent=!0;var T=Array.isArray,k={H:null,A:null,T:null,S:null,V:null},A=Object.prototype.hasOwnProperty;function I($,H,W,B,J,ge){return W=ge.ref,{$$typeof:e,type:$,key:H,ref:W!==void 0?W:null,props:ge}}function P($,H){return I($.type,H,void 0,void 0,void 0,$.props)}function L($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function V($){var H={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(W){return H[W]})}var ie=/\/+/g;function se($,H){return typeof $=="object"&&$!==null&&$.key!=null?V(""+$.key):H.toString(36)}function ue(){}function le($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(ue,ue):($.status="pending",$.then(function(H){$.status==="pending"&&($.status="fulfilled",$.value=H)},function(H){$.status==="pending"&&($.status="rejected",$.reason=H)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function ce($,H,W,B,J){var ge=typeof $;(ge==="undefined"||ge==="boolean")&&($=null);var ye=!1;if($===null)ye=!0;else switch(ge){case"bigint":case"string":case"number":ye=!0;break;case"object":switch($.$$typeof){case e:case t:ye=!0;break;case p:return ye=$._init,ce(ye($._payload),H,W,B,J)}}if(ye)return J=J($),ye=B===""?"."+se($,0):B,T(J)?(W="",ye!=null&&(W=ye.replace(ie,"$&/")+"/"),ce(J,H,W,"",function(ze){return ze})):J!=null&&(L(J)&&(J=P(J,W+(J.key==null||$&&$.key===J.key?"":(""+J.key).replace(ie,"$&/")+"/")+ye)),H.push(J)),1;ye=0;var ae=B===""?".":B+":";if(T($))for(var fe=0;fe<$.length;fe++)B=$[fe],ge=ae+se(B,fe),ye+=ce(B,H,W,ge,J);else if(fe=v($),typeof fe=="function")for($=fe.call($),fe=0;!(B=$.next()).done;)B=B.value,ge=ae+se(B,fe++),ye+=ce(B,H,W,ge,J);else if(ge==="object"){if(typeof $.then=="function")return ce(le($),H,W,B,J);throw H=String($),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ye}function M($,H,W){if($==null)return $;var B=[],J=0;return ce($,B,"","",function(ge){return H.call(W,ge,J++)}),B}function K($){if($._status===-1){var H=$._result;H=H(),H.then(function(W){($._status===0||$._status===-1)&&($._status=1,$._result=W)},function(W){($._status===0||$._status===-1)&&($._status=2,$._result=W)}),$._status===-1&&($._status=0,$._result=H)}if($._status===1)return $._result.default;throw $._result}var U=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)};function re(){}return rt.Children={map:M,forEach:function($,H,W){M($,function(){H.apply(this,arguments)},W)},count:function($){var H=0;return M($,function(){H++}),H},toArray:function($){return M($,function(H){return H})||[]},only:function($){if(!L($))throw Error("React.Children.only expected to receive a single React element child.");return $}},rt.Component=C,rt.Fragment=n,rt.Profiler=r,rt.PureComponent=j,rt.StrictMode=o,rt.Suspense=f,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,rt.__COMPILER_RUNTIME={__proto__:null,c:function($){return k.H.useMemoCache($)}},rt.cache=function($){return function(){return $.apply(null,arguments)}},rt.cloneElement=function($,H,W){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var B=b({},$.props),J=$.key,ge=void 0;if(H!=null)for(ye in H.ref!==void 0&&(ge=void 0),H.key!==void 0&&(J=""+H.key),H)!A.call(H,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&H.ref===void 0||(B[ye]=H[ye]);var ye=arguments.length-2;if(ye===1)B.children=W;else if(1<ye){for(var ae=Array(ye),fe=0;fe<ye;fe++)ae[fe]=arguments[fe+2];B.children=ae}return I($.type,J,void 0,void 0,ge,B)},rt.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:i,_context:$},$},rt.createElement=function($,H,W){var B,J={},ge=null;if(H!=null)for(B in H.key!==void 0&&(ge=""+H.key),H)A.call(H,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(J[B]=H[B]);var ye=arguments.length-2;if(ye===1)J.children=W;else if(1<ye){for(var ae=Array(ye),fe=0;fe<ye;fe++)ae[fe]=arguments[fe+2];J.children=ae}if($&&$.defaultProps)for(B in ye=$.defaultProps,ye)J[B]===void 0&&(J[B]=ye[B]);return I($,ge,void 0,void 0,null,J)},rt.createRef=function(){return{current:null}},rt.forwardRef=function($){return{$$typeof:u,render:$}},rt.isValidElement=L,rt.lazy=function($){return{$$typeof:p,_payload:{_status:-1,_result:$},_init:K}},rt.memo=function($,H){return{$$typeof:m,type:$,compare:H===void 0?null:H}},rt.startTransition=function($){var H=k.T,W={};k.T=W;try{var B=$(),J=k.S;J!==null&&J(W,B),typeof B=="object"&&B!==null&&typeof B.then=="function"&&B.then(re,U)}catch(ge){U(ge)}finally{k.T=H}},rt.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},rt.use=function($){return k.H.use($)},rt.useActionState=function($,H,W){return k.H.useActionState($,H,W)},rt.useCallback=function($,H){return k.H.useCallback($,H)},rt.useContext=function($){return k.H.useContext($)},rt.useDebugValue=function(){},rt.useDeferredValue=function($,H){return k.H.useDeferredValue($,H)},rt.useEffect=function($,H,W){var B=k.H;if(typeof W=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return B.useEffect($,H)},rt.useId=function(){return k.H.useId()},rt.useImperativeHandle=function($,H,W){return k.H.useImperativeHandle($,H,W)},rt.useInsertionEffect=function($,H){return k.H.useInsertionEffect($,H)},rt.useLayoutEffect=function($,H){return k.H.useLayoutEffect($,H)},rt.useMemo=function($,H){return k.H.useMemo($,H)},rt.useOptimistic=function($,H){return k.H.useOptimistic($,H)},rt.useReducer=function($,H,W){return k.H.useReducer($,H,W)},rt.useRef=function($){return k.H.useRef($)},rt.useState=function($){return k.H.useState($)},rt.useSyncExternalStore=function($,H,W){return k.H.useSyncExternalStore($,H,W)},rt.useTransition=function(){return k.H.useTransition()},rt.version="19.1.1",rt}var NN;function bf(){return NN||(NN=1,sx.exports=MB()),sx.exports}var _=bf();const q=Zw(_),pA=W3({__proto__:null,default:q},[_]);function TN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xf(...e){return t=>{let n=!1;const o=e.map(r=>{const i=TN(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():TN(e[r],null)}}}}function st(...e){return _.useCallback(xf(...e),e)}function Ba(e){const t=PB(e),n=_.forwardRef((o,r)=>{const{children:i,...l}=o,u=_.Children.toArray(i),f=u.find(zB);if(f){const m=f.props.children,p=u.map(g=>g===f?_.Children.count(m)>1?_.Children.only(null):_.isValidElement(m)?m.props.children:null:g);return c.jsx(t,{...l,ref:r,children:_.isValidElement(m)?_.cloneElement(m,void 0,p):null})}return c.jsx(t,{...l,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var Ww=Ba("Slot");function PB(e){const t=_.forwardRef((n,o)=>{const{children:r,...i}=n;if(_.isValidElement(r)){const l=LB(r),u=UB(i,r.props);return r.type!==_.Fragment&&(u.ref=o?xf(o,l):l),_.cloneElement(r,u)}return _.Children.count(r)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gA=Symbol("radix.slottable");function DB(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=gA,t}function zB(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gA}function UB(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...u)=>{const f=i(...u);return r(...u),f}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function LB(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 _e({className:e,variant:t,size:n,asChild:o=!1,...r}){const i=o?Ww:"button";return c.jsx(i,{"data-slot":"button",className:Me(eB({variant:t,size:n,className:e})),...r})}function _f({className:e,...t}){return c.jsx("div",{"data-slot":"card",className:Me("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-4 shadow-deep",e),...t})}function _g({className:e,...t}){return c.jsx("div",{"data-slot":"card-header",className:Me("flex flex-col gap-1.5 px-6",e),...t})}function wg({className:e,...t}){return c.jsx("div",{"data-slot":"card-title",className:Me("leading-none text-lg",e),...t})}function Qw({className:e,...t}){return c.jsx("div",{"data-slot":"card-description",className:Me("text-muted-foreground text-xs",e),...t})}function wf({className:e,...t}){return c.jsx("div",{"data-slot":"card-content",className:Me("px-6",e),...t})}const Ac=!0,FB="/",Ic=9925,$_="HDB_ADMIN",ta="/",Jw="../";function vA(e,t){return function(){return e.apply(t,arguments)}}const{toString:VB}=Object.prototype,{getPrototypeOf:eS}=Object,{iterator:Sg,toStringTag:yA}=Symbol,Cg=(e=>t=>{const n=VB.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yo=e=>(e=e.toLowerCase(),t=>Cg(t)===e),Eg=e=>t=>typeof t===e,{isArray:iu}=Array,$c=Eg("undefined");function Sf(e){return e!==null&&!$c(e)&&e.constructor!==null&&!$c(e.constructor)&&Or(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bA=Yo("ArrayBuffer");function BB(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bA(e.buffer),t}const HB=Eg("string"),Or=Eg("function"),xA=Eg("number"),Cf=e=>e!==null&&typeof e=="object",GB=e=>e===!0||e===!1,op=e=>{if(Cg(e)!=="object")return!1;const t=eS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(yA in e)&&!(Sg in e)},qB=e=>{if(!Cf(e)||Sf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},KB=Yo("Date"),ZB=Yo("File"),YB=Yo("Blob"),XB=Yo("FileList"),WB=e=>Cf(e)&&Or(e.pipe),QB=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Or(e.append)&&((t=Cg(e))==="formdata"||t==="object"&&Or(e.toString)&&e.toString()==="[object FormData]"))},JB=Yo("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Yo),o5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ef(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,r;if(typeof e!="object"&&(e=[e]),iu(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{if(Sf(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),l=i.length;let u;for(o=0;o<l;o++)u=i[o],t.call(null,e[u],u,e)}}function _A(e,t){if(Sf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o=n.length,r;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wA=e=>!$c(e)&&e!==Aa;function M_(){const{caseless:e,skipUndefined:t}=wA(this)&&this||{},n={},o=(r,i)=>{const l=e&&_A(n,i)||i;op(n[l])&&op(r)?n[l]=M_(n[l],r):op(r)?n[l]=M_({},r):iu(r)?n[l]=r.slice():(!t||!$c(r))&&(n[l]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ef(arguments[r],o);return n}const i5=(e,t,n,{allOwnKeys:o}={})=>(Ef(t,(r,i)=>{n&&Or(r)?e[i]=vA(r,n):e[i]=r},{allOwnKeys:o}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},l5=(e,t,n,o)=>{let r,i,l;const u={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)l=r[i],(!o||o(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&eS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},c5=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},u5=e=>{if(!e)return null;if(iu(e))return e;let t=e.length;if(!xA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},d5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eS(Uint8Array)),f5=(e,t)=>{const o=(e&&e[Sg]).call(e);let r;for(;(r=o.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},m5=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},h5=Yo("HTMLFormElement"),p5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,r){return o.toUpperCase()+r}),kN=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),g5=Yo("RegExp"),SA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Ef(n,(r,i)=>{let l;(l=t(r,i,e))!==!1&&(o[i]=l||r)}),Object.defineProperties(e,o)},v5=e=>{SA(e,(t,n)=>{if(Or(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(Or(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},y5=(e,t)=>{const n={},o=r=>{r.forEach(i=>{n[i]=!0})};return iu(e)?o(e):o(String(e).split(t)),n},b5=()=>{},x5=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function _5(e){return!!(e&&Or(e.append)&&e[yA]==="FormData"&&e[Sg])}const w5=e=>{const t=new Array(10),n=(o,r)=>{if(Cf(o)){if(t.indexOf(o)>=0)return;if(Sf(o))return o;if(!("toJSON"in o)){t[r]=o;const i=iu(o)?[]:{};return Ef(o,(l,u)=>{const f=n(l,r+1);!$c(f)&&(i[u]=f)}),t[r]=void 0,i}}return o};return n(e,0)},S5=Yo("AsyncFunction"),C5=e=>e&&(Cf(e)||Or(e))&&Or(e.then)&&Or(e.catch),CA=((e,t)=>e?setImmediate:t?((n,o)=>(Aa.addEventListener("message",({source:r,data:i})=>{r===Aa&&i===n&&o.length&&o.shift()()},!1),r=>{o.push(r),Aa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Or(Aa.postMessage)),E5=typeof queueMicrotask<"u"?queueMicrotask.bind(Aa):typeof process<"u"&&process.nextTick||CA,R5=e=>e!=null&&Or(e[Sg]),ne={isArray:iu,isArrayBuffer:bA,isBuffer:Sf,isFormData:QB,isArrayBufferView:BB,isString:HB,isNumber:xA,isBoolean:GB,isObject:Cf,isPlainObject:op,isEmptyObject:qB,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:$c,isDate:KB,isFile:ZB,isBlob:YB,isRegExp:g5,isFunction:Or,isStream:WB,isURLSearchParams:JB,isTypedArray:d5,isFileList:XB,forEach:Ef,merge:M_,extend:i5,trim:o5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:Cg,kindOfTest:Yo,endsWith:c5,toArray:u5,forEachEntry:f5,matchAll:m5,isHTMLForm:h5,hasOwnProperty:kN,hasOwnProp:kN,reduceDescriptors:SA,freezeMethods:v5,toObjectSet:y5,toCamelCase:p5,noop:b5,toFiniteNumber:x5,findKey:_A,global:Aa,isContextDefined:wA,isSpecCompliantForm:_5,toJSONObject:w5,isAsyncFn:S5,isThenable:C5,setImmediate:CA,asap:E5,isIterable:R5};function nt(e,t,n,o,r){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),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status?r.status:null)}ne.inherits(nt,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:ne.toJSONObject(this.config),code:this.code,status:this.status}}});const EA=nt.prototype,RA={};["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=>{RA[e]={value:e}});Object.defineProperties(nt,RA);Object.defineProperty(EA,"isAxiosError",{value:!0});nt.from=(e,t,n,o,r,i)=>{const l=Object.create(EA);ne.toFlatObject(e,l,function(p){return p!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return nt.call(l,u,f,n,o,r),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",i&&Object.assign(l,i),l};const j5=null;function P_(e){return ne.isPlainObject(e)||ne.isArray(e)}function jA(e){return ne.endsWith(e,"[]")?e.slice(0,-2):e}function ON(e,t,n){return e?e.concat(t).map(function(r,i){return r=jA(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function N5(e){return ne.isArray(e)&&!e.some(P_)}const T5=ne.toFlatObject(ne,{},null,function(t){return/^is[A-Z]/.test(t)});function Rg(e,t,n){if(!ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!ne.isUndefined(C[S])});const o=n.metaTokens,r=n.visitor||p,i=n.dots,l=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ne.isSpecCompliantForm(t);if(!ne.isFunction(r))throw new TypeError("visitor must be a function");function m(b){if(b===null)return"";if(ne.isDate(b))return b.toISOString();if(ne.isBoolean(b))return b.toString();if(!f&&ne.isBlob(b))throw new nt("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(b)||ne.isTypedArray(b)?f&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function p(b,S,C){let E=b;if(b&&!C&&typeof b=="object"){if(ne.endsWith(S,"{}"))S=o?S:S.slice(0,-2),b=JSON.stringify(b);else if(ne.isArray(b)&&N5(b)||(ne.isFileList(b)||ne.endsWith(S,"[]"))&&(E=ne.toArray(b)))return S=jA(S),E.forEach(function(N,T){!(ne.isUndefined(N)||N===null)&&t.append(l===!0?ON([S],T,i):l===null?S:S+"[]",m(N))}),!1}return P_(b)?!0:(t.append(ON(C,S,i),m(b)),!1)}const g=[],v=Object.assign(T5,{defaultVisitor:p,convertValue:m,isVisitable:P_});function x(b,S){if(!ne.isUndefined(b)){if(g.indexOf(b)!==-1)throw Error("Circular reference detected in "+S.join("."));g.push(b),ne.forEach(b,function(E,j){(!(ne.isUndefined(E)||E===null)&&r.call(t,E,ne.isString(j)?j.trim():j,S,v))===!0&&x(E,S?S.concat(j):[j])}),g.pop()}}if(!ne.isObject(e))throw new TypeError("data must be an object");return x(e),t}function AN(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function tS(e,t){this._pairs=[],e&&Rg(e,this,t)}const NA=tS.prototype;NA.append=function(t,n){this._pairs.push([t,n])};NA.toString=function(t){const n=t?function(o){return t.call(this,o,AN)}:AN;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function k5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function TA(e,t,n){if(!t)return e;const o=n&&n.encode||k5;ne.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(r?i=r(t,n):i=ne.isURLSearchParams(t)?t.toString():new tS(t,n).toString(o),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class IN{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ne.forEach(this.handlers,function(o){o!==null&&t(o)})}}const kA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},O5=typeof URLSearchParams<"u"?URLSearchParams:tS,A5=typeof FormData<"u"?FormData:null,I5=typeof Blob<"u"?Blob:null,$5={isBrowser:!0,classes:{URLSearchParams:O5,FormData:A5,Blob:I5},protocols:["http","https","file","blob","url","data"]},nS=typeof window<"u"&&typeof document<"u",D_=typeof navigator=="object"&&navigator||void 0,M5=nS&&(!D_||["ReactNative","NativeScript","NS"].indexOf(D_.product)<0),P5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",D5=nS&&window.location.href||"http://localhost",z5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nS,hasStandardBrowserEnv:M5,hasStandardBrowserWebWorkerEnv:P5,navigator:D_,origin:D5},Symbol.toStringTag,{value:"Module"})),ir={...z5,...$5};function U5(e,t){return Rg(e,new ir.classes.URLSearchParams,{visitor:function(n,o,r,i){return ir.isNode&&ne.isBuffer(n)?(this.append(o,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function L5(e){return ne.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function F5(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o<r;o++)i=n[o],t[i]=e[i];return t}function OA(e){function t(n,o,r,i){let l=n[i++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),f=i>=n.length;return l=!l&&ne.isArray(r)?r.length:l,f?(ne.hasOwnProp(r,l)?r[l]=[r[l],o]:r[l]=o,!u):((!r[l]||!ne.isObject(r[l]))&&(r[l]=[]),t(n,o,r[l],i)&&ne.isArray(r[l])&&(r[l]=F5(r[l])),!u)}if(ne.isFormData(e)&&ne.isFunction(e.entries)){const n={};return ne.forEachEntry(e,(o,r)=>{t(L5(o),r,n,0)}),n}return null}function V5(e,t,n){if(ne.isString(e))try{return(t||JSON.parse)(e),ne.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Rf={transitional:kA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",r=o.indexOf("application/json")>-1,i=ne.isObject(t);if(i&&ne.isHTMLForm(t)&&(t=new FormData(t)),ne.isFormData(t))return r?JSON.stringify(OA(t)):t;if(ne.isArrayBuffer(t)||ne.isBuffer(t)||ne.isStream(t)||ne.isFile(t)||ne.isBlob(t)||ne.isReadableStream(t))return t;if(ne.isArrayBufferView(t))return t.buffer;if(ne.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return U5(t,this.formSerializer).toString();if((u=ne.isFileList(t))||o.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Rg(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),V5(t)):t}],transformResponse:[function(t){const n=this.transitional||Rf.transitional,o=n&&n.forcedJSONParsing,r=this.responseType==="json";if(ne.isResponse(t)||ne.isReadableStream(t))return t;if(t&&ne.isString(t)&&(o&&!this.responseType||r)){const l=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ir.classes.FormData,Blob:ir.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],e=>{Rf.headers[e]={}});const B5=ne.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"]),H5=e=>{const t={};let n,o,r;return e&&e.split(`
38
+ `).forEach(function(l){r=l.indexOf(":"),n=l.substring(0,r).trim().toLowerCase(),o=l.substring(r+1).trim(),!(!n||t[n]&&B5[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},$N=Symbol("internals");function wd(e){return e&&String(e).trim().toLowerCase()}function ip(e){return e===!1||e==null?e:ne.isArray(e)?e.map(ip):String(e)}function G5(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const q5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ax(e,t,n,o,r){if(ne.isFunction(o))return o.call(this,t,n);if(r&&(t=n),!!ne.isString(t)){if(ne.isString(o))return t.indexOf(o)!==-1;if(ne.isRegExp(o))return o.test(t)}}function K5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function Z5(e,t){const n=ne.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(r,i,l){return this[o].call(this,t,r,i,l)},configurable:!0})})}let Ar=class{constructor(t){t&&this.set(t)}set(t,n,o){const r=this;function i(u,f,m){const p=wd(f);if(!p)throw new Error("header name must be a non-empty string");const g=ne.findKey(r,p);(!g||r[g]===void 0||m===!0||m===void 0&&r[g]!==!1)&&(r[g||f]=ip(u))}const l=(u,f)=>ne.forEach(u,(m,p)=>i(m,p,f));if(ne.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ne.isString(t)&&(t=t.trim())&&!q5(t))l(H5(t),n);else if(ne.isObject(t)&&ne.isIterable(t)){let u={},f,m;for(const p of t){if(!ne.isArray(p))throw TypeError("Object iterator must return a key-value pair");u[m=p[0]]=(f=u[m])?ne.isArray(f)?[...f,p[1]]:[f,p[1]]:p[1]}l(u,n)}else t!=null&&i(n,t,o);return this}get(t,n){if(t=wd(t),t){const o=ne.findKey(this,t);if(o){const r=this[o];if(!n)return r;if(n===!0)return G5(r);if(ne.isFunction(n))return n.call(this,r,o);if(ne.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wd(t),t){const o=ne.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||ax(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let r=!1;function i(l){if(l=wd(l),l){const u=ne.findKey(o,l);u&&(!n||ax(o,o[u],u,n))&&(delete o[u],r=!0)}}return ne.isArray(t)?t.forEach(i):i(t),r}clear(t){const n=Object.keys(this);let o=n.length,r=!1;for(;o--;){const i=n[o];(!t||ax(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const n=this,o={};return ne.forEach(this,(r,i)=>{const l=ne.findKey(o,i);if(l){n[l]=ip(r),delete n[i];return}const u=t?K5(i):String(i).trim();u!==i&&delete n[i],n[u]=ip(r),o[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ne.forEach(this,(o,r)=>{o!=null&&o!==!1&&(n[r]=t&&ne.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
39
+ `)}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,...n){const o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[$N]=this[$N]={accessors:{}}).accessors,r=this.prototype;function i(l){const u=wd(l);o[u]||(Z5(r,l),o[u]=!0)}return ne.isArray(t)?t.forEach(i):i(t),this}};Ar.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ne.reduceDescriptors(Ar.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});ne.freezeMethods(Ar);function lx(e,t){const n=this||Rf,o=t||n,r=Ar.from(o.headers);let i=o.data;return ne.forEach(e,function(u){i=u.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function AA(e){return!!(e&&e.__CANCEL__)}function su(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}ne.inherits(su,nt,{__CANCEL__:!0});function IA(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Y5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function X5(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,i=0,l;return t=t!==void 0?t:1e3,function(f){const m=Date.now(),p=o[i];l||(l=m),n[r]=f,o[r]=m;let g=i,v=0;for(;g!==r;)v+=n[g++],g=g%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),m-l<t)return;const x=p&&m-p;return x?Math.round(v*1e3/x):void 0}}function W5(e,t){let n=0,o=1e3/t,r,i;const l=(m,p=Date.now())=>{n=p,r=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const p=Date.now(),g=p-n;g>=o?l(m,p):(r=m,i||(i=setTimeout(()=>{i=null,l(r)},o-g)))},()=>r&&l(r)]}const Cp=(e,t,n=3)=>{let o=0;const r=X5(50,250);return W5(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,f=l-o,m=r(f),p=l<=u;o=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:f,rate:m||void 0,estimated:m&&u&&p?(u-l)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},MN=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},PN=e=>(...t)=>ne.asap(()=>e(...t)),Q5=ir.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ir.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ir.origin),ir.navigator&&/(msie|trident)/i.test(ir.navigator.userAgent)):()=>!0,J5=ir.hasStandardBrowserEnv?{write(e,t,n,o,r,i){const l=[e+"="+encodeURIComponent(t)];ne.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),ne.isString(o)&&l.push("path="+o),ne.isString(r)&&l.push("domain="+r),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function eH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $A(e,t,n){let o=!eH(t);return e&&(o||n==!1)?tH(e,t):t}const DN=e=>e instanceof Ar?{...e}:e;function Ha(e,t){t=t||{};const n={};function o(m,p,g,v){return ne.isPlainObject(m)&&ne.isPlainObject(p)?ne.merge.call({caseless:v},m,p):ne.isPlainObject(p)?ne.merge({},p):ne.isArray(p)?p.slice():p}function r(m,p,g,v){if(ne.isUndefined(p)){if(!ne.isUndefined(m))return o(void 0,m,g,v)}else return o(m,p,g,v)}function i(m,p){if(!ne.isUndefined(p))return o(void 0,p)}function l(m,p){if(ne.isUndefined(p)){if(!ne.isUndefined(m))return o(void 0,m)}else return o(void 0,p)}function u(m,p,g){if(g in t)return o(m,p);if(g in e)return o(void 0,m)}const f={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(m,p,g)=>r(DN(m),DN(p),g,!0)};return ne.forEach(Object.keys({...e,...t}),function(p){const g=f[p]||r,v=g(e[p],t[p],p);ne.isUndefined(v)&&g!==u||(n[p]=v)}),n}const MA=e=>{const t=Ha({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:l,auth:u}=t;if(t.headers=l=Ar.from(l),t.url=TA($A(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ne.isFormData(n)){if(ir.hasStandardBrowserEnv||ir.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ne.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([p,g])=>{m.includes(p.toLowerCase())&&l.set(p,g)})}}if(ir.hasStandardBrowserEnv&&(o&&ne.isFunction(o)&&(o=o(t)),o||o!==!1&&Q5(t.url))){const f=r&&i&&J5.read(i);f&&l.set(r,f)}return t},nH=typeof XMLHttpRequest<"u",rH=nH&&function(e){return new Promise(function(n,o){const r=MA(e);let i=r.data;const l=Ar.from(r.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=r,p,g,v,x,b;function S(){x&&x(),b&&b(),r.cancelToken&&r.cancelToken.unsubscribe(p),r.signal&&r.signal.removeEventListener("abort",p)}let C=new XMLHttpRequest;C.open(r.method.toUpperCase(),r.url,!0),C.timeout=r.timeout;function E(){if(!C)return;const N=Ar.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),k={data:!u||u==="text"||u==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:N,config:e,request:C};IA(function(I){n(I),S()},function(I){o(I),S()},k),C=null}"onloadend"in C?C.onloadend=E:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(E)},C.onabort=function(){C&&(o(new nt("Request aborted",nt.ECONNABORTED,e,C)),C=null)},C.onerror=function(T){const k=T&&T.message?T.message:"Network Error",A=new nt(k,nt.ERR_NETWORK,e,C);A.event=T||null,o(A),C=null},C.ontimeout=function(){let T=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const k=r.transitional||kA;r.timeoutErrorMessage&&(T=r.timeoutErrorMessage),o(new nt(T,k.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,C)),C=null},i===void 0&&l.setContentType(null),"setRequestHeader"in C&&ne.forEach(l.toJSON(),function(T,k){C.setRequestHeader(k,T)}),ne.isUndefined(r.withCredentials)||(C.withCredentials=!!r.withCredentials),u&&u!=="json"&&(C.responseType=r.responseType),m&&([v,b]=Cp(m,!0),C.addEventListener("progress",v)),f&&C.upload&&([g,x]=Cp(f),C.upload.addEventListener("progress",g),C.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(p=N=>{C&&(o(!N||N.type?new su(null,e,C):N),C.abort(),C=null)},r.cancelToken&&r.cancelToken.subscribe(p),r.signal&&(r.signal.aborted?p():r.signal.addEventListener("abort",p)));const j=Y5(r.url);if(j&&ir.protocols.indexOf(j)===-1){o(new nt("Unsupported protocol "+j+":",nt.ERR_BAD_REQUEST,e));return}C.send(i||null)})},oH=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,r;const i=function(m){if(!r){r=!0,u();const p=m instanceof Error?m:this.reason;o.abort(p instanceof nt?p:new su(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:f}=o;return f.unsubscribe=()=>ne.asap(u),f}},iH=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,r;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},sH=async function*(e,t){for await(const n of aH(e))yield*iH(n,t)},aH=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},zN=(e,t,n,o)=>{const r=sH(e,t);let i=0,l,u=f=>{l||(l=!0,o&&o(f))};return new ReadableStream({async pull(f){try{const{done:m,value:p}=await r.next();if(m){u(),f.close();return}let g=p.byteLength;if(n){let v=i+=g;n(v)}f.enqueue(new Uint8Array(p))}catch(m){throw u(m),m}},cancel(f){return u(f),r.return()}},{highWaterMark:2})},UN=64*1024,{isFunction:Ch}=ne,lH=(({Request:e,Response:t})=>({Request:e,Response:t}))(ne.global),{ReadableStream:LN,TextEncoder:FN}=ne.global,VN=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cH=e=>{e=ne.merge.call({skipUndefined:!0},lH,e);const{fetch:t,Request:n,Response:o}=e,r=t?Ch(t):typeof fetch=="function",i=Ch(n),l=Ch(o);if(!r)return!1;const u=r&&Ch(LN),f=r&&(typeof FN=="function"?(b=>S=>b.encode(S))(new FN):async b=>new Uint8Array(await new n(b).arrayBuffer())),m=i&&u&&VN(()=>{let b=!1;const S=new n(ir.origin,{body:new LN,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!S}),p=l&&u&&VN(()=>ne.isReadableStream(new o("").body)),g={stream:p&&(b=>b.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!g[b]&&(g[b]=(S,C)=>{let E=S&&S[b];if(E)return E.call(S);throw new nt(`Response type '${b}' is not supported`,nt.ERR_NOT_SUPPORT,C)})});const v=async b=>{if(b==null)return 0;if(ne.isBlob(b))return b.size;if(ne.isSpecCompliantForm(b))return(await new n(ir.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(ne.isArrayBufferView(b)||ne.isArrayBuffer(b))return b.byteLength;if(ne.isURLSearchParams(b)&&(b=b+""),ne.isString(b))return(await f(b)).byteLength},x=async(b,S)=>{const C=ne.toFiniteNumber(b.getContentLength());return C??v(S)};return async b=>{let{url:S,method:C,data:E,signal:j,cancelToken:N,timeout:T,onDownloadProgress:k,onUploadProgress:A,responseType:I,headers:P,withCredentials:L="same-origin",fetchOptions:V}=MA(b),ie=t||fetch;I=I?(I+"").toLowerCase():"text";let se=oH([j,N&&N.toAbortSignal()],T),ue=null;const le=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let ce;try{if(A&&m&&C!=="get"&&C!=="head"&&(ce=await x(P,E))!==0){let H=new n(S,{method:"POST",body:E,duplex:"half"}),W;if(ne.isFormData(E)&&(W=H.headers.get("content-type"))&&P.setContentType(W),H.body){const[B,J]=MN(ce,Cp(PN(A)));E=zN(H.body,UN,B,J)}}ne.isString(L)||(L=L?"include":"omit");const M=i&&"credentials"in n.prototype,K={...V,signal:se,method:C.toUpperCase(),headers:P.normalize().toJSON(),body:E,duplex:"half",credentials:M?L:void 0};ue=i&&new n(S,K);let U=await(i?ie(ue,V):ie(S,K));const re=p&&(I==="stream"||I==="response");if(p&&(k||re&&le)){const H={};["status","statusText","headers"].forEach(ge=>{H[ge]=U[ge]});const W=ne.toFiniteNumber(U.headers.get("content-length")),[B,J]=k&&MN(W,Cp(PN(k),!0))||[];U=new o(zN(U.body,UN,B,()=>{J&&J(),le&&le()}),H)}I=I||"text";let $=await g[ne.findKey(g,I)||"text"](U,b);return!re&&le&&le(),await new Promise((H,W)=>{IA(H,W,{data:$,headers:Ar.from(U.headers),status:U.status,statusText:U.statusText,config:b,request:ue})})}catch(M){throw le&&le(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,b,ue),{cause:M.cause||M}):nt.from(M,M&&M.code,b,ue)}}},uH=new Map,PA=e=>{let t=e?e.env:{};const{fetch:n,Request:o,Response:r}=t,i=[o,r,n];let l=i.length,u=l,f,m,p=uH;for(;u--;)f=i[u],m=p.get(f),m===void 0&&p.set(f,m=u?new Map:cH(t)),p=m;return m};PA();const z_={http:j5,xhr:rH,fetch:{get:PA}};ne.forEach(z_,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const BN=e=>`- ${e}`,dH=e=>ne.isFunction(e)||e===null||e===!1,DA={getAdapter:(e,t)=>{e=ne.isArray(e)?e:[e];const{length:n}=e;let o,r;const i={};for(let l=0;l<n;l++){o=e[l];let u;if(r=o,!dH(o)&&(r=z_[(u=String(o)).toLowerCase()],r===void 0))throw new nt(`Unknown adapter '${u}'`);if(r&&(ne.isFunction(r)||(r=r.get(t))))break;i[u||"#"+l]=r}if(!r){const l=Object.entries(i).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since :
40
+ `+l.map(BN).join(`
41
+ `):" "+BN(l[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return r},adapters:z_};function cx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new su(null,e)}function HN(e){return cx(e),e.headers=Ar.from(e.headers),e.data=lx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),DA.getAdapter(e.adapter||Rf.adapter,e)(e).then(function(o){return cx(e),o.data=lx.call(e,e.transformResponse,o),o.headers=Ar.from(o.headers),o},function(o){return AA(o)||(cx(e),o&&o.response&&(o.response.data=lx.call(e,e.transformResponse,o.response),o.response.headers=Ar.from(o.response.headers))),Promise.reject(o)})}const zA="1.12.2",jg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jg[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const GN={};jg.transitional=function(t,n,o){function r(i,l){return"[Axios v"+zA+"] Transitional option '"+i+"'"+l+(o?". "+o:"")}return(i,l,u)=>{if(t===!1)throw new nt(r(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!GN[l]&&(GN[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};jg.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function fH(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],l=t[i];if(l){const u=e[i],f=u===void 0||l(u,i,e);if(f!==!0)throw new nt("option "+i+" must be "+f,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const sp={assertOptions:fH,validators:jg},ui=sp.validators;let za=class{constructor(t){this.defaults=t||{},this.interceptors={request:new IN,response:new IN}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
42
+ `+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ha(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:i}=n;o!==void 0&&sp.assertOptions(o,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),r!=null&&(ne.isFunction(r)?n.paramsSerializer={serialize:r}:sp.assertOptions(r,{encode:ui.function,serialize:ui.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),sp.assertOptions(n,{baseUrl:ui.spelling("baseURL"),withXsrfToken:ui.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&ne.merge(i.common,i[n.method]);i&&ne.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=Ar.concat(l,i);const u=[];let f=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(f=f&&S.synchronous,u.unshift(S.fulfilled,S.rejected))});const m=[];this.interceptors.response.forEach(function(S){m.push(S.fulfilled,S.rejected)});let p,g=0,v;if(!f){const b=[HN.bind(this),void 0];for(b.unshift(...u),b.push(...m),v=b.length,p=Promise.resolve(n);g<v;)p=p.then(b[g++],b[g++]);return p}v=u.length;let x=n;for(;g<v;){const b=u[g++],S=u[g++];try{x=b(x)}catch(C){S.call(this,C);break}}try{p=HN.call(this,x)}catch(b){return Promise.reject(b)}for(g=0,v=m.length;g<v;)p=p.then(m[g++],m[g++]);return p}getUri(t){t=Ha(this.defaults,t);const n=$A(t.baseURL,t.url,t.allowAbsoluteUrls);return TA(n,t.params,t.paramsSerializer)}};ne.forEach(["delete","get","head","options"],function(t){za.prototype[t]=function(n,o){return this.request(Ha(o||{},{method:t,url:n,data:(o||{}).data}))}});ne.forEach(["post","put","patch"],function(t){function n(o){return function(i,l,u){return this.request(Ha(u||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}za.prototype[t]=n(),za.prototype[t+"Form"]=n(!0)});let mH=class UA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const l=new Promise(u=>{o.subscribe(u),i=u}).then(r);return l.cancel=function(){o.unsubscribe(i)},l},t(function(i,l,u){o.reason||(o.reason=new su(i,l,u),n(o.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 n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new UA(function(r){t=r}),cancel:t}}};function hH(e){return function(n){return e.apply(null,n)}}function pH(e){return ne.isObject(e)&&e.isAxiosError===!0}const U_={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};Object.entries(U_).forEach(([e,t])=>{U_[t]=e});function LA(e){const t=new za(e),n=vA(za.prototype.request,t);return ne.extend(n,za.prototype,t,{allOwnKeys:!0}),ne.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return LA(Ha(e,r))},n}const en=LA(Rf);en.Axios=za;en.CanceledError=su;en.CancelToken=mH;en.isCancel=AA;en.VERSION=zA;en.toFormData=Rg;en.AxiosError=nt;en.Cancel=en.CanceledError;en.all=function(t){return Promise.all(t)};en.spread=hH;en.isAxiosError=pH;en.mergeConfig=Ha;en.AxiosHeaders=Ar;en.formToJSON=e=>OA(ne.isHTMLForm(e)?new FormData(e):e);en.getAdapter=DA.getAdapter;en.HttpStatusCode=U_;en.default=en;const{Axios:Jye,AxiosError:ebe,CanceledError:tbe,isCancel:nbe,CancelToken:rbe,VERSION:obe,all:ibe,Cancel:sbe,isAxiosError:abe,spread:lbe,toFormData:cbe,AxiosHeaders:ube,HttpStatusCode:dbe,formToJSON:fbe,getAdapter:mbe,mergeConfig:hbe}=en;function Us({id:e=Sn,operationsUrl:t}={}){const n=t||Gn.getOperationsUrl(e);return en.create({withCredentials:!0,timeout:15e3,headers:{"Content-Type":"application/json"},baseURL:n})}const kt=en.create({withCredentials:!0,baseURL:"/",timeout:15e3,headers:{"Content-Type":"application/json"}}),Cn={user:"user",organization:"organization",roles:"roles",cluster:"cluster",instance:"instance",operations:{get_component_file:"get_component_file"}};var au=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gH={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},vH=class{#e=gH;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Ia=new vH;function yH(e){setTimeout(e,0)}var Ga=typeof window>"u"||"Deno"in globalThis;function xr(){}function bH(e,t){return typeof e=="function"?e(t):e}function L_(e){return typeof e=="number"&&e>=0&&e!==1/0}function FA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ls(e,t){return typeof e=="function"?e(t):e}function _o(e,t){return typeof e=="function"?e(t):e}function qN(e,t){const{type:n="all",exact:o,fetchStatus:r,predicate:i,queryKey:l,stale:u}=e;if(l){if(o){if(t.queryHash!==rS(l,t.options))return!1}else if(!ef(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||r&&r!==t.state.fetchStatus||i&&!i(t))}function KN(e,t){const{exact:n,status:o,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qa(t.options.mutationKey)!==qa(i))return!1}else if(!ef(t.options.mutationKey,i))return!1}return!(o&&t.state.status!==o||r&&!r(t))}function rS(e,t){return(t?.queryKeyHashFn||qa)(e)}function qa(e){return JSON.stringify(e,(t,n)=>F_(n)?Object.keys(n).sort().reduce((o,r)=>(o[r]=n[r],o),{}):n)}function ef(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ef(e[n],t[n])):!1}var xH=Object.prototype.hasOwnProperty;function VA(e,t){if(e===t)return e;const n=ZN(e)&&ZN(t);if(!n&&!(F_(e)&&F_(t)))return t;const r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,u=n?new Array(l):{};let f=0;for(let m=0;m<l;m++){const p=n?m:i[m],g=e[p],v=t[p];if(g===v){u[p]=g,(n?m<r:xH.call(e,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){u[p]=v;continue}const x=VA(g,v);u[p]=x,x===g&&f++}return r===l&&f===r?e:u}function Ep(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ZN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function F_(e){if(!YN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!YN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function YN(e){return Object.prototype.toString.call(e)==="[object Object]"}function _H(e){return new Promise(t=>{Ia.setTimeout(t,e)})}function V_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?VA(e,t):t}function wH(e,t,n=0){const o=[...e,t];return n&&o.length>n?o.slice(1):o}function SH(e,t,n=0){const o=[t,...e];return n&&o.length>n?o.slice(0,-1):o}var oS=Symbol();function BA(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===oS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function HA(e,t){return typeof e=="function"?e(...t):!!e}var CH=class extends au{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ga&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},iS=new CH;function B_(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});n.status="pending",n.catch(()=>{});function o(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{o({status:"fulfilled",value:r}),e(r)},n.reject=r=>{o({status:"rejected",reason:r}),t(r)},n}var EH=yH;function RH(){let e=[],t=0,n=u=>{u()},o=u=>{u()},r=EH;const i=u=>{t?e.push(u):r(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&r(()=>{o(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||l()}return f},batchCalls:u=>(...f)=>{i(()=>{u(...f)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{o=u},setScheduler:u=>{r=u}}}var $n=RH(),jH=class extends au{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ga&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Rp=new jH;function NH(e){return Math.min(1e3*2**e,3e4)}function GA(e){return(e??"online")==="online"?Rp.isOnline():!0}var H_=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function qA(e){let t=!1,n=0,o;const r=B_(),i=()=>r.status!=="pending",l=S=>{if(!i()){const C=new H_(S);v(C),e.onCancel?.(C)}},u=()=>{t=!0},f=()=>{t=!1},m=()=>iS.isFocused()&&(e.networkMode==="always"||Rp.isOnline())&&e.canRun(),p=()=>GA(e.networkMode)&&e.canRun(),g=S=>{i()||(o?.(),r.resolve(S))},v=S=>{i()||(o?.(),r.reject(S))},x=()=>new Promise(S=>{o=C=>{(i()||m())&&S(C)},e.onPause?.()}).then(()=>{o=void 0,i()||e.onContinue?.()}),b=()=>{if(i())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(E){S=Promise.reject(E)}Promise.resolve(S).then(g).catch(E=>{if(i())return;const j=e.retry??(Ga?0:3),N=e.retryDelay??NH,T=typeof N=="function"?N(n,E):N,k=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,E);if(t||!k){v(E);return}n++,e.onFail?.(n,E),_H(T).then(()=>m()?void 0:x()).then(()=>{t?v(E):b()})})};return{promise:r,status:()=>r.status,cancel:l,continue:()=>(o?.(),r),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?b():x().then(b),r)}}var KA=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),L_(this.gcTime)&&(this.#e=Ia.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ga?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Ia.clearTimeout(this.#e),this.#e=void 0)}},TH=class extends KA{#e;#t;#n;#o;#r;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=XN(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=XN(this.options);t.data!==void 0&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=V_(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(xr).catch(xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>_o(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ls(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!FA(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,o=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const u=BA(this.options,t),m=(()=>{const p={client:this.#o,queryKey:this.queryKey,meta:this.meta};return o(p),p})();return this.#a=!1,this.options.persister?this.options.persister(u,m,this):u(m)},l=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:r};return o(u),u})();this.options.behavior?.onFetch(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#i({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=qA({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:u=>{u instanceof H_&&u.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(u,f)=>{this.#i({type:"failed",failureCount:u,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof H_){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#i({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...ZA(n.data,this.options),fetchMeta:e.meta??null};case"success":const o={...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),$n.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function ZA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function XN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,o=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var YA=class extends au{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=B_(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#s;#a;#i;#p;#f;#m;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),WN(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _o(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Ep(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&QN(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),o&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||Ls(this.options.staleTime,this.#t)!==Ls(t.staleTime,this.#t))&&this.#g();const r=this.#v();o&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||r!==this.#l)&&this.#y(r)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return OH(this,n)&&(this.#o=n,this.#s=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,o)=>(this.trackProp(o),t?.(o),o==="promise"&&!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,o))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(xr)),t}#g(){this.#x();const e=Ls(this.options.staleTime,this.#t);if(Ga||this.#o.isStale||!L_(e))return;const n=FA(this.#o.dataUpdatedAt,e)+1;this.#c=Ia.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#_(),this.#l=e,!(Ga||_o(this.options.enabled,this.#t)===!1||!L_(this.#l)||this.#l===0)&&(this.#u=Ia.setInterval(()=>{(this.options.refetchIntervalInBackground||iS.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Ia.clearTimeout(this.#c),this.#c=void 0)}#_(){this.#u&&(Ia.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,o=this.options,r=this.#o,i=this.#r,l=this.#s,f=e!==n?e.state:this.#n,{state:m}=e;let p={...m},g=!1,v;if(t._optimisticResults){const P=this.hasListeners(),L=!P&&WN(e,t),V=P&&QN(e,n,t,o);(L||V)&&(p={...p,...ZA(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=p;v=p.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let P;r?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(P=r.data,C=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,P!==void 0&&(S="success",v=V_(r?.data,P,t),g=!0)}if(t.select&&v!==void 0&&!C)if(r&&v===i?.data&&t.select===this.#p)v=this.#f;else try{this.#p=t.select,v=t.select(v),v=V_(r?.data,v,t),this.#f=v,this.#i=null}catch(P){this.#i=P}this.#i&&(x=this.#i,v=this.#f,b=Date.now(),S="error");const E=p.fetchStatus==="fetching",j=S==="pending",N=S==="error",T=j&&E,k=v!==void 0,I={status:S,fetchStatus:p.fetchStatus,isPending:j,isSuccess:S==="success",isError:N,isInitialLoading:T,isLoading:T,data:v,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:E,isRefetching:E&&!j,isLoadingError:N&&!k,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&k,isStale:sS(e,t),refetch:this.refetch,promise:this.#a,isEnabled:_o(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=ie=>{I.status==="error"?ie.reject(I.error):I.data!==void 0&&ie.resolve(I.data)},L=()=>{const ie=this.#a=I.promise=B_();P(ie)},V=this.#a;switch(V.status){case"pending":e.queryHash===n.queryHash&&P(V);break;case"fulfilled":(I.status==="error"||I.data!==V.value)&&L();break;case"rejected":(I.status!=="error"||I.error!==V.reason)&&L();break}}return I}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#m=this.#t),Ep(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,r=typeof o=="function"?o():o;if(r==="all"||!r&&!this.#h.size)return!0;const i=new Set(r??this.#h);return this.options.throwOnError&&i.add("error"),Object.keys(this.#o).some(l=>{const u=l;return this.#o[u]!==e[u]&&i.has(u)})};this.#S({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){$n.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function kH(e,t){return _o(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function WN(e,t){return kH(e,t)||e.state.data!==void 0&&G_(e,t,t.refetchOnMount)}function G_(e,t,n){if(_o(t.enabled,e)!==!1&&Ls(t.staleTime,e)!=="static"){const o=typeof n=="function"?n(e):n;return o==="always"||o!==!1&&sS(e,t)}return!1}function QN(e,t,n,o){return(e!==t||_o(o.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&sS(e,n)}function sS(e,t){return _o(t.enabled,e)!==!1&&e.isStaleByTime(Ls(t.staleTime,e))}function OH(e,t){return!Ep(e.getCurrentResult(),t)}function JN(e){return{onFetch:(t,n)=>{const o=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},f=0;const m=async()=>{let p=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},v=BA(t.options,t.fetchOptions),x=async(b,S,C)=>{if(p)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const j=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return g(A),A})(),N=await v(j),{maxPages:T}=t.options,k=C?SH:wH;return{pages:k(b.pages,N,T),pageParams:k(b.pageParams,S,T)}};if(r&&i.length){const b=r==="backward",S=b?AH:eT,C={pages:i,pageParams:l},E=S(o,C);u=await x(C,E,b)}else{const b=e??i.length;do{const S=f===0?l[0]??o.initialPageParam:eT(o,u);if(f>0&&S==null)break;u=await x(u,S),f++}while(f<b)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=m}}}function eT(e,{pages:t,pageParams:n}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,n[o],n):void 0}function AH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var IH=class extends KA{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||XA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=qA({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,l)=>{this.#r({type:"failed",failureCount:i,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",r=!this.#o.canStart();try{if(o)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#n.config.onMutate?.(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:r})}const i=await this.#o.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#n.config.onError?.(i,e,this.state.context,this,n),await this.options.onError?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,i,e,this.state.context,n),i}finally{this.#r({type:"error",error:i})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),$n.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function XA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var WA=class extends au{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const o=new IH({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(o),o}add(e){this.#e.add(e);const t=Eh(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Eh(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const o=n.indexOf(e);o!==-1&&n.splice(o,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Eh(e);if(typeof t=="string"){const o=this.#t.get(t)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=Eh(e);return typeof t=="string"?this.#t.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){$n.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>KN(t,n))}findAll(e={}){return this.getAll().filter(t=>KN(e,t))}notify(e){$n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return $n.batch(()=>Promise.all(e.map(t=>t.continue().catch(xr))))}};function Eh(e){return e.options.scope?.id}var $H=class extends au{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Ep(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&qa(n.mutationKey)!==qa(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??XA();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){$n.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,o=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#o.onSuccess?.(t.data,n,o,r),this.#o.onSettled?.(t.data,null,n,o,r)):t?.type==="error"&&(this.#o.onError?.(t.error,n,o,r),this.#o.onSettled?.(void 0,t.error,n,o,r))}this.listeners.forEach(n=>{n(this.#t)})})}},QA=class extends au{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const o=t.queryKey,r=t.queryHash??rS(o,t);let i=this.get(r);return i||(i=new TH({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){$n.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>qN(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>qN(e,n)):t}notify(e){$n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},MH=class{#e;#t;#n;#o;#r;#s;#a;#i;constructor(e={}){this.#e=e.queryCache||new QA,this.#t=e.mutationCache||new WA,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=iS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Rp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),o=n.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ls(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const o=n.data;return[t,o]})}setQueryData(e,t,n){const o=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(o.queryHash)?.state.data,l=bH(t,i);if(l!==void 0)return this.#e.build(this,o).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return $n.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;$n.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return $n.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},o=$n.batch(()=>this.#e.findAll(e).map(r=>r.cancel(n)));return Promise.all(o).then(xr).catch(xr)}invalidateQueries(e,t={}){return $n.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},o=$n.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(xr)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(xr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ls(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xr).catch(xr)}fetchInfiniteQuery(e){return e.behavior=JN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xr).catch(xr)}ensureInfiniteQueryData(e){return e.behavior=JN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rp.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(qa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(o=>{ef(e,o.queryKey)&&Object.assign(n,o.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(qa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(o=>{ef(e,o.mutationKey)&&Object.assign(n,o.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===oS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},JA=_.createContext(void 0),Xo=e=>{const t=_.useContext(JA);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},PH=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(JA.Provider,{value:e,children:t})),eI=_.createContext(!1),DH=()=>_.useContext(eI);eI.Provider;function zH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var UH=_.createContext(zH()),LH=()=>_.useContext(UH),FH=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},VH=e=>{_.useEffect(()=>{e.clearReset()},[e])},BH=({result:e,errorResetBoundary:t,throwOnError:n,query:o,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(r&&e.data===void 0||HA(n,[e.error,o])),HH=(e,t)=>t.state.data===void 0,GH=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...r)=>n(o(...r)):n(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qH=(e,t)=>e.isLoading&&e.isFetching&&!t,KH=(e,t)=>e?.suspense&&t.isPending,tT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function tI(e,t,n){const o=DH(),r=LH(),i=Xo(),l=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(l),l._optimisticResults=o?"isRestoring":"optimistic",GH(l),FH(l,r),VH(r);const u=!i.getQueryCache().get(l.queryHash),[f]=_.useState(()=>new t(i,l)),m=f.getOptimisticResult(l),p=!o&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(g=>{const v=p?f.subscribe($n.batchCalls(g)):xr;return f.updateResult(),v},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),_.useEffect(()=>{f.setOptions(l)},[l,f]),KH(l,m))throw tT(l,f,r);if(BH({result:m,errorResetBoundary:r,throwOnError:l.throwOnError,query:i.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw m.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(l,m),l.experimental_prefetchInRender&&!Ga&&qH(m,o)&&(u?tT(l,f,r):i.getQueryCache().get(l.queryHash)?.promise)?.catch(xr).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?m:f.trackResult(m)}function wn(e,t){return tI(e,YA)}function Mn(e,t){return tI({...e,enabled:!0,suspense:!0,throwOnError:HH,placeholderData:void 0},YA)}function at(e,t){const n=Xo(),[o]=_.useState(()=>new $H(n,e));_.useEffect(()=>{o.setOptions(e)},[o,e]);const r=_.useSyncExternalStore(_.useCallback(l=>o.subscribe($n.batchCalls(l)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),i=_.useCallback((l,u)=>{o.mutate(l,u).catch(xr)},[o]);if(r.error&&HA(o.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}async function ZH(){const{data:e}=await kt.get("/User/current");return e}function YH(){return{queryKey:[Cn.user],queryFn:ZH,retry:!1}}async function jf({instanceClient:e}){const{data:t}=await e.post("/",{operation:"logout"});if(t)return t;throw new Error("Something went wrong")}async function tf({instanceClient:e,...t}){const{data:n}=await e.post("/",{...t,operation:"user_info"});return n}function Ng(e=1e3){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function aS(e){let t=e?.fqdn;if(!t)return null;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return t.match(/:\d+/)||(n.port=String(Ic)),t.includes("://")||(n.protocol="https:"),n.toString()}function lS(e){let t=e.instanceFqdn;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return e.operationsApiPort&&(n.port=String(e.operationsApiPort)),e.operationsApiSecure!==void 0&&(n.protocol=e.operationsApiSecure?"https:":"http:"),n.toString()}const Sn="OverallAppSignIn";class XH{broadListeners=[];specificListeners={};localStorageKey="Studio:PotentiallyAuthenticated";potentiallyAuthenticated;checkedAuthentication={};allConnections={};constructor(){this.potentiallyAuthenticated=JSON.parse(localStorage.getItem(this.localStorageKey)||"{}")}getAllConnections(){return this.potentiallyAuthenticated.OverallAppSignIn||(this.allConnections[Sn]={user:null,isLoading:!1}),this.allConnections}getConnectionById(t){return this.allConnections[t]||(this.allConnections[t]={user:null,isLoading:!!this.potentiallyAuthenticated[t]}),this.allConnections[t]}listenToAllEntities(t){this.broadListeners.includes(t)||this.broadListeners.push(t);for(const n in this.potentiallyAuthenticated)this.ensureUserIsLoaded(n);return()=>{const n=this.broadListeners.indexOf(t);n>=0&&this.broadListeners.splice(n,1)}}listenToEntity(t,n){if(t)return this.specificListeners[t]||(this.specificListeners[t]=[]),this.specificListeners[t].includes(n)||this.specificListeners[t].push(n),this.ensureUserIsLoaded(t),()=>{const o=this.specificListeners[t].indexOf(n);o>=0&&this.specificListeners[t].splice(o,1)}}setUserForEntity(t,n){const o=this.calculateIdFromEntity(t),r=this.calculateKeyFromEntity(t);!o||!r||(n?this.flagKeyAsSignedIn(o,r):this.flagKeyAsSignedOut(o),this.updateConnectionIfChanged(o,!1,n))}calculateIdFromEntity(t){return Sn}async signOutFromPotentiallyAuthenticatedInstances(){for(const t in this.potentiallyAuthenticated)if(this.allConnections[t].user=null,this.allConnections[t].isLoading=!1,this.flagKeyAsSignedOut(t),t!==Sn)try{const n=Us({id:t});await jf({instanceClient:n})}catch(n){console.error(`Failed to log out from ${t}, carrying on`,n)}}calculateKeyFromEntity(t){return Sn}updateConnectionIfChanged(t,n,o){this.checkedAuthentication[t]=!0;const r=this.getConnectionById(t);let i=!1;r.isLoading!==n&&(r.isLoading=n,i=!0),r.user!==o&&(r.user=o,i=!0),i&&this.updateListeners(t)}flagKeyAsSignedIn(t,n){this.potentiallyAuthenticated[t]!==n&&(this.potentiallyAuthenticated[t]=n,localStorage.setItem(this.localStorageKey,JSON.stringify(this.potentiallyAuthenticated)))}flagKeyAsSignedOut(t){this.potentiallyAuthenticated[t]&&(delete this.potentiallyAuthenticated[t],localStorage.setItem(this.localStorageKey,JSON.stringify(this.potentiallyAuthenticated)))}async updateListeners(t){if(await Ng(1),this.broadListeners)for(const n of this.broadListeners)this.updateListener(t,n);if(this.specificListeners[t])for(const n of this.specificListeners[t])this.updateListener(t,n)}updateListener(t,n){n(this.getConnectionById(t),t)}async ensureUserIsLoaded(t){if(!this.checkedAuthentication[t])return this.reloadUser(t)}getOperationsUrl(t){return FB}async reloadUser(t){if(!this.potentiallyAuthenticated[t]){this.updateConnectionIfChanged(t,!1,null);return}const n=this.potentiallyAuthenticated[t];this.updateConnectionIfChanged(t,!0,null);let o=null;try{t===Sn?Ac&&(o=await tf({instanceClient:Us()})):t&&(o=await tf({instanceClient:Us({id:t})}))}catch(r){console.error(r),o=null}o?this.flagKeyAsSignedIn(t,n):this.flagKeyAsSignedOut(t),this.updateConnectionIfChanged(t,!1,o)}}const Gn=new XH;var WH="Invariant failed";function ts(e,t){if(!e)throw new Error(WH)}const wc=new WeakMap,ap=new WeakMap,jp={current:[]};let ux=!1,Hd=0;const zd=new Set,Rh=new Map;function nI(e){const t=Array.from(e).sort((n,o)=>n instanceof Sc&&n.options.deps.includes(o)?1:o instanceof Sc&&o.options.deps.includes(n)?-1:0);for(const n of t){if(jp.current.includes(n))continue;jp.current.push(n),n.recompute();const o=ap.get(n);if(o)for(const r of o){const i=wc.get(r);i&&nI(i)}}}function QH(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function JH(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function rI(e){if(Hd>0&&!Rh.has(e)&&Rh.set(e,e.prevState),zd.add(e),!(Hd>0)&&!ux)try{for(ux=!0;zd.size>0;){const t=Array.from(zd);zd.clear();for(const n of t){const o=Rh.get(n)??n.prevState;n.prevState=o,QH(n)}for(const n of t){const o=wc.get(n);o&&(jp.current.push(n),nI(o))}for(const n of t){const o=wc.get(n);if(o)for(const r of o)JH(r)}}}finally{ux=!1,jp.current=[],Rh.clear()}}function Gd(e){Hd++;try{e()}finally{if(Hd--,Hd===0){const t=Array.from(zd)[0];t&&rI(t)}}}function e8(e){return typeof e=="function"}class q_{constructor(t,n){this.listeners=new Set,this.subscribe=o=>{var r,i;this.listeners.add(o);const l=(i=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:i.call(r,o,this);return()=>{this.listeners.delete(o),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,o,r;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):e8(t)?this.state=t(this.prevState):this.state=t,(r=(o=this.options)==null?void 0:o.onUpdate)==null||r.call(o),rI(this)}}class Sc{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=[],o=[];for(const r of this.options.deps)n.push(r.prevState),o.push(r.state);return this.lastSeenDepValues=o,{prevDepVals:n,currDepVals:o,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,o;this.prevState=this.state;const{prevDepVals:r,currDepVals:i,prevVal:l}=this.getDepVals();this.state=this.options.fn({prevDepVals:r,currDepVals:i,prevVal:l}),(o=(n=this.options).onUpdate)==null||o.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const i of this.options.deps)i instanceof Sc&&i.checkIfRecalculationNeededDeeply();let n=!1;const o=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let i=0;i<r.length;i++)if(r[i]!==o[i]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var o,r;this.listeners.add(n);const i=(r=(o=this.options).onSubscribe)==null?void 0:r.call(o,n,this);return()=>{this.listeners.delete(n),i?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof Sc)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof q_){let o=wc.get(n);o||(o=new Set,wc.set(n,o)),o.add(this);let r=ap.get(this);r||(r=new Set,ap.set(this,r)),r.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof Sc)this.unregisterFromGraph(n.options.deps);else if(n instanceof q_){const o=wc.get(n);o&&o.delete(this);const r=ap.get(this);r&&r.delete(n)}}}const Fs="__TSR_index",nT="popstate",rT="beforeunload";function oI(e){let t=e.getLocation();const n=new Set,o=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},r=l=>{e.notifyOnIndexChange??!0?o(l):t=e.getLocation()},i=async({task:l,navigateOpts:u,...f})=>{var m,p;if(u?.ignoreBlocker??!1){l();return}const v=((m=e.getBlockers)==null?void 0:m.call(e))??[],x=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&v.length&&x)for(const b of v){const S=Mc(f.path,f.state);if(await b.blockerFn({currentLocation:t,nextLocation:S,action:f.type})){(p=e.onBlocked)==null||p.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,f)=>{const m=t.state[Fs];u=K_(m+1,u),i({task:()=>{e.pushState(l,u),o({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:u})},replace:(l,u,f)=>{const m=t.state[Fs];u=K_(m,u),i({task:()=>{e.replaceState(l,u),o({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:u})},go:(l,u)=>{i({task:()=>{e.go(l),r({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{i({task:()=>{e.back(l?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{i({task:()=>{e.forward(l?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Fs]!==0,createHref:l=>e.createHref(l),block:l=>{var u;if(!e.setBlockers)return()=>{};const f=((u=e.getBlockers)==null?void 0:u.call(e))??[];return e.setBlockers([...f,l]),()=>{var m,p;const g=((m=e.getBlockers)==null?void 0:m.call(e))??[];(p=e.setBlockers)==null||p.call(e,g.filter(v=>v!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function K_(e,t){t||(t={});const n=cS();return{...t,key:n,__TSR_key:n,[Fs]:e}}function iI(e){var t,n;const o=e?.window??(typeof document<"u"?window:void 0),r=o.history.pushState,i=o.history.replaceState;let l=[];const u=()=>l,f=V=>l=V,m=e?.createHref??(V=>V),p=e?.parseLocation??(()=>Mc(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!((t=o.history.state)!=null&&t.__TSR_key)&&!((n=o.history.state)!=null&&n.key)){const V=cS();o.history.replaceState({[Fs]:0,key:V,__TSR_key:V},"")}let g=p(),v,x=!1,b=!1,S=!1,C=!1;const E=()=>g;let j,N;const T=()=>{j&&(L._ignoreSubscribers=!0,(j.isPush?o.history.pushState:o.history.replaceState)(j.state,"",j.href),L._ignoreSubscribers=!1,j=void 0,N=void 0,v=void 0)},k=(V,ie,se)=>{const ue=m(ie);N||(v=g),g=Mc(ie,se),j={href:ue,state:se,isPush:j?.isPush||V==="push"},N||(N=Promise.resolve().then(()=>T()))},A=V=>{g=p(),L.notify({type:V})},I=async()=>{if(b){b=!1;return}const V=p(),ie=V.state[Fs]-g.state[Fs],se=ie===1,ue=ie===-1,le=!se&&!ue||x;x=!1;const ce=le?"GO":ue?"BACK":"FORWARD",M=le?{type:"GO",index:ie}:{type:ue?"BACK":"FORWARD"};if(S)S=!1;else{const K=u();if(typeof document<"u"&&K.length){for(const U of K)if(await U.blockerFn({currentLocation:g,nextLocation:V,action:ce})){b=!0,o.history.go(1),L.notify(M);return}}}g=p(),L.notify(M)},P=V=>{if(C){C=!1;return}let ie=!1;const se=u();if(typeof document<"u"&&se.length)for(const ue of se){const le=ue.enableBeforeUnload??!0;if(le===!0){ie=!0;break}if(typeof le=="function"&&le()===!0){ie=!0;break}}if(ie)return V.preventDefault(),V.returnValue=""},L=oI({getLocation:E,getLength:()=>o.history.length,pushState:(V,ie)=>k("push",V,ie),replaceState:(V,ie)=>k("replace",V,ie),back:V=>(V&&(S=!0),C=!0,o.history.back()),forward:V=>{V&&(S=!0),C=!0,o.history.forward()},go:V=>{x=!0,o.history.go(V)},createHref:V=>m(V),flush:T,destroy:()=>{o.history.pushState=r,o.history.replaceState=i,o.removeEventListener(rT,P,{capture:!0}),o.removeEventListener(nT,I)},onBlocked:()=>{v&&g!==v&&(g=v)},getBlockers:u,setBlockers:f,notifyOnIndexChange:!1});return o.addEventListener(rT,P,{capture:!0}),o.addEventListener(nT,I),o.history.pushState=function(...V){const ie=r.apply(o.history,V);return L._ignoreSubscribers||A("PUSH"),ie},o.history.replaceState=function(...V){const ie=i.apply(o.history,V);return L._ignoreSubscribers||A("REPLACE"),ie},L}function t8(e){const t=typeof document<"u"?window:void 0;return iI({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",r=t.location.search,i=n.slice(1),l=i.length===0?"":`#${i.join("#")}`,u=`${o}${r}${l}`;return Mc(u,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function n8(e={initialEntries:["/"]}){const t=e.initialEntries;let n=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1;const o=t.map((i,l)=>K_(l,void 0));return oI({getLocation:()=>Mc(t[n],o[n]),getLength:()=>t.length,pushState:(i,l)=>{n<t.length-1&&(t.splice(n+1),o.splice(n+1)),o.push(l),t.push(i),n=Math.max(t.length-1,0)},replaceState:(i,l)=>{o[n]=l,t[n]=i},back:()=>{n=Math.max(n-1,0)},forward:()=>{n=Math.min(n+1,t.length-1)},go:i=>{n=Math.min(Math.max(n+i,0),t.length-1)},createHref:i=>i})}function Mc(e,t){const n=e.indexOf("#"),o=e.indexOf("?"),r=cS();return{href:e,pathname:e.substring(0,n>0?o>0?Math.min(n,o):n:o>0?o:e.length),hash:n>-1?e.substring(n):"",search:o>-1?e.slice(o,n===-1?void 0:n):"",state:t||{[Fs]:0,key:r,__TSR_key:r}}}function cS(){return(Math.random()+1).toString(36).substring(7)}function Z_(e){return e[e.length-1]}function r8(e){return typeof e=="function"}function Ua(e,t){return r8(e)?e(t):e}const o8=Object.prototype.hasOwnProperty;function xo(e,t){if(e===t)return e;const n=t,o=sT(e)&&sT(n);if(!o&&!(Np(e)&&Np(n)))return n;const r=o?e:oT(e);if(!r)return n;const i=o?n:oT(n);if(!i)return n;const l=r.length,u=i.length,f=o?new Array(u):{};let m=0;for(let p=0;p<u;p++){const g=o?p:i[p],v=e[g],x=n[g];if(v===x){f[g]=v,(o?p<l:o8.call(e,g))&&m++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){f[g]=x;continue}const b=xo(v,x);f[g]=b,b===v&&m++}return l===u&&m===l?e:f}function oT(e){const t=[],n=Object.getOwnPropertyNames(e);for(const r of n){if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;t.push(r)}const o=Object.getOwnPropertySymbols(e);for(const r of o){if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;t.push(r)}return t}function Np(e){if(!iT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!iT(n)||!n.hasOwnProperty("isPrototypeOf"))}function iT(e){return Object.prototype.toString.call(e)==="[object Object]"}function sT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function La(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,r=e.length;o<r;o++)if(!La(e[o],t[o],n))return!1;return!0}if(Np(e)&&Np(t)){const o=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!o||t[l]!==void 0)&&!La(e[l],t[l],n))return!1;return!0}let r=0;if(!o)r=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&r++;let i=0;for(const l in t)if((!o||t[l]!==void 0)&&(i++,i>r||!La(e[l],t[l],n)))return!1;return r===i}return!1}function Pc(e){let t,n;const o=new Promise((r,i)=>{t=r,n=i});return o.status="pending",o.resolve=r=>{o.status="resolved",o.value=r,t(r),e?.(r)},o.reject=r=>{o.status="rejected",n(r)},o}function i8(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Vs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const yi=0,Ka=1,Dc=2,zc=3;function Ji(e){return uS(e.filter(t=>t!==void 0).join("/"))}function uS(e){return e.replace(/\/{2,}/g,"/")}function dS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Uc(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dx(e){return Uc(dS(e))}function Tp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function s8(e,t,n){return Tp(e,n)===Tp(t,n)}function a8(e){const{type:t,value:n}=e;if(t===yi)return n;const{prefixSegment:o,suffixSegment:r}=e;if(t===Ka){const i=n.substring(1);if(o&&r)return`${o}{$${i}}${r}`;if(o)return`${o}{$${i}}`;if(r)return`{$${i}}${r}`}if(t===zc){const i=n.substring(1);return o&&r?`${o}{-$${i}}${r}`:o?`${o}{-$${i}}`:r?`{-$${i}}${r}`:`{-$${i}}`}if(t===Dc){if(o&&r)return`${o}{$}${r}`;if(o)return`${o}{$}`;if(r)return`{$}${r}`}return n}function l8({basepath:e,base:t,to:n,trailingSlash:o="never",caseSensitive:r,parseCache:i}){var l;t=kp(e,t,r),n=kp(e,n,r);let u=Lc(t,i).slice();const f=Lc(n,i);u.length>1&&((l=Z_(u))==null?void 0:l.value)==="/"&&u.pop();for(let g=0,v=f.length;g<v;g++){const x=f[g],b=x.value;b==="/"?g?g===v-1&&u.push(x):u=[x]:b===".."?u.pop():b==="."||u.push(x)}u.length>1&&(Z_(u).value==="/"?o==="never"&&u.pop():o==="always"&&u.push({type:yi,value:"/"}));const m=u.map(a8);return Ji([e,...m])}const Lc=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const o=h8(e);return t?.set(e,o),o},c8=/^\$.{1,}$/,u8=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,d8=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,f8=/^\$$/,m8=/^(.*?)\{\$\}(.*)$/;function h8(e){e=uS(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:yi,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(o=>{const r=o.match(m8);if(r){const u=r[1],f=r[2];return{type:Dc,value:"$",prefixSegment:u||void 0,suffixSegment:f||void 0}}const i=o.match(d8);if(i){const u=i[1],f=i[2],m=i[3];return{type:zc,value:f,prefixSegment:u||void 0,suffixSegment:m||void 0}}const l=o.match(u8);if(l){const u=l[1],f=l[2],m=l[3];return{type:Ka,value:""+f,prefixSegment:u||void 0,suffixSegment:m||void 0}}if(c8.test(o)){const u=o.substring(1);return{type:Ka,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return f8.test(o)?{type:Dc,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:yi,value:o.includes("%25")?o.split("%25").map(u=>decodeURI(u)).join("%25"):decodeURI(o)}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:yi,value:"/"})),t}function jh({path:e,params:t,leaveWildcards:n,leaveParams:o,decodeCharMap:r,parseCache:i}){const l=Lc(e,i);function u(g){const v=t[g],x=typeof v=="string";return g==="*"||g==="_splat"?x?encodeURI(v):v:x?p8(v,r):v}let f=!1;const m={},p=Ji(l.map(g=>{if(g.type===yi)return g.value;if(g.type===Dc){m._splat=t._splat,m["*"]=t._splat;const v=g.prefixSegment||"",x=g.suffixSegment||"";if(!("_splat"in t))return f=!0,n?`${v}${g.value}${x}`:v||x?`${v}${x}`:void 0;const b=u("_splat");return n?`${v}${g.value}${b??""}${x}`:`${v}${b}${x}`}if(g.type===Ka){const v=g.value.substring(1);!f&&!(v in t)&&(f=!0),m[v]=t[v];const x=g.prefixSegment||"",b=g.suffixSegment||"";if(o){const S=u(g.value);return`${x}${g.value}${S??""}${b}`}return`${x}${u(v)??"undefined"}${b}`}if(g.type===zc){const v=g.value.substring(1),x=g.prefixSegment||"",b=g.suffixSegment||"";if(!(v in t)||t[v]==null)return n?`${x}${v}${b}`:x||b?`${x}${b}`:void 0;if(m[v]=t[v],o){const S=u(g.value);return`${x}${g.value}${S??""}${b}`}return n?`${x}${v}${u(v)??""}${b}`:`${x}${u(v)??""}${b}`}return g.value}));return{usedParams:m,interpolatedPath:p,isMissingParams:f}}function p8(e,t){let n=encodeURIComponent(e);if(t)for(const[o,r]of t)n=n.replaceAll(o,r);return n}function Y_(e,t,n,o){const r=g8(e,t,n,o);if(!(n.to&&!r))return r??{}}function kp(e,t,n=!1){const o=n?e:e.toLowerCase(),r=n?t:t.toLowerCase();switch(!0){case o==="/":return t;case r===o:return"";case t.length<e.length:return t;case r[o.length]!=="/":return t;case r.startsWith(o):return t.slice(e.length);default:return t}}function g8(e,t,{to:n,fuzzy:o,caseSensitive:r},i){if(e!=="/"&&!t.startsWith(e))return;t=kp(e,t,r),n=kp(e,`${n??"$"}`,r);const l=Lc(t.startsWith("/")?t:`/${t}`,i),u=Lc(n.startsWith("/")?n:`/${n}`,i),f={};return v8(l,u,f,o,r)?f:void 0}function v8(e,t,n,o,r){var i,l,u;let f=0,m=0;for(;f<e.length||m<t.length;){const p=e[f],g=t[m];if(g){if(g.type===Dc){const v=e.slice(f);let x;if(g.prefixSegment||g.suffixSegment){if(!p)return!1;const b=g.prefixSegment||"",S=g.suffixSegment||"",C=p.value;if("prefixSegment"in g&&!C.startsWith(b)||"suffixSegment"in g&&!((i=e[e.length-1])!=null&&i.value.endsWith(S)))return!1;let E=decodeURI(Ji(v.map(j=>j.value)));b&&E.startsWith(b)&&(E=E.slice(b.length)),S&&E.endsWith(S)&&(E=E.slice(0,E.length-S.length)),x=E}else x=decodeURI(Ji(v.map(b=>b.value)));return n["*"]=x,n._splat=x,!0}if(g.type===yi){if(g.value==="/"&&!p?.value){m++;continue}if(p){if(r){if(g.value!==p.value)return!1}else if(g.value.toLowerCase()!==p.value.toLowerCase())return!1;f++,m++;continue}else return!1}if(g.type===Ka){if(!p||p.value==="/")return!1;let v="",x=!1;if(g.prefixSegment||g.suffixSegment){const b=g.prefixSegment||"",S=g.suffixSegment||"",C=p.value;if(b&&!C.startsWith(b)||S&&!C.endsWith(S))return!1;let E=C;b&&E.startsWith(b)&&(E=E.slice(b.length)),S&&E.endsWith(S)&&(E=E.slice(0,E.length-S.length)),v=decodeURIComponent(E),x=!0}else v=decodeURIComponent(p.value),x=!0;x&&(n[g.value.substring(1)]=v,f++),m++;continue}if(g.type===zc){if(!p){m++;continue}if(p.value==="/"){m++;continue}let v="",x=!1;if(g.prefixSegment||g.suffixSegment){const b=g.prefixSegment||"",S=g.suffixSegment||"",C=p.value;if((!b||C.startsWith(b))&&(!S||C.endsWith(S))){let E=C;b&&E.startsWith(b)&&(E=E.slice(b.length)),S&&E.endsWith(S)&&(E=E.slice(0,E.length-S.length)),v=decodeURIComponent(E),x=!0}}else{let b=!0;for(let S=m+1;S<t.length;S++){const C=t[S];if(C?.type===yi&&C.value===p.value){b=!1;break}if(C?.type===Ka||C?.type===Dc){e.length<t.length&&(b=!1);break}}b&&(v=decodeURIComponent(p.value),x=!0)}x&&(n[g.value.substring(1)]=v,f++),m++;continue}}if(f<e.length&&m>=t.length)return n["**"]=Ji(e.slice(f).map(v=>v.value)),!!o&&((l=t[t.length-1])==null?void 0:l.value)!=="/";if(m<t.length&&f>=e.length){for(let v=m;v<t.length;v++)if(((u=t[v])==null?void 0:u.type)!==zc)return!1;break}break}return!0}const y8=.75,b8=1,x8=.5,_8=.4,w8=.25,S8=.2,C8=.05,E8=.02,R8=.01,aT=2e-4,lT=1e-4;function cT(e,t){return e.prefixSegment&&e.suffixSegment?t+C8+aT*e.prefixSegment.length+lT*e.suffixSegment.length:e.prefixSegment?t+E8+aT*e.prefixSegment.length:e.suffixSegment?t+R8+lT*e.suffixSegment.length:t}function j8(e){const t=[];return e.forEach((o,r)=>{var i;if(o.isRoot||!o.path)return;const l=dS(o.fullPath);let u=Lc(l),f=0;for(;u.length>f+1&&((i=u[f])==null?void 0:i.value)==="/";)f++;f>0&&(u=u.slice(f));let m=0,p=!1;const g=u.map((v,x)=>{if(v.value==="/")return y8;if(v.type===yi)return b8;let b;v.type===Ka?b=x8:v.type===zc?(b=_8,m++):b=w8;for(let S=x+1;S<u.length;S++){const C=u[S];if(C.type===yi&&C.value!=="/")return p=!0,cT(v,b+S8)}return cT(v,b)});t.push({child:o,trimmed:l,parsed:u,index:r,scores:g,optionalParamCount:m,hasStaticAfter:p})}),t.sort((o,r)=>{const i=Math.min(o.scores.length,r.scores.length);for(let l=0;l<i;l++)if(o.scores[l]!==r.scores[l])return r.scores[l]-o.scores[l];if(o.scores.length!==r.scores.length){if(o.optionalParamCount!==r.optionalParamCount){if(o.hasStaticAfter===r.hasStaticAfter)return o.optionalParamCount-r.optionalParamCount;if(o.hasStaticAfter&&!r.hasStaticAfter)return-1;if(!o.hasStaticAfter&&r.hasStaticAfter)return 1}return r.scores.length-o.scores.length}for(let l=0;l<i;l++)if(o.parsed[l].value!==r.parsed[l].value)return o.parsed[l].value>r.parsed[l].value?1:-1;return o.index-r.index}).map((o,r)=>(o.child.rank=r,o.child))}function N8({routeTree:e,initRoute:t}){const n={},o={},r=l=>{l.forEach((u,f)=>{t?.(u,f);const m=n[u.id];if(ts(!m,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const g=Uc(u.fullPath);(!o[g]||u.fullPath.endsWith("/"))&&(o[g]=u)}const p=u.children;p?.length&&r(p)})};r([e]);const i=j8(Object.values(n));return{routesById:n,routesByPath:o,flatRoutes:i}}function wi(e){return!!e?.isNotFound}function T8(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Op="tsr-scroll-restoration-v1_3",k8=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function O8(){const e=T8();if(!e)return;const t=e.getItem(Op);let n=t?JSON.parse(t):{};return{state:n,set:o=>(n=Ua(o,n)||n,e.setItem(Op,JSON.stringify(n)))}}const fx=O8(),X_=e=>e.state.__TSR_key||e.href;function A8(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ap=!1;function sI({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:r,location:i}){var l,u;let f;try{f=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(g){console.error(g);return}const m=t||((l=window.history.state)==null?void 0:l.key),p=f[m];Ap=!0;e:{if(o&&p&&Object.keys(p).length>0){for(const x in p){const b=p[x];if(x==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(x){const S=document.querySelector(x);S&&(S.scrollLeft=b.scrollX,S.scrollTop=b.scrollY)}}break e}const g=(i??window.location).hash.split("#",2)[1];if(g){const x=((u=window.history.state)==null?void 0:u.__hashScrollIntoViewOptions)??!0;if(x){const b=document.getElementById(g);b&&b.scrollIntoView(x)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),r)for(const x of r){if(x==="window")continue;const b=typeof x=="function"?x():document.querySelector(x);b&&b.scrollTo(v)}}Ap=!1}function I8(e,t){if(fx===void 0||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),typeof document>"u"||e.isScrollRestorationSetup))return;e.isScrollRestorationSetup=!0,Ap=!1;const o=e.options.getScrollRestorationKey||X_;window.history.scrollRestoration="manual";const r=i=>{if(Ap||!e.isScrollRestoring)return;let l="";if(i.target===document||i.target===window)l="window";else{const f=i.target.getAttribute("data-scroll-restoration-id");f?l=`[data-scroll-restoration-id="${f}"]`:l=A8(i.target)}const u=o(e.state.location);fx.set(f=>{const m=f[u]||(f[u]={}),p=m[l]||(m[l]={});if(l==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(l){const g=document.querySelector(l);g&&(p.scrollX=g.scrollLeft||0,p.scrollY=g.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",k8(r,100),!0),e.subscribe("onRendered",i=>{const l=o(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}sI({storageKey:Op,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&fx.set(u=>(u[l]||(u[l]={}),u))})}function $8(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function M8(e,t=String){const n=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&n.set(o,t(r))}return n.toString()}function mx(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function P8(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const i=n[o];i==null?n[o]=mx(r):Array.isArray(i)?i.push(mx(r)):n[o]=[i,mx(r)]}return n}const D8=U8(JSON.parse),z8=L8(JSON.stringify,JSON.parse);function U8(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=P8(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function L8(e,t){const n=typeof t=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(n&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const i=M8(r,o);return i?`?${i}`:""}}const wo="__root__";function il(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function hi(e){return e instanceof Response&&!!e.options}function F8(e){const t=new Map;let n,o;const r=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,o&&(o.next=i,i.prev=o)):(i.next.prev=void 0,n=i.next,i.next=void 0,o&&(i.prev=o,o.next=i)),o=i)};return{get(i){const l=t.get(i);if(l)return r(l),l.value},set(i,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===o&&(o=void 0)}const u=t.get(i);if(u)u.value=l,r(u);else{const f={key:i,value:l,prev:o};o&&(o.next=f),o=f,n||(n=f),t.set(i,f)}}}}const lp=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},Tg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),aI=(e,t)=>{var n;const o=e.router.routesById[t.routeId??""]??e.router.routeTree;!o.options.notFoundComponent&&((n=e.router.options)!=null&&n.defaultNotFoundComponent)&&(o.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ts(o.options.notFoundComponent);const r=e.matches.find(i=>i.routeId===o.id);ts(r,"Could not find match for route: "+o.id),e.updateMatch(r.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&o.parentRoute&&(t.routeId=o.parentRoute.id,aI(e,t))},Ps=(e,t,n)=>{var o,r,i;if(!(!hi(n)&&!wi(n))){if(hi(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){(o=t._nonReactive.beforeLoadPromise)==null||o.resolve(),(r=t._nonReactive.loaderPromise)==null||r.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const l=hi(n)?"redirected":"notFound";e.updateMatch(t.id,u=>({...u,status:l,isFetching:!1,error:n})),wi(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()}throw hi(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(aI(e,n),n)}},lI=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Sd=(e,t,n,o)=>{var r,i;const{id:l,routeId:u}=e.matches[t],f=e.router.looseRoutesById[u];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Ps(e,e.router.getMatch(l),n);try{(i=(r=f.options).onError)==null||i.call(r,n)}catch(m){n=m,Ps(e,e.router.getMatch(l),n)}e.updateMatch(l,m=>{var p,g;return(p=m._nonReactive.beforeLoadPromise)==null||p.resolve(),m._nonReactive.beforeLoadPromise=void 0,(g=m._nonReactive.loadPromise)==null||g.resolve(),{...m,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},V8=(e,t,n,o)=>{var r;const i=e.router.getMatch(t),l=(r=e.matches[n-1])==null?void 0:r.id,u=l?e.router.getMatch(l):void 0;if(e.router.isShell()){i.ssr=t===wo;return}if(u?.ssr===!1){i.ssr=!1;return}const f=b=>b===!0&&u?.ssr==="data-only"?"data-only":b,m=e.router.options.defaultSsr??!0;if(o.options.ssr===void 0){i.ssr=f(m);return}if(typeof o.options.ssr!="function"){i.ssr=f(o.options.ssr);return}const{search:p,params:g}=i,v={search:Nh(p,i.searchError),params:Nh(g,i.paramsError),location:e.location,matches:e.matches.map(b=>({index:b.index,pathname:b.pathname,fullPath:b.fullPath,staticData:b.staticData,id:b.id,routeId:b.routeId,search:Nh(b.search,b.searchError),params:Nh(b.params,b.paramsError),ssr:b.ssr}))},x=o.options.ssr(v);if(Vs(x))return x.then(b=>{i.ssr=f(b??m)});i.ssr=f(x??m)},cI=(e,t,n,o)=>{var r;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Tg(e,t)&&(n.options.loader||n.options.beforeLoad||fI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((r=e.router.options)==null?void 0:r.defaultPendingComponent)))){const u=setTimeout(()=>{lp(e)},i);o._nonReactive.pendingTimeout=u}},B8=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;cI(e,t,n,o);const r=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Ps(e,i,i.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},H8=(e,t,n,o)=>{var r;const i=e.router.getMatch(t),l=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Pc(()=>{l?.resolve()});const{paramsError:u,searchError:f}=i;u&&Sd(e,n,u,"PARSE_PARAMS"),f&&Sd(e,n,f,"VALIDATE_SEARCH"),cI(e,t,o,i);const m=new AbortController,p=(r=e.matches[n-1])==null?void 0:r.id,g=p?e.router.getMatch(p):void 0,x={...g?.context??e.router.options.context??void 0,...i.__routeContext};let b=!1;const S=()=>{b||(b=!0,e.updateMatch(t,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:m,context:x})))},C=()=>{var P;(P=i._nonReactive.beforeLoadPromise)==null||P.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,L=>({...L,isFetching:!1}))};if(!o.options.beforeLoad){Gd(()=>{S(),C()});return}i._nonReactive.beforeLoadPromise=Pc();const{search:E,params:j,cause:N}=i,T=Tg(e,t),k={search:E,abortController:m,params:j,preload:T,context:x,location:e.location,navigate:P=>e.router.navigate({...P,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":N,matches:e.matches},A=P=>{if(P===void 0){Gd(()=>{S(),C()});return}(hi(P)||wi(P))&&(S(),Sd(e,n,P,"BEFORE_LOAD")),Gd(()=>{S(),e.updateMatch(t,L=>({...L,__beforeLoadContext:P,context:{...L.context,...P}})),C()})};let I;try{if(I=o.options.beforeLoad(k),Vs(I))return S(),I.catch(P=>{Sd(e,n,P,"BEFORE_LOAD")}).then(A)}catch(P){S(),Sd(e,n,P,"BEFORE_LOAD")}A(I)},G8=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],i=()=>{if(e.router.isServer){const f=V8(e,n,t,r);if(Vs(f))return f.then(l)}return l()},l=()=>{if(lI(e,n))return;const f=B8(e,n,r);return Vs(f)?f.then(u):u()},u=()=>H8(e,n,t,r);return i()},qd=(e,t,n)=>{var o,r,i,l,u,f;const m=e.router.getMatch(t);if(!m||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const p={matches:e.matches,match:m,params:m.params,loaderData:m.loaderData};return Promise.all([(r=(o=n.options).head)==null?void 0:r.call(o,p),(l=(i=n.options).scripts)==null?void 0:l.call(i,p),(f=(u=n.options).headers)==null?void 0:f.call(u,p)]).then(([g,v,x])=>{const b=g?.meta,S=g?.links,C=g?.scripts,E=g?.styles;return{meta:b,links:S,headScripts:C,headers:x,scripts:v,styles:E}})},uI=(e,t,n,o)=>{const r=e.matchPromises[n-1],{params:i,loaderDeps:l,abortController:u,context:f,cause:m}=e.router.getMatch(t),p=Tg(e,t);return{params:i,deps:l,preload:!!p,parentMatchPromise:r,abortController:u,context:f,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:p?"preload":m,route:o}},uT=async(e,t,n,o)=>{var r,i,l,u;try{const f=e.router.getMatch(t);try{(!e.router.isServer||f.ssr===!0)&&dI(o);const m=(i=(r=o.options).loader)==null?void 0:i.call(r,uI(e,t,n,o)),p=o.options.loader&&Vs(m);if(!!(p||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||f._nonReactive.minPendingPromise)&&e.updateMatch(t,S=>({...S,isFetching:"loader"})),o.options.loader){const S=p?await m:m;Ps(e,e.router.getMatch(t),S),S!==void 0&&e.updateMatch(t,C=>({...C,loaderData:S}))}o._lazyPromise&&await o._lazyPromise;const v=qd(e,t,o),x=v?await v:void 0,b=f._nonReactive.minPendingPromise;b&&await b,o._componentsPromise&&await o._componentsPromise,e.updateMatch(t,S=>({...S,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...x}))}catch(m){let p=m;const g=f._nonReactive.minPendingPromise;g&&await g,Ps(e,e.router.getMatch(t),m);try{(u=(l=o.options).onError)==null||u.call(l,m)}catch(b){p=b,Ps(e,e.router.getMatch(t),b)}const v=qd(e,t,o),x=v?await v:void 0;e.updateMatch(t,b=>({...b,error:p,status:"error",isFetching:!1,...x}))}}catch(f){const m=e.router.getMatch(t);if(m){const p=qd(e,t,o);if(p){const g=await p;e.updateMatch(t,v=>({...v,...g}))}m._nonReactive.loaderPromise=void 0}Ps(e,m,f)}},q8=async(e,t)=>{var n,o;const{id:r,routeId:i}=e.matches[t];let l=!1,u=!1;const f=e.router.looseRoutesById[i];if(lI(e,r)){if(e.router.isServer){const g=qd(e,r,f);if(g){const v=await g;e.updateMatch(r,x=>({...x,...v}))}return e.router.getMatch(r)}}else{const g=e.router.getMatch(r);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload)return g;await g._nonReactive.loaderPromise;const v=e.router.getMatch(r);v.error&&Ps(e,v,v.error)}else{const v=Date.now()-g.updatedAt,x=Tg(e,r),b=x?f.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:f.options.staleTime??e.router.options.defaultStaleTime??0,S=f.options.shouldReload,C=typeof S=="function"?S(uI(e,r,t,f)):S,E=!!x&&!e.router.state.matches.some(k=>k.id===r),j=e.router.getMatch(r);j._nonReactive.loaderPromise=Pc(),E!==j.preload&&e.updateMatch(r,k=>({...k,preload:E}));const{status:N,invalid:T}=j;if(l=N==="success"&&(T||(C??v>b)),!(x&&f.options.preload===!1))if(l&&!e.sync)u=!0,(async()=>{var k,A;try{await uT(e,r,t,f);const I=e.router.getMatch(r);(k=I._nonReactive.loaderPromise)==null||k.resolve(),(A=I._nonReactive.loadPromise)==null||A.resolve(),I._nonReactive.loaderPromise=void 0}catch(I){hi(I)&&await e.router.navigate(I.options)}})();else if(N!=="success"||l&&e.sync)await uT(e,r,t,f);else{const k=qd(e,r,f);if(k){const A=await k;e.updateMatch(r,I=>({...I,...A}))}}}}const m=e.router.getMatch(r);u||((n=m._nonReactive.loaderPromise)==null||n.resolve(),(o=m._nonReactive.loadPromise)==null||o.resolve()),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const p=u?m.isFetching:!1;return p!==m.isFetching||m.invalid!==!1?(e.updateMatch(r,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(r)):m};async function dT(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&lp(t);try{for(let r=0;r<t.matches.length;r++){const i=G8(t,r);Vs(i)&&await i}const n=t.firstBadMatchIndex??t.matches.length;for(let r=0;r<n;r++)t.matchPromises.push(q8(t,r));await Promise.all(t.matchPromises);const o=lp(t);Vs(o)&&await o}catch(n){if(wi(n)&&!t.preload){const o=lp(t);throw Vs(o)&&await o,n}if(hi(n))throw n}return t.matches}async function dI(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var n;const o=[];for(const r of mI){const i=(n=e.options[r])==null?void 0:n.preload;i&&o.push(i())}if(o.length)return Promise.all(o).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Nh(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function fI(e){var t;for(const n of mI)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const mI=["component","errorComponent","pendingComponent","notFoundComponent"];function Fa(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,r=t?.href!==n.href,i=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:r,hashChanged:i}}class K8{constructor(t){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=n=>n(),this.update=n=>{var o;n.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 r=this.options;this.options={...this.options,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(i=>[encodeURIComponent(i),i])):void 0,(!this.basepath||n.basepath&&n.basepath!==r.basepath)&&(n.basepath===void 0||n.basepath===""||n.basepath==="/"?this.basepath="/":this.basepath=`/${dx(n.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?n8({initialEntries:[this.basepath||"/"]}):iI()),this.updateLatestLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new q_(Y8(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(i=>!["redirected"].includes(i.status))}}}),I8(this)),typeof window<"u"&&"CSS"in window&&typeof((o=window.CSS)==null?void 0:o.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{routesById:n,routesByPath:o,flatRoutes:r}=N8({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=o,this.flatRoutes=r;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:f,search:m,hash:p,state:g})=>{const v=this.options.parseSearch(m),x=this.options.stringifySearch(v);return{pathname:f,searchStr:x,search:xo(o?.search,v),hash:p.split("#").reverse()[0]??"",href:`${f}${x}${p}`,state:xo(o?.state,g)}},i=r(n),{__tempLocation:l,__tempKey:u}=i.state;if(l&&(!u||u===this.tempLocationKey)){const f=r(l);return f.state.key=i.state.key,f.state.__TSR_key=i.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:i}}return i},this.resolvePathWithBase=(n,o)=>l8({basepath:this.basepath,base:n,to:uS(o),trailingSlash:this.options.trailingSlash,caseSensitive:this.options.caseSensitive,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,o,r)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},r):this.matchRoutesInternal(n,o),this.parsePathnameCache=F8(1e3),this.getMatchedRoutes=(n,o)=>X8({pathname:n,routePathname:o,basepath:this.basepath,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{var n;(n=this.state.pendingMatches)==null||n.forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const o=(i={})=>{var l,u;const f=i._fromLocation||this.latestLocation,m=this.matchRoutes(f,{_buildLocation:!0}),p=Z_(m);i.from;const g=i.unsafeRelative==="path"?f.pathname:i.from??p.fullPath,v=this.resolvePathWithBase(g,"."),x=p.search,b={...p.params},S=i.to?this.resolvePathWithBase(v,`${i.to}`):this.resolvePathWithBase(v,"."),C=i.params===!1||i.params===null?{}:(i.params??!0)===!0?b:Object.assign(b,Ua(i.params,b)),E=jh({path:S,params:C,parseCache:this.parsePathnameCache}).interpolatedPath,j=this.matchRoutes(E,void 0,{_buildLocation:!0}).map(L=>this.looseRoutesById[L.routeId]);if(Object.keys(C).length>0)for(const L of j){const V=((l=L.options.params)==null?void 0:l.stringify)??L.options.stringifyParams;V&&Object.assign(C,V(C))}const N=jh({path:S,params:C,leaveWildcards:!1,leaveParams:n.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let T=x;if(n._includeValidateSearch&&((u=this.options.search)!=null&&u.strict)){const L={};j.forEach(V=>{if(V.options.validateSearch)try{Object.assign(L,W_(V.options.validateSearch,{...L,...T}))}catch{}}),T=L}T=W8({search:T,dest:i,destRoutes:j,_includeValidateSearch:n._includeValidateSearch}),T=xo(x,T);const k=this.options.stringifySearch(T),A=i.hash===!0?f.hash:i.hash?Ua(i.hash,f.hash):void 0,I=A?`#${A}`:"";let P=i.state===!0?f.state:i.state?Ua(i.state,f.state):{};return P=xo(f.state,P),{pathname:N,search:T,searchStr:k,state:P,hash:A??"",href:`${N}${k}${I}`,unmaskOnReload:i.unmaskOnReload}},r=(i={},l)=>{var u;const f=o(i);let m=l?o(l):void 0;if(!m){let p={};const g=(u=this.options.routeMasks)==null?void 0:u.find(v=>{const x=Y_(this.basepath,f.pathname,{to:v.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return x?(p=x,!0):!1});if(g){const{from:v,...x}=g;l={from:n.from,...x,params:p},m=o(l)}}return m&&(f.maskedLocation=m),f};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:o,...r})=>{const i=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{r.state[p]=this.latestLocation.state[p]});const m=La(r.state,this.latestLocation.state);return f.forEach(p=>{delete r.state[p]}),m},l=this.latestLocation.href===r.href,u=this.commitLocationPromise;if(this.commitLocationPromise=Pc(()=>{u?.resolve()}),l&&i())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=r;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](p.href,p.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:l,href:u,...f}={})=>{if(u){const p=this.history.location.state.__TSR_index,g=Mc(u,{__TSR_index:n?p:p+1});f.to=g.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});return this.commitLocation({...m,viewTransition:i,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:l})},this.navigate=({to:n,reloadDocument:o,href:r,...i})=>{if(!o&&r)try{new URL(`${r}`),o=!0}catch{}if(o){if(!r){const l=this.buildLocation({to:n,...i});r=this.history.createHref(l.href)}return i.replace?window.location.replace(r):window.location.href=r,Promise.resolve()}return this.buildAndCommitLocation({...i,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const o=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),r=i=>{try{return encodeURI(decodeURI(i))}catch{return i}};if(dx(r(this.latestLocation.href))!==dx(r(o.href)))throw il({href:o.href})}const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(i=>i.id===r.id))}))},this.load=async n=>{let o,r,i;for(i=new Promise(l=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const f=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Fa({resolvedLocation:m,location:f})}),this.emit({type:"onBeforeLoad",...Fa({resolvedLocation:m,location:f})}),await dT({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let p,g,v;Gd(()=>{this.__store.setState(x=>{const b=x.matches,S=x.pendingMatches||x.matches;return p=b.filter(C=>!S.some(E=>E.id===C.id)),g=S.filter(C=>!b.some(E=>E.id===C.id)),v=b.filter(C=>S.some(E=>E.id===C.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...p.filter(C=>C.status!=="error")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([x,b])=>{x.forEach(S=>{var C,E;(E=(C=this.looseRoutesById[S.routeId].options)[b])==null||E.call(C,S)})})})}})}catch(f){hi(f)?(o=f,this.isServer||this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):wi(f)&&(r=f),this.__store.setState(m=>({...m,statusCode:o?o.status:r?404:m.matches.some(p=>p.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===i&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;this.hasNotFoundMatch()&&this.__store.setState(l=>({...l,statusCode:404}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,l=this.state.resolvedLocation,u=typeof o.types=="function"?o.types(Fa({resolvedLocation:l,location:i})):o.types;r={update:n,types:u}}else r=n;document.startViewTransition(r)}else n()},this.updateMatch=(n,o)=>{var r;const i=(r=this.state.pendingMatches)!=null&&r.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";i&&this.__store.setState(l=>{var u;return{...l,[i]:(u=l[i])==null?void 0:u.map(f=>f.id===n?o(f):f)}})},this.getMatch=n=>{var o;const r=i=>i.id===n;return this.state.cachedMatches.find(r)??((o=this.state.pendingMatches)==null?void 0:o.find(r))??this.state.matches.find(r)},this.invalidate=n=>{const o=r=>{var i;return((i=n?.filter)==null?void 0:i.call(n,r))??!0?{...r,invalid:!0,...n?.forcePending||r.status==="error"?{status:"pending",error:void 0}:void 0}:r};return this.__store.setState(r=>{var i;return{...r,matches:r.matches.map(o),cachedMatches:r.cachedMatches.map(o),pendingMatches:(i=r.pendingMatches)==null?void 0:i.map(o)}}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>(n.options.href||(n.options.href=this.buildLocation(n.options).href,n.headers.set("Location",n.options.href)),n.headers.get("Location")||n.headers.set("Location",n.options.href),n),this.clearCache=n=>{const o=n?.filter;o!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!o(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const r=this.looseRoutesById[o.routeId];if(!r.options.loader)return!0;const i=(o.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=i};this.clearCache({filter:n})},this.loadRouteChunk=dI,this.preloadRoute=async n=>{const o=this.buildLocation(n);let r=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...i,...this.state.cachedMatches.map(u=>u.id)]);Gd(()=>{r.forEach(u=>{l.has(u.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,u]}))})});try{return r=await dT({router:this,matches:r,location:o,preload:!0,updateMatch:(u,f)=>{i.has(u)?r=r.map(m=>m.id===u?f(m):m):this.updateMatch(u,f)}}),r}catch(u){if(hi(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:o});wi(u)||console.error(u);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const u=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=Y_(this.basepath,u.pathname,{...o,to:i.pathname},this.parsePathnameCache);return!f||n.params&&!La(f,n.params,{partial:!0})?!1:f&&(o?.includeSearch??!0)?La(u.search,i.search,{partial:!0})?f:!1:f},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??z8,parseSearch:t.parseSearch??D8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){var o;const{foundRoute:r,matchedRoutes:i,routeParams:l}=this.getMatchedRoutes(t.pathname,(o=n?.dest)==null?void 0:o.to);let u=!1;(r?r.path!=="/"&&l["**"]:Uc(t.pathname))&&(this.options.notFoundRoute?i.push(this.options.notFoundRoute):u=!0);const f=(()=>{if(u){if(this.options.notFoundMode!=="root")for(let g=i.length-1;g>=0;g--){const v=i[g];if(v.children)return v.id}return wo}})(),m=[],p=g=>g?.id?g.context??this.options.context??void 0:this.options.context??void 0;return i.forEach((g,v)=>{var x,b,S;const C=m[v-1],[E,j,N]=(()=>{const M=C?.search??t.search,K=C?._strictSearch??void 0;try{const U=W_(g.options.validateSearch,{...M})??void 0;return[{...M,...U},{...K,...U},void 0]}catch(U){let re=U;if(U instanceof Ip||(re=new Ip(U.message,{cause:U})),n?.throwOnError)throw re;return[M,{},re]}})(),T=((b=(x=g.options).loaderDeps)==null?void 0:b.call(x,{search:E}))??"",k=T?JSON.stringify(T):"",{interpolatedPath:A,usedParams:I}=jh({path:g.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),P=jh({path:g.id,params:l,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+k,L=this.getMatch(P),V=this.state.matches.find(M=>M.routeId===g.id),ie=L?._strictParams??I;let se;if(!L){const M=((S=g.options.params)==null?void 0:S.parse)??g.options.parseParams;if(M)try{Object.assign(ie,M(ie))}catch(K){if(se=new Z8(K.message,{cause:K}),n?.throwOnError)throw se}}Object.assign(l,ie);const ue=V?"stay":"enter";let le;if(L)le={...L,cause:ue,params:V?xo(V.params,l):l,_strictParams:ie,search:xo(V?V.search:L.search,E),_strictSearch:j};else{const M=g.options.loader||g.options.beforeLoad||g.lazyFn||fI(g)?"pending":"success";le={id:P,index:v,routeId:g.id,params:V?xo(V.params,l):l,_strictParams:ie,pathname:Ji([this.basepath,A]),updatedAt:Date.now(),search:V?xo(V.search,E):E,_strictSearch:j,searchError:void 0,status:M,isFetching:!1,error:void 0,paramsError:se,__routeContext:void 0,_nonReactive:{loadPromise:Pc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ue,loaderDeps:V?xo(V.loaderDeps,T):T,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}n?.preload||(le.globalNotFound=f===g.id),le.searchError=N;const ce=p(C);le.context={...ce,...le.__routeContext,...le.__beforeLoadContext},m.push(le)}),m.forEach((g,v)=>{const x=this.looseRoutesById[g.routeId];if(!this.getMatch(g.id)&&n?._buildLocation!==!0){const S=m[v-1],C=p(S);if(x.options.context){const E={deps:g.loaderDeps,params:g.params,context:C??{},location:t,navigate:j=>this.navigate({...j,_fromLocation:t}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:m};g.__routeContext=x.options.context(E)??void 0}g.context={...C,...g.__routeContext,...g.__beforeLoadContext}}}),m}}class Ip extends Error{}class Z8 extends Error{}function Y8(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function W_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ip("Async validation not supported");if(n.issues)throw new Ip(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function X8({pathname:e,routePathname:t,basepath:n,caseSensitive:o,routesByPath:r,routesById:i,flatRoutes:l,parseCache:u}){let f={};const m=Uc(e),p=b=>{var S;return Y_(n,m,{to:b.fullPath,caseSensitive:((S=b.options)==null?void 0:S.caseSensitive)??o,fuzzy:!0},u)};let g=t!==void 0?r[t]:void 0;if(g)f=p(g);else{let b;for(const S of l){const C=p(S);if(C)if(S.path!=="/"&&C["**"])b||(b={foundRoute:S,routeParams:C});else{g=S,f=C;break}}!g&&b&&(g=b.foundRoute,f=b.routeParams)}let v=g||i[wo];const x=[v];for(;v.parentRoute;)v=v.parentRoute,x.push(v);return x.reverse(),{matchedRoutes:x,routeParams:f,foundRoute:g}}function W8({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){const r=n.reduce((u,f)=>{var m;const p=[];if("search"in f.options)(m=f.options.search)!=null&&m.middlewares&&p.push(...f.options.search.middlewares);else if(f.options.preSearchFilters||f.options.postSearchFilters){const g=({search:v,next:x})=>{let b=v;"preSearchFilters"in f.options&&f.options.preSearchFilters&&(b=f.options.preSearchFilters.reduce((C,E)=>E(C),v));const S=x(b);return"postSearchFilters"in f.options&&f.options.postSearchFilters?f.options.postSearchFilters.reduce((C,E)=>E(C),S):S};p.push(g)}if(o&&f.options.validateSearch){const g=({search:v,next:x})=>{const b=x(v);try{return{...b,...W_(f.options.validateSearch,b)??void 0}}catch{return b}};p.push(g)}return u.concat(p)},[])??[],i=({search:u})=>t.search?t.search===!0?u:Ua(t.search,u):{};r.push(i);const l=(u,f)=>{if(u>=r.length)return f;const m=r[u];return m({search:f,next:g=>l(u+1,g)})};return l(0,e)}const Q8="Error preloading route! ☝️";class hI{constructor(t){if(this.init=n=>{var o,r;this.originalIndex=n.originalIndex;const i=this.options,l=!i?.path&&!i?.id;this.parentRoute=(r=(o=this.options).getParentRoute)==null?void 0:r.call(o),l?this._path=wo:this.parentRoute||ts(!1);let u=l?wo:i?.path;u&&u!=="/"&&(u=dS(u));const f=i?.id||u;let m=l?wo:Ji([this.parentRoute.id===wo?"":this.parentRoute.id,f]);u===wo&&(u="/"),m!==wo&&(m=Ji(["/",m]));const p=m===wo?"/":Ji([this.parentRoute.fullPath,u]);this._path=u,this._id=m,this._fullPath=p,this._to=p},this.clone=n=>{this._path=n._path,this._id=n._id,this._fullPath=n._fullPath,this._to=n._to,this.options.getParentRoute=n.options.getParentRoute,this.children=n.children},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.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 J8 extends hI{constructor(t){super(t)}}function fS(e){const t=e.errorComponent??kg;return c.jsx(e9,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?_.createElement(t,{error:n,reset:o}):e.children})}class e9 extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function kg({error:e}){const[t,n]=_.useState(!1);return c.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[c.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),c.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),c.jsx("div",{style:{height:".25rem"}}),t?c.jsx("div",{children:c.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?c.jsx("code",{children:e.message}):null})}):null]})}function t9({children:e,fallback:t=null}){return n9()?c.jsx(q.Fragment,{children:e}):c.jsx(q.Fragment,{children:t})}function n9(){return q.useSyncExternalStore(r9,()=>!0,()=>!1)}function r9(){return()=>{}}var hx={exports:{}},px={},gx={exports:{}},vx={};/**
43
+ * @license React
44
+ * use-sync-external-store-shim.production.js
45
+ *
46
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */var fT;function o9(){if(fT)return vx;fT=1;var e=bf();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(g,v){var x=v(),b=o({inst:{value:x,getSnapshot:v}}),S=b[0].inst,C=b[1];return i(function(){S.value=x,S.getSnapshot=v,f(S)&&C({inst:S})},[g,x,v]),r(function(){return f(S)&&C({inst:S}),g(function(){f(S)&&C({inst:S})})},[g]),l(x),x}function f(g){var v=g.getSnapshot;g=g.value;try{var x=v();return!n(g,x)}catch{return!0}}function m(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:u;return vx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,vx}var mT;function i9(){return mT||(mT=1,gx.exports=o9()),gx.exports}/**
51
+ * @license React
52
+ * use-sync-external-store-shim/with-selector.production.js
53
+ *
54
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */var hT;function s9(){if(hT)return px;hT=1;var e=bf(),t=i9();function n(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,u=e.useMemo,f=e.useDebugValue;return px.useSyncExternalStoreWithSelector=function(m,p,g,v,x){var b=i(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=u(function(){function E(A){if(!j){if(j=!0,N=A,A=v(A),x!==void 0&&S.hasValue){var I=S.value;if(x(I,A))return T=I}return T=A}if(I=T,o(N,A))return I;var P=v(A);return x!==void 0&&x(I,P)?(N=A,I):(N=A,T=P)}var j=!1,N,T,k=g===void 0?null:g;return[function(){return E(p())},k===null?void 0:function(){return E(k())}]},[p,g,v,x]);var C=r(m,b[0],b[1]);return l(function(){S.hasValue=!0,S.value=C},[C]),f(C),C},px}var pT;function a9(){return pT||(pT=1,hx.exports=s9()),hx.exports}var l9=a9();function c9(e,t=n=>n){return l9.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,u9)}function u9(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!t.has(o)||!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=gT(e);if(n.length!==gT(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}function gT(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const yx=_.createContext(null);function pI(){return typeof document>"u"?yx:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=yx,yx)}function Rn(e){const t=_.useContext(pI());return e?.warn,t}function wr(e){const t=Rn({warn:e?.router===void 0}),n=e?.router||t,o=_.useRef(void 0);return c9(n.__store,r=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=xo(o.current,e.select(r));return o.current=i,i}return e.select(r)}return r})}const Og=_.createContext(void 0),d9=_.createContext(void 0);function Go(e){const t=_.useContext(e.from?d9:Og);return wr({select:o=>{const r=o.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(ts(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Ag(e){return Go({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function mS(e){const{select:t,...n}=e;return Go({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function Ze(e){return Go({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ri(e){return Go({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function pn(e){const t=Rn();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Q_(e){const t=Rn(),n=pn(),o=_.useRef(null);return _.useEffect(()=>{o.current!==e&&(n(e),o.current=e)},[t,e,n]),null}var bx={exports:{}},rr={};/**
59
+ * @license React
60
+ * react-dom.production.js
61
+ *
62
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */var vT;function f9(){if(vT)return rr;vT=1;var e=bf();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function i(f,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:g==null?null:""+g,children:f,containerInfo:m,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,rr.createPortal=function(f,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return i(f,m,null,p)},rr.flushSync=function(f){var m=l.T,p=o.p;try{if(l.T=null,o.p=2,f)return f()}finally{l.T=m,o.p=p,o.d.f()}},rr.preconnect=function(f,m){typeof f=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,o.d.C(f,m))},rr.prefetchDNS=function(f){typeof f=="string"&&o.d.D(f)},rr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var p=m.as,g=u(p,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?o.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:x}):p==="script"&&o.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},rr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=u(m.as,m.crossOrigin);o.d.M(f,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&o.d.M(f)},rr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=u(p,m.crossOrigin);o.d.L(f,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},rr.preloadModule=function(f,m){if(typeof f=="string")if(m){var p=u(m.as,m.crossOrigin);o.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else o.d.m(f)},rr.requestFormReset=function(f){o.d.r(f)},rr.unstable_batchedUpdates=function(f,m){return f(m)},rr.useFormState=function(f,m,p){return l.H.useFormState(f,m,p)},rr.useFormStatus=function(){return l.H.useHostTransitionStatus()},rr.version="19.1.1",rr}var yT;function gI(){if(yT)return bx.exports;yT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),bx.exports=f9(),bx.exports}var lu=gI();const hS=Zw(lu),Th=typeof window<"u"?_.useLayoutEffect:_.useEffect;function xx(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function m9(e,t,n={},o={}){_.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([i])=>{t(i)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,n,o.disabled,e])}function h9(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function p9(e,t){const n=Rn(),[o,r]=_.useState(!1),i=_.useRef(!1),l=h9(t),{activeProps:u,inactiveProps:f,activeOptions:m,to:p,preload:g,preloadDelay:v,hashScrollIntoView:x,replace:b,startTransition:S,resetScroll:C,viewTransition:E,children:j,target:N,disabled:T,style:k,className:A,onClick:I,onFocus:P,onMouseEnter:L,onMouseLeave:V,onTouchStart:ie,ignoreBlocker:se,params:ue,search:le,hash:ce,state:M,mask:K,reloadDocument:U,unsafeRelative:re,from:$,_fromLocation:H,...W}=e,B=_.useMemo(()=>{try{return new URL(p),"external"}catch{}return"internal"},[p]),J=wr({select:ve=>ve.location.search,structuralSharing:!0}),ge=e.from,ye=_.useMemo(()=>({...e,from:ge}),[n,J,ge,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=_.useMemo(()=>n.buildLocation({...ye}),[n,ye]),fe=B==="external",ze=e.reloadDocument||fe?!1:g??n.options.defaultPreload,Ve=v??n.options.defaultPreloadDelay??0,Ye=wr({select:ve=>{if(fe)return!1;if(m?.exact){if(!s8(ve.location.pathname,ae.pathname,n.basepath))return!1}else{const xe=Tp(ve.location.pathname,n.basepath),be=Tp(ae.pathname,n.basepath);if(!(xe.startsWith(be)&&(xe.length===be.length||xe[be.length]==="/")))return!1}return(m?.includeSearch??!0)&&!La(ve.location.search,ae.search,{partial:!m?.exact,ignoreUndefined:!m?.explicitUndefined})?!1:m?.includeHash?ve.location.hash===ae.hash:!0}}),He=_.useCallback(()=>{n.preloadRoute({...ye}).catch(ve=>{console.warn(ve),console.warn(Q8)})},[n,ye]),Gt=_.useCallback(ve=>{ve?.isIntersecting&&He()},[He]);m9(l,Gt,x9,{disabled:!!T||ze!=="viewport"}),_.useEffect(()=>{i.current||!T&&ze==="render"&&(He(),i.current=!0)},[T,He,ze]);const Yt=ve=>{if(!T&&!_9(ve)&&!ve.defaultPrevented&&(!N||N==="_self")&&ve.button===0){ve.preventDefault(),lu.flushSync(()=>{r(!0)});const xe=n.subscribe("onResolved",()=>{xe(),r(!1)});n.navigate({...ye,replace:b,resetScroll:C,hashScrollIntoView:x,startTransition:S,viewTransition:E,ignoreBlocker:se})}};if(fe)return{...W,ref:l,type:B,href:p,...j&&{children:j},...N&&{target:N},...T&&{disabled:T},...k&&{style:k},...A&&{className:A},...I&&{onClick:I},...P&&{onFocus:P},...L&&{onMouseEnter:L},...V&&{onMouseLeave:V},...ie&&{onTouchStart:ie}};const Zn=ve=>{T||ze&&He()},fr=Zn,Mt=ve=>{if(!(T||!ze))if(!Ve)He();else{const xe=ve.target;if(Cd.has(xe))return;const be=setTimeout(()=>{Cd.delete(xe),He()},Ve);Cd.set(xe,be)}},nn=ve=>{if(T||!ze||!Ve)return;const xe=ve.target,be=Cd.get(xe);be&&(clearTimeout(be),Cd.delete(xe))},Pt=Ye?Ua(u,{})??g9:_x,z=Ye?_x:Ua(f,{})??_x,X=[A,Pt.className,z.className].filter(Boolean).join(" "),oe=(k||Pt.style||z.style)&&{...k,...Pt.style,...z.style};return{...W,...Pt,...z,href:T?void 0:ae.maskedLocation?n.history.createHref(ae.maskedLocation.href):n.history.createHref(ae.href),ref:l,onClick:Ed([I,Yt]),onFocus:Ed([P,Zn]),onMouseEnter:Ed([L,Mt]),onMouseLeave:Ed([V,nn]),onTouchStart:Ed([ie,fr]),disabled:!!T,target:N,...oe&&{style:oe},...X&&{className:X},...T&&v9,...Ye&&y9,...o&&b9}}const _x={},g9={className:"active"},v9={role:"link","aria-disabled":!0},y9={"data-status":"active","aria-current":"page"},b9={"data-transitioning":"transitioning"},Cd=new WeakMap,x9={rootMargin:"100px"},Ed=e=>t=>{e.filter(Boolean).forEach(n=>{t.defaultPrevented||n(t)})},Ue=_.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:r,ref:i,...l}=p9(o,t),u=typeof o.children=="function"?o.children({isActive:l["data-status"]==="active"}):o.children;return n===void 0&&delete l.disabled,_.createElement(n||"a",{...l,ref:i},u)});function _9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class w9 extends hI{constructor(t){super(t),this.useMatch=n=>Go({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Go({...n,from:this.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ri({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Ze({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>mS({...n,from:this.id}),this.useLoaderData=n=>Ag({...n,from:this.id}),this.useNavigate=()=>pn({from:this.fullPath}),this.Link=q.forwardRef((n,o)=>c.jsx(Ue,{ref:o,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function et(e){return new w9(e)}function S9(){return e=>E9(e)}class C9 extends J8{constructor(t){super(t),this.useMatch=n=>Go({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Go({...n,from:this.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ri({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Ze({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>mS({...n,from:this.id}),this.useLoaderData=n=>Ag({...n,from:this.id}),this.useNavigate=()=>pn({from:this.fullPath}),this.Link=q.forwardRef((n,o)=>c.jsx(Ue,{ref:o,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function E9(e){return new C9(e)}function bT(e){return typeof e=="object"?new xT(e,{silent:!0}).createRoute(e):new xT(e,{silent:!0}).createRoute}class xT{constructor(t,n){this.path=t,this.createRoute=o=>{this.silent;const r=et(o);return r.isRoot=!1,r},this.silent=n?.silent}}class _T{constructor(t){this.useMatch=n=>Go({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Go({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ri({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Ze({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>mS({...n,from:this.options.id}),this.useLoaderData=n=>Ag({...n,from:this.options.id}),this.useNavigate=()=>{const n=Rn();return pn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function wT(e){return typeof e=="object"?new _T(e):t=>new _T({id:e,...t})}function R9(e,t){let n,o,r,i;const l=()=>(n||(n=e().then(f=>{n=void 0,o=f[t]}).catch(f=>{if(r=f,i8(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const m=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(m)||(sessionStorage.setItem(m,"1"),i=!0)}})),n),u=function(m){if(i)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!o)throw l();return _.createElement(o,m)};return u.preload=l,u}function j9(){const e=Rn(),t=_.useRef({router:e,mounted:!1}),[n,o]=_.useState(!1),{hasPendingMatches:r,isLoading:i}=wr({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=xx(i),u=i||n||r,f=xx(u),m=i||r,p=xx(m);return e.startTransition=g=>{o(!0),_.startTransition(()=>{g(),o(!1)})},_.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Uc(e.latestLocation.href)!==Uc(v.href)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),Th(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Th(()=>{l&&!i&&e.emit({type:"onLoad",...Fa(e.state)})},[l,e,i]),Th(()=>{p&&!m&&e.emit({type:"onBeforeRouteMount",...Fa(e.state)})},[m,p,e]),Th(()=>{f&&!u&&(e.emit({type:"onResolved",...Fa(e.state)}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),$8(e))},[u,f,e]),null}function N9(e){const t=wr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return c.jsx(fS,{getResetKey:()=>t,onCatch:(n,o)=>{var r;if(wi(n))(r=e.onCatch)==null||r.call(e,n,o);else throw n},errorComponent:({error:n})=>{var o;if(wi(n))return(o=e.fallback)==null?void 0:o.call(e,n);throw n},children:e.children})}function T9(){return c.jsx("p",{children:"Not Found"})}function hc(e){return c.jsx(c.Fragment,{children:e.children})}function vI(e,t,n){return t.options.notFoundComponent?c.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?c.jsx(e.options.defaultNotFoundComponent,{data:n}):c.jsx(T9,{})}function k9({children:e}){return typeof document<"u"?null:c.jsx("script",{className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
67
+ `)}})}function O9(){const e=Rn(),n=(e.options.getScrollRestorationKey||X_)(e.latestLocation),o=n!==X_(e.latestLocation)?n:void 0;if(!e.isScrollRestoring||!e.isServer)return null;const r={storageKey:Op,shouldScrollRestoration:!0};return o&&(r.key=o),c.jsx(k9,{children:`(${sI.toString()})(${JSON.stringify(r)})`})}const yI=_.memo(function({matchId:t}){var n,o;const r=Rn(),i=wr({select:N=>{const T=N.matches.find(k=>k.id===t);return ts(T),{routeId:T.routeId,ssr:T.ssr,_displayPending:T._displayPending}},structuralSharing:!0}),l=r.routesById[i.routeId],u=l.options.pendingComponent??r.options.defaultPendingComponent,f=u?c.jsx(u,{}):null,m=l.options.errorComponent??r.options.defaultErrorComponent,p=l.options.onCatch??r.options.defaultOnCatch,g=l.isRoot?l.options.notFoundComponent??((n=r.options.notFoundRoute)==null?void 0:n.options.component):l.options.notFoundComponent,v=i.ssr===!1||i.ssr==="data-only",x=(!l.isRoot||l.options.wrapInSuspense||v)&&(l.options.wrapInSuspense??u??(((o=l.options.errorComponent)==null?void 0:o.preload)||v))?_.Suspense:hc,b=m?fS:hc,S=g?N9:hc,C=wr({select:N=>N.loadedAt}),E=wr({select:N=>{var T;const k=N.matches.findIndex(A=>A.id===t);return(T=N.matches[k-1])==null?void 0:T.routeId}}),j=l.isRoot?l.options.shellComponent??hc:hc;return c.jsxs(j,{children:[c.jsx(Og.Provider,{value:t,children:c.jsx(x,{fallback:f,children:c.jsx(b,{getResetKey:()=>C,errorComponent:m||kg,onCatch:(N,T)=>{if(wi(N))throw N;p?.(N,T)},children:c.jsx(S,{fallback:N=>{if(!g||N.routeId&&N.routeId!==i.routeId||!N.routeId&&!l.isRoot)throw N;return _.createElement(g,N)},children:v||i._displayPending?c.jsx(t9,{fallback:f,children:c.jsx(ST,{matchId:t})}):c.jsx(ST,{matchId:t})})})})}),E===wo&&r.options.scrollRestoration?c.jsxs(c.Fragment,{children:[c.jsx(A9,{}),c.jsx(O9,{})]}):null]})});function A9(){const e=Rn(),t=_.useRef(void 0);return c.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Fa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ST=_.memo(function({matchId:t}){var n,o,r,i;const l=Rn(),{match:u,key:f,routeId:m}=wr({select:v=>{const x=v.matches.find(j=>j.id===t),b=x.routeId,S=l.routesById[b].options.remountDeps??l.options.defaultRemountDeps,C=S?.({routeId:b,loaderDeps:x.loaderDeps,params:x._strictParams,search:x._strictSearch});return{key:C?JSON.stringify(C):void 0,routeId:b,match:{id:x.id,status:x.status,error:x.error,_forcePending:x._forcePending,_displayPending:x._displayPending}}},structuralSharing:!0}),p=l.routesById[m],g=_.useMemo(()=>{const v=p.options.component??l.options.defaultComponent;return v?c.jsx(v,{},f):c.jsx(ss,{})},[f,p.options.component,l.options.defaultComponent]);if(u._displayPending)throw(n=l.getMatch(u.id))==null?void 0:n._nonReactive.displayPendingPromise;if(u._forcePending)throw(o=l.getMatch(u.id))==null?void 0:o._nonReactive.minPendingPromise;if(u.status==="pending"){const v=p.options.pendingMinMs??l.options.defaultPendingMinMs;if(v){const x=l.getMatch(u.id);if(x&&!x._nonReactive.minPendingPromise&&!l.isServer){const b=Pc();x._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),x._nonReactive.minPendingPromise=void 0},v)}}throw(r=l.getMatch(u.id))==null?void 0:r._nonReactive.loadPromise}if(u.status==="notFound")return ts(wi(u.error)),vI(l,p,u.error);if(u.status==="redirected")throw ts(hi(u.error)),(i=l.getMatch(u.id))==null?void 0:i._nonReactive.loadPromise;if(u.status==="error"){if(l.isServer){const v=(p.options.errorComponent??l.options.defaultErrorComponent)||kg;return c.jsx(v,{error:u.error,reset:void 0,info:{componentStack:""}})}throw u.error}return g}),ss=_.memo(function(){const t=Rn(),n=_.useContext(Og),o=wr({select:m=>{var p;return(p=m.matches.find(g=>g.id===n))==null?void 0:p.routeId}}),r=t.routesById[o],i=wr({select:m=>{const g=m.matches.find(v=>v.id===n);return ts(g),g.globalNotFound}}),l=wr({select:m=>{var p;const g=m.matches,v=g.findIndex(x=>x.id===n);return(p=g[v+1])==null?void 0:p.id}}),u=t.options.defaultPendingComponent?c.jsx(t.options.defaultPendingComponent,{}):null;if(i)return vI(t,r,void 0);if(!l)return null;const f=c.jsx(yI,{matchId:l});return n===wo?c.jsx(_.Suspense,{fallback:u,children:f}):f});function I9(){const e=Rn(),t=e.options.defaultPendingComponent?c.jsx(e.options.defaultPendingComponent,{}):null,n=e.isServer||typeof document<"u"&&e.ssr?hc:_.Suspense,o=c.jsxs(n,{fallback:t,children:[!e.isServer&&c.jsx(j9,{}),c.jsx($9,{})]});return e.options.InnerWrap?c.jsx(e.options.InnerWrap,{children:o}):o}function $9(){const e=Rn(),t=wr({select:r=>{var i;return(i=r.matches[0])==null?void 0:i.id}}),n=wr({select:r=>r.loadedAt}),o=t?c.jsx(yI,{matchId:t}):null;return c.jsx(Og.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:c.jsx(fS,{getResetKey:()=>n,errorComponent:kg,onCatch:r=>{r.message||r.toString()},children:o})})}const M9=e=>new P9(e);class P9 extends K8{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=bT,globalThis.createLazyFileRoute=wT):typeof window<"u"&&(window.createFileRoute=bT,window.createLazyFileRoute=wT);function D9({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=pI(),r=c.jsx(o.Provider,{value:e,children:t});return e.options.Wrap?c.jsx(e.options.Wrap,{children:r}):r}function z9({router:e,...t}){return c.jsx(D9,{router:e,...t,children:c.jsx(I9,{})})}function U9(e){return Go({...e,select:t=>e.select?e.select(t.context):t.context})}function L9(e){return wr({select:t=>t.location})}function F9(){const[e,t]=_.useState(Gn.getAllConnections());return _.useEffect(()=>Gn.listenToAllEntities((n,o)=>{t({...e,[o]:n})}),[e]),e}function sl(){const e=Gn.calculateIdFromEntity(Sn),[t,n]=_.useState(Gn.getConnectionById(Sn));return _.useEffect(()=>Gn.listenToEntity(e,n),[e]),t}function Nf(){return sl()}function na(e){e=Sn;const{clusterId:t,instanceId:n}=Ze({strict:!1}),[o,r]=_.useState(Gn.getConnectionById(e??n??t));return _.useEffect(()=>Gn.listenToEntity(e,r),[e]),o}function V9(e){return e!==null&&!!e.username}function cu(e){if(e&&!V9(e)){const t=Object.keys(e.roles);if(t.length===1)return`/${t[0]}`}return"/"}/**
68
+ * @license lucide-react v0.544.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const B9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),CT=e=>{const t=H9(e);return t.charAt(0).toUpperCase()+t.slice(1)},bI=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),G9=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
73
+ * @license lucide-react v0.544.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */var q9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
78
+ * @license lucide-react v0.544.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const K9=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:l,...u},f)=>_.createElement("svg",{ref:f,...q9,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:bI("lucide",r),...!i&&!G9(u)&&{"aria-hidden":"true"},...u},[...l.map(([m,p])=>_.createElement(m,p)),...Array.isArray(i)?i:[i]]));/**
83
+ * @license lucide-react v0.544.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const dt=(e,t)=>{const n=_.forwardRef(({className:o,...r},i)=>_.createElement(K9,{ref:i,iconNode:t,className:bI(`lucide-${B9(CT(e))}`,`lucide-${e}`,o),...r}));return n.displayName=CT(e),n};/**
88
+ * @license lucide-react v0.544.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Z9=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],xI=dt("arrow-down",Z9);/**
93
+ * @license lucide-react v0.544.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Y9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Za=dt("arrow-left",Y9);/**
98
+ * @license lucide-react v0.544.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const X9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Yr=dt("arrow-right",X9);/**
103
+ * @license lucide-react v0.544.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const W9=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Q9=dt("arrow-up-down",W9);/**
108
+ * @license lucide-react v0.544.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const J9=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],eG=dt("arrow-up",J9);/**
113
+ * @license lucide-react v0.544.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const tG=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_I=dt("ban",tG);/**
118
+ * @license lucide-react v0.544.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const nG=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]],pS=dt("book-open-text",nG);/**
123
+ * @license lucide-react v0.544.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const rG=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],wI=dt("chart-pie",rG);/**
128
+ * @license lucide-react v0.544.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const oG=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iG=dt("check",oG);/**
133
+ * @license lucide-react v0.544.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const sG=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],SI=dt("chevron-down",sG);/**
138
+ * @license lucide-react v0.544.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const aG=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lG=dt("chevron-up",aG);/**
143
+ * @license lucide-react v0.544.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const cG=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],CI=dt("credit-card",cG);/**
148
+ * @license lucide-react v0.544.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const uG=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],dG=dt("database",uG);/**
153
+ * @license lucide-react v0.544.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const fG=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],EI=dt("ellipsis",fG);/**
158
+ * @license lucide-react v0.544.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const mG=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],hG=dt("folder-plus",mG);/**
163
+ * @license lucide-react v0.544.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const pG=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],gG=dt("gauge",pG);/**
168
+ * @license lucide-react v0.544.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const vG=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],RI=dt("handshake",vG);/**
173
+ * @license lucide-react v0.544.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const yG=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],bG=dt("house",yG);/**
178
+ * @license lucide-react v0.544.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const xG=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]],jI=dt("import",xG);/**
183
+ * @license lucide-react v0.544.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const _G=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],wG=dt("loader",_G);/**
188
+ * @license lucide-react v0.544.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const SG=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],CG=dt("log-in",SG);/**
193
+ * @license lucide-react v0.544.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const EG=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],NI=dt("log-out",EG);/**
198
+ * @license lucide-react v0.544.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const RG=[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]],jG=dt("mail-warning",RG);/**
203
+ * @license lucide-react v0.544.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const NG=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],TI=dt("menu",NG);/**
208
+ * @license lucide-react v0.544.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const TG=[["path",{d:"M5 12h14",key:"1ays0h"}]],kG=dt("minus",TG);/**
213
+ * @license lucide-react v0.544.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const OG=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]],AG=dt("notepad-text",OG);/**
218
+ * @license lucide-react v0.544.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const IG=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],$G=dt("package",IG);/**
223
+ * @license lucide-react v0.544.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const MG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lr=dt("plus",MG);/**
228
+ * @license lucide-react v0.544.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const PG=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M13 16H8",key:"wsln4y"}]],kI=dt("receipt-text",PG);/**
233
+ * @license lucide-react v0.544.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const DG=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],zG=dt("receipt",DG);/**
238
+ * @license lucide-react v0.544.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const UG=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Gs=dt("refresh-cw",UG);/**
243
+ * @license lucide-react v0.544.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const LG=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],FG=dt("rotate-ccw",LG);/**
248
+ * @license lucide-react v0.544.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const VG=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],as=dt("save",VG);/**
253
+ * @license lucide-react v0.544.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const BG=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],HG=dt("settings",BG);/**
258
+ * @license lucide-react v0.544.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const GG=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],qG=dt("table",GG);/**
263
+ * @license lucide-react v0.544.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const KG=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ls=dt("trash",KG);/**
268
+ * @license lucide-react v0.544.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const ZG=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],YG=dt("triangle-alert",ZG);/**
273
+ * @license lucide-react v0.544.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const XG=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],OI=dt("users",XG);/**
278
+ * @license lucide-react v0.544.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const WG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],AI=dt("x",WG);function gS({className:e,error:t,title:n,showReturnToHome:o}){const{user:r,isLoading:i}=sl();return cu(r),c.jsxs(_f,{className:Me("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[c.jsxs(_g,{children:[c.jsx(wg,{className:"text-2xl",children:c.jsx("h2",{children:n??"Component Error"})}),c.jsx(Qw,{children:t.message})]}),o!==!1&&c.jsx(wf,{children:r&&!i?c.jsx(Ue,{to:ta,children:c.jsxs(_e,{children:[" ",c.jsx(Za,{})," Return to Home"]})}):c.jsx(Ue,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(Za,{})," Go to Sign In Page"]})})})]})}function QG(){const{user:e,isLoading:t}=sl();return cu(e),c.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:c.jsxs(_f,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[c.jsx(_g,{children:c.jsx(wg,{className:"text-2xl",children:c.jsx("h2",{children:"Sorry, Page Not Found"})})}),c.jsx(wf,{children:e&&!t?c.jsx(Ue,{to:ta,children:c.jsxs(_e,{children:[" ",c.jsx(Za,{})," Return to Home"]})}):c.jsx(Ue,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(Za,{})," Go Sign In Page"]})})})]})})}function JG(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function eq(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const tq=e=>{switch(e){case"success":return oq;case"info":return sq;case"warning":return iq;case"error":return aq;default:return null}},nq=Array(12).fill(0),rq=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},nq.map((n,o)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),oq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),iq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.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"})),sq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),aq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),lq=q.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"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cq=()=>{const[e,t]=q.useState(document.hidden);return q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let J_=1;class uq{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:J_++,l=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:o}),{...f,...t,id:i,dismissible:u,title:o}):f):this.addToast({title:o,...r,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=o!==void 0,l;const u=r.then(async m=>{if(l=["resolve",m],q.isValidElement(m))i=!1,this.create({id:o,type:"default",message:m});else if(fq(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,b=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...b})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,v=typeof n.description=="function"?await n.description(m):n.description,b=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...b})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,v=typeof n.description=="function"?await n.description(m):n.description,b=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:v,...b})}}).catch(async m=>{if(l=["reject",m],n.error!==void 0){i=!1;const p=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,x=typeof p=="object"&&!q.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:g,...x})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,p)=>u.then(()=>l[0]==="reject"?p(l[1]):m(l[1])).catch(p));return typeof o!="string"&&typeof o!="number"?{unwrap:f}:Object.assign(o,{unwrap:f})},this.custom=(t,n)=>{const o=n?.id||J_++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tr=new uq,dq=(e,t)=>{const n=t?.id||J_++;return Tr.addToast({title:e,...t,id:n}),n},fq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mq=dq,hq=()=>Tr.toasts,pq=()=>Tr.getActiveToasts(),Ee=Object.assign(mq,{success:Tr.success,info:Tr.info,warning:Tr.warning,error:Tr.error,custom:Tr.custom,message:Tr.message,promise:Tr.promise,dismiss:Tr.dismiss,loading:Tr.loading},{getHistory:hq,getToasts:pq});eq("[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 kh(e){return e.label!==void 0}const gq=3,vq="24px",yq="16px",ET=4e3,bq=356,xq=14,_q=45,wq=200;function di(...e){return e.filter(Boolean).join(" ")}function Sq(e){const[t,n]=e.split("-"),o=[];return t&&o.push(t),n&&o.push(n),o}const Cq=e=>{var t,n,o,r,i,l,u,f,m;const{invert:p,toast:g,unstyled:v,interacting:x,setHeights:b,visibleToasts:S,heights:C,index:E,toasts:j,expanded:N,removeToast:T,defaultRichColors:k,closeButton:A,style:I,cancelButtonStyle:P,actionButtonStyle:L,className:V="",descriptionClassName:ie="",duration:se,position:ue,gap:le,expandByDefault:ce,classNames:M,icons:K,closeButtonAriaLabel:U="Close toast"}=e,[re,$]=q.useState(null),[H,W]=q.useState(null),[B,J]=q.useState(!1),[ge,ye]=q.useState(!1),[ae,fe]=q.useState(!1),[ze,Ve]=q.useState(!1),[Ye,He]=q.useState(!1),[Gt,Yt]=q.useState(0),[Zn,fr]=q.useState(0),Mt=q.useRef(g.duration||se||ET),nn=q.useRef(null),Pt=q.useRef(null),z=E===0,X=E+1<=S,oe=g.type,ve=g.dismissible!==!1,xe=g.className||"",be=g.descriptionClassName||"",Re=q.useMemo(()=>C.findIndex(Qe=>Qe.toastId===g.id)||0,[C,g.id]),We=q.useMemo(()=>{var Qe;return(Qe=g.closeButton)!=null?Qe:A},[g.closeButton,A]),ft=q.useMemo(()=>g.duration||se||ET,[g.duration,se]),Rt=q.useRef(0),Pr=q.useRef(0),Dr=q.useRef(0),ti=q.useRef(null),[ni,ri]=ue.split("-"),lo=q.useMemo(()=>C.reduce((Qe,rn,bn)=>bn>=Re?Qe:Qe+rn.height,0),[C,Re]),oi=cq(),Ti=g.invert||p,cs=oe==="loading";Pr.current=q.useMemo(()=>Re*le+lo,[Re,lo]),q.useEffect(()=>{Mt.current=ft},[ft]),q.useEffect(()=>{J(!0)},[]),q.useEffect(()=>{const Qe=Pt.current;if(Qe){const rn=Qe.getBoundingClientRect().height;return fr(rn),b(bn=>[{toastId:g.id,height:rn,position:g.position},...bn]),()=>b(bn=>bn.filter(Yn=>Yn.toastId!==g.id))}},[b,g.id]),q.useLayoutEffect(()=>{if(!B)return;const Qe=Pt.current,rn=Qe.style.height;Qe.style.height="auto";const bn=Qe.getBoundingClientRect().height;Qe.style.height=rn,fr(bn),b(Yn=>Yn.find(Tn=>Tn.toastId===g.id)?Yn.map(Tn=>Tn.toastId===g.id?{...Tn,height:bn}:Tn):[{toastId:g.id,height:bn,position:g.position},...Yn])},[B,g.title,g.description,b,g.id,g.jsx,g.action,g.cancel]);const Mo=q.useCallback(()=>{ye(!0),Yt(Pr.current),b(Qe=>Qe.filter(rn=>rn.toastId!==g.id)),setTimeout(()=>{T(g)},wq)},[g,T,b,Pr]);q.useEffect(()=>{if(g.promise&&oe==="loading"||g.duration===1/0||g.type==="loading")return;let Qe;return N||x||oi?(()=>{if(Dr.current<Rt.current){const Yn=new Date().getTime()-Rt.current;Mt.current=Mt.current-Yn}Dr.current=new Date().getTime()})():(()=>{Mt.current!==1/0&&(Rt.current=new Date().getTime(),Qe=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Mo()},Mt.current))})(),()=>clearTimeout(Qe)},[N,x,g,oe,oi,Mo]),q.useEffect(()=>{g.delete&&(Mo(),g.onDismiss==null||g.onDismiss.call(g,g))},[Mo,g.delete]);function um(){var Qe;if(K?.loading){var rn;return q.createElement("div",{className:di(M?.loader,g==null||(rn=g.classNames)==null?void 0:rn.loader,"sonner-loader"),"data-visible":oe==="loading"},K.loading)}return q.createElement(rq,{className:di(M?.loader,g==null||(Qe=g.classNames)==null?void 0:Qe.loader),visible:oe==="loading"})}const Eu=g.icon||K?.[oe]||tq(oe);var us,dm;return q.createElement("li",{tabIndex:0,ref:Pt,className:di(V,xe,M?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,M?.default,M?.[oe],g==null||(n=g.classNames)==null?void 0:n[oe]),"data-sonner-toast":"","data-rich-colors":(us=g.richColors)!=null?us:k,"data-styled":!(g.jsx||g.unstyled||v),"data-mounted":B,"data-promise":!!g.promise,"data-swiped":Ye,"data-removed":ge,"data-visible":X,"data-y-position":ni,"data-x-position":ri,"data-index":E,"data-front":z,"data-swiping":ae,"data-dismissible":ve,"data-type":oe,"data-invert":Ti,"data-swipe-out":ze,"data-swipe-direction":H,"data-expanded":!!(N||ce&&B),"data-testid":g.testId,style:{"--index":E,"--toasts-before":E,"--z-index":j.length-E,"--offset":`${ge?Gt:Pr.current}px`,"--initial-height":ce?"auto":`${Zn}px`,...I,...g.style},onDragEnd:()=>{fe(!1),$(null),ti.current=null},onPointerDown:Qe=>{Qe.button!==2&&(cs||!ve||(nn.current=new Date,Yt(Pr.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(fe(!0),ti.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,rn,bn;if(ze||!ve)return;ti.current=null;const Yn=Number(((Qe=Pt.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ca=Number(((rn=Pt.current)==null?void 0:rn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tn=new Date().getTime()-((bn=nn.current)==null?void 0:bn.getTime()),on=re==="x"?Yn:ca,sn=Math.abs(on)/Tn;if(Math.abs(on)>=_q||sn>.11){Yt(Pr.current),g.onDismiss==null||g.onDismiss.call(g,g),W(re==="x"?Yn>0?"right":"left":ca>0?"down":"up"),Mo(),Ve(!0);return}else{var Dt,zn;(Dt=Pt.current)==null||Dt.style.setProperty("--swipe-amount-x","0px"),(zn=Pt.current)==null||zn.style.setProperty("--swipe-amount-y","0px")}He(!1),fe(!1),$(null)},onPointerMove:Qe=>{var rn,bn,Yn;if(!ti.current||!ve||((rn=window.getSelection())==null?void 0:rn.toString().length)>0)return;const Tn=Qe.clientY-ti.current.y,on=Qe.clientX-ti.current.x;var sn;const Dt=(sn=e.swipeDirections)!=null?sn:Sq(ue);!re&&(Math.abs(on)>1||Math.abs(Tn)>1)&&$(Math.abs(on)>Math.abs(Tn)?"x":"y");let zn={x:0,y:0};const bl=ki=>1/(1.5+Math.abs(ki)/20);if(re==="y"){if(Dt.includes("top")||Dt.includes("bottom"))if(Dt.includes("top")&&Tn<0||Dt.includes("bottom")&&Tn>0)zn.y=Tn;else{const ki=Tn*bl(Tn);zn.y=Math.abs(ki)<Math.abs(Tn)?ki:Tn}}else if(re==="x"&&(Dt.includes("left")||Dt.includes("right")))if(Dt.includes("left")&&on<0||Dt.includes("right")&&on>0)zn.x=on;else{const ki=on*bl(on);zn.x=Math.abs(ki)<Math.abs(on)?ki:on}(Math.abs(zn.x)>0||Math.abs(zn.y)>0)&&He(!0),(bn=Pt.current)==null||bn.style.setProperty("--swipe-amount-x",`${zn.x}px`),(Yn=Pt.current)==null||Yn.style.setProperty("--swipe-amount-y",`${zn.y}px`)}},We&&!g.jsx&&oe!=="loading"?q.createElement("button",{"aria-label":U,"data-disabled":cs,"data-close-button":!0,onClick:cs||!ve?()=>{}:()=>{Mo(),g.onDismiss==null||g.onDismiss.call(g,g)},className:di(M?.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(dm=K?.close)!=null?dm:lq):null,(oe||g.icon||g.promise)&&g.icon!==null&&(K?.[oe]!==null||g.icon)?q.createElement("div",{"data-icon":"",className:di(M?.icon,g==null||(r=g.classNames)==null?void 0:r.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||um():null,g.type!=="loading"?Eu:null):null,q.createElement("div",{"data-content":"",className:di(M?.content,g==null||(i=g.classNames)==null?void 0:i.content)},q.createElement("div",{"data-title":"",className:di(M?.title,g==null||(l=g.classNames)==null?void 0:l.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:di(ie,be,M?.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),q.isValidElement(g.cancel)?g.cancel:g.cancel&&kh(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||P,onClick:Qe=>{kh(g.cancel)&&ve&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Qe),Mo())},className:di(M?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,q.isValidElement(g.action)?g.action:g.action&&kh(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||L,onClick:Qe=>{kh(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Qe),!Qe.defaultPrevented&&Mo())},className:di(M?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function RT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Eq(e,t){const n={};return[e,t].forEach((o,r)=>{const i=r===1,l=i?"--mobile-offset":"--offset",u=i?yq:vq;function f(m){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?f(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?n[`${l}-${m}`]=u:n[`${l}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):f(u)}),n}const Rq=q.forwardRef(function(t,n){const{id:o,invert:r,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:p,mobileOffset:g,theme:v="light",richColors:x,duration:b,style:S,visibleToasts:C=gq,toastOptions:E,dir:j=RT(),gap:N=xq,icons:T,containerAriaLabel:k="Notifications"}=t,[A,I]=q.useState([]),P=q.useMemo(()=>o?A.filter(B=>B.toasterId===o):A.filter(B=>!B.toasterId),[A,o]),L=q.useMemo(()=>Array.from(new Set([i].concat(P.filter(B=>B.position).map(B=>B.position)))),[P,i]),[V,ie]=q.useState([]),[se,ue]=q.useState(!1),[le,ce]=q.useState(!1),[M,K]=q.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=q.useRef(null),re=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=q.useRef(null),H=q.useRef(!1),W=q.useCallback(B=>{I(J=>{var ge;return(ge=J.find(ye=>ye.id===B.id))!=null&&ge.delete||Tr.dismiss(B.id),J.filter(({id:ye})=>ye!==B.id)})},[]);return q.useEffect(()=>Tr.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{I(J=>J.map(ge=>ge.id===B.id?{...ge,delete:!0}:ge))});return}setTimeout(()=>{hS.flushSync(()=>{I(J=>{const ge=J.findIndex(ye=>ye.id===B.id);return ge!==-1?[...J.slice(0,ge),{...J[ge],...B},...J.slice(ge+1)]:[B,...J]})})})}),[A]),q.useEffect(()=>{if(v!=="system"){K(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:J})=>{K(J?"dark":"light")})}catch{B.addListener(({matches:ge})=>{try{K(ge?"dark":"light")}catch(ye){console.error(ye)}})}},[v]),q.useEffect(()=>{A.length<=1&&ue(!1)},[A]),q.useEffect(()=>{const B=J=>{var ge;if(l.every(fe=>J[fe]||J.code===fe)){var ae;ue(!0),(ae=U.current)==null||ae.focus()}J.code==="Escape"&&(document.activeElement===U.current||(ge=U.current)!=null&&ge.contains(document.activeElement))&&ue(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[l]),q.useEffect(()=>{if(U.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,H.current=!1)}},[U.current]),q.createElement("section",{ref:n,"aria-label":`${k} ${re}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((B,J)=>{var ge;const[ye,ae]=B.split("-");return P.length?q.createElement("ol",{key:B,dir:j==="auto"?RT():j,tabIndex:-1,ref:U,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ye,"data-x-position":ae,style:{"--front-toast-height":`${((ge=V[0])==null?void 0:ge.height)||0}px`,"--width":`${bq}px`,"--gap":`${N}px`,...S,...Eq(p,g)},onBlur:fe=>{H.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(H.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||H.current||(H.current=!0,$.current=fe.relatedTarget)},onMouseEnter:()=>ue(!0),onMouseMove:()=>ue(!0),onMouseLeave:()=>{le||ue(!1)},onDragEnd:()=>ue(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},P.filter(fe=>!fe.position&&J===0||fe.position===B).map((fe,ze)=>{var Ve,Ye;return q.createElement(Cq,{key:fe.id,icons:T,index:ze,toast:fe,defaultRichColors:x,duration:(Ve=E?.duration)!=null?Ve:b,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:r,visibleToasts:C,closeButton:(Ye=E?.closeButton)!=null?Ye:f,interacting:le,position:B,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:W,toasts:P.filter(He=>He.position==fe.position),heights:V.filter(He=>He.position==fe.position),setHeights:ie,expandByDefault:u,gap:N,expanded:se,swipeDirections:t.swipeDirections})})):null}))});function jT(e){let t="Error",n="We had some trouble!";console.error(e);const o=e,r=e;if(typeof e=="string"?n=e:o?.response?.data?typeof o.response.data=="string"?n=o.response.data:o.response.data.error?n=o.response.data.error:o.response.data.message&&(n=o.response.data.message):r?.message&&(n=r.message),n.includes(":")){const i=n.split(":");t=i.shift(),n=i.join(":")}Ee.error(t,{description:n,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}const nf=new MH({queryCache:new QA({onError:jT}),mutationCache:new WA({onError:jT})});function Ig(e){return!!e}const $g={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Yi=console,pc={};Object.keys($g).forEach(e=>{pc[e]=Yi[e]});const Rd="Datadog Browser SDK:",ht={debug:pc.debug.bind(Yi,Rd),log:pc.log.bind(Yi,Rd),info:pc.info.bind(Yi,Rd),warn:pc.warn.bind(Yi,Rd),error:pc.error.bind(Yi,Rd)},Mg="https://docs.datadoghq.com",jq=`${Mg}/real_user_monitoring/browser/troubleshooting`,vS="More details:";function II(e,t){return(...n)=>{try{return e(...n)}catch(o){ht.error(t,o)}}}function es(e){return e!==0&&Math.random()*100<=e}function Kd(e,t){return+e.toFixed(t)}function Nq(e){return Tf(e)&&e>=0&&e<=100}function Tf(e){return typeof e=="number"}const cr=1e3,Ir=60*cr,$I=60*Ir,Tq=24*$I,MI=365*Tq;function Pg(e){return{relative:e,timeStamp:Oq(e)}}function kq(e){return{relative:yS(e),timeStamp:e}}function Oq(e){const t=ko()-performance.now();return t>kf()?Math.round(uu(t,e)):Iq(e)}function Aq(){return Math.round(ko()-uu(kf(),performance.now()))}function ot(e){return Tf(e)?Kd(e*1e6,0):e}function ko(){return new Date().getTime()}function Hn(){return ko()}function ro(){return performance.now()}function qn(){return{relative:ro(),timeStamp:Hn()}}function PI(){return{relative:0,timeStamp:kf()}}function Jt(e,t){return t-e}function uu(e,t){return e+t}function yS(e){return e-kf()}function Iq(e){return Math.round(uu(kf(),e))}function $q(e){return e<MI}let wx;function kf(){return wx===void 0&&(wx=performance.timing.navigationStart),wx}const rf=1024,DI=1024*rf,Mq=/[^\u0000-\u007F]/;function zI(e){return Mq.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Pq(e){const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);let o=0;for(const r of e)n.set(r,o),o+=r.length;return n}function of(e){return{...e}}function $p(e,t){return Object.keys(e).some(n=>e[n]===t)}function al(e){return Object.keys(e).length===0}function UI(e,t){const n={};for(const o of Object.keys(e))n[o]=t(e[o]);return n}function Wo(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function qs(e,t){const n=Wo();let o;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(o=e[n.Zone.__symbol__(t)]),o||(o=e[t]),o}let ew,LI=!1;function Dq(e){ew=e}function zq(e){LI=e}function tt(e){return function(){return Ya(e,this,arguments)}}function Ya(e,t,n){try{return e.apply(t,n)}catch(o){Fc(o)}}function Fc(e){if(tw(e),ew)try{ew(e)}catch(t){tw(t)}}function tw(...e){LI&&ht.error("[MONITOR]",...e)}function ar(e,t){return qs(Wo(),"setTimeout")(tt(e),t)}function Co(e){qs(Wo(),"clearTimeout")(e)}function du(e,t){return qs(Wo(),"setInterval")(tt(e),t)}function Dg(e){qs(Wo(),"clearInterval")(e)}function NT(e){const t=window.queueMicrotask;typeof t=="function"?t(tt(e)):Promise.resolve().then(tt(e))}class xt{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(n=>n(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function FI(...e){return new xt(t=>{const n=e.map(o=>o.subscribe(r=>t.notify(r)));return()=>n.forEach(o=>o.unsubscribe())})}class VI extends xt{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let n=!1;const o={unsubscribe:()=>{n=!0,this.removeObserver(t)}};return NT(()=>{for(const r of this.buffer){if(n)return;t(r)}n||this.addObserver(t)}),o}unbuffer(){NT(()=>{this.maxBufferSize=this.buffer.length=0})}}function zg(e,t,n){const o=n&&n.leading!==void 0?n.leading:!0,r=n&&n.trailing!==void 0?n.trailing:!0;let i=!1,l,u;return{throttled:(...f)=>{if(i){l=f;return}o?e(...f):l=f,i=!0,u=ar(()=>{r&&l&&e(...l),i=!1,l=void 0},t)},cancel:()=>{Co(u),i=!1,l=void 0}}}function Tt(){}function ur(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ur)}const Mp=/([\w-]+)\s*=\s*([^;]+)/g;function sf(e,t){for(Mp.lastIndex=0;;){const n=Mp.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Uq(e){const t=new Map;for(Mp.lastIndex=0;;){const n=Mp.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function BI(e,t,n=""){const o=e.charCodeAt(t-1),i=o>=55296&&o<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function Lq(){return HI()===0}function gbe(){return HI()===1}let Oh;function HI(){return Oh??(Oh=Fq())}function Fq(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Ug(e,t,n=0,o){const r=new Date;r.setTime(r.getTime()+n);const i=`expires=${r.toUTCString()}`,l=o&&o.crossSite?"none":"strict",u=o&&o.domain?`;domain=${o.domain}`:"",f=o&&o.secure?";secure":"",m=o&&o.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${l}${u}${f}${m}`}function Lg(e){return sf(document.cookie,e)}let Sx;function Ds(e){return Sx||(Sx=Uq(document.cookie)),Sx.get(e)}function GI(e,t){Ug(e,"",0,t)}function Vq(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ur()}`,n="test";Ug(t,n,Ir,e);const o=Lg(t)===n;return GI(t,e),o}catch(t){return ht.error(t),!1}}let Cx;function qI(){if(Cx===void 0){const e=`dd_site_test_${ur()}`,t="test",n=window.location.hostname.split(".");let o=n.pop();for(;n.length&&!Lg(e);)o=`${n.pop()}.${o}`,Ug(e,t,cr,{domain:o});GI(e,{domain:o}),Cx=o}return Cx}const Of="_dd_s";function Bq(e,t){for(let n=e.length-1;n>=0;n-=1){const o=e[n];if(t(o,n,e))return o}}function KI(e){return Object.values(e)}function bS(e){return Object.entries(e)}const ll=4*$I,ZI=15*Ir,Hq=MI,YI="0",af={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},XI=/^([a-zA-Z]+)=([a-z0-9-]+)$/,xS="&";function Gq(e){return!!e&&(e.indexOf(xS)!==-1||XI.test(e))}const qq="1";function Ta(e,t){const n={isExpired:qq};return t.trackAnonymousUser&&(e?.anonymousId?n.anonymousId=e?.anonymousId:n.anonymousId=ur()),n}function cp(e){return al(e)}function WI(e){return!cp(e)}function Zd(e){return e.isExpired!==void 0||!Kq(e)}function Kq(e){return(e.created===void 0||ko()-Number(e.created)<ll)&&(e.expire===void 0||ko()<Number(e.expire))}function QI(e){e.expire=String(ko()+ZI)}function JI(e){return bS(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(xS)}function e$(e){const t={};return Gq(e)&&e.split(xS).forEach(n=>{const o=XI.exec(n);if(o!==null){const[,r,i]=o;r==="aid"?t.anonymousId=i:t[r]=i}}),t}const Zq="_dd",Yq="_dd_r",Xq="_dd_l",Wq="rum",Qq="logs";function Jq(e){if(!Ds(Of)){const n=Ds(Zq),o=Ds(Yq),r=Ds(Xq),i={};n&&(i.id=n),r&&/^[01]$/.test(r)&&(i[Qq]=r),o&&/^[012]$/.test(o)&&(i[Wq]=o),WI(i)&&(QI(i),e.persistSession(i))}}function TT(e){const t=t7(e);return Vq(t)?{type:af.COOKIE,cookieOptions:t}:void 0}function e7(e,t){const n={isLockEnabled:Lq(),persistSession:o=>kT(t,e,o,ZI),retrieveSession:t$,expireSession:o=>kT(t,e,Ta(o,e),ll)};return Jq(n),n}function kT(e,t,n,o){Ug(Of,JI(n),t.trackAnonymousUser?Hq:o,e)}function t$(){const e=Lg(Of);return e$(e)}function t7(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=qI()),t}const n7="_dd_test_";function OT(){try{const e=ur(),t=`${n7}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:af.LOCAL_STORAGE}:void 0}catch{return}}function r7(e){return{isLockEnabled:!1,persistSession:n$,retrieveSession:o7,expireSession:t=>i7(t,e)}}function n$(e){localStorage.setItem(Of,JI(e))}function o7(){const e=localStorage.getItem(Of);return e$(e)}function i7(e,t){n$(Ta(e,t))}function fu(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const o=gc(Object.prototype),r=gc(Array.prototype),i=gc(Object.getPrototypeOf(e)),l=gc(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{o(),r(),i(),l()}}function gc(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):Tt}const s7=220*rf,a7="$",l7=3;function dn(e,t=s7){const n=gc(Object.prototype),o=gc(Array.prototype),r=[],i=new WeakMap,l=Ex(e,a7,void 0,r,i),u=JSON.stringify(l);let f=u?u.length:0;if(f>t){Rx(t,"discarded",e);return}for(;r.length>0&&f<t;){const m=r.shift();let p=0;if(Array.isArray(m.source))for(let g=0;g<m.source.length;g++){const v=Ex(m.source[g],m.path,g,r,i);if(v!==void 0?f+=JSON.stringify(v).length:f+=4,f+=p,p=1,f>t){Rx(t,"truncated",e);break}m.target[g]=v}else for(const g in m.source)if(Object.prototype.hasOwnProperty.call(m.source,g)){const v=Ex(m.source[g],m.path,g,r,i);if(v!==void 0&&(f+=JSON.stringify(v).length+p+g.length+l7,p=1),f>t){Rx(t,"truncated",e);break}m.target[g]=v}}return n(),o(),l}function Ex(e,t,n,o,r){const i=d7(e);if(!i||typeof i!="object")return c7(i);const l=nw(i);if(l!=="[Object]"&&l!=="[Array]"&&l!=="[Error]")return l;const u=e;if(r.has(u))return`[Reference seen at ${r.get(u)}]`;const f=n!==void 0?`${t}.${n}`:t,m=Array.isArray(i)?[]:{};return r.set(u,f),o.push({source:i,target:m,path:f}),m}function c7(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function nw(e){try{if(e instanceof Event)return u7(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function u7(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?nw(e.currentTarget):null,target:e.target?nw(e.target):null}}function d7(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function Rx(e,t,n){ht.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const Vc="?";function Af(e){var t,n;const o=[];let r=jx(e,"stack");const i=String(e);if(r&&r.startsWith(i)&&(r=r.slice(i.length)),r&&r.split(`
283
+ `).forEach(l=>{const u=h7(l)||g7(l)||y7(l)||_7(l);u&&(!u.func&&u.line&&(u.func=Vc),o.push(u))}),o.length>0&&E7()&&e instanceof Error){const l=[];let u=e;for(;(u=Object.getPrototypeOf(u))&&o$(u);){const f=((t=u.constructor)===null||t===void 0?void 0:t.name)||Vc;l.push(f)}for(let f=l.length-1;f>=0&&((n=o[0])===null||n===void 0?void 0:n.func)===l[f];f--)o.shift()}return{message:jx(e,"message"),name:jx(e,"name"),stack:o}}const r$="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Bc="(?::(\\d+))",f7=new RegExp(`^\\s*at (.*?) ?\\(${r$}${Bc}?${Bc}?\\)?\\s*$`,"i"),m7=new RegExp(`\\((\\S*)${Bc}${Bc}\\)`);function h7(e){const t=f7.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,o=t[2]&&t[2].indexOf("eval")===0,r=m7.exec(t[2]);return o&&r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Vc,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const p7=new RegExp(`^\\s*at ?${r$}${Bc}?${Bc}??\\s*$`,"i");function g7(e){const t=p7.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:Vc,line:t[2]?+t[2]:void 0,url:t[1]}}const v7=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function y7(e){const t=v7.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Vc,line:+t[3],url:t[2]}}const b7=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,x7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function _7(e){const t=b7.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,o=x7.exec(t[3]);return n&&o&&(t[3]=o[1],t[4]=o[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Vc,line:t[4]?+t[4]:void 0,url:t[3]}}function jx(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function w7(e,t,n,o){if(t===void 0)return;const{name:r,message:i}=C7(e);return{name:r,message:i,stack:[{url:t,column:o,line:n}]}}const S7=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function C7(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=S7.exec(e)),{name:t,message:n}}function o$(e){return String(e.constructor).startsWith("class ")}let Ah;function E7(){if(Ah!==void 0)return Ah;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(o=>new o);return Ah=o$(Object.getPrototypeOf(t))&&n.stack!==t.stack,Ah}function lf(e){const n=new Error(e);n.name="HandlingStack";let o;return Ya(()=>{const r=Af(n);r.stack=r.stack.slice(2),o=If(r)}),o}function If(e){let t=i$(e);return e.stack.forEach(n=>{const o=n.func==="?"?"<anonymous>":n.func,r=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",i=n.line?`:${n.line}`:"",l=n.line&&n.column?`:${n.column}`:"";t+=`
284
+ at ${o}${r} @ ${n.url}${i}${l}`}),t}function i$(e){return`${e.name||"Error"}: ${e.message}`}const s$="No stack, consider using an instance of Error";function _S({stackTrace:e,originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:i,useFallbackStack:l=!0,source:u,handling:f}){const m=cl(t);return!e&&m&&(e=Af(t)),{startClocks:r,source:u,handling:f,handlingStack:n,componentStack:o,originalError:t,type:e?e.name:void 0,message:R7(e,m,i,t),stack:e?If(e):l?s$:void 0,causes:m?T7(t,u):void 0,fingerprint:j7(t),context:N7(t)}}function R7(e,t,n,o){return e?.message&&e?.name?e.message:t?"Empty message":`${n} ${fu(dn(o))}`}function j7(e){return cl(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function N7(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function cl(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function T7(e,t){let n=e;const o=[];for(;cl(n?.cause)&&o.length<10;){const r=Af(n.cause);o.push({message:n.cause.message,source:t,type:r?.name,stack:r&&If(r)}),n=n.cause}return o.length?o:void 0}var Xa;(function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.EARLY_REQUEST_COLLECTION="early_request_collection",e.WATCH_COOKIE_WITHOUT_LOCK="watch_cookie_without_lock",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name"})(Xa||(Xa={}));const wS=new Set;function k7(e){Array.isArray(e)&&O7(e.filter(t=>$p(Xa,t)))}function O7(e){e.forEach(t=>{wS.add(t)})}function Fg(e){return wS.has(e)}function A7(){return wS}const a$="datad0g.com",I7="dd0g-gov.com",$a="datadoghq.com",$7="datadoghq.eu",M7="ddog-gov.com",P7="pci.browser-intake-datadoghq.com",D7=["ddsource","dd-api-key","dd-request-id"];function l$(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function ul(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Pp(e,t,n=z7()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const r=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)r[i]=Pp(r[i],t[i],n);return r}const o=ul(e)==="object"?e:{};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=Pp(o[r],t[r],n));return o}function SS(e){return Pp(void 0,e)}function ns(...e){let t;for(const n of e)n!=null&&(t=Pp(t,n));return t}function z7(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const o=t.has(n);return o||t.add(n),o}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function c$(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function U7(e){return e>=500}function L7(e){try{return e.clone()}catch{return}}const mu={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},F7=80*rf,V7=32,u$=20*DI,B7=Ir,d$=cr;function f$(e,t,n,o,r,i){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?h$(e,t,n,i,{onSuccess:()=>p$(0,t,n,o,r,i),onFailure:()=>{t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),m$(t,n,o,r,i)}}):t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function m$(e,t,n,o,r){e.transportStatus===2&&ar(()=>{const i=e.queuedPayloads.first();h$(i,e,t,r,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=d$,p$(1,e,t,n,o,r)},onFailure:()=>{e.currentBackoffTime=Math.min(B7,e.currentBackoffTime*2),m$(e,t,n,o,r)}})},e.currentBackoffTime)}function h$(e,t,n,o,{onSuccess:r,onFailure:i}){t.bandwidthMonitor.add(e),n(e,l=>{t.bandwidthMonitor.remove(e),H7(l)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:l.status},o.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i()):(t.transportStatus=0,o.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),r())})}function p$(e,t,n,o,r,i){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(r({message:`Reached max ${o} events size queued for upload: ${u$/DI}MiB`,source:mu.AGENT,startClocks:qn()}),t.queueFullReported=!0);const l=t.queuedPayloads;for(t.queuedPayloads=g$();l.size()>0;)f$(l.dequeue(),t,n,o,r,i)}function H7(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||U7(e.status))}function G7(){return{transportStatus:0,currentBackoffTime:d$,bandwidthMonitor:q7(),queuedPayloads:g$(),queueFullReported:!1}}function g$(){const e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=u$}}}function q7(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=F7&&this.ongoingRequestCount<V7},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}function v$(e,t,n){const o=new xt,r=G7();return{observable:o,send:i=>{for(const l of e)f$(i,r,(u,f)=>Y7(l,t,u,f),l.trackType,n,o)},sendOnExit:i=>{for(const l of e)K7(l,t,i)}}}function K7(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const r=e.build("beacon",n);if(navigator.sendBeacon(r,n.data))return}catch(r){Z7(r)}rw(e,n)}let AT=!1;function Z7(e){AT||(AT=!0,Fc(e))}function Y7(e,t,n,o){if(X7()&&n.bytesCount<t){const i=e.build("fetch-keepalive",n);fetch(i,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(tt(l=>o?.({status:l.status,type:l.type}))).catch(tt(()=>rw(e,n,o)))}else rw(e,n,o)}function rw(e,t,n){const o=e.build("fetch",t);fetch(o,{method:"POST",body:t.data,mode:"cors"}).then(tt(r=>n?.({status:r.status,type:r.type}))).catch(tt(()=>n?.({status:0})))}function X7(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function $f(){const e=W7();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,o){const r=o?{id:o}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:r}))}}}function y$(e){const t=$f();return!!t&&t.getCapabilities().includes(e)}function Hc(e){var t;e===void 0&&(e=(t=Wo().location)===null||t===void 0?void 0:t.hostname);const n=$f();return!!n&&n.getAllowedWebViewHosts().some(o=>e===o||e.endsWith(`.${o}`))}function W7(){return Wo().DatadogEventBridge}function Qt(e,t,n,o,r){return Ks(e,t,[n],o,r)}function Ks(e,t,n,o,{once:r,capture:i,passive:l}={}){const u=tt(v=>{!v.isTrusted&&!v.__ddIsTrusted&&!e.allowUntrustedEvents||(r&&g(),o(v))}),f=l?{capture:i,passive:l}:i,m=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,p=qs(m,"addEventListener");n.forEach(v=>p.call(t,v,u,f));function g(){const v=qs(m,"removeEventListener");n.forEach(x=>v.call(t,x,u,f))}return{stop:g}}const Cc={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Q7(e){return new xt(t=>{const{stop:n}=Ks(e,window,["visibilitychange","freeze"],r=>{r.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:Cc.HIDDEN}):r.type==="freeze"&&t.notify({reason:Cc.FROZEN})},{capture:!0}),o=Qt(e,window,"beforeunload",()=>{t.notify({reason:Cc.UNLOADING})}).stop;return()=>{n(),o()}})}function J7(e){return KI(Cc).includes(e)}function b$({encoder:e,request:t,flushController:n,messageBytesLimit:o}){let r={};const i=n.flushObservable.subscribe(g=>p(g));function l(g,v,x){n.notifyBeforeAddMessage(v),x!==void 0?(r[x]=g,n.notifyAfterAddMessage()):e.write(e.isEmpty?g:`
285
+ ${g}`,b=>{n.notifyAfterAddMessage(b-v)})}function u(g){return g!==void 0&&r[g]!==void 0}function f(g){const v=r[g];delete r[g];const x=e.estimateEncodedBytesCount(v);n.notifyAfterRemoveMessage(x)}function m(g,v){const x=fu(g),b=e.estimateEncodedBytesCount(x);if(b>=o){ht.warn(`Discarded a message whose size was bigger than the maximum allowed size ${o}KB. ${vS} ${jq}/#technical-limitations`);return}u(v)&&f(v),l(x,b,v)}function p(g){const v=KI(r).join(`
286
+ `);r={};const x=J7(g.reason),b=x?t.sendOnExit:t.send;if(x&&e.isAsync){const S=e.finishSync();S.outputBytesCount&&b(IT(S));const C=[S.pendingData,v].filter(Boolean).join(`
287
+ `);C&&b({data:C,bytesCount:zI(C)})}else v&&e.write(e.isEmpty?v:`
288
+ ${v}`),e.finish(S=>{b(IT(S))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function IT(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function x$({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(b=>p(b.reason)),l=r.subscribe(()=>p("session_expire")),u=new xt(()=>()=>{i.unsubscribe(),l.unsubscribe()});let f=0,m=0;function p(b){if(m===0)return;const S=m,C=f;m=0,f=0,x(),u.notify({reason:b,messagesCount:S,bytesCount:C})}let g;function v(){g===void 0&&(g=ar(()=>{p("duration_limit")},n))}function x(){Co(g),g=void 0}return{flushObservable:u,get messagesCount(){return m},notifyBeforeAddMessage(b){f+b>=t&&p("bytes_limit"),m+=1,f+=b,v()},notifyAfterAddMessage(b=0){f+=b,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(b){f-=b,m-=1,m===0&&x()}}}const Zs="DISCARDED",oo="SKIPPED";function eK(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(o=>o!==n)}}},triggerHook(t,n){const o=e[t]||[],r=[];for(const i of o){const l=i(n);if(l===Zs)return Zs;l!==oo&&r.push(l)}return ns(...r)}}}const bi={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},tK=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],nK=[M7];let Nx;function hu(){return Nx||(Nx=new VI(100)),Nx}function rK(e,t,n,o,r,i){const l=new xt,{stop:u}=iK(t,o,r,i,l),{enabled:f}=oK(e,t,n,l);return{stop:u,enabled:f}}function oK(e,t,n,o){const r={},i=!nK.includes(t.site)&&es(t.telemetrySampleRate),l={[bi.LOG]:i,[bi.CONFIGURATION]:i&&es(t.telemetryConfigurationSampleRate),[bi.USAGE]:i&&es(t.telemetryUsageSampleRate)},u=sK(),f=hu();return f.subscribe(({rawEvent:p,kind:g})=>{if(!l[p.type])return;let v=r[g];if(v||(v=r[g]=new Set),v.size>=t.maxTelemetryEventsPerPage)return;const x=fu(p);if(v.has(x))return;const b=n.triggerHook(1,{startTime:qn().relative});if(b===Zs)return;const S=m(b,e,p,u);o.notify(S),l$("telemetry",S),v.add(x)}),f.unbuffer(),Dq(CS),{enabled:i};function m(p,g,v,x){const S={type:"telemetry",date:qn().timeStamp,service:g,version:"6.19.0",source:"browser",_dd:{format_version:2},telemetry:ns(v,{runtime_env:x,connectivity:c$(),sdk_setup:"npm"}),experimental_features:Array.from(A7())};return ns(S,p)}}function iK(e,t,n,o,r){const i=[];if(Hc()){const l=$f(),u=r.subscribe(f=>l.send("internal_telemetry",f));i.push(u.unsubscribe)}else{const l=[e.rumEndpointBuilder];e.replica&&aK(e)&&l.push(e.replica.rumEndpointBuilder);const u=b$({encoder:o(4),request:v$(l,e.batchBytesLimit,t),flushController:x$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new xt}),messageBytesLimit:e.messageBytesLimit});i.push(u.stop);const f=r.subscribe(u.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(l=>l())}}function sK(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function aK(e){return e.site===a$}function ra(e,t){tw($g.debug,e,t),hu().notify({rawEvent:{type:bi.LOG,message:e,status:"debug",...t},kind:"debug"})}function CS(e,t){hu().notify({rawEvent:{type:bi.LOG,status:"error",...cK(e),...t},kind:"error"})}function lK(e){hu().notify({rawEvent:{type:bi.CONFIGURATION,configuration:e},kind:bi.CONFIGURATION})}function ES(e,t){hu().notify({rawEvent:{type:bi.LOG,message:e,status:"debug",...t},kind:e})}function vr(e){hu().notify({rawEvent:{type:bi.USAGE,usage:e},kind:bi.USAGE})}function cK(e){if(cl(e)){const t=Af(e);return{error:{kind:t.name,stack:If(uK(t))},message:t.message}}return{error:{stack:s$},message:`Uncaught ${fu(e)}`}}function uK(e){return e.stack=e.stack.filter(t=>!t.url||tK.some(n=>t.url.startsWith(n))),e}const dK=10,fK=100,mK=cr,_$="--",w$=[];let up;function ka(e,t,n=0){var o;const{isLockEnabled:r,persistSession:i,expireSession:l}=t,u=v=>i({...v,lock:m}),f=()=>{const{lock:v,...x}=t.retrieveSession();return{session:x,lock:v&&!pK(v)?v:void 0}};if(up||(up=e),e!==up){w$.push(e);return}if(r&&n>=fK){ra("Aborted session operation after max lock retries",{currentStore:f()}),$T(t);return}let m,p=f();if(r){if(p.lock){Ih(e,t,n);return}if(m=hK(),u(p.session),p=f(),p.lock!==m){Ih(e,t,n);return}}let g=e.process(p.session);if(r&&(p=f(),p.lock!==m)){Ih(e,t,n);return}if(g&&(Zd(g)?l(g):(QI(g),r?u(g):i(g))),r&&!(g&&Zd(g))){if(p=f(),p.lock!==m){Ih(e,t,n);return}i(p.session),g=p.session}(o=e.after)===null||o===void 0||o.call(e,g||p.session),$T(t)}function Ih(e,t,n){ar(()=>{ka(e,t,n+1)},dK)}function $T(e){up=void 0;const t=w$.shift();t&&ka(t,e)}function hK(){return ur()+_$+Hn()}function pK(e){const[,t]=e.split(_$);return!t||Jt(Number(t),Hn())>mK}const MT=cr;function gK(e){switch(e.sessionPersistence){case af.COOKIE:return TT(e);case af.LOCAL_STORAGE:return OT();case void 0:{let t=TT(e);return!t&&e.allowFallbackToLocalStorage&&(t=OT()),t}default:ht.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function vK(e,t){return e.type===af.COOKIE?e7(t,e.cookieOptions):r7(t)}function yK(e,t,n,o,r=vK(e,t)){const i=new xt,l=new xt,u=new xt,f=du(x,MT);let m;S();const{throttled:p,cancel:g}=zg(()=>{ka({process:A=>{if(cp(A))return;const I=b(A);return C(I),I},after:A=>{WI(A)&&!E()&&T(A),m=A}},r)},MT);function v(){ka({process:A=>E()?b(A):void 0},r)}function x(){const A=r.retrieveSession();Zd(A)?ka({process:I=>Zd(I)?Ta(I,t):void 0,after:b},r):b(A)}function b(A){return Zd(A)&&(A=Ta(A,t)),E()&&(j(A)?N():(u.notify({previousState:m,newState:A}),m=A)),A}function S(){ka({process:A=>{if(cp(A))return Ta(A,t)},after:A=>{m=A}},r)}function C(A){if(cp(A))return!1;const I=o(A[n]);A[n]=I,delete A.isExpired,I!==YI&&!A.id&&(A.id=ur(),A.created=String(ko()))}function E(){return m?.[n]!==void 0}function j(A){return m.id!==A.id||m[n]!==A[n]}function N(){m=Ta(m,t),l.notify()}function T(A){m=A,i.notify()}function k(A){ka({process:I=>({...I,...A}),after:b},r)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>m,renewObservable:i,expireObservable:l,sessionStateUpdateObservable:u,restartSession:S,expire:()=>{g(),r.expireSession(m),b(Ta(m,t))},stop:()=>{Dg(f)},updateSessionState:k}}const ow={GRANTED:"granted",NOT_GRANTED:"not-granted"};function bK(e){const t=new xt;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===ow.GRANTED},observable:t}}function RS(e){const t=ul(e);return t==="string"||t==="function"||e instanceof RegExp}function jS(e,t,n=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return n?t.startsWith(o):o===t}catch(r){ht.error(r)}return!1})}const S$=["chrome-extension://","moz-extension://"];function PT(e){return S$.some(t=>e.includes(t))}function xK(e,t=""){return!PT(e)&&PT(t)}function _K(e=""){for(const t of S$){const n=e.match(new RegExp(`${t}[^/]+`));if(n)return n[0]}}const DT="Running the Browser SDK in a Web extension content script is discouraged and will be forbidden in a future major release unless the `allowedTrackingOrigins` option is provided.",wK="SDK initialized on a non-allowed domain.";function SK(e,t=typeof location<"u"?location.origin:"",n=new Error().stack){const o=e.allowedTrackingOrigins;if(!o){if(xK(t,n)){ht.warn(DT);const i=_K(n);ra(DT,{extensionUrl:i||"unknown"})}return!0}const r=jS(o,t);return r||ht.error(wK),r}function NS(e){return TS(e,location.href).href}function CK(e){try{return!!TS(e)}catch{return!1}}function EK(e){const t=TS(e).pathname;return t[0]==="/"?t:`/${t}`}function TS(e,t){const{URL:n}=RK();try{return t!==void 0?new n(e,t):new n(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)} ${fu({url:e,base:t})}`)}}let Tx;function RK(){if(!Tx){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=window}Tx={URL:t.URL},e?.remove()}return Tx}function Oa(e,t,n){const o=jK(e,t);return{build(r,i){const l=NK(e,t,r,i,n);return o(l)},trackType:t}}function jK(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=NS(o);return l=>`${i}?ddforward=${encodeURIComponent(`${n}?${l}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=C$(t,e);return i=>`https://${r}${n}?${i}`}function C$(e,t){const{site:n=$a,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===$a)return P7;if(o&&n===$a)return`${o}.${$a}`;if(n===I7)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function NK({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:l},u=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.19.0")}`,"dd-evp-origin=browser",`dd-request-id=${ur()}`].concat(u);return l&&f.push(`dd-evp-encoding=${l}`),o==="rum"&&(f.push(`batch_time=${Hn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function TK(e){const t=e.site||$a,n=e.source==="flutter"?"flutter":"browser",o=kK({...e,site:t,source:n});return{replica:OK({...e,site:t,source:n}),site:t,source:n,...o}}function kK(e){return{logsEndpointBuilder:Oa(e,"logs"),rumEndpointBuilder:Oa(e,"rum"),profilingEndpointBuilder:Oa(e,"profile"),sessionReplayEndpointBuilder:Oa(e,"replay"),exposuresEndpointBuilder:Oa(e,"exposures")}}function OK(e){if(!e.replica)return;const t={...e,site:$a,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Oa(t,"logs"),rumEndpointBuilder:Oa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function AK(e){return D7.every(t=>e.includes(t))}const Yd={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},iw={ALL:"all",SAMPLED:"sampled"};function kx(e,t){return e!=null&&typeof e!="string"?(ht.error(`${t} must be defined as a string`),!1):!0}function IK(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(ht.error(`Site should be a valid Datadog site. ${vS} ${Mg}/getting_started/site/.`),!1):!0}function vc(e,t){return e!==void 0&&!Nq(e)?(ht.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function $K(e){var t,n,o,r,i,l,u,f,m,p;if(!e||!e.clientToken){ht.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){ht.error("Allowed Tracking Origins must be an array");return}if(!(!IK(e.site)||!vc(e.sessionSampleRate,"Session")||!vc(e.telemetrySampleRate,"Telemetry")||!vc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!vc(e.telemetryUsageSampleRate,"Telemetry Usage")||!kx(e.version,"Version")||!kx(e.env,"Env")||!kx(e.service,"Service")||!SK(e))){if(e.trackingConsent!==void 0&&!$p(ow,e.trackingConsent)){ht.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&II(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:gK(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(o=e.telemetryConfigurationSampleRate)!==null&&o!==void 0?o:5,telemetryUsageSampleRate:(r=e.telemetryUsageSampleRate)!==null&&r!==void 0?r:5,service:(i=e.service)!==null&&i!==void 0?i:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(u=e.version)!==null&&u!==void 0?u:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:ow.GRANTED,trackAnonymousUser:(p=e.trackAnonymousUser)!==null&&p!==void 0?p:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*rf,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*cr,batchMessagesLimit:50,messageBytesLimit:256*rf,variant:e.variant,sdkVersion:e.sdkVersion,...TK(e)}}}function MK(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const PK=200;function DK(e){const{env:t,service:n,version:o,datacenter:r,sdkVersion:i,variant:l}=e,u=[ic("sdk_version",i??"6.19.0")];return t&&u.push(ic("env",t)),n&&u.push(ic("service",n)),o&&u.push(ic("version",o)),r&&u.push(ic("datacenter",r)),l&&u.push(ic("variant",l)),u}function ic(e,t){const n=t?`${e}:${t}`:e;return(n.length>PK||UK(n))&&ht.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${vS} ${Mg}/getting_started/tagging/#defining-tags`),zK(n)}function zK(e){return e.replace(/,/g,"_")}function UK(e){return LK()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function LK(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function xi(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if(typeof r!="function")if(t in e&&t.startsWith("on"))r=Tt;else return{stop:Tt};let i=!1;const l=function(){if(i)return r.apply(this,arguments);const u=Array.from(arguments);let f;Ya(n,null,[{target:this,parameters:u,onPostCall:p=>{f=p},handlingStack:o?lf("instrumented method"):void 0}]);const m=r.apply(this,u);return f&&Ya(f,null,[m]),m};return e[t]=l,{stop:()=>{i=!0,e[t]===l&&(e[t]=r)}}}function vbe(e,t,n){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:Tt};const r=Tt;let i=(u,f)=>{ar(()=>{i!==r&&n(u,f)},0)};const l=function(u){o.set.call(this,u),i(this,u)};return Object.defineProperty(e,t,{set:l}),{stop:()=>{var u;((u=Object.getOwnPropertyDescriptor(e,t))===null||u===void 0?void 0:u.set)===l&&Object.defineProperty(e,t,o),i=r}}}function FK(){return new xt(e=>{const t=(r,i)=>{const l=_S({stackTrace:i,originalError:r,startClocks:qn(),nonErrorPrefix:"Uncaught",source:mu.SOURCE,handling:"unhandled"});e.notify(l)},{stop:n}=VK(t),{stop:o}=BK(t);return()=>{n(),o()}})}function VK(e){return xi(Wo(),"onerror",({parameters:[t,n,o,r,i]})=>{let l;cl(i)||(l=w7(t,n,o,r)),e(i??t,l)})}function BK(e){return xi(Wo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function HK(e){const t={version:"6.19.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return zq},enumerable:!1}),t}function GK(e,t,n){const o=e[t];o&&!o.q&&o.version&&ht.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach(r=>II(r,"onReady callback threw an error:")())}function E$(e,t){t.silentMultipleInit||ht.error(`${e} is already initialized.`)}const cf={intervention:"intervention",cspViolation:"csp_violation"};function qK(e,t){const n=[];t.includes(cf.cspViolation)&&n.push(ZK(e));const o=t.filter(r=>r!==cf.cspViolation);return o.length&&n.push(KK(o)),FI(...n)}function KK(e){return new xt(t=>{if(!window.ReportingObserver)return;const n=tt((r,i)=>r.forEach(l=>t.notify(YK(l)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function ZK(e){return new xt(t=>{const{stop:n}=Qt(e,document,"securitypolicyviolation",o=>{t.notify(XK(o))});return n})}function YK(e){const{type:t,body:n}=e;return R$({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:j$(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function XK(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return R$({type:e.effectiveDirective,message:`${cf.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:j$(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${BI(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function R$(e){return{startClocks:qn(),source:mu.REPORT,handling:"unhandled",...e}}function j$(e,t,n,o,r){return n?If({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function N$(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const $h=1/0,WK=Ir;let jd=null;const dp=new Set;function QK(){dp.forEach(e=>e())}function pu({expireDelay:e,maxEntries:t}){let n=[];jd||(jd=du(()=>QK(),WK));const o=()=>{const p=ro()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};dp.add(o);function r(p,g){const v={value:p,startTime:g,endTime:$h,remove:()=>{N$(n,v)},close:x=>{v.endTime=x}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=$h,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function l(p){const g=n[0];g&&g.endTime===$h&&g.close(p)}function u(p=$h,g=0){const v=uu(p,g);return n.filter(x=>x.startTime<=v&&p<=x.endTime).map(x=>x.value)}function f(){n=[]}function m(){dp.delete(o),dp.size===0&&jd&&(Dg(jd),jd=null)}return{add:r,find:i,closeActive:l,findAll:u,reset:f,stop:m}}const JK="datadog-synthetics-public-id",eZ="datadog-synthetics-result-id",tZ="datadog-synthetics-injects-rum";function T$(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Ds(tZ))}function k$(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Ds(JK);return typeof e=="string"?e:void 0}function O$(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Ds(eZ);return typeof e=="string"?e:void 0}function A$(){return!!(k$()&&O$())}const nZ=Ir,rZ=ll;function oZ(e,t,n,o){const r=new xt,i=new xt,l=yK(e.sessionStoreStrategyType,e,t,n),u=pu({expireDelay:rZ});l.renewObservable.subscribe(()=>{u.add(f(),ro()),r.notify()}),l.expireObservable.subscribe(()=>{i.notify(),u.closeActive(ro())}),l.expandOrRenewSession(),u.add(f(),PI().relative),o.observable.subscribe(()=>{o.isGranted()?l.expandOrRenewSession():l.expire()}),iZ(e,()=>{o.isGranted()&&l.expandOrRenewSession()}),sZ(e,()=>l.expandSession()),aZ(e,()=>l.restartSession());function f(){const m=l.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(lZ().catch(()=>{}),{id:"invalid",trackingType:YI,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>u.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:l.sessionStateUpdateObservable,expire:l.expire,updateSessionState:l.updateSessionState}}function iZ(e,t){const{stop:n}=Ks(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function sZ(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Qt(e,document,"visibilitychange",n);du(n,nZ)}function aZ(e,t){const{stop:n}=Qt(e,window,"resume",t,{capture:!0})}async function lZ(){const e=t$();let t=[];"cookieStore"in window?t=await window.cookieStore.getAll("_dd_s"):t=document.cookie.split(/\s*;\s*/).filter(n=>n.startsWith("_dd_s")),ra("Unexpected session state",{session:e,isSyntheticsTest:A$(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:{count:t.length,domain:qI(),...t},currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function cZ(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=zI(n);t+=r,e+=n,o&&o(r)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class uZ{constructor(){this.callbacks={}}notify(t,n){const o=this.callbacks[t];o&&o.forEach(r=>r(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>n!==o)}}}}function Ox(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&ar(()=>{o=0},Ir),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:mu.AGENT,startClocks:qn()})}finally{r=!1}}return!0}}}function kS(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Tt}):Qt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function dZ(e,t){return new Promise(n=>{kS(e,t,n)})}let Ax;const OS=new WeakMap;function fZ(e){return Ax||(Ax=mZ(e)),Ax}function mZ(e){return new xt(t=>{const{stop:n}=xi(XMLHttpRequest.prototype,"open",hZ),{stop:o}=xi(XMLHttpRequest.prototype,"send",i=>{pZ(i,e,t)},{computeHandlingStack:!0}),{stop:r}=xi(XMLHttpRequest.prototype,"abort",gZ);return()=>{n(),o(),r()}})}function hZ({target:e,parameters:[t,n]}){OS.set(e,{state:"open",method:String(t).toUpperCase(),url:NS(String(n))})}function pZ({target:e,handlingStack:t},n,o){const r=OS.get(e);if(!r)return;const i=r;i.state="start",i.startClocks=qn(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let l=!1;const{stop:u}=xi(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),u(),l)return;l=!0;const p=r;p.state="complete",p.duration=Jt(i.startClocks.timeStamp,Hn()),p.status=e.status,o.notify(of(p))},{stop:m}=Qt(n,e,"loadend",f);o.notify(i)}function gZ({target:e}){const t=OS.get(e);t&&(t.isAborted=!0)}let Ix;function I$(){return Ix||(Ix=vZ()),Ix}function vZ(){return new xt(e=>{if(!window.fetch)return;const{stop:t}=xi(window,"fetch",n=>yZ(n,e),{computeHandlingStack:!0});return t})}function yZ({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let l=i&&i.method;l===void 0&&r instanceof Request&&(l=r.method);const u=l!==void 0?String(l).toUpperCase():"GET",f=r instanceof Request?r.url:NS(String(r)),m=qn(),p={state:"start",init:i,input:r,method:u,startClocks:m,url:f,handlingStack:n};o.notify(p),e[0]=p.input,e[1]=p.init,t(g=>bZ(o,g,p))}function bZ(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(tt(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),tt(i=>{var l,u;r({status:0,isAborted:((u=(l=o.init)===null||l===void 0?void 0:l.signal)===null||u===void 0?void 0:u.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function xZ(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(tt(e),t);return()=>window.cancelIdleCallback(n)}return wZ(e)}const _Z=50;function wZ(e){const t=ko(),n=ar(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,_Z-(ko()-t))})},0);return()=>Co(n)}const SZ=cr,CZ=30;function EZ(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>CZ-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){xZ(t,{timeout:SZ})}return{push(o){e.push(o)===1&&n()}}}let $x={};function RZ(e){const t=e.map(n=>($x[n]||($x[n]=jZ(n)),$x[n]));return FI(...t)}function jZ(e){return new xt(t=>{const n=Yi[e];return Yi[e]=(...o)=>{n.apply(console,o);const r=lf("console error");Ya(()=>{t.notify(NZ(o,e,r))})},()=>{Yi[e]=n}})}function NZ(e,t,n){const o=e.map(r=>TZ(r)).join(" ");if(t===$g.error){const r=e.find(cl),i=_S({originalError:r,handlingStack:n,startClocks:qn(),source:mu.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:n,error:i}}return{api:t,message:o,error:void 0,handlingStack:n}}function TZ(e){return typeof e=="string"?dn(e):cl(e)?i$(Af(e)):fu(dn(e),void 0,2)}const kZ=500;function OZ(){const e=[];return{add:r=>{e.push(r)>kZ&&e.splice(0,1)},remove:r=>{N$(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function AZ(e){const t=ul(e)==="object";return t||ht.error("Unsupported context:",e),t}function Mx(e,t,n){const o={...e};for(const[r,{required:i,type:l}]of Object.entries(t))l==="string"&&!zT(o[r])&&(o[r]=String(o[r])),i&&zT(o[r])&&ht.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function zT(e){return e==null||e===""}function Vg(e="",{propertiesConfig:t={}}={}){let n={};const o=new xt,r={getContext:()=>SS(n),setContext:i=>{AZ(i)?n=dn(Mx(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,l)=>{n=dn(Mx({...n,[i]:l},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],Mx(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function hr(e,t,n,o){return tt((...r)=>(o&&vr({feature:o}),e()[t][n](...r)))}const IZ="_dd_c",$Z=[];function AS(e,t,n,o){const r=MZ(n,o);$Z.push(Qt(e,window,"storage",({key:m})=>{r===m&&l()})),t.changeObservable.subscribe(u);const i=ns(f(),t.getContext());al(i)||t.setContext(i);function l(){t.setContext(f())}function u(){localStorage.setItem(r,JSON.stringify(t.getContext()))}function f(){const m=localStorage.getItem(r);return m?JSON.parse(m):{}}}function MZ(e,t){return`${IZ}_${e}_${t}`}function PZ(e,t,n){const o=$$();return t.storeContextsAcrossPages&&AS(t,o,n,4),e.register(0,()=>{const r=o.getContext();return al(r)||!r.id?oo:{account:r}}),o}function $$(){return Vg("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function DZ(e,t,n,o){const r=M$();return t.storeContextsAcrossPages&&AS(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function M$(){return Vg("global context")}function zZ(e,t,n,o){const r=P$();return t.storeContextsAcrossPages&&AS(t,r,o,1),e.register(0,({eventType:i,startTime:l})=>{const u=r.getContext(),f=n.findTrackedSession(l);return f&&f.anonymousId&&!u.anonymous_id&&t.trackAnonymousUser&&(u.anonymous_id=f.anonymousId),al(u)?oo:{type:i,usr:u}}),e.register(1,({startTime:i})=>{var l;return{anonymous_id:(l=n.findTrackedSession(i))===null||l===void 0?void 0:l.anonymousId}}),r}function P$(){return Vg("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Bn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},pr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function UZ(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(tt(u=>{if(u.done){l();return}r+=u.value.length,r>n.bytesLimit?l():i()}),tt(u=>t(u)))}function l(){o.cancel().catch(Tt),t(void 0,void 0,void 0)}}const br={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Bg={FETCH:br.FETCH,XHR:br.XHR},LZ=500;function FZ(e=FK){const t=new VI(LZ),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function VZ(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const it={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},D$={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Xi={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},IS={CLICK:"click",CUSTOM:"custom"},Nd={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},z$={DURATION:"duration"};function BZ(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function HZ(e,t,n){function o(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function r(i){o(i)&&e.notify(12,qZ(i))}return{addDurationVital:r,startDurationVital:(i,l={})=>U$(n,i,l),stopDurationVital:(i,l={})=>{L$(r,n,i,l)}}}function U$({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:qn(),context:o.context,description:o.description},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function L$(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e(GZ(i,i.startClocks,r,qn())),typeof o=="string"?t.delete(o):n.delete(o))}function GZ(e,t,n,o){var r;return{name:e.name,type:z$.DURATION,startClocks:t,duration:Jt(t.timeStamp,o.timeStamp),context:ns(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function qZ(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ur(),type:e.type,name:e.name,duration:ot(e.duration),description:e.description},type:it.VITAL,context:e.context};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,domainContext:{}}}function F$(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const UT=new Map;function V$(e,t){if(t===100)return!0;if(t===0)return!1;const n=UT.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=KZ(BigInt(`0x${e.split("-")[4]}`),t):o=es(t),UT.set(t,{sessionId:e,decision:o}),o}function KZ(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function ZZ(){return H$(64)}function B$(){return H$(63)}function H$(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let o=t[1],r=t[0],i="";do{const l=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(l/n),i=(l%n).toString(n)+i}while(o||r);return i}}}function sc(e){return e.toString(16).padStart(16,"0")}function YZ(e){const t=e;return ul(t)==="object"&&RS(t.match)&&Array.isArray(t.propagatorTypes)}function XZ(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function WZ(e,t,n,o){return{clearTracingIfNeeded:XZ,traceFetch:r=>LT(e,r,t,n,o,i=>{var l;if(r.input instanceof Request&&!(!((l=r.init)===null||l===void 0)&&l.headers))r.input=new Request(r.input),Object.keys(i).forEach(u=>{r.input.headers.append(u,i[u])});else{r.init=of(r.init);const u=[];r.init.headers instanceof Headers?r.init.headers.forEach((f,m)=>{u.push([m,f])}):Array.isArray(r.init.headers)?r.init.headers.forEach(f=>{u.push(f)}):r.init.headers&&Object.keys(r.init.headers).forEach(f=>{u.push([f,r.init.headers[f]])}),r.init.headers=u.concat(bS(i))}}),traceXhr:(r,i)=>LT(e,r,t,n,o,l=>{Object.keys(l).forEach(u=>{i.setRequestHeader(u,l[u])})})}}function LT(e,t,n,o,r,i){const l=n.findTrackedSession();if(!l)return;const u=e.allowedTracingUrls.find(p=>jS([p.match],t.url,!0));if(!u)return;const f=V$(l.id,e.traceSampleRate);(f||e.traceContextInjection===iw.ALL)&&(t.traceSampled=f,t.traceId=ZZ(),t.spanId=B$(),i(QZ(t.traceId,t.spanId,t.traceSampled,l.id,u.propagatorTypes,o,r,e)))}function QZ(e,t,n,o,r,i,l,u){const f={};if(r.forEach(m=>{switch(m){case"datadog":{Object.assign(f,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(f,{traceparent:`00-0000000000000000${sc(e)}-${sc(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${sc(e)}-${sc(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":sc(e),"X-B3-SpanId":sc(t),"X-B3-Sampled":n?"1":"0"});break}}}),u.propagateTraceBaggage){const m={"session.id":o},p=i.getContext().id;typeof p=="string"&&(m["user.id"]=p);const g=l.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([x,b])=>`${x}=${encodeURIComponent(b)}`).join(",");v&&(f.baggage=v)}return f}const G$=["tracecontext","datadog"];function JZ(e){var t,n,o,r,i,l,u;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ht.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ht.error("Application ID is not configured, no RUM data will be collected.");return}if(!vc(e.sessionReplaySampleRate,"Session Replay")||!vc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ht.error("Excluded Activity Urls should be an array");return}const f=eY(e);if(!f)return;const m=$K(e);if(!m)return;const p=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:p,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:p===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Tf(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(o=e.excludedActivityUrls)!==null&&o!==void 0?o:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((r=e.trackUserInteractions)!==null&&r!==void 0)||r),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,subdomain:e.subdomain,defaultPrivacyLevel:$p(Yd,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Yd.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,initialViewMetricsTelemetrySampleRate:1,replayTelemetrySampleRate:1,traceContextInjection:$p(iw,e.traceContextInjection)?e.traceContextInjection:iw.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(u=e.profilingSampleRate)!==null&&u!==void 0?u:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...m}}function eY(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ht.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ht.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{RS(n)?t.push({match:n,propagatorTypes:G$}):YZ(n)?t.push(n):ht.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function tY(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{RS(n)?G$.forEach(o=>t.add(o)):ul(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function nY(e){var t;const n=MK(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:tY(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var r;return{name:o.name,...(r=o.getConfigurationTelemetry)===null||r===void 0?void 0:r.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,...n}}const rY="v1",oY=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function iY(e,t){const n=await hY(e);if(!n.ok){ht.error(n.error);return}return sY(e,n.value,t)}function sY(e,t,n){const o={...e};return oY.forEach(r=>{r in t&&(o[r]=Dp(t[r]))}),Object.keys(n).forEach(r=>{t[r]!==void 0&&cY(n[r],t[r])}),o}function Dp(e){if(Array.isArray(e))return e.map(Dp);if(aY(e)){if(lY(e)){const t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return q$(e.value);case"dynamic":return uY(e);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return UI(e,Dp)}return e}function aY(e){return typeof e=="object"&&e!==null}function lY(e){return"rcSerializedType"in e}function q$(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function cY(e,t){t.forEach(({key:n,value:o})=>{e.setContextProperty(n,Dp(o))})}function uY(e){const t=e.strategy;switch(t){case"cookie":return dY(e);case"dom":return fY(e);default:ht.error(`Unsupported remote configuration: "strategy": "${t}"`);return}}function dY({name:e,extractor:t}){const n=Lg(e);return t!==void 0&&n!==void 0?K$(t,n):n}function fY({selector:e,attribute:t,extractor:n}){let o;try{o=document.querySelector(e)}catch{o=null,ht.error(`Invalid selector in the remote configuration: '${e}'`)}if(o===null||mY(o,t))return;const r=t!==void 0?o.getAttribute(t):o.textContent;return n!==void 0&&r!==null?K$(n,r):r??void 0}function mY(e,t){return e.getAttribute("type")==="password"&&t==="value"}function K$(e,t){const n=q$(e.value);if(n===void 0)return;const o=n.exec(t);if(o===null)return;const[r,i]=o;return i||r}async function hY(e){let t;try{t=await fetch(pY(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function pY(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${C$("rum",e)}/${rY}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function gY({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=OZ(),l=M$();Px(l,Bn.globalContext,i);const u=P$();Px(u,Bn.userContext,i);const f=$$();Px(f,Bn.accountContext,i);let m,p,g,v;const x=n.observable.subscribe(S),b={};function S(){if(!g||!v||!n.isGranted())return;x.unsubscribe();let N;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),N=m.options}const T=r(v,p,N);i.drain(T)}function C(N){const T=Hc();if(T&&(N=vY(N)),g=N,lK(nY(N)),v){E$("DD_RUM",N);return}const k=JZ(N);if(k){if(!T&&!k.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!T&&t&&(p=t(k,"Datadog RUM",Tt),!p)||(v=k,I$().subscribe(Tt),n.tryToInit(k.trackingConsent),S())}}const E=N=>{i.add(T=>T.addDurationVital(N))};return{init(N,T){if(!N){ht.error("Missing configuration");return}k7(N.enableExperimentalFeatures),g=N,!(e&&T$())&&(F$(N.plugins,"onInit",{initConfiguration:N,publicApi:T}),N.remoteConfigurationId?iY(N,{user:u,context:l}).then(k=>{k&&C(k)}).catch(Fc):C(N))},get initConfiguration(){return g},getInternalContext:Tt,stopSession:Tt,addTiming(N,T=Hn()){i.add(k=>k.addTiming(N,T))},startView(N,T=qn()){const k=A=>{A.startView(N,T)};i.add(k),m||(m={options:N,callback:k},S())},setViewName(N){i.add(T=>T.setViewName(N))},setViewContext(N){i.add(T=>T.setViewContext(N))},setViewContextProperty(N,T){i.add(k=>k.setViewContextProperty(N,T))},getViewContext:()=>b,globalContext:l,userContext:u,accountContext:f,addAction(N){i.add(T=>T.addAction(N))},addError(N){i.add(T=>T.addError(N))},addFeatureFlagEvaluation(N,T){i.add(k=>k.addFeatureFlagEvaluation(N,T))},startDurationVital(N,T){return U$(o,N,T)},stopDurationVital(N,T){L$(E,o,N,T)},addDurationVital:E}}function vY(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=$f())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Px(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function yY(e,t,n,o={}){const r=bK(),i=BZ(),l=FZ().observable;let u=gY(o,r,i,(g,v,x)=>{const b=e(g,t,n,x,v&&o.createDeflateEncoder?S=>o.createDeflateEncoder(g,v,S):cZ,r,i,l,o.sdkName);return t.onRumStart(b.lifeCycle,g,b.session,b.viewHistory,v,b.telemetry),n.onRumStart(b.lifeCycle,b.hooks,g,b.session,b.viewHistory),u=bY(u,b),F$(g.plugins,"onRumStart",{strategy:u,addEvent:b.addEvent}),b});const f=()=>u,m=tt(g=>{const v=typeof g=="object"?g:{name:g};u.startView(v),vr({feature:"start-view"})}),p=HK({init:tt(g=>{u.init(g,p)}),setTrackingConsent:tt(g=>{r.update(g),vr({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:tt(g=>{u.setViewName(g),vr({feature:"set-view-name"})}),setViewContext:tt(g=>{u.setViewContext(g),vr({feature:"set-view-context"})}),setViewContextProperty:tt((g,v)=>{u.setViewContextProperty(g,v),vr({feature:"set-view-context-property"})}),getViewContext:tt(()=>(vr({feature:"set-view-context-property"}),u.getViewContext())),getInternalContext:tt(g=>u.getInternalContext(g)),getInitConfiguration:tt(()=>SS(u.initConfiguration)),addAction:(g,v)=>{const x=lf("action");Ya(()=>{u.addAction({name:dn(g),context:dn(v),startClocks:qn(),type:IS.CUSTOM,handlingStack:x}),vr({feature:"add-action"})})},addError:(g,v)=>{const x=lf("error");Ya(()=>{u.addError({error:g,handlingStack:x,context:dn(v),startClocks:qn()}),vr({feature:"add-error"})})},addTiming:tt((g,v)=>{u.addTiming(dn(g),v)}),setGlobalContext:hr(f,Bn.globalContext,pr.setContext,"set-global-context"),getGlobalContext:hr(f,Bn.globalContext,pr.getContext,"get-global-context"),setGlobalContextProperty:hr(f,Bn.globalContext,pr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:hr(f,Bn.globalContext,pr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:hr(f,Bn.globalContext,pr.clearContext,"clear-global-context"),setUser:hr(f,Bn.userContext,pr.setContext,"set-user"),getUser:hr(f,Bn.userContext,pr.getContext,"get-user"),setUserProperty:hr(f,Bn.userContext,pr.setContextProperty,"set-user-property"),removeUserProperty:hr(f,Bn.userContext,pr.removeContextProperty,"remove-user-property"),clearUser:hr(f,Bn.userContext,pr.clearContext,"clear-user"),setAccount:hr(f,Bn.accountContext,pr.setContext,"set-account"),getAccount:hr(f,Bn.accountContext,pr.getContext,"get-account"),setAccountProperty:hr(f,Bn.accountContext,pr.setContextProperty,"set-account-property"),removeAccountProperty:hr(f,Bn.accountContext,pr.removeContextProperty,"remove-account-property"),clearAccount:hr(f,Bn.accountContext,pr.clearContext,"clear-account"),startView:m,stopSession:tt(()=>{u.stopSession(),vr({feature:"stop-session"})}),addFeatureFlagEvaluation:tt((g,v)=>{u.addFeatureFlagEvaluation(dn(g),dn(v)),vr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:tt(()=>t.getSessionReplayLink()),startSessionReplayRecording:tt(g=>{t.start(g),vr({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:tt(()=>t.stop()),addDurationVital:tt((g,v)=>{vr({feature:"add-duration-vital"}),u.addDurationVital({name:dn(g),type:z$.DURATION,startClocks:kq(v.startTime),duration:v.duration,context:dn(v&&v.context),description:dn(v&&v.description)})}),startDurationVital:tt((g,v)=>(vr({feature:"start-duration-vital"}),u.startDurationVital(dn(g),{context:dn(v&&v.context),description:dn(v&&v.description)}))),stopDurationVital:tt((g,v)=>{vr({feature:"stop-duration-vital"}),u.stopDurationVital(typeof g=="string"?dn(g):g,{context:dn(v&&v.context),description:dn(v&&v.description)})})});return p}function bY(e,t){return{init:n=>{E$("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function xY(){const e=_Y();return new xt(t=>{if(!e)return;const n=new e(tt(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function _Y(){let e;const t=window;if(t.Zone&&(e=qs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Tt),o=qs(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function wY(){const e=new xt,{stop:t}=xi(window,"open",()=>e.notify());return{observable:e,stop:t}}function SY(e,t,n,o,r){return{get:i=>{const l=n.findView(i),u=r.findUrl(i),f=t.findTrackedSession(i);if(f&&l&&u){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:l.id,name:l.name,referrer:u.referrer,url:u.url}}}}}}const CY=uZ,EY=ll;function RY(e){const t=pu({expireDelay:EY});e.subscribe(1,o=>{t.add(n(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const r=t.find(o.startClocks.relative);r&&(o.name&&(r.name=o.name),o.context&&(r.context=o.context),r.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const Z$="initial_document",jY=[[br.DOCUMENT,e=>Z$===e],[br.XHR,e=>e==="xmlhttprequest"],[br.FETCH,e=>e==="fetch"],[br.BEACON,e=>e==="beacon"],[br.CSS,(e,t)=>/\.css$/i.test(t)],[br.JS,(e,t)=>/\.js$/i.test(t)],[br.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[br.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[br.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function NY(e){const t=e.name;if(!CK(t))return ra(`Failed to construct URL for "${e.name}"`),br.OTHER;const n=EK(t);for(const[o,r]of jY)if(r(e.initiatorType,n))return o;return br.OTHER}function FT(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Y$(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function TY(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?Jt(n,o):t}function kY(e){if(!W$(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:l,domainLookupEnd:u,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:x}=e,b={download:Na(t,v,x),first_byte:Na(t,g,v)};return 0<o&&o<n&&(b.worker=Na(t,o,n)),n<p&&(b.connect=Na(t,f,p),f<=m&&m<=p&&(b.ssl=Na(t,m,p))),n<u&&(b.dns=Na(t,l,u)),t<i&&(b.redirect=Na(t,r,i)),b}function X$(e){return e.duration>=0}function W$(e){const t=FT(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=OY(e)?FT(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function OY(e){return e.redirectEnd>e.startTime}function Na(e,t,n){if(e<=t&&t<=n)return{duration:ot(Jt(t,n)),start:ot(Jt(e,t))}}function AY(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function IY(e){return e.deliveryType===""?"other":e.deliveryType}function $Y(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:o}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function $S(e){return e&&(!AK(e)||Fg(Xa.TRACK_INTAKE_REQUESTS))}const MY=/data:(.+)?(;base64)?,/g,PY=24e3;function DY(e,t=PY){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(MY);return n?`${n[0]}[...]`:e}let VT=1;function zY(e,t,n,o,r){const i=WZ(t,n,o,r);UY(e,t,i),LY(e,i)}function UY(e,t,n){const o=fZ(t).subscribe(r=>{const i=r;if($S(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=Q$(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Bg.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>o.unsubscribe()}}function LY(e,t){const n=I$().subscribe(o=>{const r=o;if($S(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=Q$(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":FY(r,i=>{t.clearTracingIfNeeded(r),e.notify(8,{duration:i,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:Bg.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function Q$(){const e=VT;return VT+=1,e}function FY(e,t){const n=e.response&&L7(e.response);!n||!n.body?t(Jt(e.startClocks.timeStamp,Hn())):UZ(n.body,()=>{t(Jt(e.startClocks.timeStamp,Hn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function J$(e){return Tf(e)&&e<0?void 0:e}function eM({lifeCycle:e,isChildEvent:t,onChange:n=Tt}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},r=e.subscribe(13,i=>{var l;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case it.ERROR:o.errorCount+=1,n();break;case it.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case it.LONG_TASK:o.longTaskCount+=1,n();break;case it.RESOURCE:!((l=i._dd)===null||l===void 0)&&l.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function VY(e,t){const n=ko();let o=!1;const{stop:r}=Ks(e,window,["click","mousedown","keydown","touchstart","pointerdown"],u=>{if(!u.cancelable)return;const f={entryType:"first-input",processingStart:ro(),processingEnd:ro(),startTime:u.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};u.type==="pointerdown"?i(e,f):l(f)},{passive:!0,capture:!0});return{stop:r};function i(u,f){Ks(u,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&l(f)},{once:!0})}function l(u){if(!o){o=!0,r();const f=u.processingStart-u.startTime;f>=0&&f<ko()-n&&t(u)}}}var wt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(wt||(wt={}));function Si(e,t){return new xt(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=GY(f);m.length>0&&n.notify(m)};let r,i=!0;const l=new PerformanceObserver(tt(f=>{i?r=ar(()=>o(f.getEntries())):o(f.getEntries())}));try{l.observe(t)}catch{if([wt.RESOURCE,wt.NAVIGATION,wt.LONG_TASK,wt.PAINT].includes(t.type)){t.buffered&&(r=ar(()=>o(performance.getEntriesByType(t.type))));try{l.observe({entryTypes:[t.type]})}catch{return}}}i=!1,BY(e);let u;return!dl(wt.FIRST_INPUT)&&t.type===wt.FIRST_INPUT&&({stop:u}=VY(e,f=>{o([f])})),()=>{l.disconnect(),u&&u(),Co(r)}})}let Td;function BY(e){return!Td&&HY()&&"addEventListener"in performance&&(Td=Qt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Td?.stop()}}function HY(){return window.performance!==void 0&&"getEntries"in performance}function dl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function GY(e){return e.filter(t=>!qY(t))}function qY(e){return e.entryType===wt.RESOURCE&&(!$S(e.name)||!X$(e))}function tM(e){return e.nodeType===Node.TEXT_NODE}function KY(e){return e.nodeType===Node.COMMENT_NODE}function rs(e){return e.nodeType===Node.ELEMENT_NODE}function nM(e){return rs(e)&&!!e.shadowRoot}function ZY(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&rs(t.host)}function ybe(e){return e.childNodes.length>0||nM(e)}function bbe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;nM(e)&&t(e.shadowRoot)}function YY(e){return ZY(e)?e.host:e.parentNode}const rM=100,XY=100,BT="data-dd-excluded-activity-mutations";function MS(e,t,n,o,r,i){const l=QY(e,t,n,o);return WY(l,r,i)}function WY(e,t,n){let o,r=!1;const i=ar(tt(()=>m({hadActivity:!1})),rM),l=n!==void 0?ar(tt(()=>m({hadActivity:!0,end:Hn()})),n):void 0,u=e.subscribe(({isBusy:p})=>{Co(i),Co(o);const g=Hn();p||(o=ar(tt(()=>m({hadActivity:!0,end:g})),XY))}),f=()=>{r=!0,Co(i),Co(o),Co(l),u.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function QY(e,t,n,o){return new xt(r=>{const i=[];let l,u=0;return i.push(t.subscribe(m=>{m.every(JY)||f()}),n.subscribe(f),Si(o,{type:wt.RESOURCE}).subscribe(m=>{m.some(p=>!Dx(o,p.name))&&f()}),e.subscribe(7,m=>{Dx(o,m.url)||(l===void 0&&(l=m.requestIndex),u+=1,f())}),e.subscribe(8,m=>{Dx(o,m.url)||l===void 0||m.requestIndex<l||(u-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:u>0})}})}function Dx(e,t){return jS(e.excludedActivityUrls,t)}function JY(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&rs(t)&&t.matches(`[${BT}], [${BT}] *`))}const Et={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Yd.ALLOW,MASK:Yd.MASK,MASK_USER_INPUT:Yd.MASK_USER_INPUT},eX="data-dd-privacy",xbe="hidden",tX="dd-privacy-",zx="***",_be="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",nX={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},rX="x";function oM(e,t,n){if(n&&n.has(e))return n.get(e);const o=YY(e),r=o?oM(o,t,n):t,i=iM(e),l=oX(i,r);return n&&n.set(e,l),l}function oX(e,t){switch(t){case Et.HIDDEN:case Et.IGNORE:return t}switch(e){case Et.ALLOW:case Et.MASK:case Et.MASK_USER_INPUT:case Et.HIDDEN:case Et.IGNORE:return e;default:return t}}function iM(e){if(rs(e)){if(e.tagName==="BASE")return Et.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Et.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Et.MASK}if(e.matches(yc(Et.HIDDEN)))return Et.HIDDEN;if(e.matches(yc(Et.MASK)))return Et.MASK;if(e.matches(yc(Et.MASK_USER_INPUT)))return Et.MASK_USER_INPUT;if(e.matches(yc(Et.ALLOW)))return Et.ALLOW;if(sX(e))return Et.IGNORE}}function sM(e,t){switch(t){case Et.MASK:case Et.HIDDEN:case Et.IGNORE:return!0;case Et.MASK_USER_INPUT:return tM(e)?HT(e.parentNode):HT(e);default:return!1}}function HT(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!nX[t.tagName]}const iX=e=>e.replace(/\S/g,rX);function wbe(e,t,n){var o;const r=(o=e.parentElement)===null||o===void 0?void 0:o.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const l=n;if(r==="SCRIPT")i=zx;else if(l===Et.HIDDEN)i=zx;else if(sM(e,l))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=zx:i=iX(i);return i}function sX(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),o=t("rel"),r=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function yc(e){return`[${eX}="${e}"], .${tX}${e}`}const Hg="data-dd-action-name",aX="Masked Element";function lX(e,{enablePrivacyForActionName:t,actionNameAttribute:n},o=Et.ALLOW){const r=GT(e,Hg)||n&&GT(e,n);return r?{name:r,nameSource:"custom_attribute"}:o===Et.MASK?{name:aX,nameSource:"mask_placeholder"}:qT(e,n,cX,t)||qT(e,n,uX,t)||{name:"",nameSource:"blank"}}function GT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return lM(aM(o.trim()))}const cX=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return fp(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return fp(e,t,n)},e=>kd(e,"aria-label"),(e,t,n)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(r=>fX(e,r)).filter(r=>!!r).map(r=>cM(r,t,n)).join(" "),nameSource:"text_content"}},e=>kd(e,"alt"),e=>kd(e,"name"),e=>kd(e,"title"),e=>kd(e,"placeholder"),(e,t,n)=>{if("options"in e&&e.options.length>0)return fp(e.options[0],t,n)}],uX=[(e,t,n)=>fp(e,t,n)],dX=10;function qT(e,t,n,o){let r=e,i=0;for(;i<=dX&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const l of n){const u=l(r,t,o);if(u){const{name:f,nameSource:m}=u,p=f&&f.trim();if(p)return{name:lM(aM(p)),nameSource:m}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function aM(e){return e.replace(/\s+/g," ")}function lM(e){return e.length>100?`${BI(e,100)} [...]`:e}function fX(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function kd(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function fp(e,t,n){return{name:cM(e,t,n)||"",nameSource:"text_content"}}function cM(e,t,n){if(!e.isContentEditable){if(Fg(Xa.USE_TREE_WALKER_FOR_ACTION_NAME))return mX(e,t,n);if("innerText"in e){let o=e.innerText;const r=i=>{const l=e.querySelectorAll(i);for(let u=0;u<l.length;u+=1){const f=l[u];if("innerText"in f){const m=f.innerText;m&&m.trim().length>0&&(o=o.replace(m,""))}}};return r(`[${Hg}]`),t&&r(`[${t}]`),n&&r(`${yc(Et.HIDDEN)}, ${yc(Et.MASK)}`),o}return e.textContent}}function mX(e,t,n){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,i);let r="";for(;o.nextNode();){const l=o.currentNode;if(rs(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(r+=" ");continue}r+=l.textContent||""}return r.replace(/\s+/g," ").trim();function i(l){if(rs(l)){const u=iM(l);if(l.hasAttribute(Hg)||t&&l.hasAttribute(t)||n&&u&&sM(l,u))return NodeFilter.FILTER_REJECT;const f=getComputedStyle(l);if(f.visibility!=="visible"||f.display==="none"||f.contentVisibility&&f.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}const hX=[Hg,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],pX=[dM,vX],gX=[dM,yX,bX];function Mf(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=KT(o,pX,_X,t,n);if(r)return r;n=KT(o,gX,wX,t,n)||Gg(xX(o),n),o=o.parentElement}return n}function uM(e){return/[0-9]/.test(e)}function vX(e){if(e.id&&!uM(e.id))return`#${CSS.escape(e.id)}`}function yX(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!uM(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function bX(e){return CSS.escape(e.tagName)}function dM(e,t){if(t){const o=n(t);if(o)return o}for(const o of hX){const r=n(o);if(r)return r}function n(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function xX(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function KT(e,t,n,o,r){for(const i of t){const l=i(e,o);if(l&&n(e,l,r))return Gg(l,r)}}function _X(e,t,n){return e.ownerDocument.querySelectorAll(Gg(t,n)).length===1}function wX(e,t,n){let o;if(n===void 0)o=l=>l.matches(t);else{const l=Gg(`${t}:scope`,n);o=u=>u.querySelector(l)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Gg(e,t){return t?`${e}>${t}`:e}const fM=cr,SX=100;function CX(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(l),n.push(f),Co(r),r=ar(u,fM)}function l(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function u(){Co(r),o===0&&(o=1,l())}return{tryAppend:f=>o!==0?!1:n.length>0&&!EX(n[n.length-1].event,f.event)?(u(),!1):(i(f),!0),stop:()=>{u()}}}function EX(e,t){return e.target===t.target&&RX(e,t)<=SX&&e.timeStamp-t.timeStamp<=fM}function RX(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function jX(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const l=[Qt(e,window,"pointerdown",u=>{YT(u)&&(o=ZT(),r={selection:!1,input:!1,scroll:!1},i=t(u))},{capture:!0}),Qt(e,window,"selectionchange",()=>{(!o||!ZT())&&(r.selection=!0)},{capture:!0}),Qt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Qt(e,window,"pointerup",u=>{if(YT(u)&&i){const f=r;n(i,u,()=>f),i=void 0}},{capture:!0}),Qt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{l.forEach(u=>u.stop())}}}function ZT(){const e=window.getSelection();return!e||e.isCollapsed}function YT(e){return e.target instanceof Element&&e.isPrimary!==!1}const XT=3;function NX(e,t){if(TX(e))return t.addFrustration(Nd.RAGE_CLICK),e.some(WT)&&t.addFrustration(Nd.DEAD_CLICK),t.hasError&&t.addFrustration(Nd.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(Nd.ERROR_CLICK),WT(o)&&!n&&o.addFrustration(Nd.DEAD_CLICK)}),{isRage:!1}}function TX(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(XT-1);t+=1)if(e[t+XT-1].event.timeStamp-e[t].event.timeStamp<=cr)return!0;return!1}const kX='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function WT(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(kX)}const mM=10*cr,Xd=new Map;function OX(e){const t=Xd.get(e);return Xd.delete(e),t}function hM(e,t){Xd.set(e,t),Xd.forEach((n,o)=>{Jt(o,ro())>mM&&Xd.delete(o)})}const AX=5*Ir;function IX(e,t,n,o){const r=pu({expireDelay:AX}),i=new xt;let l;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===Cc.UNLOADING&&p()});const{stop:u}=jX(o,{onPointerDown:g=>$X(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},x,b)=>{MX(o,e,t,n,r,i,m,g,x,b,v)}});return{stop:()=>{p(),i.notify(),u()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!l||!l.tryAppend(g)){const v=g.clone();l=CX(g,x=>{DX(x,v)})}}function p(){l&&l.stop()}}function $X(e,t,n,o,r){const i=e.enablePrivacyForActionName?oM(o.target,e.defaultPrivacyLevel):Et.ALLOW;if(i===Et.HIDDEN)return;const l=PX(o,i,e);let u=!1;return MS(t,n,r,e,f=>{u=f.hadActivity},rM),{clickActionBase:l,hadActivityOnPointerDown:()=>u}}function MX(e,t,n,o,r,i,l,u,f,m,p){var g;const v=pM(t,r,m,u,f);l(v);const x=(g=u?.target)===null||g===void 0?void 0:g.selector;x&&hM(f.timeStamp,x);const{stop:b}=MS(t,n,o,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},mM),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function PX(e,t,n){const o=e.target.getBoundingClientRect(),r=Mf(e.target,n.actionNameAttribute);r&&hM(e.timeStamp,r);const i=lX(e.target,n,t);return{type:IS.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:r},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i.name,nameSource:i.nameSource}}function pM(e,t,n,o,r){const i=ur(),l=qn(),u=t.add(i,l.relative),f=eM({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(i):b.action.id===i)});let m=0,p;const g=[],v=new xt;function x(b){m===0&&(p=b,m=1,p?u.close(yS(p)):u.remove(),f.stop(),v.notify())}return{event:r,stop:x,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{g.push(b)},startClocks:l,isStopped:()=>m===1||m===2,clone:()=>pM(e,t,n,o,r),validate:b=>{if(x(),m!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=f.eventCounts,j={duration:p&&Jt(l.timeStamp,p),startClocks:l,id:i,frustrationTypes:g,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[r],event:r,...o};e.notify(0,j),m=2},discard:()=>{x(),m=2}}}function DX(e,t){const{isRage:n}=NX(e,t);n?(e.forEach(o=>o.discard()),t.stop(Hn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function zX(e,t,n,o,r){e.subscribe(0,u=>e.notify(12,QT(u))),t.register(0,({startTime:u,eventType:f})=>{if(f!==it.ERROR&&f!==it.RESOURCE&&f!==it.LONG_TASK)return oo;const m=i.findActionId(u);return m?{type:f,action:{id:m}}:oo}),t.register(1,({startTime:u})=>({action:{id:i.findActionId(u)}}));let i={findActionId:Tt},l=Tt;return r.trackUserInteractions&&({actionContexts:i,stop:l}=IX(e,n,o,r)),{addAction:u=>{e.notify(12,QT(u))},actionContexts:i,stop:l}}function QT(e){const t=Ux(e)?{action:{id:e.id,loading_time:J$(ot(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=ns({action:{id:ur(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:it.ACTION},t),o=Ux(e)?e.duration:void 0,r=Ux(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function Ux(e){return e.type!==IS.CUSTOM}function UX(e){const t=RZ([$g.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function LX(e,t){const n=qK(e,[cf.cspViolation,cf.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function FX(e,t,n){const o=new xt;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),UX(o),LX(t,o),o.subscribe(r=>e.notify(14,{error:r})),VX(e)}function VX(e){return e.subscribe(14,({error:t})=>{e.notify(12,BX(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const l=_S({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:mu.CUSTOM,handling:"handled"});l.context=ns(l.context,i),e.notify(14,{error:l})}}}function BX(e){const t={date:e.startClocks.timeStamp,error:{id:ur(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:it.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const JT=new WeakSet;function HX(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(o=>!JT.has(o)).filter(o=>X$(o)&&W$(o)).filter(o=>GX(o,e.startClocks.relative,gM({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return JT.add(n[0]),n[0].toJSON()}function gM(e){return uu(e.startTime,e.duration)}function GX(e,t,n){return e.startTime>=t-1&&gM(e)<=uu(n,1)}const qX=2*Ir;function KX(e){const t=ZX(e)||YX(e);if(!(!t||t.traceTime<=ko()-qX))return t.traceId}function ZX(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return vM(t&&t.content,n&&n.content)}function YX(e){const t=XX(e);if(t)return vM(sf(t,"trace-id"),sf(t,"trace-time"))}function vM(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function XX(e){for(let t=0;t<e.childNodes.length;t+=1){const n=ek(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],o=ek(n);if(o)return o;if(!tM(n))break}}function ek(e){if(e&&KY(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function yM(){if(dl(wt.NAVIGATION)){const n=performance.getEntriesByType(wt.NAVIGATION)[0];if(n)return n}const e=WX(),t={entryType:wt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function WX(){const e={},t=performance.timing;for(const n in t)if(Tf(t[n])){const o=n,r=t[o];e[o]=r===0?0:yS(r)}return e}function QX(e,t,n=yM){kS(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:wt.RESOURCE,initiatorType:Z$,duration:o.responseEnd,traceId:KX(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const JX=1e3;function eW(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>JX&&(ra("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const l of t){const u=o.startTime-l.startClocks.relative;0<=u&&u<r&&l.url===o.name&&(r=Math.abs(u),i=l)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}function tW(e,t,n,o=EZ(),r=QX){let i;const l=Fg(Xa.EARLY_REQUEST_COLLECTION);l?i=eW(e):e.subscribe(8,m=>{f(()=>nW(m,t,n))});const u=Si(t,{type:wt.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(l||!Y$(p))&&f(()=>tk(p,t,n,i))});r(t,m=>{f(()=>tk(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{u.unsubscribe()}}}function nW(e,t,n){const o=HX(e);return bM(o,e,n,t)}function tk(e,t,n,o){const r=Y$(e)&&o?o.getMatchingRequest(e):void 0;return bM(e,r,n,t)}function bM(e,t,n,o){if(!e&&!t)return;const r=t?iW(t,o):sW(e,o);if(!o.trackResources&&!r)return;const i=e?Pg(e.startTime):t.startClocks,l=e?TY(e):aW(n,i,t.duration),u=ns({date:i.timeStamp,resource:{id:ur(),duration:ot(l),type:t?t.type===Bg.XHR?br.XHR:br.FETCH:NY(e),method:t?t.method:void 0,status_code:t?t.status:lW(e.responseStatus),url:t?DY(t.url):e.name,protocol:e&&AY(e),delivery_type:e&&IY(e)},type:it.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&oW(e));return{startTime:i.relative,duration:l,rawRumEvent:u,domainContext:rW(e,t)}}function rW(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Bg.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function oW(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...$Y(e),...kY(e)}}}function iW(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function sW(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:B$().toString(),rule_psr:t.rulePsr}}}function aW(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function lW(e){return e===0?void 0:e}function cW(e,t,n){const{stop:o,eventCounts:r}=eM({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const uW=10*Ir;function dW(e,t,n){return{stop:Si(e,{type:wt.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.name==="first-contentful-paint"&&l.startTime<t.timeStamp&&l.startTime<uW);i&&n(i.startTime)}).unsubscribe}}function fW(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Jt(e,ro()))})})}function mW(e,t,n){const o=Si(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.startTime<t.timeStamp);if(i){const l=Jt(i.startTime,i.processingStart);let u;i.target&&rs(i.target)&&(u=Mf(i.target,e.actionNameAttribute)),n({delay:l>=0?l:0,time:i.startTime,targetSelector:u})}});return{stop:()=>{o.unsubscribe()}}}function hW(e,t,n=yM){return vW(e,()=>{const o=n();gW(o)||t(pW(o))})}function pW(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ro()?e.responseStart:void 0}}function gW(e){return e.loadEventEnd<=0}function vW(e,t){let n;const{stop:o}=kS(e,"complete",()=>{n=ar(()=>t())});return{stop:()=>{o(),Co(n)}}}const yW=10*Ir;function bW(e,t,n,o){let r=1/0;const{stop:i}=Ks(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let l=0;const u=Si(e,{type:wt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=Bq(f,p=>p.entryType===wt.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<yW&&p.size>l);if(m){let p;m.element&&(p=Mf(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:xW(m)}),l=m.size}});return{stop:()=>{i(),u.unsubscribe()}}}function xW(e){return e.url===""?void 0:e.url}function xM(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Tt};if(dl(wt.VISIBILITY_STATE)){const i=performance.getEntriesByType(wt.VISIBILITY_STATE).filter(l=>l.name==="hidden").find(l=>l.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:Tt}}let o=1/0;const{stop:r}=Ks(e,n,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,r())},{capture:!0});return{get timeStamp(){return o},stop:r}}function _W(e,t,n,o){const r={},{stop:i}=hW(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),l=xM(e,t),{stop:u}=dW(e,l,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=bW(e,l,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=mW(e,l,g=>{r.firstInput=g,o()});function p(){i(),u(),f(),m(),l.stop()}return{stop:p,initialViewMetrics:r}}const sw=(e,t)=>e*t,wW=(e,t)=>{const n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return n>=r||o>=i?0:sw(r-n,i-o)},nk=e=>{const t=sw(e.previousRect.width,e.previousRect.height),n=sw(e.currentRect.width,e.currentRect.height),o=wW(e.previousRect,e.currentRect);return t+n-o};function SW(e,t,n){if(!NW())return{stop:Tt};let o=0,r;n({value:0});const i=jW(),l=Si(e,{type:wt.LAYOUT_SHIFT,buffered:!0}).subscribe(u=>{var f;for(const m of u){if(m.hadRecentInput||m.startTime<t)continue;const{cumulatedValue:p,isMaxValue:g}=i.update(m);if(g){const v=CW(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:Jt(t,m.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>o){o=p;const v=(f=r?.target)===null||f===void 0?void 0:f.deref();n({value:Kd(o,4),targetSelector:v&&Mf(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?rk(r.previousRect):void 0,currentRect:r?.currentRect?rk(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{l.unsubscribe()}}}function CW(e){let t;for(const n of e)if(n.node&&rs(n.node)){const o=nk(n);(!t||nk(t)<o)&&(t=n)}return t}function rk({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const EW=5*cr,RW=cr;function jW(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=RW||r.startTime-t>=EW;let l;return i?(t=n=r.startTime,o=e=r.value,l=!0):(e+=r.value,n=r.startTime,l=r.value>o,l&&(o=r.value)),{cumulatedValue:e,isMaxValue:l}}}}function NW(){return dl(wt.LAYOUT_SHIFT)&&"WeakRef"in window}let mp,_M=0,Lx=1/0,Fx=0;function TW(){"interactionCount"in performance||mp||(mp=new window.PerformanceObserver(tt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Lx=Math.min(Lx,n.interactionId),Fx=Math.max(Fx,n.interactionId),_M=(Fx-Lx)/7+1)})})),mp.observe({type:"event",buffered:!0,durationThreshold:0}))}const ok=()=>mp?_M:window.performance.interactionCount||0,ik=10,kW=1*Ir;function OW(e,t,n){if(!$W())return{getInteractionToNextPaint:()=>{},setViewEnd:Tt,stop:Tt};const{getViewInteractionCount:o,stopViewInteractionCount:r}=IW(n);let i=1/0;const l=AW(o);let u=-1,f,m;function p(x){for(const S of x)S.interactionId&&S.startTime>=t&&S.startTime<=i&&l.process(S);const b=l.estimateP98Interaction();b&&b.duration!==u&&(u=b.duration,m=Jt(t,b.startTime),f=OX(b.startTime),!f&&b.target&&rs(b.target)&&(f=Mf(b.target,e.actionNameAttribute)))}const g=Si(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(p),v=Si(e,{type:wt.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(u>=0)return{value:Math.min(u,kW),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:x=>{i=x,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function AW(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(ik)}return{process(o){const r=t.findIndex(l=>o.interactionId===l.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<ik||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function IW(e){TW();const t=e===Xi.INITIAL_LOAD?0:ok();let n={stopped:!1};function o(){return ok()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function $W(){return dl(wt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function MW(e,t,n,o,r,i,l){let u=r===Xi.INITIAL_LOAD,f=!0;const m=[],p=xM(o,i);function g(){if(!f&&!u&&m.length>0){const x=Math.max(...m);x<p.timeStamp-i.relative&&l(x)}}const{stop:v}=MS(e,t,n,o,x=>{f&&(f=!1,x.hadActivity&&m.push(Jt(i.timeStamp,x.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:x=>{u&&(u=!1,m.push(x),g())}}}function Sbe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function PW(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Vx;function DW(e){return Vx||(Vx=zW(e)),Vx}function zW(e){return new xt(t=>{const{throttled:n}=zg(()=>{t.notify(PS())},200);return Qt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function PS(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const UW=cr;function LW(e,t,n,o=VW(e)){let r=0,i=0,l=0;const u=o.subscribe(({scrollDepth:f,scrollTop:m,scrollHeight:p})=>{let g=!1;if(f>r&&(r=f,g=!0),p>i){i=p;const v=ro();l=Jt(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:l})});return{stop:()=>u.unsubscribe()}}function FW(){const e=PW(),{height:t}=PS(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function VW(e,t=UW){return new xt(n=>{function o(){n.notify(FW())}if(window.ResizeObserver){const r=zg(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,l=new ResizeObserver(tt(r.throttled));i&&l.observe(i);const u=Qt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),l.disconnect(),u.stop()}}})}function BW(e,t,n,o,r,i,l){const u={},{stop:f,setLoadEvent:m}=MW(e,t,n,o,i,l,S=>{u.loadingTime=S,r()}),{stop:p}=LW(o,l,S=>{u.scroll=S}),{stop:g}=SW(o,l.relative,S=>{u.cumulativeLayoutShift=S,r()}),{stop:v,getInteractionToNextPaint:x,setViewEnd:b}=OW(o,l.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:b,getCommonViewMetrics:()=>(u.interactionToNextPaint=x(),u)}}function HW(e,t){const{stop:n}=Qt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function GW(e,t,n){fW(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const qW=3e3,KW=5*Ir,ZW=5*Ir;function YW(e,t,n,o,r,i,l,u){const f=new Set;let m=v(Xi.INITIAL_LOAD,PI(),u),p;x();let g;l&&(g=b(i),r.trackBfcacheViews&&(p=HW(r,S=>{m.end();const C=Pg(S.timeStamp);m=v(Xi.BF_CACHE,C,void 0)})));function v(S,C,E){const j=XW(t,n,o,r,e,S,C,E);return f.add(j),j.stopObservable.subscribe(()=>{f.delete(j)}),j}function x(){t.subscribe(10,()=>{m=v(Xi.ROUTE_CHANGE,void 0,{name:m.name,service:m.service,version:m.version,context:m.contextManager.getContext()})}),t.subscribe(9,()=>{m.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{QW(C,E)&&(m.end(),m=v(Xi.ROUTE_CHANGE))})}return{addTiming:(S,C=Hn())=>{m.addTiming(S,C)},startView:(S,C)=>{m.end({endClocks:C}),m=v(Xi.ROUTE_CHANGE,C,S)},setViewContext:S=>{m.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{m.contextManager.setContextProperty(S,C)},setViewName:S=>{m.setViewName(S)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(S=>S.stop())}}}function XW(e,t,n,o,r,i,l=qn(),u){const f=ur(),m=new xt,p={};let g=0,v;const x=of(r),b=Vg();let S=!0,C=u?.name;const E=u?.service||o.service,j=u?.version||o.version,N=u?.context;N&&b.setContext(N);const T={id:f,name:C,startClocks:l,service:E,version:j,context:N};e.notify(1,T),e.notify(2,T);const{throttled:k,cancel:A}=zg($,qW,{leading:!1}),{setLoadEvent:I,setViewEnd:P,stop:L,stopINPTracking:V,getCommonViewMetrics:ie}=BW(e,t,n,o,re,i,l),{stop:se,initialViewMetrics:ue}=i===Xi.INITIAL_LOAD?_W(o,l,I,re):{stop:Tt,initialViewMetrics:{}};i===Xi.BF_CACHE&&GW(l,ue,re);const{stop:le,eventCounts:ce}=cW(e,f,re),M=du($,KW),K=e.subscribe(11,H=>{H.reason===Cc.UNLOADING&&$()});$(),b.changeObservable.subscribe(re);function U(){e.notify(3,{id:f,name:C,context:b.getContext(),startClocks:l,sessionIsActive:S})}function re(){U(),k()}function $(){A(),U(),g+=1;const H=v===void 0?Hn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:j,context:b.getContext(),loadingType:i,location:x,startClocks:l,commonViewMetrics:ie(),initialViewMetrics:ue,duration:Jt(l.timeStamp,H),isActive:v===void 0,sessionIsActive:S,eventCounts:ce})}return{get name(){return C},service:E,version:j,contextManager:b,stopObservable:m,end(H={}){var W,B;v||(v=(W=H.endClocks)!==null&&W!==void 0?W:qn(),S=(B=H.sessionIsActive)!==null&&B!==void 0?B:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Dg(M),P(v.relative),L(),K.unsubscribe(),$(),ar(()=>{this.stop()},ZW))},stop(){se(),le(),V(),m.notify()},addTiming(H,W){if(v)return;const B=$q(W)?W:Jt(l.timeStamp,W);p[WW(H)]=B,re()},setViewName(H){C=H,$()}}}function WW(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function QW(e,t){return e.pathname!==t.pathname||!JW(t.hash)&&sk(t.hash)!==sk(e.hash)}function JW(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function sk(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function eQ(e,t,n,o,r,i,l,u,f,m){return e.subscribe(4,p=>e.notify(12,tQ(p,n,u))),t.register(0,({startTime:p,eventType:g})=>{const v=f.findView(p);return v?{type:g,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Zs}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),YW(o,e,r,i,n,l,!n.trackViewsManually,m)}function tQ(e,t,n){var o,r,i,l,u,f,m,p,g,v,x,b,S,C,E,j,N,T;const k=n.getReplayStats(e.id),A=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:k,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:it.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:ot((l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.time),cumulative_layout_shift_target_selector:(u=e.commonViewMetrics.cumulativeLayoutShift)===null||u===void 0?void 0:u.targetSelector,first_byte:ot((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:ot((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:ot((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ot((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ot(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ot((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ot((x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:ot((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ot((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ot((j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.value),largest_contentful_paint_target_selector:(N=e.initialViewMetrics.largestContentfulPaint)===null||N===void 0?void 0:N.targetSelector,load_event:ot((T=e.initialViewMetrics.navigationTimings)===null||T===void 0?void 0:T.loadEvent),loading_time:J$(ot(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:nQ(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ot(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:ot(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:VZ()}};return al(e.customTimings)||(I.view.custom_timings=UI(e.customTimings,ot)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function nQ({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:ot(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ot(n)},fid:o&&{duration:ot(o.delay),timestamp:ot(o.time),target_selector:o.targetSelector},inp:t&&{duration:ot(t.value),timestamp:ot(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:ot(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const rQ="rum";function oQ(e,t,n){const o=oZ(e,rQ,r=>sQ(e,r),n);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:r,newState:i})=>{if(!r.forcedReplay&&i.forcedReplay){const l=o.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:r=>{const i=o.findSession(r);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function iQ(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:y$("records")?1:0};return{findTrackedSession:()=>e,expire:Tt,expireObservable:new xt,setForcedReplay:Tt}}function sQ(e,t){return aQ(t)?t:es(e.sessionSampleRate)?es(e.sessionReplaySampleRate)?"1":"2":"0"}function aQ(e){return e==="0"||e==="1"||e==="2"}function lQ(e,t,n,o,r,i){const l=[e.rumEndpointBuilder];e.replica&&l.push(e.replica.rumEndpointBuilder);const u=b$({encoder:i(2),request:v$(l,e.batchBytesLimit,n),flushController:x$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===it.VIEW?u.upsert(f,f.view.id):u.add(f)}),u}function cQ(e){const t=$f();e.subscribe(13,n=>{t.send("rum",n)})}const uQ=ll;function dQ(e,t,n,o){const r=pu({expireDelay:uQ});let i;e.subscribe(1,({startClocks:f})=>{const m=o.href;r.add(u({url:m,referrer:i||document.referrer}),f.relative),i=m}),e.subscribe(6,({endClocks:f})=>{r.closeActive(f.relative)});const l=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=ro();r.closeActive(p),r.add(u({url:f.href,referrer:m.referrer}),p)}});function u({url:f,referrer:m}){return{url:f,referrer:m}}return t.register(0,({startTime:f,eventType:m})=>{const p=r.find(f);return p?{type:m,view:{url:p.url,referrer:p.referrer}}:Zs}),{findUrl:f=>r.find(f),stop:()=>{l.unsubscribe(),r.stop()}}}function fQ(e,t){let n=of(t);return new xt(o=>{const{stop:r}=mQ(e,l),{stop:i}=hQ(e,l);function l(){if(n.href===t.href)return;const u=of(t);o.notify({newLocation:u,oldLocation:n}),n=u}return()=>{r(),i()}})}function mQ(e,t){const{stop:n}=xi(ak("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=xi(ak("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Qt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function hQ(e,t){return Qt(e,window,"hashchange",t)}function ak(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const pQ=ll;function gQ(e,t,n){const o=pu({expireDelay:pQ});return e.subscribe(1,({startClocks:r})=>{o.add({},r.relative)}),e.subscribe(6,({endClocks:r})=>{o.closeActive(r.relative)}),t.register(0,({startTime:r,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat([it.VIEW,it.ERROR]).includes(i))return oo;const u=o.find(r);return!u||al(u)?oo:{type:i,feature_flags:u}}),{addFeatureFlagEvaluation:(r,i)=>{const l=o.find();l&&(l[r]=i)}}}const vQ=10*cr;let Ec,Mh;function yQ(e,t,n,o){t.enabled&&es(e.customerDataTelemetrySampleRate)&&(wM(),Mh=!1,n.subscribe(13,()=>{Mh=!0}),o.subscribe(({bytesCount:i,messagesCount:l})=>{Mh&&(Mh=!1,Ec.batchCount+=1,ck(Ec.batchBytesCount,i),ck(Ec.batchMessagesCount,l))}),du(bQ,vQ))}function bQ(){Ec.batchCount!==0&&(ES("Customer data measures",Ec),wM())}function lk(){return{min:1/0,max:0,sum:0}}function ck(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function wM(){Ec={batchCount:0,batchBytesCount:lk(),batchMessagesCount:lk()}}const xQ=4e3,_Q=500,wQ=ll;function SQ(e,t,n=_Q){const o=pu({expireDelay:wQ,maxEntries:xQ});let r;dl(wt.VISIBILITY_STATE)&&performance.getEntriesByType(wt.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";l(p,m.startTime)}),l(SM(),ro());const{stop:i}=Ks(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{l(EQ(f),f.timeStamp)},{capture:!0});function l(f,m=ro()){f!==r&&(r=f,o.closeActive(m),o.add({state:r,startTime:m},m))}function u(f,m,p){return o.findAll(m,p).some(g=>g.state===f)}return e.register(0,({startTime:f,duration:m=0,eventType:p})=>{if(p===it.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:CQ(g,f,n)}}}return p===it.ACTION||p===it.ERROR?{type:p,view:{in_foreground:u("active",f,0)}}:oo}),{wasInPageStateDuringPeriod:u,addPageState:l,stop:()=>{i(),o.stop()}}}function CQ(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:ot(Jt(t,r))}))}function EQ(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":SM()}function SM(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function RQ(e,t){let n;const o=requestAnimationFrame(tt(()=>{n=PS()})),r=DW(t).subscribe(i=>{n=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:n?{viewport:n}:void 0})),{stop:()=>{r(),o&&cancelAnimationFrame(o)}}}function jQ(e,t){const n=window.cookieStore?NQ(e):kQ;return new xt(o=>n(t,r=>o.notify(r)))}function NQ(e){return(t,n)=>Qt(e,window.cookieStore,"change",r=>{const i=r.changed.find(l=>l.name===t)||r.deleted.find(l=>l.name===t);i&&n(i.value)}).stop}const TQ=cr;function kQ(e,t){const n=sf(document.cookie,e),o=du(()=>{const r=sf(document.cookie,e);r!==n&&t(r)},TQ);return()=>{Dg(o)}}const uk="datadog-ci-visibility-test-execution-id";function OQ(e,t,n=jQ(e,uk)){var o;let r=Ds(uk)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(l=>{r=l});return t.register(0,({eventType:l})=>typeof r!="string"?oo:{type:l,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function AQ(e,t){const n=Si(t,{type:wt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=Pg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:D$.LONG_ANIMATION_FRAME,duration:ot(r.duration),blocking_duration:ot(r.blockingDuration),first_ui_event_timestamp:ot(r.firstUIEventTimestamp),render_start:ot(r.renderStart),style_and_layout_start:ot(r.styleAndLayoutStart),start_time:ot(r.startTime),scripts:r.scripts.map(u=>({duration:ot(u.duration),pause_duration:ot(u.pauseDuration),forced_style_and_layout_duration:ot(u.forcedStyleAndLayoutDuration),start_time:ot(u.startTime),execution_start:ot(u.executionStart),source_url:u.sourceURL,source_function_name:u.sourceFunctionName,source_char_position:u.sourceCharPosition,invoker:u.invoker,invoker_type:u.invokerType,window_attribution:u.windowAttribution}))},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function IQ(e,t){const n=Si(t,{type:wt.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==wt.LONG_TASK||!t.trackLongTasks)break;const i=Pg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:D$.LONG_TASK,duration:ot(r.duration)},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function $Q(e){e.register(0,({eventType:t})=>{if(!A$())return oo;const n=k$(),o=O$();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:T$()}}})}function MQ(e,t,n){const o=SS(e),r=n(o);return bS(t).forEach(([i,l])=>aw(e,o,i.split(/\.|(?=\[\])/),l)),r}function aw(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((l,u)=>aw(l,t[u],i,o));return}if(!(!dk(e)||!dk(t))){if(i.length>0)return aw(e[r],t[r],i,o);PQ(e,r,t[r],o)}}function PQ(e,t,n,o){const r=ul(n);r===o?e[t]=dn(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function dk(e){return ul(e)==="object"}const ac={"view.name":"string","view.url":"string","view.referrer":"string"},lc={context:"object"},cc={service:"string",version:"string"};let CM;function DQ(e,t,n,o){CM={[it.VIEW]:{"view.performance.lcp.resource_url":"string",...lc,...ac,...cc},[it.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...lc,...ac,...cc},[it.RESOURCE]:{"resource.url":"string",...Fg(Xa.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...lc,...ac,...cc},[it.ACTION]:{"action.target.name":"string",...lc,...ac,...cc},[it.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...lc,...ac,...cc},[it.VITAL]:{...lc,...ac,...cc}};const r={[it.ERROR]:Ox(it.ERROR,e.eventRateLimiterThreshold,o),[it.ACTION]:Ox(it.ACTION,e.eventRateLimiterThreshold,o),[it.VITAL]:Ox(it.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:l,rawRumEvent:u,domainContext:f})=>{const m=n.triggerHook(0,{eventType:u.type,startTime:i,duration:l});if(m===Zs)return;const p=ns(m,u,{ddtags:DK(e).join(",")});zQ(p,e.beforeSend,f,r)&&(al(p.context)&&delete p.context,t.notify(13,p))})}function zQ(e,t,n,o){var r;if(t){const l=MQ(e,CM[e.type],u=>t(u,n));if(l===!1&&e.type!==it.VIEW)return!1;l===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function UQ(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const l=t.findTrackedSession(i),u=o.findView(i);if(!l||!u)return Zs;let f,m,p;return r===it.VIEW?(f=n.getReplayStats(u.id)?!0:void 0,m=l.sessionReplay===1,p=u.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:l.id,type:"user",has_replay:f,sampled_for_replay:m,is_active:p}}}),e.register(1,({startTime:r})=>{const i=t.findTrackedSession(r);return i?{session:{id:i.id}}:oo})}function LQ(e){e.register(0,({eventType:t})=>({type:t,connectivity:c$()}))}function FQ(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:Aq(),configuration:{session_sample_rate:Kd(t.sessionSampleRate,3),session_replay_sample_rate:Kd(t.sessionReplaySampleRate,3),profiling_sample_rate:Kd(t.profilingSampleRate,3)},browser_sdk_version:Hc()?"6.19.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Hn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function VQ(e,t){e.register(1,()=>t.isGranted()?oo:Zs)}const BQ=eK,HQ=[it.ACTION,it.ERROR,it.LONG_TASK,it.RESOURCE,it.VITAL];function GQ(e){return{addEvent:(t,n,o,r)=>{HQ.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}const qQ="Initial view metrics";function KQ(e,t,n){if(!(n.enabled&&es(e.initialViewMetricsTelemetrySampleRate)))return{stop:Tt};const{unsubscribe:r}=t.subscribe(4,({initialViewMetrics:i})=>{!i.largestContentfulPaint||!i.navigationTimings||(ES(qQ,{metrics:ZQ(i.largestContentfulPaint,i.navigationTimings)}),r())});return{stop:r}}function ZQ(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function YQ(e,t,n,o,r,i,l,u,f){const m=[],p=new CY,g=BQ();p.subscribe(13,fe=>l$("rum",fe));const v=fe=>{p.notify(14,{error:fe}),ra("Error reported to customer",{"error.message":fe.message})},x=Q7(e),b=x.subscribe(fe=>{p.notify(11,fe)});m.push(()=>b.unsubscribe());const S=rK("browser-rum-sdk",e,g,v,x,r);m.push(S.stop);const C=Hc()?iQ():oQ(e,p,i);if(Hc())cQ(p);else{const fe=lQ(e,p,v,x,C.expireObservable,r);m.push(()=>fe.stop()),yQ(e,S,p,fe.flushController.flushObservable)}const E=xY(),j=fQ(e,location),{observable:N,stop:T}=wY();m.push(T),FQ(g,e,f);const k=SQ(g,e),A=RY(p);m.push(()=>A.stop());const I=dQ(p,g,j,location);m.push(()=>I.stop());const P=gQ(p,g,e);UQ(g,C,t,A),LQ(g),VQ(g,i);const L=DZ(g,e,"rum"),V=zZ(g,e,C,"rum"),ie=PZ(g,e,"rum"),{actionContexts:se,addAction:ue,addEvent:le,stop:ce}=XQ(p,g,e,k,E,N,v);m.push(ce);const{addTiming:M,startView:K,setViewName:U,setViewContext:re,setViewContextProperty:$,getViewContext:H,stop:W}=eQ(p,g,e,location,E,N,j,t,A,o);m.push(W);const{stop:B}=KQ(e,p,S);m.push(B);const{stop:J}=tW(p,e,k);if(m.push(J),e.trackLongTasks)if(dl(wt.LONG_ANIMATION_FRAME)){const{stop:fe}=AQ(p,e);m.push(fe)}else IQ(p,e);const{addError:ge}=FX(p,e,u);u.unbuffer(),zY(p,e,C,V,ie);const ye=HZ(p,k,l),ae=SY(e.applicationId,C,A,se,I);return m.push(()=>n.stop()),{addAction:ue,addEvent:le,addError:ge,addTiming:M,addFeatureFlagEvaluation:P.addFeatureFlagEvaluation,startView:K,setViewContext:re,setViewContextProperty:$,getViewContext:H,setViewName:U,lifeCycle:p,viewHistory:A,session:C,stopSession:()=>C.expire(),getInternalContext:ae.get,startDurationVital:ye.startDurationVital,stopDurationVital:ye.stopDurationVital,addDurationVital:ye.addDurationVital,globalContext:L,userContext:V,accountContext:ie,telemetry:S,stop:()=>{m.forEach(fe=>fe())},hooks:g}}function XQ(e,t,n,o,r,i,l){const u=zX(e,t,r,i,n),f=GQ(e),m=RQ(t,n),p=OQ(n,t);return $Q(t),DQ(n,e,t,l),{pageStateHistory:o,addAction:u.addAction,addEvent:f.addEvent,actionContexts:u.actionContexts,stop:()=>{u.stop(),p.stop(),m.stop(),o.stop()}}}function WQ(e,{session:t,viewContext:n,errorType:o}){const r=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const l=QQ(e),u=`/rum/replay/sessions/${r}`;return`${l}${u}?${i.join("&")}`}function QQ(e){const t=e.site,n=e.subdomain||JQ(e);return`https://${n?`${n}.`:""}${t}`}function JQ(e){switch(e.site){case $a:case $7:return"app";case a$:return"dd";default:return}}const eJ=1e3;let So;function Cbe(e){return qg(e).segments_count}function Ebe(e){qg(e).segments_count+=1}function Rbe(e){qg(e).records_count+=1}function jbe(e,t){qg(e).segments_total_raw_size+=t}function tJ(e){return So?.get(e)}function qg(e){So||(So=new Map);let t;return So.has(e)?t=So.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},So.set(e,t),So.size>eJ&&nJ()),t}function nJ(){if(!So)return;const e=So.keys().next().value;e&&So.delete(e)}function EM(e,t,n){let o=0,r=[],i,l=!0,u=0;const f=[],{stop:m}=Qt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const x=f[0];x&&(x.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,x.writeCallback?x.writeCallback(v.result.byteLength):x.finishCallback&&x.finishCallback()):x.id<v.id&&(m(),ra("Worker responses received out of order.")))});function p(){const v=r.length===0?new Uint8Array(0):Pq(r.concat(i)),x={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],x}function g(){l||(t.postMessage({action:"reset",streamId:n}),l=!0)}return{isAsync:!0,get isEmpty(){return l},write(v,x){t.postMessage({action:"write",id:u,data:v,streamId:n}),f.push({id:u,writeCallback:x,data:v}),l=!1,u+=1},finish(v){g(),f.length?(f.forEach(x=>{delete x.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(x=>x.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function DS({configuredUrl:e,error:t,source:n,scriptType:o}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&rJ(t.message)){let r;e?r=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:r="Please make sure CSP is correctly configured.",ht.error(`${r} See documentation at ${Mg}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&CS(t)}function rJ(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const oJ=30*cr;function RM(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.19.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let fn={status:0};function jM(e,t,n,o=RM){switch(fn.status===0&&iJ(e,t,o),fn.status){case 1:return fn.initializationFailureCallbacks.push(n),fn.worker;case 3:return fn.worker}}function fk(){return fn.status}function iJ(e,t,n=RM){try{const o=n(e),{stop:r}=Qt(e,o,"error",u=>{Bx(e,t,u)}),{stop:i}=Qt(e,o,"message",({data:u})=>{u.type==="errored"?Bx(e,t,u.error,u.streamId):u.type==="initialized"&&aJ(u.version)});o.postMessage({action:"init"}),ar(()=>sJ(t),oJ),fn={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){Bx(e,t,o)}}function sJ(e){fn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),fn.initializationFailureCallbacks.forEach(t=>t()),fn={status:2})}function aJ(e){fn.status===1&&(fn={status:3,worker:fn.worker,stop:fn.stop,version:e})}function Bx(e,t,n,o){fn.status===1||fn.status===0?(DS({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),fn.status===1&&fn.initializationFailureCallbacks.forEach(r=>r()),fn={status:2}):CS(n,{worker_version:fn.status===3&&fn.version,stream_id:o})}function NM(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function lJ(e,t,n,o){const r=t.findTrackedSession(),i=cJ(r,o),l=n.findView();return WQ(e,{viewContext:l,errorType:i,session:r})}function cJ(e,t){if(!NM())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}const uJ="Recorder init metrics";function dJ(e,t,n){if(!(t.enabled&&es(e.replayTelemetrySampleRate)))return{stop:Tt};let r,i,l;const{unsubscribe:u}=n.subscribe(f=>{switch(f.type){case"start":r={forced:f.forced,timestamp:Hn()},i=void 0,l=void 0;break;case"document-ready":r&&(i=Jt(r.timestamp,Hn()));break;case"recorder-settled":r&&(l=Jt(r.timestamp,Hn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":u(),r&&ES(uJ,{metrics:fJ(r.forced,l,Jt(r.timestamp,Hn()),f.type,i)});break}});return{stop:u}}function fJ(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function mJ(e,t,n,o,r,i,l){let u=0,f;t.subscribe(9,()=>{(u===2||u===3)&&(v(),u=1)}),t.subscribe(10,()=>{u===1&&g()});const m=new xt;dJ(e,l,m);const p=async x=>{m.notify({type:"start",forced:x});const[b]=await Promise.all([mk(m,{type:"recorder-settled"},r()),mk(m,{type:"document-ready"},dZ(e,"interactive"))]);if(u!==2){m.notify({type:"aborted"});return}if(!b){u=0,m.notify({type:"recorder-load-failed"});return}const S=i();if(!S){u=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=b(t,e,n,o,S,l)),u=3,m.notify({type:"succeeded"})};function g(x){const b=n.findTrackedSession();if(hJ(b,x)){u=1;return}if(pJ(u))return;u=2;const S=gJ(b,x)||!1;p(S).catch(Fc),S&&n.setForcedReplay()}function v(){u===3&&f?.(),u=0}return{start:g,stop:v,getSessionReplayLink(){return lJ(e,n,o,u!==0)},isRecording:()=>u===3}}function hJ(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function pJ(e){return e===2||e===3}function gJ(e,t){return t&&t.force&&e.sessionReplay===0}async function mk(e,t,n){try{return await n}finally{e.notify(t)}}function vJ(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Tt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function yJ(e,t){if(Hc()&&!y$("records")||!NM())return{start:Tt,stop:Tt,getReplayStats:()=>{},onRumStart:Tt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=vJ();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>fk()===3&&n.isRecording(),getReplayStats:i=>fk()===3?tJ(i):void 0};function r(i,l,u,f,m,p){let g;function v(){return g||(m??(m=jM(l,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=EM(l,m,1))),g}n=mJ(l,i,u,f,e,v,p),o(l)&&n.start()}}const bJ="modulepreload",xJ=function(e){return"/"+e},hk={},zS=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");r=f(n.map(m=>{if(m=xJ(m),m in hk)return;hk[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":bJ,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((x,b)=>{v.addEventListener("load",x),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return r.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function _J(e=wJ){try{return await e()}catch(t){DS({error:t,source:"Recorder",scriptType:"module"})}}async function wJ(){return(await zS(()=>import("./startRecording-C6eEOH0W.js"),[])).startRecording}function SJ(){return Wo().Profiler!==void 0}const CJ=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==it.VIEW&&n!==it.LONG_TASK?oo:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function EJ(e=RJ){try{return await e()}catch(t){DS({error:t,source:"Profiler",scriptType:"module"})}}async function RJ(){return(await zS(()=>import("./profiler-B1-1lWIR.js"),[])).createRumProfiler}function jJ(){let e;function t(n,o,r,i,l){const u=i.findTrackedSession();if(!u||!V$(u.id,r.profilingSampleRate))return;const f=CJ(o);if(!SJ()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}EJ().then(m=>{if(!m){ra("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(r,n,i,f),e.start(l.findView())}).catch(Fc)}return{onRumStart:t,stop:()=>{e?.stop().catch(Fc)}}}const NJ=yJ(_J),TJ=jJ(),kJ=yY(YQ,NJ,TJ,{startDeflateWorker:jM,createDeflateEncoder:EM,sdkName:"rum"});GK(Wo(),"DD_RUM",kJ);function hp(e,t){lf("react error"),qn()}const pk={didCatch:!1,error:null};class Nbe extends q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(pk)},this.state=pk}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){hp()}render(){return this.state.didCatch?q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let gk=!1;function OJ(){_.useEffect(()=>{gk||(gk=!0)},[])}function AJ(){return c.jsx(c.Fragment,{children:c.jsx(ss,{})})}const Kg=S9()({component:AJ});function IJ(e,t){const n=_.createContext(t),o=i=>{const{children:l,...u}=i,f=_.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:f,children:l})};o.displayName=e+"Provider";function r(i){const l=_.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Qo(e,t=[]){let n=[];function o(i,l){const u=_.createContext(l),f=n.length;n=[...n,l];const m=g=>{const{scope:v,children:x,...b}=g,S=v?.[e]?.[f]||u,C=_.useMemo(()=>b,Object.values(b));return c.jsx(S.Provider,{value:C,children:x})};m.displayName=i+"Provider";function p(g,v){const x=v?.[e]?.[f]||u,b=_.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(l=>_.createContext(l));return function(u){const f=u?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return r.scopeName=e,[o,$J(r,...t)]}function $J(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const l=o.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var MJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=MJ.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:l,...u}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...u,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function zp(e,t){e&&lu.flushSync(()=>e.dispatchEvent(t))}var En=globalThis?.document?_.useLayoutEffect:()=>{},PJ=pA[" useInsertionEffect ".trim().toString()]||En;function Ci({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,l]=DJ({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:r;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const g=p.current;g!==u&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${u?"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.`),p.current=u},[u,o])}const m=_.useCallback(p=>{if(u){const g=zJ(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[u,e,i,l]);return[f,m]}function DJ({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return PJ(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function zJ(e){return typeof e=="function"}var UJ=_.createContext(void 0);function gu(e){const t=_.useContext(UJ);return e||t||"ltr"}function LJ(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Dn=e=>{const{present:t,children:n}=e,o=FJ(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=st(o.ref,VJ(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Dn.displayName="Presence";function FJ(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[u,f]=LJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Ph(o.current);i.current=u==="mounted"?m:"none"},[u]),En(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,x=Ph(m);e?f("MOUNT"):x==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),En(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=x=>{const S=Ph(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(f("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=x=>{x.target===t&&(i.current=Ph(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Ph(e){return e?.animationName||"none"}function VJ(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 BJ=pA[" useId ".trim().toString()]||(()=>{}),HJ=0;function Xr(e){const[t,n]=_.useState(BJ());return En(()=>{n(o=>o??String(HJ++))},[e]),t?`radix-${t}`:""}function Pf(e){const t=e+"CollectionProvider",[n,o]=Qo(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:E}=S,j=q.useRef(null),N=q.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:N,collectionRef:j,children:E})};l.displayName=t;const u=e+"CollectionSlot",f=Ba(u),m=q.forwardRef((S,C)=>{const{scope:E,children:j}=S,N=i(u,E),T=st(C,N.collectionRef);return c.jsx(f,{ref:T,children:j})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Ba(p),x=q.forwardRef((S,C)=>{const{scope:E,children:j,...N}=S,T=q.useRef(null),k=st(C,T),A=i(p,E);return q.useEffect(()=>(A.itemMap.set(T,{ref:T,...N}),()=>void A.itemMap.delete(T))),c.jsx(v,{[g]:"",ref:k,children:j})});x.displayName=p;function b(S){const C=i(e+"CollectionConsumer",S);return q.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,I)=>N.indexOf(A.ref.current)-N.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:m,ItemSlot:x},b,o]}function Kt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function GJ(e,t=globalThis?.document){const n=Kt(e);_.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var qJ="DismissableLayer",lw="dismissableLayer.update",KJ="dismissableLayer.pointerDownOutside",ZJ="dismissableLayer.focusOutside",vk,TM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...f}=e,m=_.useContext(TM),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,x]=_.useState({}),b=st(t,I=>g(I)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),j=p?S.indexOf(p):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,T=j>=E,k=WJ(I=>{const P=I.target,L=[...m.branches].some(V=>V.contains(P));!T||L||(r?.(I),l?.(I),I.defaultPrevented||u?.())},v),A=QJ(I=>{const P=I.target;[...m.branches].some(V=>V.contains(P))||(i?.(I),l?.(I),I.defaultPrevented||u?.())},v);return GJ(I=>{j===m.layers.size-1&&(o?.(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(vk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),yk(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=vk)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),yk())},[p,m]),_.useEffect(()=>{const I=()=>x({});return document.addEventListener(lw,I),()=>document.removeEventListener(lw,I)},[]),c.jsx(De.div,{...f,ref:b,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,k.onPointerDownCapture)})});vu.displayName=qJ;var YJ="DismissableLayerBranch",XJ=_.forwardRef((e,t)=>{const n=_.useContext(TM),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(De.div,{...e,ref:r})});XJ.displayName=YJ;function WJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let f=function(){kM(KJ,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function QJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&kM(ZJ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function yk(){const e=new CustomEvent(lw);document.dispatchEvent(e)}function kM(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?zp(r,i):r.dispatchEvent(i)}function OM(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var AM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),JJ="VisuallyHidden",IM=_.forwardRef((e,t)=>c.jsx(De.span,{...e,ref:t,style:{...AM,...e.style}}));IM.displayName=JJ;var $M=IM,fl="NavigationMenu",[US,MM,eee]=Pf(fl),[cw,tee,nee]=Pf(fl),[LS,Tbe]=Qo(fl,[eee,nee]),[ree,Oo]=LS(fl),[oee,iee]=LS(fl),PM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:l=200,skipDelayDuration:u=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),x=st(t,L=>v(L)),b=gu(m),S=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[j,N]=_.useState(!0),[T,k]=Ci({prop:o,onChange:L=>{const V=L!=="",ie=u>0;V?(window.clearTimeout(E.current),ie&&N(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>N(!0),u)),r?.(L)},defaultProp:i??"",caller:fl}),A=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(""),150)},[k]),I=_.useCallback(L=>{window.clearTimeout(C.current),k(L)},[k]),P=_.useCallback(L=>{T===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),k(L)},l)},[T,k,l]);return _.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(DM,{scope:n,isRootMenu:!0,value:T,dir:b,orientation:f,rootNavigationMenu:g,onTriggerEnter:L=>{window.clearTimeout(S.current),j?P(L):I(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),A()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:A,onItemSelect:L=>{k(V=>V===L?"":L)},onItemDismiss:()=>k(""),children:c.jsx(De.nav,{"aria-label":"Main","data-orientation":f,dir:b,...p,ref:x})})});PM.displayName=fl;var uw="NavigationMenuSub",see=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",...u}=e,f=Oo(uw,n),[m,p]=Ci({prop:o,onChange:r,defaultProp:i??"",caller:uw});return c.jsx(DM,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:l,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(De.div,{"data-orientation":l,...u,ref:t})})});see.displayName=uw;var DM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:l,value:u,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:x}=e,[b,S]=_.useState(null),[C,E]=_.useState(new Map),[j,N]=_.useState(null);return c.jsx(ree,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:u,previousValue:OM(u),baseId:Xr(),dir:r,orientation:i,viewport:b,onViewportChange:S,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:Kt(p),onTriggerLeave:Kt(g),onContentEnter:Kt(v),onContentLeave:Kt(x),onItemSelect:Kt(f),onItemDismiss:Kt(m),onViewportContentChange:_.useCallback((T,k)=>{E(A=>(A.set(T,k),new Map(A)))},[]),onViewportContentRemove:_.useCallback(T=>{E(k=>k.has(T)?(k.delete(T),new Map(k)):k)},[]),children:c.jsx(US.Provider,{scope:t,children:c.jsx(oee,{scope:t,items:C,children:l})})})},zM="NavigationMenuList",UM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Oo(zM,n),i=c.jsx(De.ul,{"data-orientation":r.orientation,...o,ref:t});return c.jsx(De.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:c.jsx(US.Slot,{scope:n,children:r.isRootMenu?c.jsx(qM,{asChild:!0,children:i}):i})})});UM.displayName=zM;var LM="NavigationMenuItem",[aee,FM]=LS(LM),VM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=Xr(),l=o||i||"LEGACY_REACT_AUTO_VALUE",u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((b="start")=>{if(u.current){p.current();const S=fw(u.current);S.length&&BS(b==="start"?S:S.reverse())}},[]),x=_.useCallback(()=>{if(u.current){const b=fw(u.current);b.length&&(p.current=vee(b))}},[]);return c.jsx(aee,{scope:n,value:l,triggerRef:f,contentRef:u,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:x,onContentFocusOutside:x,children:c.jsx(De.li,{...r,ref:t})})});VM.displayName=LM;var dw="NavigationMenuTrigger",lee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=Oo(dw,e.__scopeNavigationMenu),l=FM(dw,e.__scopeNavigationMenu),u=_.useRef(null),f=st(u,l.triggerRef,t),m=ZM(i.baseId,l.value),p=YM(i.baseId,l.value),g=_.useRef(!1),v=_.useRef(!1),x=l.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(US.ItemSlot,{scope:n,value:l.value,children:c.jsx(KM,{asChild:!0,children:c.jsx(De.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":HS(x),"aria-expanded":x,"aria-controls":p,...r,ref:f,onPointerEnter:Se(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:Se(e.onPointerMove,Up(()=>{o||v.current||l.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(l.value),g.current=!0)})),onPointerLeave:Se(e.onPointerLeave,Up(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:Se(e.onClick,()=>{i.onItemSelect(l.value),v.current=x}),onKeyDown:Se(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];x&&b.key===C&&(l.onEntryKeyDown(),b.preventDefault())})})})}),x&&c.jsxs(c.Fragment,{children:[c.jsx($M,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:b=>{const S=l.contentRef.current,C=b.relatedTarget,E=C===u.current,j=S?.contains(C);(E||!j)&&l.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});lee.displayName=dw;var cee="NavigationMenuLink",bk="navigationMenu.linkSelect",BM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(KM,{asChild:!0,children:c.jsx(De.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:Se(e.onClick,l=>{const u=l.target,f=new CustomEvent(bk,{bubbles:!0,cancelable:!0});if(u.addEventListener(bk,m=>r?.(m),{once:!0}),zp(u,f),!f.defaultPrevented&&!l.metaKey){const m=new CustomEvent(pp,{bubbles:!0,cancelable:!0});zp(u,m)}},{checkForDefaultPrevented:!1})})})});BM.displayName=cee;var FS="NavigationMenuIndicator",uee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Oo(FS,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?hS.createPortal(c.jsx(Dn,{present:n||i,children:c.jsx(dee,{...o,ref:t})}),r.indicatorTrack):null});uee.displayName=FS;var dee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Oo(FS,n),i=MM(n),[l,u]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const b=i().find(S=>S.value===r.value)?.ref.current;b&&u(b)},[i,r.value]);const v=()=>{l&&m({size:p?l.offsetWidth:l.offsetHeight,offset:p?l.offsetLeft:l.offsetTop})};return mw(l,v),mw(r.indicatorTrack,v),f?c.jsx(De.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...p?{left:0,width:f.size+"px",transform:`translateX(${f.offset}px)`}:{top:0,height:f.size+"px",transform:`translateY(${f.offset}px)`},...o.style}}):null}),Gc="NavigationMenuContent",fee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Oo(Gc,e.__scopeNavigationMenu),i=FM(Gc,e.__scopeNavigationMenu),l=st(i.contentRef,t),u=i.value===r.value,f={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.jsx(mee,{forceMount:n,...f,ref:l}):c.jsx(Dn,{present:n||u,children:c.jsx(HM,{"data-state":HS(u),...f,ref:l,onPointerEnter:Se(e.onPointerEnter,r.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Up(r.onContentLeave)),style:{pointerEvents:!u&&r.isRootMenu?"none":void 0,...f.style}})})});fee.displayName=Gc;var mee=_.forwardRef((e,t)=>{const n=Oo(Gc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return En(()=>{o(e.value,{ref:t,...e})},[e,t,o]),En(()=>()=>r(e.value),[e.value,r]),null}),pp="navigationMenu.rootContentDismiss",HM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:l,onRootContentClose:u,onContentFocusOutside:f,...m}=e,p=Oo(Gc,n),g=_.useRef(null),v=st(g,t),x=ZM(p.baseId,o),b=YM(p.baseId,o),S=MM(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const N=g.current;if(p.isRootMenu&&N){const T=()=>{E(),u(),N.contains(document.activeElement)&&r.current?.focus()};return N.addEventListener(pp,T),()=>N.removeEventListener(pp,T)}},[p.isRootMenu,e.value,r,E,u]);const j=_.useMemo(()=>{const T=S().map(V=>V.value);p.dir==="rtl"&&T.reverse();const k=T.indexOf(p.value),A=T.indexOf(p.previousValue),I=o===p.value,P=A===T.indexOf(o);if(!I&&!P)return C.current;const L=(()=>{if(k!==A){if(I&&A!==-1)return k>A?"from-end":"from-start";if(P&&k!==-1)return k>A?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,o]);return c.jsx(qM,{asChild:!0,children:c.jsx(vu,{id:b,"aria-labelledby":x,"data-motion":j,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const N=new Event(pp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(N)},onFocusOutside:Se(e.onFocusOutside,N=>{f();const T=N.target;p.rootNavigationMenu?.contains(T)&&N.preventDefault()}),onPointerDownOutside:Se(e.onPointerDownOutside,N=>{const T=N.target,k=S().some(I=>I.ref.current?.contains(T)),A=p.isRootMenu&&p.viewport?.contains(T);(k||A||!p.isRootMenu)&&N.preventDefault()}),onKeyDown:Se(e.onKeyDown,N=>{const T=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!T){const A=fw(N.currentTarget),I=document.activeElement,P=A.findIndex(ie=>ie===I),V=N.shiftKey?A.slice(0,P).reverse():A.slice(P+1,A.length);BS(V)?N.preventDefault():i.current?.focus()}}),onEscapeKeyDown:Se(e.onEscapeKeyDown,N=>{l.current=!0})})})}),VS="NavigationMenuViewport",GM=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!Oo(VS,e.__scopeNavigationMenu).value;return c.jsx(Dn,{present:n||i,children:c.jsx(hee,{...o,ref:t})})});GM.displayName=VS;var hee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=Oo(VS,n),l=st(t,i.onViewportChange),u=iee(Gc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,x=f?f?.height+"px":void 0,b=!!i.value,S=b?i.value:i.previousValue;return mw(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(De.div,{"data-state":HS(b),"data-orientation":i.orientation,...r,ref:l,style:{pointerEvents:!b&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":x,...r.style},onPointerEnter:Se(e.onPointerEnter,i.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Up(i.onContentLeave)),children:Array.from(u.items).map(([E,{ref:j,forceMount:N,...T}])=>{const k=S===E;return c.jsx(Dn,{present:N||k,children:c.jsx(HM,{...T,ref:xf(j,A=>{k&&A&&g(A)})})},E)})})}),pee="FocusGroup",qM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Oo(pee,n);return c.jsx(cw.Provider,{scope:n,children:c.jsx(cw.Slot,{scope:n,children:c.jsx(De.div,{dir:r.dir,...o,ref:t})})})}),xk=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],gee="FocusGroupItem",KM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=tee(n),i=Oo(gee,n);return c.jsx(cw.ItemSlot,{scope:n,children:c.jsx(De.button,{...o,ref:t,onKeyDown:Se(e.onKeyDown,l=>{if(["Home","End",...xk].includes(l.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(l.key)&&f.reverse(),xk.includes(l.key)){const g=f.indexOf(l.currentTarget);f=f.slice(g+1)}setTimeout(()=>BS(f)),l.preventDefault()}})})})});function fw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function BS(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function vee(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function mw(e,t){const n=Kt(t);En(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function HS(e){return e?"open":"closed"}function ZM(e,t){return`${e}-trigger-${t}`}function YM(e,t){return`${e}-content-${t}`}function Up(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yee=PM,bee=UM,xee=VM,_ee=BM,wee=GM;function See({className:e,...t}){return c.jsx("div",{className:Me("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(wee,{"data-slot":"navigation-menu-viewport",className:Me("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function XM({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(yee,{"data-slot":"navigation-menu","data-viewport":n,className:Me("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx(See,{})]})}function Lp({className:e,...t}){return c.jsx(xee,{"data-slot":"navigation-menu-item",className:Me("relative",e),...t})}function Fp({className:e,...t}){return c.jsx(_ee,{"data-slot":"navigation-menu-link",className:Me("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function WM({className:e,...t}){return c.jsx(bee,{"data-slot":"navigation-menu-list",className:Me("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Df(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return Us({id:Sn,operationsUrl:e})}function zf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return{instanceClient:Us({id:Sn,operationsUrl:e}),entityType:"instance"}}function dr(e){const{instanceId:t,clusterId:n}=Ze({strict:!1}),o=Sn;return{instanceClient:Us({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}async function Cee(){Gn.setUserForEntity(Sn,null),nf.getQueryCache().clear(),await nf.invalidateQueries({refetchType:"none"})}async function Eee(e){await Gn.signOutFromPotentiallyAuthenticatedInstances(),await jf(e)}function Ree(){const e=Df();return at({mutationFn:()=>Eee({instanceClient:e}),onSuccess:Cee})}function Uf(e){const{user:t}=Nf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];return!o?.permission&&!o?.organization?{update:!1,remove:!1}:o.permission?.super_user?{update:!0,remove:!0}:{update:o.organization.update,remove:o.organization.delete}}function yu(e){const{user:t}=Nf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];if(!o?.permission&&!o?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(o.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const r=o.organization.roles;return{create:r.create,remove:r.delete,update:r.update,view:r.view}}function GS(e,t){const{user:n}=Nf(),{organizationId:o,clusterId:r}=Ze({strict:!1}),i=t??r,l=n?.roles?.[e??o];if(!l?.permission&&!l?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(l.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const u=l.organization.clusters.resources?.find(m=>m.id===i),f=l.organization.clusters;return{create:f.create,remove:u?u.delete:f.delete,update:u?u.update:f.update,view:u?u.view:f.view}}function QM(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=na(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function qS(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=na(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Hx(e,t,n,o){const{clusterId:r,instanceId:i}=Ze({strict:!1}),{user:l}=na(e??i??r),u=l?.role?.permission;return u?u.super_user===!0||u.structure_user===!0?!0:u[t]?.tables?.[n][o]===!0:!1}const jee={className:"text-white"};function Nee({signOut:e}){const{user:t}=sl();cu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Uf(n),{view:r}=yu(n),[i,l]=_.useState(!1);return c.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(Ue,{to:ta,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.1"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{l(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(AI,{}):c.jsx(TI,{})]})]}),c.jsxs("div",{className:`${i?"block":"hidden"} md:hidden space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:[!Ac,!Ac,c.jsxs(Ue,{to:"/docs",className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(pS,{className:"mr-4"})," Docs"]}),c.jsxs(Ue,{to:void 0,onClick:e,className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(NI,{className:"mr-4"})," Sign Out"]})]})]})}function Tee({signOut:e}){const{user:t}=sl();cu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Uf(n),{view:r}=yu(n);return c.jsx("div",{className:"hidden md:block",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:ta,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.1"})]})}),c.jsx(XM,{children:c.jsxs(WM,{className:"text-grey-400",children:[!Ac,!Ac,c.jsx(Lp,{children:c.jsx(Fp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(Lp,{children:c.jsx(Fp,{asChild:!0,children:c.jsxs(Ue,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(NI,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function kee(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:"/sign-in",children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.1"})]})}),c.jsx(XM,{children:c.jsxs(WM,{className:"text-grey-400",children:[c.jsx(Lp,{children:c.jsx(Fp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(Lp,{children:c.jsx(Fp,{asChild:!0,children:c.jsxs(Ue,{to:"/sign-in",className:"flex-row items-center",activeProps:jee,children:[c.jsx(CG,{})," Sign In"]})})})]})})]})}function KS(){return c.jsxs(c.Fragment,{children:[c.jsx("img",{src:"/logo_harper_db_studio.png",alt:"logo",className:"w-64 hidden md:inline-block"}),c.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function JM(){const{mutate:e}=Ree(),t=pn(),{user:n}=sl(),o=Rn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ee.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(Nee,{signOut:r}),c.jsx(Tee,{signOut:r})]}):c.jsx(kee,{})}function Dh({title:e,children:t}){return c.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[c.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Oee(){return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(JM,{})}),c.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[c.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Harper Studio"}),c.jsx("span",{children:"Manage all your Harper instances."}),c.jsxs("ul",{className:"ps-5",children:[c.jsx(Dh,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx(Dh,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx(Dh,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx(Dh,{title:"Deploy Anywhere",children:c.jsxs("div",{className:"mt-6",children:[c.jsx("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"Docker"}),c.jsx("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"npm"}),c.jsx("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 border-2 border-blue-100 rounded-md",children:"all options"})]})})]})]})}),c.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:c.jsx(ss,{})})]})]})}function Aee(e){if(!e)return"";const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return"";const o=[];for(let i=0;i<n.length;i++){const l=n[i],u=i+1<n.length?n[i+1]:void 0;/^[A-Z]{2,}$/.test(l)&&u==="s"?(o.push(l+"s"),i++):/^[A-Z]$/.test(l)&&u!==void 0&&/^[A-Z]s$/.test(u)?(o.push(l+u),i++):o.push(l)}return o.map(i=>/^[A-Z]{2,}s?$/.test(i)||/^[0-9]+$/.test(i)?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")}function Zg(){const e=L9(),t=U9({strict:!1}),n=_.useMemo(()=>{const o=e.pathname.split("/").filter(i=>i&&i.length>0),r=[c.jsxs(Ue,{to:"/",children:[c.jsx(bG,{"aria-hidden":"true",className:"size-5 shrink-0"}),c.jsx("span",{className:"sr-only",children:"Home"})]})];for(let i=0;i<o.length;i++){const l=o[i];if(l==="instance")continue;const u=`/${o.slice(0,i+1).join("/")}`;let f=Aee(l),m;l==="databases"&&o.length===i+3?(m=o[i+1],f=o[i+2],i+=2):f.startsWith("Org ")?(m=l.split("org-").pop(),f=t?.organization?.name||"Org"):f.startsWith("Clu ")?(m=l.split("clu-").pop(),f=t?.cluster?.name||"Cluster"):f.startsWith("Ins ")&&(m=l.split("ins-").pop(),f="Instance"),r.push(c.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:c.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),c.jsxs(Ue,{to:u,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[f,m&&c.jsx("div",{className:"text-gray-500 text-xs hidden md:block",children:m})]}))}return r},[e.pathname,t?.cluster?.name,t?.organization?.name]);return c.jsxs("div",{role:"list",className:"flex items-center space-x-0 lg:space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...n]})}var Lf=e=>e.type==="checkbox",Ma=e=>e instanceof Date,_r=e=>e==null;const eP=e=>typeof e=="object";var hn=e=>!_r(e)&&!Array.isArray(e)&&eP(e)&&!Ma(e),tP=e=>hn(e)&&e.target?Lf(e.target)?e.target.checked:e.target.value:e,Iee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,nP=(e,t)=>e.has(Iee(t)),$ee=e=>{const t=e.constructor&&e.constructor.prototype;return hn(t)&&t.hasOwnProperty("isPrototypeOf")},ZS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ft(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(ZS&&(e instanceof Blob||o))&&(n||hn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!$ee(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ft(e[r]));else return e;return t}var Yg=e=>/^\w*$/.test(e),Bt=e=>e===void 0,Xg=e=>Array.isArray(e)?e.filter(Boolean):[],YS=e=>Xg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ce=(e,t,n)=>{if(!t||!hn(e))return n;const o=(Yg(t)?[t]:YS(t)).reduce((r,i)=>_r(r)?r:r[i],e);return Bt(o)||o===e?Bt(e[t])?n:e[t]:o},Gr=e=>typeof e=="boolean",Ct=(e,t,n)=>{let o=-1;const r=Yg(t)?[t]:YS(t),i=r.length,l=i-1;for(;++o<i;){const u=r[o];let f=n;if(o!==l){const m=e[u];f=hn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Vp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Eo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ki={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XS=q.createContext(null);XS.displayName="HookFormContext";const Ff=()=>q.useContext(XS),Mee=e=>{const{children:t,...n}=e;return q.createElement(XS.Provider,{value:n},t)};var rP=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const l=i;return t._proxyFormState[l]!==Eo.all&&(t._proxyFormState[l]=!o||Eo.all),n&&(n[l]=!0),e[l]}});return r};const Wg=typeof window<"u"?q.useLayoutEffect:q.useEffect;function WS(e){const t=Ff(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[l,u]=q.useState(n._formState),f=q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Wg(()=>n._subscribe({name:r,formState:f.current,exact:i,callback:m=>{!o&&u({...n._formState,...m})}}),[r,o,i]),q.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),q.useMemo(()=>rP(l,n,f.current,!1),[l,n])}var pi=e=>typeof e=="string",oP=(e,t,n,o,r)=>pi(e)?(o&&t.watch.add(e),Ce(n,e,r)):Array.isArray(e)?e.map(i=>(o&&t.watch.add(i),Ce(n,i))):(o&&(t.watchAll=!0),n),hw=e=>_r(e)||!eP(e);function Wi(e,t,n=new WeakSet){if(hw(e)||hw(t))return e===t;if(Ma(e)&&Ma(t))return e.getTime()===t.getTime();const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of o){const l=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const u=t[i];if(Ma(l)&&Ma(u)||hn(l)&&hn(u)||Array.isArray(l)&&Array.isArray(u)?!Wi(l,u,n):l!==u)return!1}}return!0}function Pee(e){const t=Ff(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:l,compute:u}=e||{},f=q.useRef(r),m=q.useRef(u),p=q.useRef(void 0);m.current=u;const g=q.useMemo(()=>n._getWatch(o,f.current),[n,o]),[v,x]=q.useState(m.current?m.current(g):g);return Wg(()=>n._subscribe({name:o,formState:{values:!0},exact:l,callback:b=>{if(!i){const S=oP(o,n._names,b.values||n._formValues,!1,f.current);if(m.current){const C=m.current(S);Wi(C,p.current)||(x(C),p.current=C)}else x(S)}}}),[n,i,o,l]),q.useEffect(()=>n._removeUnmounted()),v}function Dee(e){const t=Ff(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:l}=e,u=nP(r._names.array,n),f=q.useMemo(()=>Ce(r._formValues,n,Ce(r._defaultValues,n,l)),[r,n,l]),m=Pee({control:r,name:n,defaultValue:f,exact:!0}),p=WS({control:r,name:n,exact:!0}),g=q.useRef(e),v=q.useRef(r.register(n,{...e.rules,value:m,...Gr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const x=q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ce(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ce(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ce(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ce(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ce(p.errors,n)}}),[p,n]),b=q.useCallback(j=>v.current.onChange({target:{value:tP(j),name:n},type:Vp.CHANGE}),[n]),S=q.useCallback(()=>v.current.onBlur({target:{value:Ce(r._formValues,n),name:n},type:Vp.BLUR}),[n,r._formValues]),C=q.useCallback(j=>{const N=Ce(r._fields,n);N&&j&&(N._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:T=>j.setCustomValidity(T),reportValidity:()=>j.reportValidity()})},[r._fields,n]),E=q.useMemo(()=>({name:n,value:m,...Gr(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:b,onBlur:S,ref:C}),[n,o,p.disabled,b,S,C,m]);return q.useEffect(()=>{const j=r._options.shouldUnregister||i;r.register(n,{...g.current.rules,...Gr(g.current.disabled)?{disabled:g.current.disabled}:{}});const N=(T,k)=>{const A=Ce(r._fields,T);A&&A._f&&(A._f.mount=k)};if(N(n,!0),j){const T=Ft(Ce(r._options.defaultValues,n));Ct(r._defaultValues,n,T),Bt(Ce(r._formValues,n))&&Ct(r._formValues,n,T)}return!u&&r.register(n),()=>{(u?j&&!r._state.action:j)?r.unregister(n):N(n,!1)}},[n,r,u,i]),q.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),q.useMemo(()=>({field:E,formState:p,fieldState:x}),[E,p,x])}const zee=e=>e.render(Dee(e));var QS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},kr=e=>Array.isArray(e)?e:[e],_k=()=>{let e=[];return{get observers(){return e},next:r=>{for(const i of e)i.next&&i.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(i=>i!==r)}}),unsubscribe:()=>{e=[]}}},yr=e=>hn(e)&&!Object.keys(e).length,JS=e=>e.type==="file",Lo=e=>typeof e=="function",Bp=e=>{if(!ZS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},iP=e=>e.type==="select-multiple",e0=e=>e.type==="radio",Uee=e=>e0(e)||Lf(e),Gx=e=>Bp(e)&&e.isConnected;function Lee(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Bt(e)?o++:e[t[o++]];return e}function Fee(e){for(const t in e)if(e.hasOwnProperty(t)&&!Bt(e[t]))return!1;return!0}function un(e,t){const n=Array.isArray(t)?t:Yg(t)?[t]:YS(t),o=n.length===1?e:Lee(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(hn(o)&&yr(o)||Array.isArray(o)&&Fee(o))&&un(e,n.slice(0,-1)),e}var sP=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function Hp(e,t={}){const n=Array.isArray(e);if(hn(e)||n)for(const o in e)Array.isArray(e[o])||hn(e[o])&&!sP(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Hp(e[o],t[o])):_r(e[o])||(t[o]=!0);return t}function aP(e,t,n){const o=Array.isArray(e);if(hn(e)||o)for(const r in e)Array.isArray(e[r])||hn(e[r])&&!sP(e[r])?Bt(t)||hw(n[r])?n[r]=Array.isArray(e[r])?Hp(e[r],[]):{...Hp(e[r])}:aP(e[r],_r(t)?{}:t[r],n[r]):n[r]=!Wi(e[r],t[r]);return n}var Od=(e,t)=>aP(e,t,Hp(t));const wk={value:!1,isValid:!1},Sk={value:!0,isValid:!0};var lP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Bt(e[0].attributes.value)?Bt(e[0].value)||e[0].value===""?Sk:{value:e[0].value,isValid:!0}:Sk:wk}return wk},cP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Bt(e)?e:t?e===""?NaN:e&&+e:n&&pi(e)?new Date(e):o?o(e):e;const Ck={isValid:!1,value:null};var uP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Ck):Ck;function Ek(e){const t=e.ref;return JS(t)?t.files:e0(t)?uP(e.refs).value:iP(t)?[...t.selectedOptions].map(({value:n})=>n):Lf(t)?lP(e.refs).value:cP(Bt(t.value)?e.ref.value:t.value,e)}var Vee=(e,t,n,o)=>{const r={};for(const i of e){const l=Ce(t,i);l&&Ct(r,i,l._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},Gp=e=>e instanceof RegExp,Ad=e=>Bt(e)?e:Gp(e)?e.source:hn(e)?Gp(e.value)?e.value.source:e.value:e,bc=e=>({isOnSubmit:!e||e===Eo.onSubmit,isOnBlur:e===Eo.onBlur,isOnChange:e===Eo.onChange,isOnAll:e===Eo.all,isOnTouch:e===Eo.onTouched});const Rk="AsyncFunction";var Bee=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===Rk||hn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Rk)),Hee=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),pw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Rc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ce(e,r);if(i){const{_f:l,...u}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o)return!0;if(l.ref&&t(l.ref,l.name)&&!o)return!0;if(Rc(u,t))break}else if(hn(u)&&Rc(u,t))break}}};function jk(e,t,n){const o=Ce(e,n);if(o||Yg(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Ce(t,i),u=Ce(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};r.pop()}return{name:n}}var Gee=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return yr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!o||Eo.all))},qee=(e,t,n)=>!e||!t||e===t||kr(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),Kee=(e,t,n,o,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(t||e):(n?o.isOnBlur:r.isOnBlur)?!e:(n?o.isOnChange:r.isOnChange)?e:!0,Zee=(e,t)=>!Xg(Ce(e,t)).length&&un(e,t),dP=(e,t,n)=>{const o=kr(Ce(e,n));return Ct(o,"root",t[n]),Ct(e,n,o),e},gp=e=>pi(e);function Nk(e,t,n="validate"){if(gp(e)||Array.isArray(e)&&e.every(gp)||Gr(e)&&!e)return{type:n,message:gp(e)?e:"",ref:t}}var uc=e=>hn(e)&&!Gp(e)?e:{value:e,message:""},gw=async(e,t,n,o,r,i)=>{const{ref:l,refs:u,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:x,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,j=Ce(n,S);if(!E||t.has(S))return{};const N=u?u[0]:l,T=se=>{r&&N.reportValidity&&(N.setCustomValidity(Gr(se)?"":se||""),N.reportValidity())},k={},A=e0(l),I=Lf(l),P=A||I,L=(C||JS(l))&&Bt(l.value)&&Bt(j)||Bp(l)&&l.value===""||j===""||Array.isArray(j)&&!j.length,V=QS.bind(null,S,o,k),ie=(se,ue,le,ce=Ki.maxLength,M=Ki.minLength)=>{const K=se?ue:le;k[S]={type:se?ce:M,message:K,ref:l,...V(se?ce:M,K)}};if(i?!Array.isArray(j)||!j.length:f&&(!P&&(L||_r(j))||Gr(j)&&!j||I&&!lP(u).isValid||A&&!uP(u).isValid)){const{value:se,message:ue}=gp(f)?{value:!!f,message:f}:uc(f);if(se&&(k[S]={type:Ki.required,message:ue,ref:N,...V(Ki.required,ue)},!o))return T(ue),k}if(!L&&(!_r(g)||!_r(v))){let se,ue;const le=uc(v),ce=uc(g);if(!_r(j)&&!isNaN(j)){const M=l.valueAsNumber||j&&+j;_r(le.value)||(se=M>le.value),_r(ce.value)||(ue=M<ce.value)}else{const M=l.valueAsDate||new Date(j),K=$=>new Date(new Date().toDateString()+" "+$),U=l.type=="time",re=l.type=="week";pi(le.value)&&j&&(se=U?K(j)>K(le.value):re?j>le.value:M>new Date(le.value)),pi(ce.value)&&j&&(ue=U?K(j)<K(ce.value):re?j<ce.value:M<new Date(ce.value))}if((se||ue)&&(ie(!!se,le.message,ce.message,Ki.max,Ki.min),!o))return T(k[S].message),k}if((m||p)&&!L&&(pi(j)||i&&Array.isArray(j))){const se=uc(m),ue=uc(p),le=!_r(se.value)&&j.length>+se.value,ce=!_r(ue.value)&&j.length<+ue.value;if((le||ce)&&(ie(le,se.message,ue.message),!o))return T(k[S].message),k}if(x&&!L&&pi(j)){const{value:se,message:ue}=uc(x);if(Gp(se)&&!j.match(se)&&(k[S]={type:Ki.pattern,message:ue,ref:l,...V(Ki.pattern,ue)},!o))return T(ue),k}if(b){if(Lo(b)){const se=await b(j,n),ue=Nk(se,N);if(ue&&(k[S]={...ue,...V(Ki.validate,ue.message)},!o))return T(ue.message),k}else if(hn(b)){let se={};for(const ue in b){if(!yr(se)&&!o)break;const le=Nk(await b[ue](j,n),N,ue);le&&(se={...le,...V(ue,le.message)},T(le.message),o&&(k[S]=se))}if(!yr(se)&&(k[S]={ref:N,...se},!o))return k}}return T(!0),k};const Yee={mode:Eo.onSubmit,reValidateMode:Eo.onChange,shouldFocusError:!0};function Xee(e={}){let t={...Yee,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=hn(t.defaultValues)||hn(t.values)?Ft(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Ft(r),l={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const v={array:_k(),state:_k()},x=t.criteriaMode===Eo.all,b=z=>X=>{clearTimeout(m),m=setTimeout(z,X)},S=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const X=t.resolver?yr((await I()).errors):await L(o,!0);X!==n.isValid&&v.state.next({isValid:X})}},C=(z,X)=>{!t.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(u.mount)).forEach(oe=>{oe&&(X?Ct(n.validatingFields,oe,X):un(n.validatingFields,oe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!yr(n.validatingFields)}))},E=(z,X=[],oe,ve,xe=!0,be=!0)=>{if(ve&&oe&&!t.disabled){if(l.action=!0,be&&Array.isArray(Ce(o,z))){const Re=oe(Ce(o,z),ve.argA,ve.argB);xe&&Ct(o,z,Re)}if(be&&Array.isArray(Ce(n.errors,z))){const Re=oe(Ce(n.errors,z),ve.argA,ve.argB);xe&&Ct(n.errors,z,Re),Zee(n.errors,z)}if((p.touchedFields||g.touchedFields)&&be&&Array.isArray(Ce(n.touchedFields,z))){const Re=oe(Ce(n.touchedFields,z),ve.argA,ve.argB);xe&&Ct(n.touchedFields,z,Re)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Od(r,i)),v.state.next({name:z,isDirty:ie(z,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ct(i,z,X)},j=(z,X)=>{Ct(n.errors,z,X),v.state.next({errors:n.errors})},N=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},T=(z,X,oe,ve)=>{const xe=Ce(o,z);if(xe){const be=Ce(i,z,Bt(oe)?Ce(r,z):oe);Bt(be)||ve&&ve.defaultChecked||X?Ct(i,z,X?be:Ek(xe._f)):le(z,be),l.mount&&S()}},k=(z,X,oe,ve,xe)=>{let be=!1,Re=!1;const We={name:z};if(!t.disabled){if(!oe||ve){(p.isDirty||g.isDirty)&&(Re=n.isDirty,n.isDirty=We.isDirty=ie(),be=Re!==We.isDirty);const ft=Wi(Ce(r,z),X);Re=!!Ce(n.dirtyFields,z),ft?un(n.dirtyFields,z):Ct(n.dirtyFields,z,!0),We.dirtyFields=n.dirtyFields,be=be||(p.dirtyFields||g.dirtyFields)&&Re!==!ft}if(oe){const ft=Ce(n.touchedFields,z);ft||(Ct(n.touchedFields,z,oe),We.touchedFields=n.touchedFields,be=be||(p.touchedFields||g.touchedFields)&&ft!==oe)}be&&xe&&v.state.next(We)}return be?We:{}},A=(z,X,oe,ve)=>{const xe=Ce(n.errors,z),be=(p.isValid||g.isValid)&&Gr(X)&&n.isValid!==X;if(t.delayError&&oe?(f=b(()=>j(z,oe)),f(t.delayError)):(clearTimeout(m),f=null,oe?Ct(n.errors,z,oe):un(n.errors,z)),(oe?!Wi(xe,oe):xe)||!yr(ve)||be){const Re={...ve,...be&&Gr(X)?{isValid:X}:{},errors:n.errors,name:z};n={...n,...Re},v.state.next(Re)}},I=async z=>{C(z,!0);const X=await t.resolver(i,t.context,Vee(z||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),X},P=async z=>{const{errors:X}=await I(z);if(z)for(const oe of z){const ve=Ce(X,oe);ve?Ct(n.errors,oe,ve):un(n.errors,oe)}else n.errors=X;return X},L=async(z,X,oe={valid:!0})=>{for(const ve in z){const xe=z[ve];if(xe){const{_f:be,...Re}=xe;if(be){const We=u.array.has(be.name),ft=xe._f&&Bee(xe._f);ft&&p.validatingFields&&C([ve],!0);const Rt=await gw(xe,u.disabled,i,x,t.shouldUseNativeValidation&&!X,We);if(ft&&p.validatingFields&&C([ve]),Rt[be.name]&&(oe.valid=!1,X))break;!X&&(Ce(Rt,be.name)?We?dP(n.errors,Rt,be.name):Ct(n.errors,be.name,Rt[be.name]):un(n.errors,be.name))}!yr(Re)&&await L(Re,X,oe)}}return oe.valid},V=()=>{for(const z of u.unMount){const X=Ce(o,z);X&&(X._f.refs?X._f.refs.every(oe=>!Gx(oe)):!Gx(X._f.ref))&&ae(z)}u.unMount=new Set},ie=(z,X)=>!t.disabled&&(z&&X&&Ct(i,z,X),!Wi($(),r)),se=(z,X,oe)=>oP(z,u,{...l.mount?i:Bt(X)?r:pi(z)?{[z]:X}:X},oe,X),ue=z=>Xg(Ce(l.mount?i:r,z,t.shouldUnregister?Ce(r,z,[]):[])),le=(z,X,oe={})=>{const ve=Ce(o,z);let xe=X;if(ve){const be=ve._f;be&&(!be.disabled&&Ct(i,z,cP(X,be)),xe=Bp(be.ref)&&_r(X)?"":X,iP(be.ref)?[...be.ref.options].forEach(Re=>Re.selected=xe.includes(Re.value)):be.refs?Lf(be.ref)?be.refs.forEach(Re=>{(!Re.defaultChecked||!Re.disabled)&&(Array.isArray(xe)?Re.checked=!!xe.find(We=>We===Re.value):Re.checked=xe===Re.value||!!xe)}):be.refs.forEach(Re=>Re.checked=Re.value===xe):JS(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||v.state.next({name:z,values:Ft(i)})))}(oe.shouldDirty||oe.shouldTouch)&&k(z,xe,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&re(z)},ce=(z,X,oe)=>{for(const ve in X){if(!X.hasOwnProperty(ve))return;const xe=X[ve],be=z+"."+ve,Re=Ce(o,be);(u.array.has(z)||hn(xe)||Re&&!Re._f)&&!Ma(xe)?ce(be,xe,oe):le(be,xe,oe)}},M=(z,X,oe={})=>{const ve=Ce(o,z),xe=u.array.has(z),be=Ft(X);Ct(i,z,be),xe?(v.array.next({name:z,values:Ft(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&oe.shouldDirty&&v.state.next({name:z,dirtyFields:Od(r,i),isDirty:ie(z,be)})):ve&&!ve._f&&!_r(be)?ce(z,be,oe):le(z,be,oe),pw(z,u)&&v.state.next({...n,name:z}),v.state.next({name:l.mount?z:void 0,values:Ft(i)})},K=async z=>{l.mount=!0;const X=z.target;let oe=X.name,ve=!0;const xe=Ce(o,oe),be=ft=>{ve=Number.isNaN(ft)||Ma(ft)&&isNaN(ft.getTime())||Wi(ft,Ce(i,oe,ft))},Re=bc(t.mode),We=bc(t.reValidateMode);if(xe){let ft,Rt;const Pr=X.type?Ek(xe._f):tP(z),Dr=z.type===Vp.BLUR||z.type===Vp.FOCUS_OUT,ti=!Hee(xe._f)&&!t.resolver&&!Ce(n.errors,oe)&&!xe._f.deps||Kee(Dr,Ce(n.touchedFields,oe),n.isSubmitted,We,Re),ni=pw(oe,u,Dr);Ct(i,oe,Pr),Dr?(!X||!X.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const ri=k(oe,Pr,Dr),lo=!yr(ri)||ni;if(!Dr&&v.state.next({name:oe,type:z.type,values:Ft(i)}),ti)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?Dr&&S():Dr||S()),lo&&v.state.next({name:oe,...ni?{}:ri});if(!Dr&&ni&&v.state.next({...n}),t.resolver){const{errors:oi}=await I([oe]);if(be(Pr),ve){const Ti=jk(n.errors,o,oe),cs=jk(oi,o,Ti.name||oe);ft=cs.error,oe=cs.name,Rt=yr(oi)}}else C([oe],!0),ft=(await gw(xe,u.disabled,i,x,t.shouldUseNativeValidation))[oe],C([oe]),be(Pr),ve&&(ft?Rt=!1:(p.isValid||g.isValid)&&(Rt=await L(o,!0)));ve&&(xe._f.deps&&re(xe._f.deps),A(oe,Rt,ft,ri))}},U=(z,X)=>{if(Ce(n.errors,X)&&z.focus)return z.focus(),1},re=async(z,X={})=>{let oe,ve;const xe=kr(z);if(t.resolver){const be=await P(Bt(z)?z:xe);oe=yr(be),ve=z?!xe.some(Re=>Ce(be,Re)):oe}else z?(ve=(await Promise.all(xe.map(async be=>{const Re=Ce(o,be);return await L(Re&&Re._f?{[be]:Re}:Re)}))).every(Boolean),!(!ve&&!n.isValid)&&S()):ve=oe=await L(o);return v.state.next({...!pi(z)||(p.isValid||g.isValid)&&oe!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:oe}:{},errors:n.errors}),X.shouldFocus&&!ve&&Rc(o,U,z?xe:u.mount),ve},$=z=>{const X={...l.mount?i:r};return Bt(z)?X:pi(z)?Ce(X,z):z.map(oe=>Ce(X,oe))},H=(z,X)=>({invalid:!!Ce((X||n).errors,z),isDirty:!!Ce((X||n).dirtyFields,z),error:Ce((X||n).errors,z),isValidating:!!Ce(n.validatingFields,z),isTouched:!!Ce((X||n).touchedFields,z)}),W=z=>{z&&kr(z).forEach(X=>un(n.errors,X)),v.state.next({errors:z?n.errors:{}})},B=(z,X,oe)=>{const ve=(Ce(o,z,{_f:{}})._f||{}).ref,xe=Ce(n.errors,z)||{},{ref:be,message:Re,type:We,...ft}=xe;Ct(n.errors,z,{...ft,...X,ref:ve}),v.state.next({name:z,errors:n.errors,isValid:!1}),oe&&oe.shouldFocus&&ve&&ve.focus&&ve.focus()},J=(z,X)=>Lo(z)?v.state.subscribe({next:oe=>"values"in oe&&z(se(void 0,X),oe)}):se(z,X,!0),ge=z=>v.state.subscribe({next:X=>{qee(z.name,X.name,z.exact)&&Gee(X,z.formState||p,Mt,z.reRenderRoot)&&z.callback({values:{...i},...n,...X,defaultValues:r})}}).unsubscribe,ye=z=>(l.mount=!0,g={...g,...z.formState},ge({...z,formState:g})),ae=(z,X={})=>{for(const oe of z?kr(z):u.mount)u.mount.delete(oe),u.array.delete(oe),X.keepValue||(un(o,oe),un(i,oe)),!X.keepError&&un(n.errors,oe),!X.keepDirty&&un(n.dirtyFields,oe),!X.keepTouched&&un(n.touchedFields,oe),!X.keepIsValidating&&un(n.validatingFields,oe),!t.shouldUnregister&&!X.keepDefaultValue&&un(r,oe);v.state.next({values:Ft(i)}),v.state.next({...n,...X.keepDirty?{isDirty:ie()}:{}}),!X.keepIsValid&&S()},fe=({disabled:z,name:X})=>{(Gr(z)&&l.mount||z||u.disabled.has(X))&&(z?u.disabled.add(X):u.disabled.delete(X))},ze=(z,X={})=>{let oe=Ce(o,z);const ve=Gr(X.disabled)||Gr(t.disabled);return Ct(o,z,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:z}},name:z,mount:!0,...X}}),u.mount.add(z),oe?fe({disabled:Gr(X.disabled)?X.disabled:t.disabled,name:z}):T(z,!0,X.value),{...ve?{disabled:X.disabled||t.disabled}:{},...t.progressive?{required:!!X.required,min:Ad(X.min),max:Ad(X.max),minLength:Ad(X.minLength),maxLength:Ad(X.maxLength),pattern:Ad(X.pattern)}:{},name:z,onChange:K,onBlur:K,ref:xe=>{if(xe){ze(z,X),oe=Ce(o,z);const be=Bt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Re=Uee(be),We=oe._f.refs||[];if(Re?We.find(ft=>ft===be):be===oe._f.ref)return;Ct(o,z,{_f:{...oe._f,...Re?{refs:[...We.filter(Gx),be,...Array.isArray(Ce(r,z))?[{}]:[]],ref:{type:be.type,name:z}}:{ref:be}}}),T(z,!1,void 0,be)}else oe=Ce(o,z,{}),oe._f&&(oe._f.mount=!1),(t.shouldUnregister||X.shouldUnregister)&&!(nP(u.array,z)&&l.action)&&u.unMount.add(z)}}},Ve=()=>t.shouldFocusError&&Rc(o,U,u.mount),Ye=z=>{Gr(z)&&(v.state.next({disabled:z}),Rc(o,(X,oe)=>{const ve=Ce(o,oe);ve&&(X.disabled=ve._f.disabled||z,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(xe=>{xe.disabled=ve._f.disabled||z}))},0,!1))},He=(z,X)=>async oe=>{let ve;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let xe=Ft(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:Re}=await I();n.errors=be,xe=Ft(Re)}else await L(o);if(u.disabled.size)for(const be of u.disabled)un(xe,be);if(un(n.errors,"root"),yr(n.errors)){v.state.next({errors:{}});try{await z(xe,oe)}catch(be){ve=be}}else X&&await X({...n.errors},oe),Ve(),setTimeout(Ve);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yr(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},Gt=(z,X={})=>{Ce(o,z)&&(Bt(X.defaultValue)?M(z,Ft(Ce(r,z))):(M(z,X.defaultValue),Ct(r,z,Ft(X.defaultValue))),X.keepTouched||un(n.touchedFields,z),X.keepDirty||(un(n.dirtyFields,z),n.isDirty=X.defaultValue?ie(z,Ft(Ce(r,z))):ie()),X.keepError||(un(n.errors,z),p.isValid&&S()),v.state.next({...n}))},Yt=(z,X={})=>{const oe=z?Ft(z):r,ve=Ft(oe),xe=yr(z),be=xe?r:ve;if(X.keepDefaultValues||(r=oe),!X.keepValues){if(X.keepDirtyValues){const Re=new Set([...u.mount,...Object.keys(Od(r,i))]);for(const We of Array.from(Re))Ce(n.dirtyFields,We)?Ct(be,We,Ce(i,We)):M(We,Ce(be,We))}else{if(ZS&&Bt(z))for(const Re of u.mount){const We=Ce(o,Re);if(We&&We._f){const ft=Array.isArray(We._f.refs)?We._f.refs[0]:We._f.ref;if(Bp(ft)){const Rt=ft.closest("form");if(Rt){Rt.reset();break}}}}if(X.keepFieldsRef)for(const Re of u.mount)M(Re,Ce(be,Re));else o={}}i=t.shouldUnregister?X.keepDefaultValues?Ft(r):{}:Ft(be),v.array.next({values:{...be}}),v.state.next({values:{...be}})}u={mount:X.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!X.keepIsValid||!!X.keepDirtyValues,l.watch=!!t.shouldUnregister,v.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:X.keepDirty?n.isDirty:!!(X.keepDefaultValues&&!Wi(z,r)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:X.keepDirtyValues?X.keepDefaultValues&&i?Od(r,i):n.dirtyFields:X.keepDefaultValues&&z?Od(r,z):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:r})},Zn=(z,X)=>Yt(Lo(z)?z(i):z,X),fr=(z,X={})=>{const oe=Ce(o,z),ve=oe&&oe._f;if(ve){const xe=ve.refs?ve.refs[0]:ve.ref;xe.focus&&(xe.focus(),X.shouldSelect&&Lo(xe.select)&&xe.select())}},Mt=z=>{n={...n,...z}},Pt={control:{register:ze,unregister:ae,getFieldState:H,handleSubmit:He,setError:B,_subscribe:ge,_runSchema:I,_focusError:Ve,_getWatch:se,_getDirty:ie,_setValid:S,_setFieldArray:E,_setDisabledField:fe,_setErrors:N,_getFieldArray:ue,_reset:Yt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(z=>{Zn(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:Ye,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(z){l=z},get _defaultValues(){return r},get _names(){return u},set _names(z){u=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ye,trigger:re,register:ze,handleSubmit:He,watch:J,setValue:M,getValues:$,reset:Zn,resetField:Gt,clearErrors:W,unregister:ae,setError:B,setFocus:fr,getFieldState:H};return{...Pt,formControl:Pt}}var $s=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},qx=(e,t,n={})=>n.shouldFocus||Bt(n.shouldFocus)?n.focusName||`${e}.${Bt(n.focusIndex)?t:n.focusIndex}.`:"",Kx=(e,t)=>[...e,...kr(t)],Zx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Yx(e,t,n){return[...e.slice(0,t),...kr(n),...e.slice(t)]}var Xx=(e,t,n)=>Array.isArray(e)?(Bt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Wx=(e,t)=>[...kr(t),...kr(e)];function Wee(e,t){let n=0;const o=[...e];for(const r of t)o.splice(r-n,1),n++;return Xg(o).length?o:[]}var Qx=(e,t)=>Bt(t)?[]:Wee(e,kr(t).sort((n,o)=>n-o)),Jx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},Tk=(e,t,n)=>(e[t]=n,e);function fP(e){const t=Ff(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:l}=e,[u,f]=q.useState(n._getFieldArray(o)),m=q.useRef(n._getFieldArray(o).map($s)),p=q.useRef(u),g=q.useRef(!1);p.current=u,n._names.array.add(o),q.useMemo(()=>l&&n.register(o,l),[n,l,o]),Wg(()=>n._subjects.array.subscribe({next:({values:k,name:A})=>{if(A===o||!A){const I=Ce(k,o);Array.isArray(I)&&(f(I),m.current=I.map($s))}}}).unsubscribe,[n,o]);const v=q.useCallback(k=>{g.current=!0,n._setFieldArray(o,k)},[n,o]),x=(k,A)=>{const I=kr(Ft(k)),P=Kx(n._getFieldArray(o),I);n._names.focus=qx(o,P.length-1,A),m.current=Kx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Kx,{argA:Zx(k)})},b=(k,A)=>{const I=kr(Ft(k)),P=Wx(n._getFieldArray(o),I);n._names.focus=qx(o,0,A),m.current=Wx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Wx,{argA:Zx(k)})},S=k=>{const A=Qx(n._getFieldArray(o),k);m.current=Qx(m.current,k),v(A),f(A),!Array.isArray(Ce(n._fields,o))&&Ct(n._fields,o,void 0),n._setFieldArray(o,A,Qx,{argA:k})},C=(k,A,I)=>{const P=kr(Ft(A)),L=Yx(n._getFieldArray(o),k,P);n._names.focus=qx(o,k,I),m.current=Yx(m.current,k,P.map($s)),v(L),f(L),n._setFieldArray(o,L,Yx,{argA:k,argB:Zx(A)})},E=(k,A)=>{const I=n._getFieldArray(o);Jx(I,k,A),Jx(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,Jx,{argA:k,argB:A},!1)},j=(k,A)=>{const I=n._getFieldArray(o);Xx(I,k,A),Xx(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,Xx,{argA:k,argB:A},!1)},N=(k,A)=>{const I=Ft(A),P=Tk(n._getFieldArray(o),k,I);m.current=[...P].map((L,V)=>!L||V===k?$s():m.current[V]),v(P),f([...P]),n._setFieldArray(o,P,Tk,{argA:k,argB:I},!0,!1)},T=k=>{const A=kr(Ft(k));m.current=A.map($s),v([...A]),f([...A]),n._setFieldArray(o,[...A],I=>I,{},!0,!1)};return q.useEffect(()=>{if(n._state.action=!1,pw(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!bc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!bc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(k=>{const A=Ce(k.errors,o),I=Ce(n._formState.errors,o);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?Ct(n._formState.errors,o,A):un(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ce(n._fields,o);k&&k._f&&!(bc(n._options.reValidateMode).isOnSubmit&&bc(n._options.mode).isOnSubmit)&&gw(k,n._names.disabled,n._formValues,n._options.criteriaMode===Eo.all,n._options.shouldUseNativeValidation,!0).then(A=>!yr(A)&&n._subjects.state.next({errors:dP(n._formState.errors,A,o)}))}n._subjects.state.next({name:o,values:Ft(n._formValues)}),n._names.focus&&Rc(n._fields,(k,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),g.current=!1},[u,o,n]),q.useEffect(()=>(!Ce(n._formValues,o)&&n._setFieldArray(o),()=>{const k=(A,I)=>{const P=Ce(n._fields,A);P&&P._f&&(P._f.mount=I)};n._options.shouldUnregister||i?n.unregister(o):k(o,!1)}),[o,n,r,i]),{swap:q.useCallback(E,[v,o,n]),move:q.useCallback(j,[v,o,n]),prepend:q.useCallback(b,[v,o,n]),append:q.useCallback(x,[v,o,n]),remove:q.useCallback(S,[v,o,n]),insert:q.useCallback(C,[v,o,n]),update:q.useCallback(N,[v,o,n]),replace:q.useCallback(T,[v,o,n]),fields:q.useMemo(()=>u.map((k,A)=>({...k,[r]:m.current[A]||$s()})),[u,r])}}function gn(e={}){const t=q.useRef(void 0),n=q.useRef(void 0),[o,r]=q.useState({isDirty:!1,isValidating:!1,isLoading:Lo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=Xee(e);t.current={...u,formState:o}}const i=t.current.control;return i._options=e,Wg(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(u=>({...u,isReady:!0})),i._formState.isReady=!0,l},[i]),q.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),q.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),q.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),q.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),q.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==o.isDirty&&i._subjects.state.next({isDirty:l})}},[i,o.isDirty]),q.useEffect(()=>{e.values&&!Wi(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),q.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=rP(o,i),t.current}const vn=Mee,mP=_.createContext({}),hP=_.createContext({});function t0(){const e=_.useContext(mP),t=_.useContext(hP),{getFieldState:n}=Ff(),o=WS({name:e.name}),r=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}}function Ie({...e}){const{error:t,formItemId:n,formDescriptionId:o,formMessageId:r}=t0();return c.jsx(Ww,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function $e({...e}){return c.jsx(mP,{value:{name:e.name},children:c.jsx(zee,{...e})})}function ke({className:e,...t}){const n=_.useId();return c.jsx(hP,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:Me("grid gap-2",e),...t})})}var Qee="Label",pP=_.forwardRef((e,t)=>c.jsx(De.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pP.displayName=Qee;var Jee=pP;function n0({className:e,...t}){return c.jsx(Jee,{"data-slot":"label",className:Me("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Oe({className:e,...t}){const{error:n,formItemId:o}=t0();return c.jsx(n0,{"data-slot":"form-label","data-error":!!n,className:Me("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Ae({className:e,...t}){const{error:n,formMessageId:o}=t0(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:Me("text-destructive text-sm",e),...t,children:r}):null}function Le({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:Me(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
289
+ selection:text-primary-foreground
290
+ dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
291
+ dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
292
+ aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
293
+ flex h-9 w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
294
+ file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
295
+ focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
296
+ aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...n})}async function r0(e){const{data:t}=await kt.get(`/Cluster/${e}`);return t}function Vf(e,t){return{queryKey:[Cn.cluster,e],queryFn:()=>r0(e),retry:!1,enabled:!!e,refetchInterval:t?1e4:void 0}}async function vw({username:e,password:t,instanceClient:n}){const{data:o}=await n.post("/",{operation:"login",username:e,password:t});if(o)return o;throw new Error("Something went wrong")}function ete(){return at({mutationFn:vw})}const gP=Object.freeze({status:"aborted"});function Z(e,t,n){function o(u,f){var m;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(m=u._zod).traits??(m.traits=new Set),u._zod.traits.add(e),t(u,f);for(const p in l.prototype)p in u||Object.defineProperty(u,p,{value:l.prototype[p].bind(u)});u._zod.constr=l,u._zod.def=f}const r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function l(u){var f;const m=n?.Parent?new i:this;o(m,u),(f=m._zod).deferred??(f.deferred=[]);for(const p of m._zod.deferred)p();return m}return Object.defineProperty(l,"init",{value:o}),Object.defineProperty(l,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}const vP=Symbol("zod_brand");class Va extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Qg extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const qp={};function Sr(e){return e&&Object.assign(qp,e),qp}function tte(e){return e}function nte(e){return e}function rte(e){}function ote(e){throw new Error}function ite(e){}function o0(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function we(e,t="|"){return e.map(n=>Xe(n)).join(t)}function Kp(e,t){return typeof t=="bigint"?t.toString():t}function Bf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ml(e){return e==null}function Jg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function yP(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){const f=o.match(/\d?e-(\d?)/);f?.[1]&&(r=Number.parseInt(f[1]))}const i=n>r?n:r,l=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return l%u/10**i}const kk=Symbol("evaluating");function yt(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==kk)return o===void 0&&(o=kk,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ev(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Jo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oa(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function ste(e){return oa(e._zod.def)}function ate(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function lte(e){const t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{const r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function cte(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function yw(e){return JSON.stringify(e)}const i0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bP=Bf(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Wa(e){if(qc(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(qc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tv(e){return Wa(e)?{...e}:Array.isArray(e)?[...e]:e}function ute(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const dte=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Zp=new Set(["string","number","symbol"]),xP=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ao(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function pe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function fte(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function Xe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function _P(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wP={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},SP={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function CP(e,t){const n=e._zod.def,o=oa(e._zod.def,{get shape(){const r={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return Jo(this,"shape",r),r},checks:[]});return Ao(e,o)}function EP(e,t){const n=e._zod.def,o=oa(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return Jo(this,"shape",r),r},checks:[]});return Ao(e,o)}function RP(e,t){if(!Wa(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=oa(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Jo(this,"shape",i),i},checks:[]});return Ao(e,r)}function jP(e,t){if(!Wa(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return Jo(this,"shape",o),o},checks:e._zod.def.checks};return Ao(e,n)}function NP(e,t){const n=oa(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Jo(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ao(e,n)}function TP(e,t,n){const o=oa(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const l in n){if(!(l in r))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(i[l]=e?new e({type:"optional",innerType:r[l]}):r[l])}else for(const l in r)i[l]=e?new e({type:"optional",innerType:r[l]}):r[l];return Jo(this,"shape",i),i},checks:[]});return Ao(t,o)}function kP(e,t,n){const o=oa(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const l in n){if(!(l in i))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(i[l]=new e({type:"nonoptional",innerType:r[l]}))}else for(const l in r)i[l]=new e({type:"nonoptional",innerType:r[l]});return Jo(this,"shape",i),i},checks:[]});return Ao(t,o)}function Pa(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Vo(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ud(e){return typeof e=="string"?e:e?.message}function qo(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const r=Ud(e.inst?._zod.def?.error?.(e))??Ud(t?.error?.(e))??Ud(n.customError?.(e))??Ud(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function nv(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function rv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kc(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function mte(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function OP(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function AP(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function hte(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return OP(t+n)}function pte(e){return AP(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function gte(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function vte(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class yte{constructor(...t){}}const IP=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:SP,Class:yte,NUMBER_FORMAT_RANGES:wP,aborted:Pa,allowsEval:bP,assert:ite,assertEqual:tte,assertIs:rte,assertNever:ote,assertNotEqual:nte,assignProp:Jo,base64ToUint8Array:OP,base64urlToUint8Array:hte,cached:Bf,captureStackTrace:i0,cleanEnum:mte,cleanRegex:Jg,clone:Ao,cloneDef:ste,createTransparentProxy:fte,defineLazy:yt,esc:yw,escapeRegex:Ys,extend:RP,finalizeIssue:qo,floatSafeRemainder:yP,getElementAtPath:ate,getEnumValues:o0,getLengthableOrigin:rv,getParsedType:dte,getSizableOrigin:nv,hexToUint8Array:gte,isObject:qc,isPlainObject:Wa,issue:Kc,joinValues:we,jsonStringifyReplacer:Kp,merge:NP,mergeDefs:oa,normalizeParams:pe,nullish:ml,numKeys:ute,objectClone:ev,omit:EP,optionalKeys:_P,partial:TP,pick:CP,prefixIssues:Vo,primitiveTypes:xP,promiseAllObject:lte,propertyKeyTypes:Zp,randomString:cte,required:kP,safeExtend:jP,shallowClone:tv,stringifyPrimitive:Xe,uint8ArrayToBase64:AP,uint8ArrayToBase64url:pte,uint8ArrayToHex:vte,unwrapMessage:Ud},Symbol.toStringTag,{value:"Module"})),$P=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Kp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ov=Z("$ZodError",$P),so=Z("$ZodError",$P,{Parent:Error});function s0(e,t=n=>n.message){const n={},o=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function a0(e,t){const n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u}));else if(l.code==="invalid_key")r({issues:l.issues});else if(l.code==="invalid_element")r({issues:l.issues});else if(l.path.length===0)o._errors.push(n(l));else{let u=o,f=0;for(;f<l.path.length;){const m=l.path[f];f===l.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(n(l))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return r(e),o}function MP(e,t){const n=t||function(i){return i.message},o={errors:[]},r=(i,l=[])=>{var u,f;for(const m of i.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(p=>r({issues:p},m.path));else if(m.code==="invalid_key")r({issues:m.issues},m.path);else if(m.code==="invalid_element")r({issues:m.issues},m.path);else{const p=[...l,...m.path];if(p.length===0){o.errors.push(n(m));continue}let g=o,v=0;for(;v<p.length;){const x=p[v],b=v===p.length-1;typeof x=="string"?(g.properties??(g.properties={}),(u=g.properties)[x]??(u[x]={errors:[]}),g=g.properties[x]):(g.items??(g.items=[]),(f=g.items)[x]??(f[x]={errors:[]}),g=g.items[x]),b&&g.errors.push(n(m)),v++}}};return r(e),o}function PP(e){const t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(const o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function DP(e){const t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(const o of n)t.push(`✖ ${o.message}`),o.path?.length&&t.push(` → at ${PP(o.path)}`);return t.join(`
297
+ `)}const Hf=e=>(t,n,o,r)=>{const i=o?Object.assign(o,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw new Va;if(l.issues.length){const u=new(r?.Err??e)(l.issues.map(f=>qo(f,i,Sr())));throw i0(u,r?.callee),u}return l.value},Yp=Hf(so),Gf=e=>async(t,n,o,r)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new(r?.Err??e)(l.issues.map(f=>qo(f,i,Sr())));throw i0(u,r?.callee),u}return l.value},Xp=Gf(so),qf=e=>(t,n,o)=>{const r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Va;return i.issues.length?{success:!1,error:new(e??ov)(i.issues.map(l=>qo(l,r,Sr())))}:{success:!0,data:i.value}},zP=qf(so),Kf=e=>async(t,n,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(l=>qo(l,r,Sr())))}:{success:!0,data:i.value}},UP=Kf(so),l0=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Hf(e)(t,n,r)},bte=l0(so),c0=e=>(t,n,o)=>Hf(e)(t,n,o),xte=c0(so),u0=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gf(e)(t,n,r)},_te=u0(so),d0=e=>async(t,n,o)=>Gf(e)(t,n,o),wte=d0(so),f0=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return qf(e)(t,n,r)},Ste=f0(so),m0=e=>(t,n,o)=>qf(e)(t,n,o),Cte=m0(so),h0=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Kf(e)(t,n,r)},Ete=h0(so),p0=e=>async(t,n,o)=>Kf(e)(t,n,o),Rte=p0(so),LP=/^[cC][^\s-]{8,}$/,FP=/^[0-9a-z]+$/,VP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,BP=/^[0-9a-vA-V]{20}$/,HP=/^[A-Za-z0-9]{27}$/,GP=/^[a-zA-Z0-9_-]{21}$/,qP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jte=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KP=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Nte=Zc(4),Tte=Zc(6),kte=Zc(7),ZP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ote=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ate=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,YP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ite=YP,$te=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mte="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function XP(){return new RegExp(Mte,"u")}const WP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,QP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,JP=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,g0=/^[A-Za-z0-9_-]*$/,v0=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,nD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,rD=/^\+(?:[0-9]){6,14}[0-9]$/,oD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",iD=new RegExp(`^${oD}$`);function sD(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function aD(e){return new RegExp(`^${sD(e)}$`)}function lD(e){const t=sD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${oD}T(?:${o})$`)}const cD=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},uD=/^-?\d+n?$/,dD=/^-?\d+$/,fD=/^-?\d+(?:\.\d+)?/,mD=/^(?:true|false)$/i,hD=/^null$/i,pD=/^undefined$/i,gD=/^[^A-Z]*$/,vD=/^[^a-z]*$/,yD=/^[0-9a-fA-F]*$/;function Zf(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Yf(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Pte=/^[0-9a-fA-F]{32}$/,Dte=Zf(22,"=="),zte=Yf(22),Ute=/^[0-9a-fA-F]{40}$/,Lte=Zf(27,"="),Fte=Yf(27),Vte=/^[0-9a-fA-F]{64}$/,Bte=Zf(43,"="),Hte=Yf(43),Gte=/^[0-9a-fA-F]{96}$/,qte=Zf(64,""),Kte=Yf(64),Zte=/^[0-9a-fA-F]{128}$/,Yte=Zf(86,"=="),Xte=Yf(86),y0=Object.freeze(Object.defineProperty({__proto__:null,base64:tD,base64url:g0,bigint:uD,boolean:mD,browserEmail:$te,cidrv4:JP,cidrv6:eD,cuid:LP,cuid2:FP,date:iD,datetime:lD,domain:nD,duration:qP,e164:rD,email:ZP,emoji:XP,extendedDuration:jte,guid:KP,hex:yD,hostname:v0,html5Email:Ote,idnEmail:Ite,integer:dD,ipv4:WP,ipv6:QP,ksuid:HP,lowercase:gD,md5_base64:Dte,md5_base64url:zte,md5_hex:Pte,nanoid:GP,null:hD,number:fD,rfc5322Email:Ate,sha1_base64:Lte,sha1_base64url:Fte,sha1_hex:Ute,sha256_base64:Bte,sha256_base64url:Hte,sha256_hex:Vte,sha384_base64:qte,sha384_base64url:Kte,sha384_hex:Gte,sha512_base64:Yte,sha512_base64url:Xte,sha512_hex:Zte,string:cD,time:aD,ulid:VP,undefined:pD,unicodeEmail:YP,uppercase:vD,uuid:Zc,uuid4:Nte,uuid6:Tte,uuid7:kte,xid:BP},Symbol.toStringTag,{value:"Module"})),tn=Z("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bD={number:"number",bigint:"bigint",object:"date"},b0=Z("$ZodCheckLessThan",(e,t)=>{tn.init(e,t);const n=bD[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),x0=Z("$ZodCheckGreaterThan",(e,t)=>{tn.init(e,t);const n=bD[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xD=Z("$ZodCheckMultipleOf",(e,t)=>{tn.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):yP(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_D=Z("$ZodCheckNumberFormat",(e,t)=>{tn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[r,i]=wP[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=r,u.maximum=i,n&&(u.pattern=dD)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):l.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}u<r&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>i&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inst:e})}}),wD=Z("$ZodCheckBigIntFormat",(e,t)=>{tn.init(e,t);const[n,o]=SP[t.format];e._zod.onattach.push(r=>{const i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{const i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),SD=Z("$ZodCheckMaxSize",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;r.size<=t.maximum||o.issues.push({origin:nv(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),CD=Z("$ZodCheckMinSize",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;r.size>=t.minimum||o.issues.push({origin:nv(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ED=Z("$ZodCheckSizeEquals",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{const r=o.value,i=r.size;if(i===t.size)return;const l=i>t.size;o.issues.push({origin:nv(r),...l?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),RD=Z("$ZodCheckMaxLength",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;if(r.length<=t.maximum)return;const l=rv(r);o.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jD=Z("$ZodCheckMinLength",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;if(r.length>=t.minimum)return;const l=rv(r);o.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ND=Z("$ZodCheckLengthEquals",(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ml(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{const r=o.value,i=r.length;if(i===t.length)return;const l=rv(r),u=i>t.length;o.issues.push({origin:l,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Xf=Z("$ZodCheckStringFormat",(e,t)=>{var n,o;tn.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),TD=Z("$ZodCheckRegex",(e,t)=>{Xf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kD=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=gD),Xf.init(e,t)}),OD=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=vD),Xf.init(e,t)}),AD=Z("$ZodCheckIncludes",(e,t)=>{tn.init(e,t);const n=Ys(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ID=Z("$ZodCheckStartsWith",(e,t)=>{tn.init(e,t);const n=new RegExp(`^${Ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),$D=Z("$ZodCheckEndsWith",(e,t)=>{tn.init(e,t);const n=new RegExp(`.*${Ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Ok(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues))}const MD=Z("$ZodCheckProperty",(e,t)=>{tn.init(e,t),e._zod.check=n=>{const o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>Ok(r,n,t.property));Ok(o,n,t.property)}}),PD=Z("$ZodCheckMimeType",(e,t)=>{tn.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),DD=Z("$ZodCheckOverwrite",(e,t)=>{tn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class zD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
298
+ `).filter(l=>l),r=Math.min(...o.map(l=>l.length-l.trimStart().length)),i=o.map(l=>l.slice(r)).map(l=>" ".repeat(this.indent*2)+l);for(const l of i)this.content.push(l)}compile(){const t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
299
+ `))}}const UD={major:4,minor:1,patch:8},Je=Z("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=UD;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const r of o)for(const i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(l,u,f)=>{let m=Pa(l),p;for(const g of u){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,x=g._zod.check(l);if(x instanceof Promise&&f?.async===!1)throw new Va;if(p||x instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await x,l.issues.length!==v&&(m||(m=Pa(l,v)))});else{if(l.issues.length===v)continue;m||(m=Pa(l,v))}}return p?p.then(()=>l):l},i=(l,u,f)=>{if(Pa(l))return l.aborted=!0,l;const m=r(u,o,f);if(m instanceof Promise){if(f.async===!1)throw new Va;return m.then(p=>e._zod.parse(p,f))}return e._zod.parse(m,f)};e._zod.run=(l,u)=>{if(u.skipChecks)return e._zod.parse(l,u);if(u.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return m instanceof Promise?m.then(p=>i(p,l,u)):i(m,l,u)}const f=e._zod.parse(l,u);if(f instanceof Promise){if(u.async===!1)throw new Va;return f.then(m=>r(m,o,u))}return r(f,o,u)}}e["~standard"]={validate:r=>{try{const i=zP(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return UP(e,r).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}}),Wf=Z("$ZodString",(e,t)=>{Je.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cD(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ut=Z("$ZodStringFormat",(e,t)=>{Xf.init(e,t),Wf.init(e,t)}),LD=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=KP),Ut.init(e,t)}),FD=Z("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zc(o))}else t.pattern??(t.pattern=Zc());Ut.init(e,t)}),VD=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ZP),Ut.init(e,t)}),BD=Z("$ZodURL",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v0.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),HD=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=XP()),Ut.init(e,t)}),GD=Z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=GP),Ut.init(e,t)}),qD=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=LP),Ut.init(e,t)}),KD=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=FP),Ut.init(e,t)}),ZD=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=VP),Ut.init(e,t)}),YD=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=BP),Ut.init(e,t)}),XD=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=HP),Ut.init(e,t)}),WD=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lD(t)),Ut.init(e,t)}),QD=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=iD),Ut.init(e,t)}),JD=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=aD(t)),Ut.init(e,t)}),e2=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qP),Ut.init(e,t)}),t2=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=WP),Ut.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv4"})}),n2=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=QP),Ut.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),r2=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=JP),Ut.init(e,t)}),o2=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eD),Ut.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[r,i]=o;if(!i)throw new Error;const l=Number(i);if(`${l}`!==i)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function _0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const i2=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tD),Ut.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{_0(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function s2(e){if(!g0.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return _0(n)}const a2=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=g0),Ut.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{s2(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),l2=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rD),Ut.init(e,t)});function c2(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const u2=Z("$ZodJWT",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{c2(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),d2=Z("$ZodCustomStringFormat",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),w0=Z("$ZodNumber",(e,t)=>{Je.init(e,t),e._zod.pattern=e._zod.bag.pattern??fD,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;const i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),f2=Z("$ZodNumber",(e,t)=>{_D.init(e,t),w0.init(e,t)}),S0=Z("$ZodBoolean",(e,t)=>{Je.init(e,t),e._zod.pattern=mD,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),C0=Z("$ZodBigInt",(e,t)=>{Je.init(e,t),e._zod.pattern=uD,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),m2=Z("$ZodBigInt",(e,t)=>{wD.init(e,t),C0.init(e,t)}),h2=Z("$ZodSymbol",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),p2=Z("$ZodUndefined",(e,t)=>{Je.init(e,t),e._zod.pattern=pD,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{const r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),g2=Z("$ZodNull",(e,t)=>{Je.init(e,t),e._zod.pattern=hD,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{const r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),v2=Z("$ZodAny",(e,t)=>{Je.init(e,t),e._zod.parse=n=>n}),y2=Z("$ZodUnknown",(e,t)=>{Je.init(e,t),e._zod.parse=n=>n}),b2=Z("$ZodNever",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),x2=Z("$ZodVoid",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),_2=Z("$ZodDate",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Ak(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const w2=Z("$ZodArray",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const i=[];for(let l=0;l<r.length;l++){const u=r[l],f=t.element._zod.run({value:u,issues:[]},o);f instanceof Promise?i.push(f.then(m=>Ak(m,n,l))):Ak(f,n,l)}return i.length?Promise.all(i).then(()=>n):n}});function Wp(e,t,n,o){e.issues.length&&t.issues.push(...Vo(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function S2(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=_P(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function C2(e,t,n,o,r,i){const l=[],u=r.keySet,f=r.catchall._zod,m=f.def.type;for(const p of Object.keys(t)){if(u.has(p))continue;if(m==="never"){l.push(p);continue}const g=f.run({value:t[p],issues:[]},o);g instanceof Promise?e.push(g.then(v=>Wp(v,n,p,t))):Wp(g,n,p,t)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const E2=Z("$ZodObject",(e,t)=>{Je.init(e,t);const n=Bf(()=>S2(t));yt(e._zod,"propValues",()=>{const l=t.shape,u={};for(const f in l){const m=l[f]._zod;if(m.values){u[f]??(u[f]=new Set);for(const p of m.values)u[f].add(p)}}return u});const o=qc,r=t.catchall;let i;e._zod.parse=(l,u)=>{i??(i=n.value);const f=l.value;if(!o(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;l.value={};const m=[],p=i.shape;for(const g of i.keys){const x=p[g]._zod.run({value:f[g],issues:[]},u);x instanceof Promise?m.push(x.then(b=>Wp(b,l,g,f))):Wp(x,l,g,f)}return r?C2(m,f,l,u,n.value,e):m.length?Promise.all(m).then(()=>l):l}}),R2=Z("$ZodObjectJIT",(e,t)=>{E2.init(e,t);const n=e._zod.parse,o=Bf(()=>S2(t)),r=v=>{const x=new zD(["shape","payload","ctx"]),b=o.value,S=N=>{const T=yw(N);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};x.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const N of b.keys)C[N]=`key_${E++}`;x.write("const newResult = {};");for(const N of b.keys){const T=C[N],k=yw(N);x.write(`const ${T} = ${S(N)};`),x.write(`
300
+ if (${T}.issues.length) {
301
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
302
+ ...iss,
303
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
304
+ })));
305
+ }
306
+
307
+
308
+ if (${T}.value === undefined) {
309
+ if (${k} in input) {
310
+ newResult[${k}] = undefined;
311
+ }
312
+ } else {
313
+ newResult[${k}] = ${T}.value;
314
+ }
315
+
316
+ `)}x.write("payload.value = newResult;"),x.write("return payload;");const j=x.compile();return(N,T)=>j(v,N,T)};let i;const l=qc,u=!qp.jitless,m=u&&bP.value,p=t.catchall;let g;e._zod.parse=(v,x)=>{g??(g=o.value);const b=v.value;return l(b)?u&&m&&x?.async===!1&&x.jitless!==!0?(i||(i=r(t.shape)),v=i(v,x),p?C2([],b,v,x,g,e):v):n(v,x):(v.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),v)}});function Ik(e,t,n,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const r=e.filter(i=>!Pa(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(l=>qo(l,o,Sr())))}),t)}const E0=Z("$ZodUnion",(e,t)=>{Je.init(e,t),yt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),yt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),yt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),yt(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>Jg(i.source)).join("|")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let l=!1;const u=[];for(const f of t.options){const m=f._zod.run({value:r.value,issues:[]},i);if(m instanceof Promise)u.push(m),l=!0;else{if(m.issues.length===0)return m;u.push(m)}}return l?Promise.all(u).then(f=>Ik(f,r,e,i)):Ik(u,r,e,i)}}),j2=Z("$ZodDiscriminatedUnion",(e,t)=>{E0.init(e,t);const n=e._zod.parse;yt(e._zod,"propValues",()=>{const r={};for(const i of t.options){const l=i._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[u,f]of Object.entries(l)){r[u]||(r[u]=new Set);for(const m of f)r[u].add(m)}}return r});const o=Bf(()=>{const r=t.options,i=new Map;for(const l of r){const u=l._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const f of u){if(i.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);i.set(f,l)}}return i});e._zod.parse=(r,i)=>{const l=r.value;if(!qc(l))return r.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),r;const u=o.value.get(l?.[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),r)}}),N2=Z("$ZodIntersection",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value,i=t.left._zod.run({value:r,issues:[]},o),l=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||l instanceof Promise?Promise.all([i,l]).then(([f,m])=>$k(n,f,m)):$k(n,i,l)}});function bw(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wa(e)&&Wa(t)){const n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(const i of o){const l=bw(e[i],t[i]);if(!l.valid)return{valid:!1,mergeErrorPath:[i,...l.mergeErrorPath]};r[i]=l.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const r=e[o],i=t[o],l=bw(r,i);if(!l.valid)return{valid:!1,mergeErrorPath:[o,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $k(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Pa(e))return e;const o=bw(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const R0=Z("$ZodTuple",(e,t)=>{Je.init(e,t);const n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{const l=r.value;if(!Array.isArray(l))return r.issues.push({input:l,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const u=[];if(!t.rest){const m=l.length>n.length,p=l.length<o-1;if(m||p)return r.issues.push({...m?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:l,inst:e,origin:"array"}),r}let f=-1;for(const m of n){if(f++,f>=l.length&&f>=o)continue;const p=m._zod.run({value:l[f],issues:[]},i);p instanceof Promise?u.push(p.then(g=>zh(g,r,f))):zh(p,r,f)}if(t.rest){const m=l.slice(n.length);for(const p of m){f++;const g=t.rest._zod.run({value:p,issues:[]},i);g instanceof Promise?u.push(g.then(v=>zh(v,r,f))):zh(g,r,f)}}return u.length?Promise.all(u).then(()=>r):r}});function zh(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const T2=Z("$ZodRecord",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Wa(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;const i=[];if(t.keyType._zod.values){const l=t.keyType._zod.values;n.value={};for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){const m=t.valueType._zod.run({value:r[f],issues:[]},o);m instanceof Promise?i.push(m.then(p=>{p.issues.length&&n.issues.push(...Vo(f,p.issues)),n.value[f]=p.value})):(m.issues.length&&n.issues.push(...Vo(f,m.issues)),n.value[f]=m.value)}let u;for(const f in r)l.has(f)||(u=u??[],u.push(f));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{n.value={};for(const l of Reflect.ownKeys(r)){if(l==="__proto__")continue;const u=t.keyType._zod.run({value:l,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>qo(m,o,Sr())),input:l,path:[l],inst:e}),n.value[u.value]=u.value;continue}const f=t.valueType._zod.run({value:r[l],issues:[]},o);f instanceof Promise?i.push(f.then(m=>{m.issues.length&&n.issues.push(...Vo(l,m.issues)),n.value[u.value]=m.value})):(f.issues.length&&n.issues.push(...Vo(l,f.issues)),n.value[u.value]=f.value)}}return i.length?Promise.all(i).then(()=>n):n}}),k2=Z("$ZodMap",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;const i=[];n.value=new Map;for(const[l,u]of r){const f=t.keyType._zod.run({value:l,issues:[]},o),m=t.valueType._zod.run({value:u,issues:[]},o);f instanceof Promise||m instanceof Promise?i.push(Promise.all([f,m]).then(([p,g])=>{Mk(p,g,n,l,r,e,o)})):Mk(f,m,n,l,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function Mk(e,t,n,o,r,i,l){e.issues.length&&(Zp.has(typeof o)?n.issues.push(...Vo(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(u=>qo(u,l,Sr()))})),t.issues.length&&(Zp.has(typeof o)?n.issues.push(...Vo(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(u=>qo(u,l,Sr()))})),n.value.set(e.value,t.value)}const O2=Z("$ZodSet",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const l of r){const u=t.valueType._zod.run({value:l,issues:[]},o);u instanceof Promise?i.push(u.then(f=>Pk(f,n))):Pk(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function Pk(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const A2=Z("$ZodEnum",(e,t)=>{Je.init(e,t);const n=o0(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>Zp.has(typeof r)).map(r=>typeof r=="string"?Ys(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const l=r.value;return o.has(l)||r.issues.push({code:"invalid_value",values:n,input:l,inst:e}),r}}),I2=Z("$ZodLiteral",(e,t)=>{if(Je.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ys(n):n?Ys(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),$2=Z("$ZodFile",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),M2=Z("$ZodTransform",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Qg(e.constructor.name);const r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(l=>(n.value=l,n));if(r instanceof Promise)throw new Va;return n.value=r,n}});function Dk(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const P2=Z("$ZodOptional",(e,t)=>{Je.init(e,t),e._zod.optin="optional",e._zod.optout="optional",yt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),yt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jg(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Dk(i,n.value)):Dk(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),D2=Z("$ZodNullable",(e,t)=>{Je.init(e,t),yt(e._zod,"optin",()=>t.innerType._zod.optin),yt(e._zod,"optout",()=>t.innerType._zod.optout),yt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jg(n.source)}|null)$`):void 0}),yt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),z2=Z("$ZodDefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",yt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>zk(i,t)):zk(r,t)}});function zk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const U2=Z("$ZodPrefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",yt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),L2=Z("$ZodNonOptional",(e,t)=>{Je.init(e,t),yt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Uk(i,e)):Uk(r,e)}});function Uk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const F2=Z("$ZodSuccess",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Qg("ZodSuccess");const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),V2=Z("$ZodCatch",(e,t)=>{Je.init(e,t),yt(e._zod,"optin",()=>t.innerType._zod.optin),yt(e._zod,"optout",()=>t.innerType._zod.optout),yt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(l=>qo(l,o,Sr()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>qo(i,o,Sr()))},input:n.value}),n.issues=[]),n)}}),B2=Z("$ZodNaN",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),H2=Z("$ZodPipe",(e,t)=>{Je.init(e,t),yt(e._zod,"values",()=>t.in._zod.values),yt(e._zod,"optin",()=>t.in._zod.optin),yt(e._zod,"optout",()=>t.out._zod.optout),yt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(n,o);return i instanceof Promise?i.then(l=>Uh(l,t.in,o)):Uh(i,t.in,o)}const r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>Uh(i,t.out,o)):Uh(r,t.out,o)}});function Uh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const j0=Z("$ZodCodec",(e,t)=>{Je.init(e,t),yt(e._zod,"values",()=>t.in._zod.values),yt(e._zod,"optin",()=>t.in._zod.optin),yt(e._zod,"optout",()=>t.out._zod.optout),yt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){const i=t.in._zod.run(n,o);return i instanceof Promise?i.then(l=>Lh(l,t,o)):Lh(i,t,o)}else{const i=t.out._zod.run(n,o);return i instanceof Promise?i.then(l=>Lh(l,t,o)):Lh(i,t,o)}}});function Lh(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>Fh(e,i,t.out,n)):Fh(e,r,t.out,n)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>Fh(e,i,t.in,n)):Fh(e,r,t.in,n)}}function Fh(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}const G2=Z("$ZodReadonly",(e,t)=>{Je.init(e,t),yt(e._zod,"propValues",()=>t.innerType._zod.propValues),yt(e._zod,"values",()=>t.innerType._zod.values),yt(e._zod,"optin",()=>t.innerType._zod.optin),yt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(Lk):Lk(r)}});function Lk(e){return e.value=Object.freeze(e.value),e}const q2=Z("$ZodTemplateLiteral",(e,t)=>{Je.init(e,t);const n=[];for(const o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);const r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);const i=r.startsWith("^")?1:0,l=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,l))}else if(o===null||xP.has(typeof o))n.push(Ys(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),K2=Z("$ZodFunction",(e,t)=>(Je.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){const r=e._def.input?Yp(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Yp(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){const r=e._def.input?await Xp(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await Xp(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new R0({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{const o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),Z2=Z("$ZodPromise",(e,t)=>{Je.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),Y2=Z("$ZodLazy",(e,t)=>{Je.init(e,t),yt(e._zod,"innerType",()=>t.getter()),yt(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),yt(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),yt(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),yt(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),X2=Z("$ZodCustom",(e,t)=>{tn.init(e,t),Je.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>Fk(i,n,o,e));Fk(r,n,o,e)}});function Fk(e,t,n,o){if(!e){const r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Kc(r))}}const Wte=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return r=>{switch(r.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${r.expected}، ولكن تم إدخال ${n(r.input)}`;case"invalid_value":return r.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${Xe(r.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${l.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${l.unit}`:`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`:i.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`:i.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`:i.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`:`${o[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${we(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};function Qte(){return{localeError:Wte()}}const Jte=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanlış dəyər: gözlənilən ${Xe(r.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${l.unit??"element"}`:`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${l.unit}`:`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`:i.format==="ends_with"?`Yanlış mətn: "${i.suffix}" ilə bitməlidir`:i.format==="includes"?`Yanlış mətn: "${i.includes}" daxil olmalıdır`:i.format==="regex"?`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${we(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function ene(){return{localeError:Jte()}}function Vk(e,t,n,o){const r=Math.abs(e),i=r%10,l=r%100;return l>=11&&l<=19?o:i===1?t:i>=2&&i<=4?n:o}const tne=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"лік";case"object":{if(Array.isArray(r))return"масіў";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return r=>{switch(r.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${r.expected}, атрымана ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Няправільны ўвод: чакалася ${Xe(r.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);if(l){const u=Number(r.maximum),f=Vk(u,l.unit.one,l.unit.few,l.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${l.verb} ${i}${r.maximum.toString()} ${f}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);if(l){const u=Number(r.minimum),f=Vk(u,l.unit.one,l.unit.few,l.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${l.verb} ${i}${r.minimum.toString()} ${f}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${i.prefix}"`:i.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${i.suffix}"`:i.format==="includes"?`Няправільны радок: павінен змяшчаць "${i.includes}"`:i.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`:`Няправільны ${o[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${we(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function nne(){return{localeError:tne()}}const rne=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus invàlid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor invàlid: s'esperava ${Xe(r.values[0])}`:`Opció invàlida: s'esperava una de ${we(r.values," o ")}`;case"too_big":{const i=r.inclusive?"com a màxim":"menys de",l=t(r.origin);return l?`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${l.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?"com a mínim":"més de",l=t(r.origin);return l?`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${l.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Format invàlid: ha de començar amb "${i.prefix}"`:i.format==="ends_with"?`Format invàlid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format invàlid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${i.pattern}`:`Format invàlid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};function one(){return{localeError:rne()}}const ine=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatný vstup: očekáváno ${r.expected}, obdrženo ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatný vstup: očekáváno ${Xe(r.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${l.unit??"prvků"}`:`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${l.unit??"prvků"}`:`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Neplatný řetězec: musí začínat na "${i.prefix}"`:i.format==="ends_with"?`Neplatný řetězec: musí končit na "${i.suffix}"`:i.format==="includes"?`Neplatný řetězec: musí obsahovat "${i.includes}"`:i.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`:`Neplatný formát ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${we(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};function sne(){return{localeError:ine()}}const ane=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(l){return e[l]??null}function o(l){return t[l]??l}const r=l=>{const u=typeof l;switch(u){case"number":return Number.isNaN(l)?"NaN":"tal";case"object":return Array.isArray(l)?"liste":l===null?"null":Object.getPrototypeOf(l)!==Object.prototype&&l.constructor?l.constructor.name:"objekt"}return u},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return l=>{switch(l.code){case"invalid_type":return`Ugyldigt input: forventede ${o(l.expected)}, fik ${o(r(l.input))}`;case"invalid_value":return l.values.length===1?`Ugyldig værdi: forventede ${Xe(l.values[0])}`:`Ugyldigt valg: forventede en af følgende ${we(l.values,"|")}`;case"too_big":{const u=l.inclusive?"<=":"<",f=n(l.origin),m=o(l.origin);return f?`For stor: forventede ${m??"value"} ${f.verb} ${u} ${l.maximum.toString()} ${f.unit??"elementer"}`:`For stor: forventede ${m??"value"} havde ${u} ${l.maximum.toString()}`}case"too_small":{const u=l.inclusive?">=":">",f=n(l.origin),m=o(l.origin);return f?`For lille: forventede ${m} ${f.verb} ${u} ${l.minimum.toString()} ${f.unit}`:`For lille: forventede ${m} havde ${u} ${l.minimum.toString()}`}case"invalid_format":{const u=l;return u.format==="starts_with"?`Ugyldig streng: skal starte med "${u.prefix}"`:u.format==="ends_with"?`Ugyldig streng: skal ende med "${u.suffix}"`:u.format==="includes"?`Ugyldig streng: skal indeholde "${u.includes}"`:u.format==="regex"?`Ugyldig streng: skal matche mønsteret ${u.pattern}`:`Ugyldig ${i[u.format]??l.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${l.divisor}`;case"unrecognized_keys":return`${l.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${we(l.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${l.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${l.origin}`;default:return"Ugyldigt input"}}};function lne(){return{localeError:ane()}}const cne=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ungültige Eingabe: erwartet ${Xe(r.values[0])}`:`Ungültige Option: erwartet eine von ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${l.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${l.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ungültiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ungültiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ungültiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`:`Ungültig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${we(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};function une(){return{localeError:cne()}}const dne=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},fne=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${dne(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Xe(o.values[0])}`:`Invalid option: expected one of ${we(o.values,"|")}`;case"too_big":{const r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{const r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${we(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function W2(){return{localeError:fne()}}const mne=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},hne=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}const n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${mne(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendiĝis ${Xe(o.values[0])}`:`Nevalida opcio: atendiĝis unu el ${we(o.values,"|")}`;case"too_big":{const r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{const r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendiĝis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendiĝis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${we(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function pne(){return{localeError:hne()}}const gne=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(l){return e[l]??null}function o(l){return t[l]??l}const r=l=>{const u=typeof l;switch(u){case"number":return Number.isNaN(l)?"NaN":"number";case"object":return Array.isArray(l)?"array":l===null?"null":Object.getPrototypeOf(l)!==Object.prototype?l.constructor.name:"object"}return u},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return l=>{switch(l.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(l.expected)}, recibido ${o(r(l.input))}`;case"invalid_value":return l.values.length===1?`Entrada inválida: se esperaba ${Xe(l.values[0])}`:`Opción inválida: se esperaba una de ${we(l.values,"|")}`;case"too_big":{const u=l.inclusive?"<=":"<",f=n(l.origin),m=o(l.origin);return f?`Demasiado grande: se esperaba que ${m??"valor"} tuviera ${u}${l.maximum.toString()} ${f.unit??"elementos"}`:`Demasiado grande: se esperaba que ${m??"valor"} fuera ${u}${l.maximum.toString()}`}case"too_small":{const u=l.inclusive?">=":">",f=n(l.origin),m=o(l.origin);return f?`Demasiado pequeño: se esperaba que ${m} tuviera ${u}${l.minimum.toString()} ${f.unit}`:`Demasiado pequeño: se esperaba que ${m} fuera ${u}${l.minimum.toString()}`}case"invalid_format":{const u=l;return u.format==="starts_with"?`Cadena inválida: debe comenzar con "${u.prefix}"`:u.format==="ends_with"?`Cadena inválida: debe terminar en "${u.suffix}"`:u.format==="includes"?`Cadena inválida: debe incluir "${u.includes}"`:u.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${u.pattern}`:`Inválido ${i[u.format]??l.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${l.divisor}`;case"unrecognized_keys":return`Llave${l.keys.length>1?"s":""} desconocida${l.keys.length>1?"s":""}: ${we(l.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(l.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(l.origin)}`;default:return"Entrada inválida"}}};function vne(){return{localeError:gne()}}const yne=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"آرایه";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return r=>{switch(r.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${r.expected} می‌بود، ${n(r.input)} دریافت شد`;case"invalid_value":return r.values.length===1?`ورودی نامعتبر: می‌بایست ${Xe(r.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${we(r.values,"|")} می‌بود`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${l.unit??"عنصر"} باشد`:`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${l.unit} باشد`:`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{const i=r;return i.format==="starts_with"?`رشته نامعتبر: باید با "${i.prefix}" شروع شود`:i.format==="ends_with"?`رشته نامعتبر: باید با "${i.suffix}" تمام شود`:i.format==="includes"?`رشته نامعتبر: باید شامل "${i.includes}" باشد`:i.format==="regex"?`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`:`${o[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${we(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};function bne(){return{localeError:yne()}}const xne=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen syöte: täytyy olla ${Xe(r.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Liian suuri: ${l.subject} täytyy olla ${i}${r.maximum.toString()} ${l.unit}`.trim():`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Liian pieni: ${l.subject} täytyy olla ${i}${r.minimum.toString()} ${l.unit}`.trim():`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen syöte: täytyy sisältää "${i.includes}"`:i.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${we(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function _ne(){return{localeError:xne()}}const wne=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return r=>{switch(r.code){case"invalid_type":return`Entrée invalide : ${r.expected} attendu, ${n(r.input)} reçu`;case"invalid_value":return r.values.length===1?`Entrée invalide : ${Xe(r.values[0])} attendu`:`Option invalide : une valeur parmi ${we(r.values,"|")} attendue`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Trop grand : ${r.origin??"valeur"} doit ${l.verb} ${i}${r.maximum.toString()} ${l.unit??"élément(s)"}`:`Trop grand : ${r.origin??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Trop petit : ${r.origin} doit ${l.verb} ${i}${r.minimum.toString()} ${l.unit}`:`Trop petit : ${r.origin} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Chaîne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${we(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Sne(){return{localeError:wne()}}const Cne=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return r=>{switch(r.code){case"invalid_type":return`Entrée invalide : attendu ${r.expected}, reçu ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrée invalide : attendu ${Xe(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"≤":"<",l=t(r.origin);return l?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${l.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?"≥":">",l=t(r.origin);return l?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${l.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Chaîne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${we(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Ene(){return{localeError:Cne()}}const Rne=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return r=>{switch(r.code){case"invalid_type":return`קלט לא תקין: צריך ${r.expected}, התקבל ${n(r.input)}`;case"invalid_value":return r.values.length===1?`קלט לא תקין: צריך ${Xe(r.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()} ${l.unit??"elements"}`:`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()} ${l.unit}`:`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`:i.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`:i.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`:i.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`:`${o[i.format]??r.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${r.divisor}`;case"unrecognized_keys":return`מפתח${r.keys.length>1?"ות":""} לא מזוה${r.keys.length>1?"ים":"ה"}: ${we(r.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${r.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r.origin}`;default:return"קלט לא תקין"}}};function jne(){return{localeError:Rne()}}const Nne=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"szám";case"object":{if(Array.isArray(r))return"tömb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${r.expected}, a kapott érték ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Érvénytelen bemenet: a várt érték ${Xe(r.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${l.unit??"elem"}`:`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${l.unit}`:`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`:i.format==="ends_with"?`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`:i.format==="includes"?`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`:i.format==="regex"?`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`:`Érvénytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};function Tne(){return{localeError:Nne()}}const kne=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${Xe(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${l.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${l.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function One(){return{localeError:kne()}}const Ane=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Ine=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(o){return e[o]??null}const n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Ane(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert ráð fyrir ${Xe(o.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${we(o.values,"|")}`;case"too_big":{const r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${r}${o.maximum.toString()}`}case"too_small":{const r=o.inclusive?">=":">",i=t(o.origin);return i?`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`:`Of lítið: gert er ráð fyrir að ${o.origin} sé ${r}${o.minimum.toString()}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`Ógildur strengur: verður að byrja á "${r.prefix}"`:r.format==="ends_with"?`Ógildur strengur: verður að enda á "${r.suffix}"`:r.format==="includes"?`Ógildur strengur: verður að innihalda "${r.includes}"`:r.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`:`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${we(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function $ne(){return{localeError:Ine()}}const Mne=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${Xe(r.values[0])}`:`Opzione non valida: atteso uno tra ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${l.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${l.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${we(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Pne(){return{localeError:Mne()}}const Dne=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"数値";case"object":{if(Array.isArray(r))return"配列";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return r=>{switch(r.code){case"invalid_type":return`無効な入力: ${r.expected}が期待されましたが、${n(r.input)}が入力されました`;case"invalid_value":return r.values.length===1?`無効な入力: ${Xe(r.values[0])}が期待されました`:`無効な選択: ${we(r.values,"、")}のいずれかである必要があります`;case"too_big":{const i=r.inclusive?"以下である":"より小さい",l=t(r.origin);return l?`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${l.unit??"要素"}${i}必要があります`:`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{const i=r.inclusive?"以上である":"より大きい",l=t(r.origin);return l?`小さすぎる値: ${r.origin}は${r.minimum.toString()}${l.unit}${i}必要があります`:`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{const i=r;return i.format==="starts_with"?`無効な文字列: "${i.prefix}"で始まる必要があります`:i.format==="ends_with"?`無効な文字列: "${i.suffix}"で終わる必要があります`:i.format==="includes"?`無効な文字列: "${i.includes}"を含む必要があります`:i.format==="regex"?`無効な文字列: パターン${i.pattern}に一致する必要があります`:`無効な${o[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${we(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};function zne(){return{localeError:Dne()}}const Une=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},Lne=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(o){return e[o]??null}const n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return o=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${Une(o.input)}`;case"invalid_value":return o.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${Xe(o.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${we(o.values,"|")}-დან`;case"too_big":{const r=o.inclusive?"<=":"<",i=t(o.origin);return i?`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${r}${o.maximum.toString()}`}case"too_small":{const r=o.inclusive?">=":">",i=t(o.origin);return i?`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${r}${o.minimum.toString()}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${r.prefix}"-ით`:r.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${r.suffix}"-ით`:r.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${r.includes}"-ს`:r.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`:`არასწორი ${n[r.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${we(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Fne(){return{localeError:Lne()}}const Vne=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(r))return"អារេ (Array)";if(r===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return r=>{switch(r.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r.expected} ប៉ុន្តែទទួលបាន ${n(r.input)}`;case"invalid_value":return r.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Xe(r.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${l.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${l.unit}`:`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`:i.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`:i.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`:i.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`:`មិនត្រឹមត្រូវ៖ ${o[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${we(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Q2(){return{localeError:Vne()}}function Bne(){return Q2()}const Hne=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return r=>{switch(r.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${r.expected}, 받은 타입은 ${n(r.input)}입니다`;case"invalid_value":return r.values.length===1?`잘못된 입력: 값은 ${Xe(r.values[0])} 이어야 합니다`:`잘못된 옵션: ${we(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const i=r.inclusive?"이하":"미만",l=i==="미만"?"이어야 합니다":"여야 합니다",u=t(r.origin),f=u?.unit??"요소";return u?`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${f} ${i}${l}`:`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${l}`}case"too_small":{const i=r.inclusive?"이상":"초과",l=i==="이상"?"이어야 합니다":"여야 합니다",u=t(r.origin),f=u?.unit??"요소";return u?`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${f} ${i}${l}`:`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${l}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`:i.format==="ends_with"?`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`:i.format==="includes"?`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`:i.format==="regex"?`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`:`잘못된 ${o[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${we(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};function Gne(){return{localeError:Hne()}}const qne=e=>Ld(typeof e,e),Ld=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"nežinomas objektas":t===null?"nulinė reikšmė":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulinė reikšmė"}return e},Id=e=>e.charAt(0).toUpperCase()+e.slice(1);function Bk(e){const t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}const Kne=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(o,r,i,l){const u=e[o]??null;return u===null?u:{unit:u.unit[r],verb:u.verb[l][i?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${qne(o.input)}, o tikėtasi - ${Ld(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo būti ${Xe(o.values[0])}`:`Privalo būti vienas iš ${we(o.values,"|")} pasirinkimų`;case"too_big":{const r=Ld(o.origin),i=t(o.origin,Bk(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${Id(r??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;const l=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Id(r??o.origin??"reikšmė")} turi būti ${l} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{const r=Ld(o.origin),i=t(o.origin,Bk(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${Id(r??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;const l=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Id(r??o.origin??"reikšmė")} turi būti ${l} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`Eilutė privalo prasidėti "${r.prefix}"`:r.format==="ends_with"?`Eilutė privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilutė privalo įtraukti "${r.includes}"`:r.format==="regex"?`Eilutė privalo atitikti ${r.pattern}`:`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${we(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const r=Ld(o.origin);return`${Id(r??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Zne(){return{localeError:Kne()}}const Yne=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"број";case"object":{if(Array.isArray(r))return"низа";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return r=>{switch(r.code){case"invalid_type":return`Грешен внес: се очекува ${r.expected}, примено ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${Xe(r.values[0])}`:`Грешана опција: се очекува една ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${l.unit??"елементи"}`:`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${l.unit}`:`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Неважечка низа: мора да започнува со "${i.prefix}"`:i.format==="ends_with"?`Неважечка низа: мора да завршува со "${i.suffix}"`:i.format==="includes"?`Неважечка низа: мора да вклучува "${i.includes}"`:i.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${we(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};function Xne(){return{localeError:Yne()}}const Wne=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${Xe(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Terlalu besar: dijangka ${r.origin??"nilai"} ${l.verb} ${i}${r.maximum.toString()} ${l.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Terlalu kecil: dijangka ${r.origin} ${l.verb} ${i}${r.minimum.toString()} ${l.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${we(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Qne(){return{localeError:Wne()}}const Jne=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${Xe(r.values[0])}`:`Ongeldige optie: verwacht één van ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${l.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${l.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function ere(){return{localeError:Jne()}}const tre=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${Xe(r.values[0])}`:`Ugyldig valg: forventet en av ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${l.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${l.unit}`:`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ugyldig streng: må starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: må ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: må inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: må matche mønsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${we(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function nre(){return{localeError:tre()}}const rre=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`Fâsit giren: umulan ${r.expected}, alınan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Fâsit giren: umulan ${Xe(r.values[0])}`:`Fâsit tercih: mûteberler ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${l.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${l.unit} sahip olmalıydı.`:`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Fâsit metin: "${i.prefix}" ile başlamalı.`:i.format==="ends_with"?`Fâsit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`Fâsit metin: "${i.includes}" ihtivâ etmeli.`:i.format==="regex"?`Fâsit metin: ${i.pattern} nakşına uymalı.`:`Fâsit ${o[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function ore(){return{localeError:rre()}}const ire=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"ارې";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return r=>{switch(r.code){case"invalid_type":return`ناسم ورودي: باید ${r.expected} وای, مګر ${n(r.input)} ترلاسه شو`;case"invalid_value":return r.values.length===1?`ناسم ورودي: باید ${Xe(r.values[0])} وای`:`ناسم انتخاب: باید یو له ${we(r.values,"|")} څخه وای`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${l.unit??"عنصرونه"} ولري`:`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${l.unit} ولري`:`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{const i=r;return i.format==="starts_with"?`ناسم متن: باید د "${i.prefix}" سره پیل شي`:i.format==="ends_with"?`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`:i.format==="includes"?`ناسم متن: باید "${i.includes}" ولري`:i.format==="regex"?`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`:`${o[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${we(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};function sre(){return{localeError:ire()}}const are=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return r=>{switch(r.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${Xe(r.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${l.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${l.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`:i.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`:i.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`:i.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`:`Nieprawidłow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function lre(){return{localeError:are()}}const cre=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"número";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inválido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inválida: esperado ${Xe(r.values[0])}`:`Opção inválida: esperada uma das ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${l.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${l.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Texto inválido: deve começar com "${i.prefix}"`:i.format==="ends_with"?`Texto inválido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inválido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inválido: deve corresponder ao padrão ${i.pattern}`:`${o[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};function ure(){return{localeError:cre()}}function Hk(e,t,n,o){const r=Math.abs(e),i=r%10,l=r%100;return l>=11&&l<=19?o:i===1?t:i>=2&&i<=4?n:o}const dre=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"массив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return r=>{switch(r.code){case"invalid_type":return`Неверный ввод: ожидалось ${r.expected}, получено ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Неверный ввод: ожидалось ${Xe(r.values[0])}`:`Неверный вариант: ожидалось одно из ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);if(l){const u=Number(r.maximum),f=Hk(u,l.unit.one,l.unit.few,l.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${f}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);if(l){const u=Number(r.minimum),f=Hk(u,l.unit.one,l.unit.few,l.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${f}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Неверная строка: должна начинаться с "${i.prefix}"`:i.format==="ends_with"?`Неверная строка: должна заканчиваться на "${i.suffix}"`:i.format==="includes"?`Неверная строка: должна содержать "${i.includes}"`:i.format==="regex"?`Неверная строка: должна соответствовать шаблону ${i.pattern}`:`Неверный ${o[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function fre(){return{localeError:dre()}}const mre=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"število";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pričakovano ${Xe(r.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${l.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${l.unit}`:`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Neveljaven niz: mora se začeti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se končati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${we(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function hre(){return{localeError:mre()}}const pre=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: förväntat ${Xe(r.values[0])}`:`Ogiltigt val: förväntade en av ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${l.unit??"element"}`:`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${l.unit}`:`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ogiltig sträng: måste börja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig sträng: måste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig sträng: måste innehålla "${i.includes}"`:i.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${we(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};function gre(){return{localeError:pre()}}const vre=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(r))return"அணி";if(r===null)return"வெறுமை";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r.expected}, பெறப்பட்டது ${n(r.input)}`;case"invalid_value":return r.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Xe(r.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${we(r.values,"|")} இல் ஒன்று`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${l.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${l.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const i=r;return i.format==="starts_with"?`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`:i.format==="ends_with"?`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`:i.format==="includes"?`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`:i.format==="regex"?`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${o[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${we(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function yre(){return{localeError:vre()}}const bre=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(r))return"อาร์เรย์ (Array)";if(r===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return r=>{switch(r.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r.expected} แต่ได้รับ ${n(r.input)}`;case"invalid_value":return r.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${Xe(r.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"ไม่เกิน":"น้อยกว่า",l=t(r.origin);return l?`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${l.unit??"รายการ"}`:`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?"อย่างน้อย":"มากกว่า",l=t(r.origin);return l?`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${l.unit}`:`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`:i.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`:i.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`:i.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`:`รูปแบบไม่ถูกต้อง: ${o[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${we(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function xre(){return{localeError:bre()}}const _re=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wre=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(o){return e[o]??null}const n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${_re(o.input)}`;case"invalid_value":return o.values.length===1?`Geçersiz değer: beklenen ${Xe(o.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${we(o.values,"|")}`;case"too_big":{const r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()} ${i.unit??"öğe"}`:`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()}`}case"too_small":{const r=o.inclusive?">=":">",i=t(o.origin);return i?`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{const r=o;return r.format==="starts_with"?`Geçersiz metin: "${r.prefix}" ile başlamalı`:r.format==="ends_with"?`Geçersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Geçersiz metin: "${r.includes}" içermeli`:r.format==="regex"?`Geçersiz metin: ${r.pattern} desenine uymalı`:`Geçersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${we(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Sre(){return{localeError:wre()}}const Cre=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"масив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return r=>{switch(r.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${r.expected}, отримано ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Неправильні вхідні дані: очікується ${Xe(r.values[0])}`:`Неправильна опція: очікується одне з ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Занадто велике: очікується, що ${r.origin??"значення"} ${l.verb} ${i}${r.maximum.toString()} ${l.unit??"елементів"}`:`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Занадто мале: очікується, що ${r.origin} ${l.verb} ${i}${r.minimum.toString()} ${l.unit}`:`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Неправильний рядок: повинен починатися з "${i.prefix}"`:i.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`:i.format==="includes"?`Неправильний рядок: повинен містити "${i.includes}"`:i.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`:`Неправильний ${o[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${we(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};function J2(){return{localeError:Cre()}}function Ere(){return J2()}const Rre=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"نمبر";case"object":{if(Array.isArray(r))return"آرے";if(r===null)return"نل";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return r=>{switch(r.code){case"invalid_type":return`غلط ان پٹ: ${r.expected} متوقع تھا، ${n(r.input)} موصول ہوا`;case"invalid_value":return r.values.length===1?`غلط ان پٹ: ${Xe(r.values[0])} متوقع تھا`:`غلط آپشن: ${we(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${l.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${l.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const i=r;return i.format==="starts_with"?`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`:i.format==="ends_with"?`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`:i.format==="includes"?`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`:i.format==="regex"?`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`:`غلط ${o[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${we(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function jre(){return{localeError:Rre()}}const Nre=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"số";case"object":{if(Array.isArray(r))return"mảng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return r=>{switch(r.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${r.expected}, nhận được ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Đầu vào không hợp lệ: mong đợi ${Xe(r.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Quá lớn: mong đợi ${r.origin??"giá trị"} ${l.verb} ${i}${r.maximum.toString()} ${l.unit??"phần tử"}`:`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Quá nhỏ: mong đợi ${r.origin} ${l.verb} ${i}${r.minimum.toString()} ${l.unit}`:`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`:i.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`:i.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`:i.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`:`${o[i.format]??r.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${we(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};function Tre(){return{localeError:Nre()}}const kre=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(r))return"数组";if(r===null)return"空值(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return r=>{switch(r.code){case"invalid_type":return`无效输入:期望 ${r.expected},实际接收 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`无效输入:期望 ${Xe(r.values[0])}`:`无效选项:期望以下之一 ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${l.unit??"个元素"}`:`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${l.unit}`:`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`无效字符串:必须以 "${i.prefix}" 开头`:i.format==="ends_with"?`无效字符串:必须以 "${i.suffix}" 结尾`:i.format==="includes"?`无效字符串:必须包含 "${i.includes}"`:i.format==="regex"?`无效字符串:必须满足正则表达式 ${i.pattern}`:`无效${o[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${we(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Ore(){return{localeError:kre()}}const Are=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return r=>{switch(r.code){case"invalid_type":return`無效的輸入值:預期為 ${r.expected},但收到 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`無效的輸入值:預期為 ${Xe(r.values[0])}`:`無效的選項:預期為以下其中之一 ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${l.unit??"個元素"}`:`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${l.unit}`:`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`無效的字串:必須以 "${i.prefix}" 開頭`:i.format==="ends_with"?`無效的字串:必須以 "${i.suffix}" 結尾`:i.format==="includes"?`無效的字串:必須包含 "${i.includes}"`:i.format==="regex"?`無效的字串:必須符合格式 ${i.pattern}`:`無效的 ${o[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${we(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Ire(){return{localeError:Are()}}const $re=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}const n=r=>{const i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(r))return"akopọ";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return r=>{switch(r.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${r.expected}, àmọ̀ a rí ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${Xe(r.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${we(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",l=t(r.origin);return l?`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${l.verb} ${i}${r.maximum} ${l.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{const i=r.inclusive?">=":">",l=t(r.origin);return l?`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${l.verb} ${i}${r.minimum} ${l.unit}`:`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`:i.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`:i.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`:i.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`:`Aṣìṣe: ${o[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${we(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Mre(){return{localeError:$re()}}const ez=Object.freeze(Object.defineProperty({__proto__:null,ar:Qte,az:ene,be:nne,ca:one,cs:sne,da:lne,de:une,en:W2,eo:pne,es:vne,fa:bne,fi:_ne,fr:Sne,frCA:Ene,he:jne,hu:Tne,id:One,is:$ne,it:Pne,ja:zne,ka:Fne,kh:Bne,km:Q2,ko:Gne,lt:Zne,mk:Xne,ms:Qne,nl:ere,no:nre,ota:ore,pl:lre,ps:sre,pt:ure,ru:fre,sl:hre,sv:gre,ta:yre,th:xre,tr:Sre,ua:Ere,uk:J2,ur:jre,vi:Tre,yo:Mre,zhCN:Ore,zhTW:Ire},Symbol.toStringTag,{value:"Module"})),tz=Symbol("ZodOutput"),nz=Symbol("ZodInput");class N0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function T0(){return new N0}const Da=T0();function rz(e,t){return new e({type:"string",...pe(t)})}function oz(e,t){return new e({type:"string",coerce:!0,...pe(t)})}function k0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...pe(t)})}function Qp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...pe(t)})}function O0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...pe(t)})}function A0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...pe(t)})}function I0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...pe(t)})}function $0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...pe(t)})}function iv(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...pe(t)})}function M0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...pe(t)})}function P0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...pe(t)})}function D0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...pe(t)})}function z0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...pe(t)})}function U0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...pe(t)})}function L0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...pe(t)})}function F0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...pe(t)})}function V0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...pe(t)})}function B0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...pe(t)})}function H0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...pe(t)})}function G0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...pe(t)})}function q0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...pe(t)})}function K0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...pe(t)})}function Z0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...pe(t)})}function Y0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...pe(t)})}const iz={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function sz(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...pe(t)})}function az(e,t){return new e({type:"string",format:"date",check:"string_format",...pe(t)})}function lz(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...pe(t)})}function cz(e,t){return new e({type:"string",format:"duration",check:"string_format",...pe(t)})}function uz(e,t){return new e({type:"number",checks:[],...pe(t)})}function dz(e,t){return new e({type:"number",coerce:!0,checks:[],...pe(t)})}function fz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...pe(t)})}function mz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...pe(t)})}function hz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...pe(t)})}function pz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...pe(t)})}function gz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...pe(t)})}function vz(e,t){return new e({type:"boolean",...pe(t)})}function yz(e,t){return new e({type:"boolean",coerce:!0,...pe(t)})}function bz(e,t){return new e({type:"bigint",...pe(t)})}function xz(e,t){return new e({type:"bigint",coerce:!0,...pe(t)})}function _z(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...pe(t)})}function wz(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...pe(t)})}function Sz(e,t){return new e({type:"symbol",...pe(t)})}function Cz(e,t){return new e({type:"undefined",...pe(t)})}function Ez(e,t){return new e({type:"null",...pe(t)})}function Rz(e){return new e({type:"any"})}function jz(e){return new e({type:"unknown"})}function Nz(e,t){return new e({type:"never",...pe(t)})}function Tz(e,t){return new e({type:"void",...pe(t)})}function kz(e,t){return new e({type:"date",...pe(t)})}function Oz(e,t){return new e({type:"date",coerce:!0,...pe(t)})}function Az(e,t){return new e({type:"nan",...pe(t)})}function Qa(e,t){return new b0({check:"less_than",...pe(t),value:e,inclusive:!1})}function Bo(e,t){return new b0({check:"less_than",...pe(t),value:e,inclusive:!0})}function Ja(e,t){return new x0({check:"greater_than",...pe(t),value:e,inclusive:!1})}function Zr(e,t){return new x0({check:"greater_than",...pe(t),value:e,inclusive:!0})}function Iz(e){return Ja(0,e)}function $z(e){return Qa(0,e)}function Mz(e){return Bo(0,e)}function Pz(e){return Zr(0,e)}function uf(e,t){return new xD({check:"multiple_of",...pe(t),value:e})}function sv(e,t){return new SD({check:"max_size",...pe(t),maximum:e})}function df(e,t){return new CD({check:"min_size",...pe(t),minimum:e})}function X0(e,t){return new ED({check:"size_equals",...pe(t),size:e})}function av(e,t){return new RD({check:"max_length",...pe(t),maximum:e})}function Yc(e,t){return new jD({check:"min_length",...pe(t),minimum:e})}function lv(e,t){return new ND({check:"length_equals",...pe(t),length:e})}function W0(e,t){return new TD({check:"string_format",format:"regex",...pe(t),pattern:e})}function Q0(e){return new kD({check:"string_format",format:"lowercase",...pe(e)})}function J0(e){return new OD({check:"string_format",format:"uppercase",...pe(e)})}function eC(e,t){return new AD({check:"string_format",format:"includes",...pe(t),includes:e})}function tC(e,t){return new ID({check:"string_format",format:"starts_with",...pe(t),prefix:e})}function nC(e,t){return new $D({check:"string_format",format:"ends_with",...pe(t),suffix:e})}function Dz(e,t,n){return new MD({check:"property",property:e,schema:t,...pe(n)})}function rC(e,t){return new PD({check:"mime_type",mime:e,...pe(t)})}function hl(e){return new DD({check:"overwrite",tx:e})}function oC(e){return hl(t=>t.normalize(e))}function iC(){return hl(e=>e.trim())}function sC(){return hl(e=>e.toLowerCase())}function aC(){return hl(e=>e.toUpperCase())}function zz(e,t,n){return new e({type:"array",element:t,...pe(n)})}function Pre(e,t,n){return new e({type:"union",options:t,...pe(n)})}function Dre(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...pe(o)})}function zre(e,t,n){return new e({type:"intersection",left:t,right:n})}function Ure(e,t,n,o){const r=n instanceof Je,i=r?o:n,l=r?n:null;return new e({type:"tuple",items:t,rest:l,...pe(i)})}function Lre(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...pe(o)})}function Fre(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...pe(o)})}function Vre(e,t,n){return new e({type:"set",valueType:t,...pe(n)})}function Bre(e,t,n){const o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...pe(n)})}function Hre(e,t,n){return new e({type:"enum",entries:t,...pe(n)})}function Gre(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...pe(n)})}function Uz(e,t){return new e({type:"file",...pe(t)})}function qre(e,t){return new e({type:"transform",transform:t})}function Kre(e,t){return new e({type:"optional",innerType:t})}function Zre(e,t){return new e({type:"nullable",innerType:t})}function Yre(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():tv(n)}})}function Xre(e,t,n){return new e({type:"nonoptional",innerType:t,...pe(n)})}function Wre(e,t){return new e({type:"success",innerType:t})}function Qre(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function Jre(e,t,n){return new e({type:"pipe",in:t,out:n})}function eoe(e,t){return new e({type:"readonly",innerType:t})}function toe(e,t,n){return new e({type:"template_literal",parts:t,...pe(n)})}function noe(e,t){return new e({type:"lazy",getter:t})}function roe(e,t){return new e({type:"promise",innerType:t})}function Lz(e,t,n){const o=pe(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Fz(e,t,n){return new e({type:"custom",check:"custom",fn:t,...pe(n)})}function Vz(e){const t=Bz(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Kc(o,n.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Kc(r))}},e(n.value,n)));return t}function Bz(e,t){const n=new tn({check:"custom",...pe(t)});return n._zod.check=e,n}function Hz(e,t){const n=pe(t);let o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(x=>typeof x=="string"?x.toLowerCase():x),r=r.map(x=>typeof x=="string"?x.toLowerCase():x));const i=new Set(o),l=new Set(r),u=e.Codec??j0,f=e.Boolean??S0,m=e.String??Wf,p=new m({type:"string",error:n.error}),g=new f({type:"boolean",error:n.error}),v=new u({type:"pipe",in:p,out:g,transform:((x,b)=>{let S=x;return n.case!=="sensitive"&&(S=S.toLowerCase()),i.has(S)?!0:l.has(S)?!1:(b.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...l],input:b.value,inst:v,continue:!1}),{})}),reverseTransform:((x,b)=>x===!0?o[0]||"true":r[0]||"false"),error:n.error});return v}function Qf(e,t,n,o={}){const r=pe(o),i={...pe(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}class xw{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Da,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;const r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},l=this.seen.get(t);if(l)return l.count++,n.schemaPath.includes(t)&&(l.cycle=n.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,u);const f=t._zod.toJSONSchema?.();if(f)u.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,t],path:n.path},v=t._zod.parent;if(v)u.ref=v,this.process(v,g),this.seen.get(v).isParent=!0;else{const x=u.schema;switch(r.type){case"string":{const b=x;b.type="string";const{minimum:S,maximum:C,format:E,patterns:j,contentEncoding:N}=t._zod.bag;if(typeof S=="number"&&(b.minLength=S),typeof C=="number"&&(b.maxLength=C),E&&(b.format=i[E]??E,b.format===""&&delete b.format),N&&(b.contentEncoding=N),j&&j.size>0){const T=[...j];T.length===1?b.pattern=T[0].source:T.length>1&&(u.schema.allOf=[...T.map(k=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:k.source}))])}break}case"number":{const b=x,{minimum:S,maximum:C,format:E,multipleOf:j,exclusiveMaximum:N,exclusiveMinimum:T}=t._zod.bag;typeof E=="string"&&E.includes("int")?b.type="integer":b.type="number",typeof T=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(b.minimum=T,b.exclusiveMinimum=!0):b.exclusiveMinimum=T),typeof S=="number"&&(b.minimum=S,typeof T=="number"&&this.target!=="draft-4"&&(T>=S?delete b.minimum:delete b.exclusiveMinimum)),typeof N=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(b.maximum=N,b.exclusiveMaximum=!0):b.exclusiveMaximum=N),typeof C=="number"&&(b.maximum=C,typeof N=="number"&&this.target!=="draft-4"&&(N<=C?delete b.maximum:delete b.exclusiveMaximum)),typeof j=="number"&&(b.multipleOf=j);break}case"boolean":{const b=x;b.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(x.type="string",x.nullable=!0,x.enum=[null]):x.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{x.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const b=x,{minimum:S,maximum:C}=t._zod.bag;typeof S=="number"&&(b.minItems=S),typeof C=="number"&&(b.maxItems=C),b.type="array",b.items=this.process(r.element,{...g,path:[...g.path,"items"]});break}case"object":{const b=x;b.type="object",b.properties={};const S=r.shape;for(const j in S)b.properties[j]=this.process(S[j],{...g,path:[...g.path,"properties",j]});const C=new Set(Object.keys(S)),E=new Set([...C].filter(j=>{const N=r.shape[j]._zod;return this.io==="input"?N.optin===void 0:N.optout===void 0}));E.size>0&&(b.required=Array.from(E)),r.catchall?._zod.def.type==="never"?b.additionalProperties=!1:r.catchall?r.catchall&&(b.additionalProperties=this.process(r.catchall,{...g,path:[...g.path,"additionalProperties"]})):this.io==="output"&&(b.additionalProperties=!1);break}case"union":{const b=x,S=r.options.map((C,E)=>this.process(C,{...g,path:[...g.path,"anyOf",E]}));b.anyOf=S;break}case"intersection":{const b=x,S=this.process(r.left,{...g,path:[...g.path,"allOf",0]}),C=this.process(r.right,{...g,path:[...g.path,"allOf",1]}),E=N=>"allOf"in N&&Object.keys(N).length===1,j=[...E(S)?S.allOf:[S],...E(C)?C.allOf:[C]];b.allOf=j;break}case"tuple":{const b=x;b.type="array";const S=this.target==="draft-2020-12"?"prefixItems":"items",C=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",E=r.items.map((k,A)=>this.process(k,{...g,path:[...g.path,S,A]})),j=r.rest?this.process(r.rest,{...g,path:[...g.path,C,...this.target==="openapi-3.0"?[r.items.length]:[]]}):null;this.target==="draft-2020-12"?(b.prefixItems=E,j&&(b.items=j)):this.target==="openapi-3.0"?(b.items={anyOf:E},j&&b.items.anyOf.push(j),b.minItems=E.length,j||(b.maxItems=E.length)):(b.items=E,j&&(b.additionalItems=j));const{minimum:N,maximum:T}=t._zod.bag;typeof N=="number"&&(b.minItems=N),typeof T=="number"&&(b.maxItems=T);break}case"record":{const b=x;b.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(b.propertyNames=this.process(r.keyType,{...g,path:[...g.path,"propertyNames"]})),b.additionalProperties=this.process(r.valueType,{...g,path:[...g.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const b=x,S=o0(r.entries);S.every(C=>typeof C=="number")&&(b.type="number"),S.every(C=>typeof C=="string")&&(b.type="string"),b.enum=S;break}case"literal":{const b=x,S=[];for(const C of r.values)if(C===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof C=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");S.push(Number(C))}else S.push(C);if(S.length!==0)if(S.length===1){const C=S[0];b.type=C===null?"null":typeof C,this.target==="draft-4"||this.target==="openapi-3.0"?b.enum=[C]:b.const=C}else S.every(C=>typeof C=="number")&&(b.type="number"),S.every(C=>typeof C=="string")&&(b.type="string"),S.every(C=>typeof C=="boolean")&&(b.type="string"),S.every(C=>C===null)&&(b.type="null"),b.enum=S;break}case"file":{const b=x,S={type:"string",format:"binary",contentEncoding:"binary"},{minimum:C,maximum:E,mime:j}=t._zod.bag;C!==void 0&&(S.minLength=C),E!==void 0&&(S.maxLength=E),j?j.length===1?(S.contentMediaType=j[0],Object.assign(b,S)):b.anyOf=j.map(N=>({...S,contentMediaType:N})):Object.assign(b,S);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const b=this.process(r.innerType,g);this.target==="openapi-3.0"?(u.ref=r.innerType,x.nullable=!0):x.anyOf=[b,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,g),u.ref=r.innerType;break}case"success":{const b=x;b.type="boolean";break}case"default":{this.process(r.innerType,g),u.ref=r.innerType,x.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,g),u.ref=r.innerType,this.io==="input"&&(x._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,g),u.ref=r.innerType;let b;try{b=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}x.default=b;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const b=x,S=t._zod.pattern;if(!S)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=S.source;break}case"pipe":{const b=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(b,g),u.ref=b;break}case"readonly":{this.process(r.innerType,g),u.ref=r.innerType,x.readOnly=!0;break}case"promise":{this.process(r.innerType,g),u.ref=r.innerType;break}case"optional":{this.process(r.innerType,g),u.ref=r.innerType;break}case"lazy":{const b=t._zod.innerType;this.process(b,g),u.ref=b;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}}}}const m=this.metadataRegistry.get(t);return m&&Object.assign(u.schema,m),this.io==="input"&&In(t)&&(delete u.schema.examples,delete u.schema.default),this.io==="input"&&u.schema._prefault&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,this.seen.get(t).schema}emit(t,n){const o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=p=>{const g=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){const S=o.external.registry.get(p[0])?.id,C=o.external.uri??(j=>j);if(S)return{ref:C(S)};const E=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=E,{defId:E,ref:`${C("__shared")}#/${g}/${E}`}}if(p[1]===r)return{ref:"#"};const x=`#/${g}/`,b=p[1].schema.id??`__schema${this.counter++}`;return{defId:b,ref:x+b}},l=p=>{if(p[1].schema.$ref)return;const g=p[1],{ref:v,defId:x}=i(p);g.def={...g.schema},x&&(g.defId=x);const b=g.schema;for(const S in b)delete b[S];b.$ref=v};if(o.cycles==="throw")for(const p of this.seen.entries()){const g=p[1];if(g.cycle)throw new Error(`Cycle detected: #/${g.cycle?.join("/")}/<root>
317
+
318
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of this.seen.entries()){const g=p[1];if(t===p[0]){l(p);continue}if(o.external){const x=o.external.registry.get(p[0])?.id;if(t!==p[0]&&x){l(p);continue}}if(this.metadataRegistry.get(p[0])?.id){l(p);continue}if(g.cycle){l(p);continue}if(g.count>1&&o.reused==="ref"){l(p);continue}}const u=(p,g)=>{const v=this.seen.get(p),x=v.def??v.schema,b={...x};if(v.ref===null)return;const S=v.ref;if(v.ref=null,S){u(S,g);const C=this.seen.get(S).schema;C.$ref&&(g.target==="draft-7"||g.target==="draft-4"||g.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(C)):(Object.assign(x,C),Object.assign(x,b))}v.isParent||this.override({zodSchema:p,jsonSchema:x,path:v.path??[]})};for(const p of[...this.seen.entries()].reverse())u(p[0],{target:this.target});const f={};if(this.target==="draft-2020-12"?f.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?f.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?f.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),o.external?.uri){const p=o.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");f.$id=o.external.uri(p)}Object.assign(f,r.def);const m=o.external?.defs??{};for(const p of this.seen.entries()){const g=p[1];g.def&&g.defId&&(m[g.defId]=g.def)}o.external||Object.keys(m).length>0&&(this.target==="draft-2020-12"?f.$defs=m:f.definitions=m);try{return JSON.parse(JSON.stringify(f))}catch{throw new Error("Error converting schema to JSON.")}}}function Gz(e,t){if(e instanceof N0){const o=new xw(t),r={};for(const u of e._idmap.entries()){const[f,m]=u;o.process(m)}const i={},l={registry:e,uri:t?.uri,defs:r};for(const u of e._idmap.entries()){const[f,m]=u;i[f]=o.emit(m,{...t,external:l})}if(Object.keys(r).length>0){const u=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[u]:r}}return{schemas:i}}const n=new xw(t);return n.process(e),n.emit(e,t)}function In(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return In(r.element,n);case"object":{for(const i in r.shape)if(In(r.shape[i],n))return!0;return!1}case"union":{for(const i of r.options)if(In(i,n))return!0;return!1}case"intersection":return In(r.left,n)||In(r.right,n);case"tuple":{for(const i of r.items)if(In(i,n))return!0;return!!(r.rest&&In(r.rest,n))}case"record":return In(r.keyType,n)||In(r.valueType,n);case"map":return In(r.keyType,n)||In(r.valueType,n);case"set":return In(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return In(r.innerType,n);case"lazy":return In(r.getter(),n);case"default":return In(r.innerType,n);case"prefault":return In(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return In(r.in,n)||In(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1}throw new Error(`Unknown schema type: ${r.type}`)}const ooe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ioe=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:v2,$ZodArray:w2,$ZodAsyncError:Va,$ZodBase64:i2,$ZodBase64URL:a2,$ZodBigInt:C0,$ZodBigIntFormat:m2,$ZodBoolean:S0,$ZodCIDRv4:r2,$ZodCIDRv6:o2,$ZodCUID:qD,$ZodCUID2:KD,$ZodCatch:V2,$ZodCheck:tn,$ZodCheckBigIntFormat:wD,$ZodCheckEndsWith:$D,$ZodCheckGreaterThan:x0,$ZodCheckIncludes:AD,$ZodCheckLengthEquals:ND,$ZodCheckLessThan:b0,$ZodCheckLowerCase:kD,$ZodCheckMaxLength:RD,$ZodCheckMaxSize:SD,$ZodCheckMimeType:PD,$ZodCheckMinLength:jD,$ZodCheckMinSize:CD,$ZodCheckMultipleOf:xD,$ZodCheckNumberFormat:_D,$ZodCheckOverwrite:DD,$ZodCheckProperty:MD,$ZodCheckRegex:TD,$ZodCheckSizeEquals:ED,$ZodCheckStartsWith:ID,$ZodCheckStringFormat:Xf,$ZodCheckUpperCase:OD,$ZodCodec:j0,$ZodCustom:X2,$ZodCustomStringFormat:d2,$ZodDate:_2,$ZodDefault:z2,$ZodDiscriminatedUnion:j2,$ZodE164:l2,$ZodEmail:VD,$ZodEmoji:HD,$ZodEncodeError:Qg,$ZodEnum:A2,$ZodError:ov,$ZodFile:$2,$ZodFunction:K2,$ZodGUID:LD,$ZodIPv4:t2,$ZodIPv6:n2,$ZodISODate:QD,$ZodISODateTime:WD,$ZodISODuration:e2,$ZodISOTime:JD,$ZodIntersection:N2,$ZodJWT:u2,$ZodKSUID:XD,$ZodLazy:Y2,$ZodLiteral:I2,$ZodMap:k2,$ZodNaN:B2,$ZodNanoID:GD,$ZodNever:b2,$ZodNonOptional:L2,$ZodNull:g2,$ZodNullable:D2,$ZodNumber:w0,$ZodNumberFormat:f2,$ZodObject:E2,$ZodObjectJIT:R2,$ZodOptional:P2,$ZodPipe:H2,$ZodPrefault:U2,$ZodPromise:Z2,$ZodReadonly:G2,$ZodRealError:so,$ZodRecord:T2,$ZodRegistry:N0,$ZodSet:O2,$ZodString:Wf,$ZodStringFormat:Ut,$ZodSuccess:F2,$ZodSymbol:h2,$ZodTemplateLiteral:q2,$ZodTransform:M2,$ZodTuple:R0,$ZodType:Je,$ZodULID:ZD,$ZodURL:BD,$ZodUUID:FD,$ZodUndefined:p2,$ZodUnion:E0,$ZodUnknown:y2,$ZodVoid:x2,$ZodXID:YD,$brand:vP,$constructor:Z,$input:nz,$output:tz,Doc:zD,JSONSchema:ooe,JSONSchemaGenerator:xw,NEVER:gP,TimePrecision:iz,_any:Rz,_array:zz,_base64:q0,_base64url:K0,_bigint:bz,_boolean:vz,_catch:Qre,_check:Bz,_cidrv4:H0,_cidrv6:G0,_coercedBigint:xz,_coercedBoolean:yz,_coercedDate:Oz,_coercedNumber:dz,_coercedString:oz,_cuid:D0,_cuid2:z0,_custom:Lz,_date:kz,_decode:c0,_decodeAsync:d0,_default:Yre,_discriminatedUnion:Dre,_e164:Z0,_email:k0,_emoji:M0,_encode:l0,_encodeAsync:u0,_endsWith:nC,_enum:Bre,_file:Uz,_float32:mz,_float64:hz,_gt:Ja,_gte:Zr,_guid:Qp,_includes:eC,_int:fz,_int32:pz,_int64:_z,_intersection:zre,_ipv4:V0,_ipv6:B0,_isoDate:az,_isoDateTime:sz,_isoDuration:cz,_isoTime:lz,_jwt:Y0,_ksuid:F0,_lazy:noe,_length:lv,_literal:Gre,_lowercase:Q0,_lt:Qa,_lte:Bo,_map:Fre,_max:Bo,_maxLength:av,_maxSize:sv,_mime:rC,_min:Zr,_minLength:Yc,_minSize:df,_multipleOf:uf,_nan:Az,_nanoid:P0,_nativeEnum:Hre,_negative:$z,_never:Nz,_nonnegative:Pz,_nonoptional:Xre,_nonpositive:Mz,_normalize:oC,_null:Ez,_nullable:Zre,_number:uz,_optional:Kre,_overwrite:hl,_parse:Hf,_parseAsync:Gf,_pipe:Jre,_positive:Iz,_promise:roe,_property:Dz,_readonly:eoe,_record:Lre,_refine:Fz,_regex:W0,_safeDecode:m0,_safeDecodeAsync:p0,_safeEncode:f0,_safeEncodeAsync:h0,_safeParse:qf,_safeParseAsync:Kf,_set:Vre,_size:X0,_startsWith:tC,_string:rz,_stringFormat:Qf,_stringbool:Hz,_success:Wre,_superRefine:Vz,_symbol:Sz,_templateLiteral:toe,_toLowerCase:sC,_toUpperCase:aC,_transform:qre,_trim:iC,_tuple:Ure,_uint32:gz,_uint64:wz,_ulid:U0,_undefined:Cz,_union:Pre,_unknown:jz,_uppercase:J0,_url:iv,_uuid:O0,_uuidv4:A0,_uuidv6:I0,_uuidv7:$0,_void:Tz,_xid:L0,clone:Ao,config:Sr,decode:xte,decodeAsync:wte,encode:bte,encodeAsync:_te,flattenError:s0,formatError:a0,globalConfig:qp,globalRegistry:Da,isValidBase64:_0,isValidBase64URL:s2,isValidJWT:c2,locales:ez,parse:Yp,parseAsync:Xp,prettifyError:DP,regexes:y0,registry:T0,safeDecode:Cte,safeDecodeAsync:Rte,safeEncode:Ste,safeEncodeAsync:Ete,safeParse:zP,safeParseAsync:UP,toDotPath:PP,toJSONSchema:Gz,treeifyError:MP,util:IP,version:UD},Symbol.toStringTag,{value:"Module"})),lC=Z("ZodISODateTime",(e,t)=>{WD.init(e,t),Ht.init(e,t)});function qz(e){return sz(lC,e)}const cC=Z("ZodISODate",(e,t)=>{QD.init(e,t),Ht.init(e,t)});function Kz(e){return az(cC,e)}const uC=Z("ZodISOTime",(e,t)=>{JD.init(e,t),Ht.init(e,t)});function Zz(e){return lz(uC,e)}const dC=Z("ZodISODuration",(e,t)=>{e2.init(e,t),Ht.init(e,t)});function Yz(e){return cz(dC,e)}const soe=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:cC,ZodISODateTime:lC,ZodISODuration:dC,ZodISOTime:uC,date:Kz,datetime:qz,duration:Yz,time:Zz},Symbol.toStringTag,{value:"Module"})),Xz=(e,t)=>{ov.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>a0(e,n)},flatten:{value:n=>s0(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Kp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Kp,2)}},isEmpty:{get(){return e.issues.length===0}}})},aoe=Z("ZodError",Xz),ao=Z("ZodError",Xz,{Parent:Error}),Wz=Hf(ao),Qz=Gf(ao),Jz=qf(ao),eU=Kf(ao),tU=l0(ao),nU=c0(ao),rU=u0(ao),oU=d0(ao),iU=f0(ao),sU=m0(ao),aU=h0(ao),lU=p0(ao),lt=Z("ZodType",(e,t)=>(Je.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Ao(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Wz(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>Jz(e,n,o),e.parseAsync=async(n,o)=>Qz(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>eU(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>tU(e,n,o),e.decode=(n,o)=>nU(e,n,o),e.encodeAsync=async(n,o)=>rU(e,n,o),e.decodeAsync=async(n,o)=>oU(e,n,o),e.safeEncode=(n,o)=>iU(e,n,o),e.safeDecode=(n,o)=>sU(e,n,o),e.safeEncodeAsync=async(n,o)=>aU(e,n,o),e.safeDecodeAsync=async(n,o)=>lU(e,n,o),e.refine=(n,o)=>e.check(qU(n,o)),e.superRefine=n=>e.check(KU(n)),e.overwrite=n=>e.check(hl(n)),e.optional=()=>tg(e),e.nullable=()=>ng(e),e.nullish=()=>tg(ng(e)),e.nonoptional=n=>$U(e,n),e.array=()=>Qc(e),e.or=n=>$C([e,n]),e.and=n=>xU(e,n),e.transform=n=>rg(e,PC(n)),e.default=n=>OU(e,n),e.prefault=n=>IU(e,n),e.catch=n=>DU(e,n),e.pipe=n=>rg(e,n),e.readonly=()=>LU(e),e.describe=n=>{const o=e.clone();return Da.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Da.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Da.get(e);const o=e.clone();return Da.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fC=Z("_ZodString",(e,t)=>{Wf.init(e,t),lt.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(W0(...o)),e.includes=(...o)=>e.check(eC(...o)),e.startsWith=(...o)=>e.check(tC(...o)),e.endsWith=(...o)=>e.check(nC(...o)),e.min=(...o)=>e.check(Yc(...o)),e.max=(...o)=>e.check(av(...o)),e.length=(...o)=>e.check(lv(...o)),e.nonempty=(...o)=>e.check(Yc(1,...o)),e.lowercase=o=>e.check(Q0(o)),e.uppercase=o=>e.check(J0(o)),e.trim=()=>e.check(iC()),e.normalize=(...o)=>e.check(oC(...o)),e.toLowerCase=()=>e.check(sC()),e.toUpperCase=()=>e.check(aC())}),cv=Z("ZodString",(e,t)=>{Wf.init(e,t),fC.init(e,t),e.email=n=>e.check(k0(mC,n)),e.url=n=>e.check(iv(uv,n)),e.jwt=n=>e.check(Y0(NC,n)),e.emoji=n=>e.check(M0(hC,n)),e.guid=n=>e.check(Qp(Jp,n)),e.uuid=n=>e.check(O0(Qi,n)),e.uuidv4=n=>e.check(A0(Qi,n)),e.uuidv6=n=>e.check(I0(Qi,n)),e.uuidv7=n=>e.check($0(Qi,n)),e.nanoid=n=>e.check(P0(pC,n)),e.guid=n=>e.check(Qp(Jp,n)),e.cuid=n=>e.check(D0(gC,n)),e.cuid2=n=>e.check(z0(vC,n)),e.ulid=n=>e.check(U0(yC,n)),e.base64=n=>e.check(q0(EC,n)),e.base64url=n=>e.check(K0(RC,n)),e.xid=n=>e.check(L0(bC,n)),e.ksuid=n=>e.check(F0(xC,n)),e.ipv4=n=>e.check(V0(_C,n)),e.ipv6=n=>e.check(B0(wC,n)),e.cidrv4=n=>e.check(H0(SC,n)),e.cidrv6=n=>e.check(G0(CC,n)),e.e164=n=>e.check(Z0(jC,n)),e.datetime=n=>e.check(qz(n)),e.date=n=>e.check(Kz(n)),e.time=n=>e.check(Zz(n)),e.duration=n=>e.check(Yz(n))});function vt(e){return rz(cv,e)}const Ht=Z("ZodStringFormat",(e,t)=>{Ut.init(e,t),fC.init(e,t)}),mC=Z("ZodEmail",(e,t)=>{VD.init(e,t),Ht.init(e,t)});function Jf(e){return k0(mC,e)}const Jp=Z("ZodGUID",(e,t)=>{LD.init(e,t),Ht.init(e,t)});function loe(e){return Qp(Jp,e)}const Qi=Z("ZodUUID",(e,t)=>{FD.init(e,t),Ht.init(e,t)});function coe(e){return O0(Qi,e)}function uoe(e){return A0(Qi,e)}function doe(e){return I0(Qi,e)}function foe(e){return $0(Qi,e)}const uv=Z("ZodURL",(e,t)=>{BD.init(e,t),Ht.init(e,t)});function moe(e){return iv(uv,e)}function hoe(e){return iv(uv,{protocol:/^https?$/,hostname:nD,...pe(e)})}const hC=Z("ZodEmoji",(e,t)=>{HD.init(e,t),Ht.init(e,t)});function poe(e){return M0(hC,e)}const pC=Z("ZodNanoID",(e,t)=>{GD.init(e,t),Ht.init(e,t)});function goe(e){return P0(pC,e)}const gC=Z("ZodCUID",(e,t)=>{qD.init(e,t),Ht.init(e,t)});function voe(e){return D0(gC,e)}const vC=Z("ZodCUID2",(e,t)=>{KD.init(e,t),Ht.init(e,t)});function yoe(e){return z0(vC,e)}const yC=Z("ZodULID",(e,t)=>{ZD.init(e,t),Ht.init(e,t)});function boe(e){return U0(yC,e)}const bC=Z("ZodXID",(e,t)=>{YD.init(e,t),Ht.init(e,t)});function xoe(e){return L0(bC,e)}const xC=Z("ZodKSUID",(e,t)=>{XD.init(e,t),Ht.init(e,t)});function _oe(e){return F0(xC,e)}const _C=Z("ZodIPv4",(e,t)=>{t2.init(e,t),Ht.init(e,t)});function woe(e){return V0(_C,e)}const wC=Z("ZodIPv6",(e,t)=>{n2.init(e,t),Ht.init(e,t)});function Soe(e){return B0(wC,e)}const SC=Z("ZodCIDRv4",(e,t)=>{r2.init(e,t),Ht.init(e,t)});function Coe(e){return H0(SC,e)}const CC=Z("ZodCIDRv6",(e,t)=>{o2.init(e,t),Ht.init(e,t)});function Eoe(e){return G0(CC,e)}const EC=Z("ZodBase64",(e,t)=>{i2.init(e,t),Ht.init(e,t)});function Roe(e){return q0(EC,e)}const RC=Z("ZodBase64URL",(e,t)=>{a2.init(e,t),Ht.init(e,t)});function joe(e){return K0(RC,e)}const jC=Z("ZodE164",(e,t)=>{l2.init(e,t),Ht.init(e,t)});function Noe(e){return Z0(jC,e)}const NC=Z("ZodJWT",(e,t)=>{u2.init(e,t),Ht.init(e,t)});function Toe(e){return Y0(NC,e)}const em=Z("ZodCustomStringFormat",(e,t)=>{d2.init(e,t),Ht.init(e,t)});function koe(e,t,n={}){return Qf(em,e,t,n)}function Ooe(e){return Qf(em,"hostname",v0,e)}function Aoe(e){return Qf(em,"hex",yD,e)}function Ioe(e,t){const n=t?.enc??"hex",o=`${e}_${n}`,r=y0[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Qf(em,o,r,t)}const dv=Z("ZodNumber",(e,t)=>{w0.init(e,t),lt.init(e,t),e.gt=(o,r)=>e.check(Ja(o,r)),e.gte=(o,r)=>e.check(Zr(o,r)),e.min=(o,r)=>e.check(Zr(o,r)),e.lt=(o,r)=>e.check(Qa(o,r)),e.lte=(o,r)=>e.check(Bo(o,r)),e.max=(o,r)=>e.check(Bo(o,r)),e.int=o=>e.check(_w(o)),e.safe=o=>e.check(_w(o)),e.positive=o=>e.check(Ja(0,o)),e.nonnegative=o=>e.check(Zr(0,o)),e.negative=o=>e.check(Qa(0,o)),e.nonpositive=o=>e.check(Bo(0,o)),e.multipleOf=(o,r)=>e.check(uf(o,r)),e.step=(o,r)=>e.check(uf(o,r)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function TC(e){return uz(dv,e)}const bu=Z("ZodNumberFormat",(e,t)=>{f2.init(e,t),dv.init(e,t)});function _w(e){return fz(bu,e)}function $oe(e){return mz(bu,e)}function Moe(e){return hz(bu,e)}function Poe(e){return pz(bu,e)}function Doe(e){return gz(bu,e)}const fv=Z("ZodBoolean",(e,t)=>{S0.init(e,t),lt.init(e,t)});function Xc(e){return vz(fv,e)}const mv=Z("ZodBigInt",(e,t)=>{C0.init(e,t),lt.init(e,t),e.gte=(o,r)=>e.check(Zr(o,r)),e.min=(o,r)=>e.check(Zr(o,r)),e.gt=(o,r)=>e.check(Ja(o,r)),e.gte=(o,r)=>e.check(Zr(o,r)),e.min=(o,r)=>e.check(Zr(o,r)),e.lt=(o,r)=>e.check(Qa(o,r)),e.lte=(o,r)=>e.check(Bo(o,r)),e.max=(o,r)=>e.check(Bo(o,r)),e.positive=o=>e.check(Ja(BigInt(0),o)),e.negative=o=>e.check(Qa(BigInt(0),o)),e.nonpositive=o=>e.check(Bo(BigInt(0),o)),e.nonnegative=o=>e.check(Zr(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(uf(o,r));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function zoe(e){return bz(mv,e)}const kC=Z("ZodBigIntFormat",(e,t)=>{m2.init(e,t),mv.init(e,t)});function Uoe(e){return _z(kC,e)}function Loe(e){return wz(kC,e)}const cU=Z("ZodSymbol",(e,t)=>{h2.init(e,t),lt.init(e,t)});function Foe(e){return Sz(cU,e)}const uU=Z("ZodUndefined",(e,t)=>{p2.init(e,t),lt.init(e,t)});function eg(e){return Cz(uU,e)}const dU=Z("ZodNull",(e,t)=>{g2.init(e,t),lt.init(e,t)});function fU(e){return Ez(dU,e)}const mU=Z("ZodAny",(e,t)=>{v2.init(e,t),lt.init(e,t)});function Voe(){return Rz(mU)}const hU=Z("ZodUnknown",(e,t)=>{y2.init(e,t),lt.init(e,t)});function Wc(){return jz(hU)}const pU=Z("ZodNever",(e,t)=>{b2.init(e,t),lt.init(e,t)});function OC(e){return Nz(pU,e)}const gU=Z("ZodVoid",(e,t)=>{x2.init(e,t),lt.init(e,t)});function Boe(e){return Tz(gU,e)}const AC=Z("ZodDate",(e,t)=>{_2.init(e,t),lt.init(e,t),e.min=(o,r)=>e.check(Zr(o,r)),e.max=(o,r)=>e.check(Bo(o,r));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Hoe(e){return kz(AC,e)}const vU=Z("ZodArray",(e,t)=>{w2.init(e,t),lt.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(Yc(n,o)),e.nonempty=n=>e.check(Yc(1,n)),e.max=(n,o)=>e.check(av(n,o)),e.length=(n,o)=>e.check(lv(n,o)),e.unwrap=()=>e.element});function Qc(e,t){return zz(vU,e,t)}function Goe(e){const t=e._zod.def.shape;return Jc(Object.keys(t))}const hv=Z("ZodObject",(e,t)=>{R2.init(e,t),lt.init(e,t),yt(e,"shape",()=>t.shape),e.keyof=()=>Jc(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wc()}),e.strict=()=>e.clone({...e._zod.def,catchall:OC()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>RP(e,n),e.safeExtend=n=>jP(e,n),e.merge=n=>NP(e,n),e.pick=n=>CP(e,n),e.omit=n=>EP(e,n),e.partial=(...n)=>TP(DC,e,n[0]),e.required=(...n)=>kP(zC,e,n[0])});function Pn(e,t){const n={type:"object",get shape(){return Jo(this,"shape",e?ev(e):{}),this.shape},...pe(t)};return new hv(n)}function qoe(e,t){return new hv({type:"object",get shape(){return Jo(this,"shape",ev(e)),this.shape},catchall:OC(),...pe(t)})}function Koe(e,t){return new hv({type:"object",get shape(){return Jo(this,"shape",ev(e)),this.shape},catchall:Wc(),...pe(t)})}const IC=Z("ZodUnion",(e,t)=>{E0.init(e,t),lt.init(e,t),e.options=t.options});function $C(e,t){return new IC({type:"union",options:e,...pe(t)})}const yU=Z("ZodDiscriminatedUnion",(e,t)=>{IC.init(e,t),j2.init(e,t)});function Zoe(e,t,n){return new yU({type:"union",options:t,discriminator:e,...pe(n)})}const bU=Z("ZodIntersection",(e,t)=>{N2.init(e,t),lt.init(e,t)});function xU(e,t){return new bU({type:"intersection",left:e,right:t})}const _U=Z("ZodTuple",(e,t)=>{R0.init(e,t),lt.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function wU(e,t,n){const o=t instanceof Je,r=o?n:t,i=o?t:null;return new _U({type:"tuple",items:e,rest:i,...pe(r)})}const MC=Z("ZodRecord",(e,t)=>{T2.init(e,t),lt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function SU(e,t,n){return new MC({type:"record",keyType:e,valueType:t,...pe(n)})}function Yoe(e,t,n){const o=Ao(e);return o._zod.values=void 0,new MC({type:"record",keyType:o,valueType:t,...pe(n)})}const CU=Z("ZodMap",(e,t)=>{k2.init(e,t),lt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Xoe(e,t,n){return new CU({type:"map",keyType:e,valueType:t,...pe(n)})}const EU=Z("ZodSet",(e,t)=>{O2.init(e,t),lt.init(e,t),e.min=(...n)=>e.check(df(...n)),e.nonempty=n=>e.check(df(1,n)),e.max=(...n)=>e.check(sv(...n)),e.size=(...n)=>e.check(X0(...n))});function Woe(e,t){return new EU({type:"set",valueType:e,...pe(t)})}const ff=Z("ZodEnum",(e,t)=>{A2.init(e,t),lt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{const i={};for(const l of o)if(n.has(l))i[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new ff({...t,checks:[],...pe(r),entries:i})},e.exclude=(o,r)=>{const i={...t.entries};for(const l of o)if(n.has(l))delete i[l];else throw new Error(`Key ${l} not found in enum`);return new ff({...t,checks:[],...pe(r),entries:i})}});function Jc(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ff({type:"enum",entries:n,...pe(t)})}function Qoe(e,t){return new ff({type:"enum",entries:e,...pe(t)})}const RU=Z("ZodLiteral",(e,t)=>{I2.init(e,t),lt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Joe(e,t){return new RU({type:"literal",values:Array.isArray(e)?e:[e],...pe(t)})}const jU=Z("ZodFile",(e,t)=>{$2.init(e,t),lt.init(e,t),e.min=(n,o)=>e.check(df(n,o)),e.max=(n,o)=>e.check(sv(n,o)),e.mime=(n,o)=>e.check(rC(Array.isArray(n)?n:[n],o))});function eie(e){return Uz(jU,e)}const NU=Z("ZodTransform",(e,t)=>{M2.init(e,t),lt.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Qg(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Kc(i,n.value,t));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Kc(l))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function PC(e){return new NU({type:"transform",transform:e})}const DC=Z("ZodOptional",(e,t)=>{P2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tg(e){return new DC({type:"optional",innerType:e})}const TU=Z("ZodNullable",(e,t)=>{D2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ng(e){return new TU({type:"nullable",innerType:e})}function tie(e){return tg(ng(e))}const kU=Z("ZodDefault",(e,t)=>{z2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function OU(e,t){return new kU({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tv(t)}})}const AU=Z("ZodPrefault",(e,t)=>{U2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function IU(e,t){return new AU({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tv(t)}})}const zC=Z("ZodNonOptional",(e,t)=>{L2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function $U(e,t){return new zC({type:"nonoptional",innerType:e,...pe(t)})}const MU=Z("ZodSuccess",(e,t)=>{F2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nie(e){return new MU({type:"success",innerType:e})}const PU=Z("ZodCatch",(e,t)=>{V2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function DU(e,t){return new PU({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zU=Z("ZodNaN",(e,t)=>{B2.init(e,t),lt.init(e,t)});function rie(e){return Az(zU,e)}const UC=Z("ZodPipe",(e,t)=>{H2.init(e,t),lt.init(e,t),e.in=t.in,e.out=t.out});function rg(e,t){return new UC({type:"pipe",in:e,out:t})}const LC=Z("ZodCodec",(e,t)=>{UC.init(e,t),j0.init(e,t)});function oie(e,t,n){return new LC({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const UU=Z("ZodReadonly",(e,t)=>{G2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function LU(e){return new UU({type:"readonly",innerType:e})}const FU=Z("ZodTemplateLiteral",(e,t)=>{q2.init(e,t),lt.init(e,t)});function iie(e,t){return new FU({type:"template_literal",parts:e,...pe(t)})}const VU=Z("ZodLazy",(e,t)=>{Y2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.getter()});function BU(e){return new VU({type:"lazy",getter:e})}const HU=Z("ZodPromise",(e,t)=>{Z2.init(e,t),lt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sie(e){return new HU({type:"promise",innerType:e})}const GU=Z("ZodFunction",(e,t)=>{K2.init(e,t),lt.init(e,t)});function Gk(e){return new GU({type:"function",input:Array.isArray(e?.input)?wU(e?.input):e?.input??Qc(Wc()),output:e?.output??Wc()})}const pv=Z("ZodCustom",(e,t)=>{X2.init(e,t),lt.init(e,t)});function aie(e){const t=new tn({check:"custom"});return t._zod.check=e,t}function lie(e,t){return Lz(pv,e??(()=>!0),t)}function qU(e,t={}){return Fz(pv,e,t)}function KU(e){return Vz(e)}function cie(e,t={error:`Input not instance of ${e.name}`}){const n=new pv({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...pe(t)});return n._zod.bag.Class=e,n}const uie=(...e)=>Hz({Codec:LC,Boolean:fv,String:cv},...e);function die(e){const t=BU(()=>$C([vt(e),TC(),Xc(),fU(),Qc(t),SU(vt(),t)]));return t}function fie(e,t){return rg(PC(e),t)}const mie={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function hie(e){Sr({customError:e})}function pie(){return Sr().customError}var ww;ww||(ww={});function gie(e){return oz(cv,e)}function vie(e){return dz(dv,e)}function yie(e){return yz(fv,e)}function bie(e){return xz(mv,e)}function xie(e){return Oz(AC,e)}const _ie=Object.freeze(Object.defineProperty({__proto__:null,bigint:bie,boolean:yie,date:xie,number:vie,string:gie},Symbol.toStringTag,{value:"Module"}));Sr(W2());const sr=Object.freeze(Object.defineProperty({__proto__:null,$brand:vP,$input:nz,$output:tz,NEVER:gP,TimePrecision:iz,ZodAny:mU,ZodArray:vU,ZodBase64:EC,ZodBase64URL:RC,ZodBigInt:mv,ZodBigIntFormat:kC,ZodBoolean:fv,ZodCIDRv4:SC,ZodCIDRv6:CC,ZodCUID:gC,ZodCUID2:vC,ZodCatch:PU,ZodCodec:LC,ZodCustom:pv,ZodCustomStringFormat:em,ZodDate:AC,ZodDefault:kU,ZodDiscriminatedUnion:yU,ZodE164:jC,ZodEmail:mC,ZodEmoji:hC,ZodEnum:ff,ZodError:aoe,ZodFile:jU,get ZodFirstPartyTypeKind(){return ww},ZodFunction:GU,ZodGUID:Jp,ZodIPv4:_C,ZodIPv6:wC,ZodISODate:cC,ZodISODateTime:lC,ZodISODuration:dC,ZodISOTime:uC,ZodIntersection:bU,ZodIssueCode:mie,ZodJWT:NC,ZodKSUID:xC,ZodLazy:VU,ZodLiteral:RU,ZodMap:CU,ZodNaN:zU,ZodNanoID:pC,ZodNever:pU,ZodNonOptional:zC,ZodNull:dU,ZodNullable:TU,ZodNumber:dv,ZodNumberFormat:bu,ZodObject:hv,ZodOptional:DC,ZodPipe:UC,ZodPrefault:AU,ZodPromise:HU,ZodReadonly:UU,ZodRealError:ao,ZodRecord:MC,ZodSet:EU,ZodString:cv,ZodStringFormat:Ht,ZodSuccess:MU,ZodSymbol:cU,ZodTemplateLiteral:FU,ZodTransform:NU,ZodTuple:_U,ZodType:lt,ZodULID:yC,ZodURL:uv,ZodUUID:Qi,ZodUndefined:uU,ZodUnion:IC,ZodUnknown:hU,ZodVoid:gU,ZodXID:bC,_ZodString:fC,_default:OU,_function:Gk,any:Voe,array:Qc,base64:Roe,base64url:joe,bigint:zoe,boolean:Xc,catch:DU,check:aie,cidrv4:Coe,cidrv6:Eoe,clone:Ao,codec:oie,coerce:_ie,config:Sr,core:ioe,cuid:voe,cuid2:yoe,custom:lie,date:Hoe,decode:nU,decodeAsync:oU,discriminatedUnion:Zoe,e164:Noe,email:Jf,emoji:poe,encode:tU,encodeAsync:rU,endsWith:nC,enum:Jc,file:eie,flattenError:s0,float32:$oe,float64:Moe,formatError:a0,function:Gk,getErrorMap:pie,globalRegistry:Da,gt:Ja,gte:Zr,guid:loe,hash:Ioe,hex:Aoe,hostname:Ooe,httpUrl:hoe,includes:eC,instanceof:cie,int:_w,int32:Poe,int64:Uoe,intersection:xU,ipv4:woe,ipv6:Soe,iso:soe,json:die,jwt:Toe,keyof:Goe,ksuid:_oe,lazy:BU,length:lv,literal:Joe,locales:ez,looseObject:Koe,lowercase:Q0,lt:Qa,lte:Bo,map:Xoe,maxLength:av,maxSize:sv,mime:rC,minLength:Yc,minSize:df,multipleOf:uf,nan:rie,nanoid:goe,nativeEnum:Qoe,negative:$z,never:OC,nonnegative:Pz,nonoptional:$U,nonpositive:Mz,normalize:oC,null:fU,nullable:ng,nullish:tie,number:TC,object:Pn,optional:tg,overwrite:hl,parse:Wz,parseAsync:Qz,partialRecord:Yoe,pipe:rg,positive:Iz,prefault:IU,preprocess:fie,prettifyError:DP,promise:sie,property:Dz,readonly:LU,record:SU,refine:qU,regex:W0,regexes:y0,registry:T0,safeDecode:sU,safeDecodeAsync:lU,safeEncode:iU,safeEncodeAsync:aU,safeParse:Jz,safeParseAsync:eU,set:Woe,setErrorMap:hie,size:X0,startsWith:tC,strictObject:qoe,string:vt,stringFormat:koe,stringbool:uie,success:nie,superRefine:KU,symbol:Foe,templateLiteral:iie,toJSONSchema:Gz,toLowerCase:sC,toUpperCase:aC,transform:PC,treeifyError:MP,trim:iC,tuple:wU,uint32:Doe,uint64:Loe,ulid:boe,undefined:eg,union:$C,unknown:Wc,uppercase:J0,url:moe,util:IP,uuid:coe,uuidv4:uoe,uuidv6:doe,uuidv7:foe,void:Boe,xid:xoe},Symbol.toStringTag,{value:"Module"})),wie=Pn({username:vt().nonempty({error:"Please enter your username."}),password:vt().nonempty({error:"Please enter your password."})}),qk=["localhost","127.0.0.1"];var Sw=(e=>(e.MixedLoopback="MixedLoopback",e.InsecureCookieOutsideChromeAndFirefox="InsecureCookieOutsideChromeAndFirefox",e))(Sw||{});function Sie(e,t,n){if(!n||!t||!e)return null;const o=new URL(n).hostname,r=qk.includes(t),i=qk.includes(o);if(r&&i&&o!==t)return"MixedLoopback";if(!r&&i){const l=e.indexOf("Chrome")>=0,u=e.indexOf("Firefox")>=0;if(!l&&!u)return"InsecureCookieOutsideChromeAndFirefox"}return null}const Kk=(e,t,n)=>{if(e&&"reportValidity"in e){const o=Ce(n,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},Cw=(e,t)=>{for(const n in t.fields){const o=t.fields[n];o&&o.ref&&"reportValidity"in o.ref?Kk(o.ref,n,e):o&&o.refs&&o.refs.forEach(r=>Kk(r,n,e))}},Zk=(e,t)=>{t.shouldUseNativeValidation&&Cw(e,t);const n={};for(const o in e){const r=Ce(t.fields,o),i=Object.assign(e[o]||{},{ref:r&&r.ref});if(Cie(t.names||Object.keys(e),o)){const l=Object.assign({},Ce(n,o));Ct(l,"root",i),Ct(n,o,l)}else Ct(n,o,i)}return n},Cie=(e,t)=>{const n=Yk(t);return e.some(o=>Yk(o).match(`^${n}\\.\\d+`))};function Yk(e){return e.replace(/\]|\[/g,"")}function Xk(e,t){try{var n=e()}catch(o){return t(o)}return n&&n.then?n.then(void 0,t):n}function Eie(e,t){for(var n={};e.length;){var o=e[0],r=o.code,i=o.message,l=o.path.join(".");if(!n[l])if("unionErrors"in o){var u=o.unionErrors[0].errors[0];n[l]={message:u.message,type:u.code}}else n[l]={message:i,type:r};if("unionErrors"in o&&o.unionErrors.forEach(function(p){return p.errors.forEach(function(g){return e.push(g)})}),t){var f=n[l].types,m=f&&f[o.code];n[l]=QS(l,t,n,r,m?[].concat(m,o.message):o.message)}e.shift()}return n}function Rie(e,t){for(var n={};e.length;){var o=e[0],r=o.code,i=o.message,l=o.path.join(".");if(!n[l])if(o.code==="invalid_union"&&o.errors.length>0){var u=o.errors[0][0];n[l]={message:u.message,type:u.code}}else n[l]={message:i,type:r};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(g){return e.push(g)})}),t){var f=n[l].types,m=f&&f[o.code];n[l]=QS(l,t,n,r,m?[].concat(m,o.message):o.message)}e.shift()}return n}function yn(e,t,n){if(n===void 0&&(n={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,r,i){try{return Promise.resolve(Xk(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](o,t)).then(function(l){return i.shouldUseNativeValidation&&Cw({},i),{errors:{},values:n.raw?Object.assign({},o):l}})},function(l){if((function(u){return Array.isArray(u?.issues)})(l))return{values:{},errors:Zk(Eie(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,r,i){try{return Promise.resolve(Xk(function(){return Promise.resolve((n.mode==="sync"?Yp:Xp)(e,o,t)).then(function(l){return i.shouldUseNativeValidation&&Cw({},i),{errors:{},values:n.raw?Object.assign({},o):l}})},function(l){if((function(u){return u instanceof ov})(l))return{values:{},errors:Zk(Rie(l.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}};throw new Error("Invalid input: not a Zod schema")}function FC(){const e=pn(),t=Rn(),n=Xo(),{redirect:o}=Ri({strict:!1}),{clusterId:r,instanceId:i}=Ze({strict:!1}),{data:l}=wn(Vf(r,!0)),u=_.useMemo(()=>i&&l&&l?.instances?.find(C=>C.id===i),[l,i]),f="Local",m=_.useMemo(()=>l?u?lS(u):aS(l):null,[l,u]),p=Df(m),g=_.useMemo(()=>Sie(navigator.userAgent,location.hostname,m),[m]),v=gn({resolver:yn(wie),defaultValues:{username:"",password:""}}),{mutate:x,isPending:b}=ete(),S=_.useCallback(async C=>{x({...C,instanceClient:p},{onSuccess:async E=>{Ee.success(E.message);const j=await tf({instanceClient:p});if(l?.instances?.length&&!u)for(const N of l.instances)Gn.setUserForEntity(N,j);Gn.setUserForEntity(u||l||Sn,j),n.invalidateQueries({queryKey:[Cn.user],refetchType:"none"}),t.invalidate(),await e({to:o?.startsWith("/")?o:ta})}})},[l,u,p,e,n,o,t,x]);return!i&&l&&!l?.fqdn?c.jsx(Q_,{to:"../instances",replace:!0}):l?.resetPassword?c.jsx(Q_,{to:"../set-password",replace:!0}):c.jsxs(c.Fragment,{children:[!Ac,c.jsx("div",{className:"h-screen items-center justify-center flex",children:c.jsxs("div",{className:"text-white w-xs",children:[c.jsxs("h2",{className:"text-2xl font-light",children:["Sign in to Harper ",f]}),c.jsx(vn,{...v,children:c.jsxs("form",{onSubmit:v.handleSubmit(S),className:"my-4",children:[c.jsx($e,{control:v.control,name:"username",render:({field:C})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Username"}),c.jsx(Ie,{children:c.jsx(Le,{autoComplete:"username",type:"text",placeholder:"harpersys",...C})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:v.control,name:"password",render:({field:C})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",placeholder:"password",...C})}),c.jsx(Ae,{})]})}),c.jsx(_e,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Sign In"}),g===Sw.MixedLoopback&&c.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[c.jsx("span",{className:"font-medium",children:"Warning!"})," Your login might not work because you're mixing 127.0.0.1 and localhost. Pick one or the other."]}),g===Sw.InsecureCookieOutsideChromeAndFirefox&&c.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[c.jsx("span",{className:"font-medium",children:"Warning!"})," Your login might not work because your browser doesn't consider localhost to be secure, so it doesn't pass the cookies along. Firefox or Chromium based browsers should pass the cookies properly."]})]})})]})})]})}async function jie({email:e}){const{data:t}=await kt.post("/ForgotPassword/",{email:e});if(t)return t;throw new Error("Something went wrong")}function Nie(){return at({mutationFn:e=>jie(e)})}const Tie=Pn({email:Jf({error:"Please enter a valid email address."}).max(75,{error:"Email cannot be longer than 75 characters."})});function kie(){const e=pn(),t=gn({resolver:yn(Tie),defaultValues:{email:""}}),{mutate:n,isPending:o}=Nie(),r=async i=>{n(i,{onSuccess:l=>{Ee.success("Success",{description:`${l}`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e({to:"/sign-in"})}})};return c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h2",{className:"text-2xl font-light",children:"Enter your account email"}),c.jsx("p",{className:"text-sm pt-1",children:"If a matching account exists, we'll send you a password reset link."}),c.jsx(vn,{...t,children:c.jsxs("form",{onSubmit:t.handleSubmit(r),className:"my-4",children:[c.jsx($e,{control:t.control,name:"email",render:({field:i})=>c.jsxs(ke,{className:"my-2",children:[c.jsx(Oe,{children:"Email"}),c.jsx(Ie,{children:c.jsx(Le,{disabled:o,type:"email",placeholder:"jane.smith@harperdb.io",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...i})}),c.jsx(Ae,{})]})}),c.jsx(_e,{type:"submit",variant:"submit",disabled:o,className:"w-full my-2 rounded-full",children:"Send Password Reset Email"})]})}),c.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[c.jsx(Ue,{className:"text-sm",to:"/sign-in",children:"Sign in to your account"}),c.jsx(Ue,{className:"text-sm",to:"/sign-up",children:"Sign up for free"})]})]})}const Oie=async({token:e,password:t})=>{const{data:n}=await kt.put("/ResetPassword/",{token:e,newPassword:t});return n};function Aie(){return at({mutationFn:e=>Oie(e)})}const Iie=Pn({password:vt().min(8,{error:"Password must be at least 8 characters long."}).max(50,{error:"Password cannot be longer than 50 characters."}),confirmPassword:vt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function $ie(){const{token:e}=Ri({strict:!1}),t=pn();_.useEffect(()=>{e||t({to:"/sign-in"})},[e,t]);const n=gn({resolver:yn(Iie),defaultValues:{password:"",confirmPassword:""}}),{mutate:o,isPending:r}=Aie(),i=async l=>{o({token:e,password:l.password},{onSuccess:()=>{Ee.success("Success",{description:"Your password has been reset successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"})}})};return c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h2",{className:"text-2xl font-light",children:"Reset Password"}),c.jsx(vn,{...n,children:c.jsxs("form",{className:"my-4",onSubmit:n.handleSubmit(i),children:[c.jsx($e,{control:n.control,name:"password",render:({field:l})=>c.jsxs(ke,{className:"my-2",children:[c.jsx(Oe,{children:"New Password"}),c.jsx(Ie,{children:c.jsx(Le,{disabled:r,type:"password",placeholder:"enter new password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:n.control,name:"confirmPassword",render:({field:l})=>c.jsxs(ke,{className:"my-2",children:[c.jsx(Oe,{children:"Confirm Password"}),c.jsx(Ie,{children:c.jsx(Le,{disabled:r,type:"password",placeholder:"confirm new password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),c.jsx(Ae,{})]})}),c.jsx(_e,{variant:"submit",type:"submit",disabled:r,className:"w-full my-2 rounded-full",children:"Submit New Password"})]})})]})}async function Mie({email:e,password:t}){const{data:n}=await kt.post("/Login/",{email:e,password:t});if(n)return n;throw new Error("Something went wrong")}function Pie(){return at({mutationFn:e=>Mie(e)})}let Die={identify:()=>{}};function zie(){_.useEffect(()=>{},[])}const Uie=["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","aol.com","protonmail.com","mail.com","zoho.com","yandex.com","gmx.com","live.com","msn.com","me.com","inbox.com"];function Lie(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Uie)if(t===n||t.endsWith("."+n))return null;return t}const Fie=Pn({email:Jf({error:"Please enter a valid email address."}),password:vt().nonempty({error:"Please enter your password."})});function Vie(){const e=pn(),t=Rn(),n=Xo(),{redirect:o}=Ri({strict:!1}),r=gn({resolver:yn(Fie),defaultValues:{email:"",password:""}}),{mutate:i,isPending:l}=Pie(),u=f=>{i(f,{onSuccess:async m=>{Gn.setUserForEntity(Sn,m);const p=cu(m),g=Lie(m.email);g&&Die.identify({username:m.email,type:"email",company:g}),await n.invalidateQueries({queryKey:[Cn.user],refetchType:"none"}),t.invalidate(),await e({to:o?.startsWith("/")?o:p})}})};return c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h2",{className:"text-2xl font-light",children:"Sign in to Harper Fabric"}),c.jsx(vn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(u),className:"my-4",children:[c.jsx($e,{control:r.control,name:"email",render:({field:f})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Email"}),c.jsx(Ie,{children:c.jsx(Le,{type:"email",placeholder:"jane.smith@harperdb.io",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:r.control,name:"password",render:({field:f})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",placeholder:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),c.jsx(Ae,{})]})}),c.jsx(_e,{type:"submit",variant:"submit",className:"w-full my-2 rounded-full",disabled:l,children:"Sign In"})]})}),c.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[c.jsx(Ue,{className:"text-sm",to:"/sign-up",children:"Sign up for free"}),c.jsx(Ue,{className:"text-sm",to:"/forgot-password",children:"Forgot password?"})]})]})}async function Bie(e){const{data:t}=await kt.post("/User/",e);if(t)return t;throw new Error("Something went wrong")}function Hie(){return at({mutationFn:e=>Bie(e)})}const Gie=Pn({email:Jf({error:"Please enter a valid email address."}).trim().toLowerCase().max(80,{error:"Email cannot be longer than 80 characters."}),firstname:vt().trim().min(2,{error:"Please enter your first name."}).max(40,{error:"First name cannot be longer than 40 characters."}),lastname:vt().trim().min(2,{error:"Please enter your last name."}).max(80,{error:"Last name cannot be longer than 80 characters."}),password:vt().min(8,{error:"Password must be at least 8 characters long."})});function qie(){const e=pn(),{email:t}=Ri({strict:!1}),n=gn({resolver:yn(Gie),defaultValues:{firstname:"",lastname:"",email:t||"",password:""}}),{mutate:o}=Hie(),r=async i=>{o(i,{onSuccess:()=>{Ee.success("Success",{description:"Your account has been created! Please check your email to finish activating your account.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e({to:"/sign-in"})}})};return c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h2",{className:"text-2xl font-light",children:"Sign up for Harper Studio"}),c.jsx(vn,{...n,children:c.jsxs("form",{onSubmit:n.handleSubmit(r),className:"grid gap-4 my-4",children:[c.jsx($e,{control:n.control,name:"firstname",render:({field:i})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"First Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"Jane",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...i})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:n.control,name:"lastname",render:({field:i})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Last Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"Doe",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...i})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:n.control,name:"email",render:({field:i})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Email"}),c.jsx(Ie,{children:c.jsx(Le,{type:"email",readOnly:!!t,disabled:!!t,placeholder:"jane.doe@harpersystems.dev",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoComplete:"email",autoCapitalize:"none",...i})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:n.control,name:"password",render:({field:i})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",placeholder:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...i})}),c.jsx(Ae,{})]})}),c.jsxs("p",{className:"text-xs",children:["By creating an account, you agree to the ",c.jsx("a",{rel:"noopener",href:"https://www.harpersystems.dev/legal/privacy-policy",target:"_blank",className:"underline",children:"Privacy Policy"})," and ",c.jsx("a",{rel:"noopener",href:"https://www.harpersystems.dev/legal/harperdb-cloud-terms-of-service",target:"_blank",className:"underline",children:"Terms of Service"})]}),c.jsx(_e,{type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Sign Up For Free"})]})}),c.jsx("div",{className:"flex px-4 mt-4 underline place-content-between",children:c.jsx(Ue,{className:"m-auto text-sm",to:"/sign-in",children:"Already have an account? Sign in instead."})})]})}const Kie=async e=>{const{data:t}=await kt.put("/VerifyEmail/",{token:e.toString()});return t};function Zie(){return at({mutationFn:e=>Kie(e)})}const Yie=async({email:e})=>{const{data:t}=await kt.post("/ResendVerificationEmail/",{email:e});return t};function Xie(){return at({mutationFn:e=>Yie(e)})}const Wie=Pn({email:Jf({error:"Please enter a valid email address."}).max(75,{error:"Email cannot be longer than 75 characters."})});function Qie(){const e=pn(),{mutate:t,isPending:n}=Xie(),o=gn({resolver:yn(Wie),defaultValues:{email:""}}),r=async i=>{t(i,{onSuccess:l=>{Ee.success("Success",{description:`${l}`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e({to:"/sign-in"})}})};return c.jsxs(vn,{...o,children:[c.jsx("p",{className:"text-sm py-2",children:"Please Enter an Email"}),c.jsxs("form",{onSubmit:o.handleSubmit(r),className:"my-4",children:[c.jsx($e,{control:o.control,name:"email",render:({field:i})=>c.jsxs(ke,{className:"my-2",children:[c.jsx(Oe,{children:"Email"}),c.jsx(Ie,{children:c.jsx(Le,{disabled:n,type:"email",placeholder:"jane.doe@harperdb.io",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...i})}),c.jsx(Ae,{})]})}),c.jsx(_e,{type:"submit",variant:"submit",disabled:n,className:"w-full my-2 rounded-full",children:"Send Verification Email"})]})]})}function Jie(){const{token:e}=Ri({strict:!1}),t=pn(),{mutate:n,isPending:o}=Zie(),r=_.useCallback(i=>{n(i,{onSuccess:()=>{Ee.success("Success",{description:"Email verified successfully",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"})}})},[n,t]);return _.useEffect(()=>{e&&r(e)},[r,e]),c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h1",{className:"text-3xl font-light",children:"Verify Email"}),o?c.jsx("p",{className:"text-sm pt-1",children:"Verifying email..."}):c.jsx(Qie,{})]})}const xu=et({getParentRoute:()=>Kg,id:"_authLayout",component:Oee}),ese=et({getParentRoute:()=>xu,path:"sign-in",component:Vie,beforeLoad:({context:e,location:t})=>{const n=e.authentication[Sn]?.user;if(n){const o=t?.search,r=cu(n);throw il({to:o?.redirect?.startsWith("/")?o.redirect:r})}}}),tse=et({getParentRoute:()=>Kg,path:"sign-in",component:FC,beforeLoad:({context:e,location:t})=>{if(e.authentication[Sn]?.user){const n=t?.search;throw il({to:n?.redirect?.startsWith("/")?n.redirect:ta})}}}),nse=et({getParentRoute:()=>xu,path:"sign-up",component:qie}),rse=et({getParentRoute:()=>xu,path:"forgot-password",component:kie}),ose=et({getParentRoute:()=>xu,path:"verify-email",component:Jie}),ise=et({getParentRoute:()=>xu,path:"reset-password",component:$ie});xu.addChildren([ese,nse,rse,ose,ise]);const sse=[tse];function $r({className:e,text:t,centered:n,...o}){const r=n?"flex flex-col items-center justify-center h-full":"";return c.jsxs("div",{className:`text-white h-full w-full ${e||""} ${r}`,...o,children:[c.jsx("img",{src:"/HDBDogOnly.svg",width:"100px",height:"100px",alt:"HDB Dog Logo Loading",className:"inline-block"}),c.jsx("p",{className:"pt-4",children:t||"Loading..."})]})}function ase(){const{isLoading:e}=sl();return e?c.jsx($r,{className:"fixed z-50 translate-1/2"}):c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(JM,{})}),c.jsx("main",{children:c.jsx(ss,{})})]})}function ZU(){const e=URL.parse(location.href);return e?.hash?e.hash.startsWith("#/")?e.hash.slice(1):e.hash:"/"}const lse=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function cse(){const e=ZU().split("?")[0];return!lse.includes(e)&&{redirect:e}}const gv=et({getParentRoute:()=>Kg,id:"_dashboardLayout",component:ase,beforeLoad:({context:e})=>{const t=e.authentication[Sn];if(t&&!t.isLoading&&!t.user)throw il({to:"/sign-in",search:cse()})}}),YU=_.createContext(null);async function use({file:e,payload:t,project:n,instanceClient:o}){const{data:r}=await o.post("/",{operation:"set_component_file",file:e,payload:t,project:n});return r}function XU(){return at({mutationFn:use})}function dse({entityId:e,instanceClient:t,file:n,project:o}){return{queryKey:[e,Cn.operations.get_component_file,n,o],queryFn:async()=>{const{data:r}=await t.post("/",{operation:"get_component_file",file:n,project:o});return{file:n,project:o,...r}},enabled:!!n,retry:!1}}function fse(e){return!!e}function mse({children:e}){const[t,n]=_.useState({filePath:"",projectName:"",content:""}),o=dr(),{data:r}=wn(dse({file:t.entries==null?t.filePath.split("/").slice(2).join("/"):"",project:t.projectName,...o})),{mutate:i,isPending:l}=XU();_.useEffect(()=>{r?.message&&r.file==t.filePath.split("/").slice(2).join("/")&&n(p=>({...p,content:r?.message}))},[r,t.filePath]);const u=_.useCallback(async p=>{n({...p})},[]),f=_.useCallback((p,g)=>{i(p,{onSuccess:()=>{t?.filePath===g&&n({...t,content:p.payload}),Ee.success("Success",{description:`${p.file.split("/").pop()} saved successfully. A restart is required to see changes.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})},onError:v=>{console.error("Error saving file:",v)}})},[i,t]),m=_.useMemo(()=>({selectedFolderFile:t,handleFileSelect:u,onSaveFile:f,isSavingFile:l,isFolder:fse}),[t,u,f,l]);return c.jsx(YU.Provider,{value:m,children:e})}function VC(){return _.useContext(YU)}const hse=e=>e&&[...e].includes(".")?e.split(".").slice(-1)[0]:null;function pse(e,t){const n=+!!e.entries,o=+!!t.entries;return n===o?e.name.localeCompare(t.name):o-n}function gse({toggleClosed:e,isOpen:t}){return c.jsx("button",{type:"button",onClick:e,onKeyDown:e,className:"project-icon fas fa-file-code text-green",tabIndex:0,"aria-expanded":t,"aria-label":t?"close project":"open project"})}function vse({toggleClosed:e,isOpen:t}){return c.jsx("button",{type:"button",onClick:e,onKeyDown:e,className:`folder-icon fas text-purple ${t?"fa-folder-open":"fa-folder"}`,tabIndex:0,"aria-expanded":t,"aria-label":t?"close folder":"open folder"})}function yse({extension:e}){switch(e){case"js":return c.jsx("i",{className:"file-icon filetype-js fab fa-js text-yellow"});case"jsx":return c.jsx("i",{className:"file-icon filetype-jsx fab fa-js text-yellow"});case"cjs":return c.jsx("i",{className:"file-icon filetype-cjs fab fa-js text-yellow"});case"yaml":return c.jsx("i",{className:"file-icon filetype-yaml fas fa-file"});case"css":return c.jsx("i",{className:"file-icon filetype-css fas fa-file text-blue"});case"html":return c.jsx("i",{className:"file-icon filetype-unknown far fa-file-alt"});case"json":return c.jsx("i",{className:"file-icon filetype-json fas fa-cog"});case"ts":return c.jsx("i",{className:"file-icon filetype-ts fas fa-file text-blue"});case"tsx":return c.jsx("i",{className:"file-icon filetype-tsx fas fa-file text-blue"});case"png":return c.jsx("i",{className:"file-icon filetype-png fas fa-image"});case"jpg":return c.jsx("i",{className:"file-icon filetype-jpg fas fa-image"});case"jpeg":return c.jsx("i",{className:"file-icon filetype-jpeg fas fa-image"});case"gif":return c.jsx("i",{className:"file-icon filetype-gif fas fa-image"});case"svg":return c.jsx("i",{className:"file-icon filetype-svg fas fa-file-svg"});case"vue":return c.jsx("i",{className:"file-icon filetype-vue fab fa-vuejs text-green"});default:return c.jsx("i",{className:"file-icon filetype-unknown far fa-file-alt"})}}function bse(){return c.jsx("i",{className:"package-icon fas fa-cube"})}function xse({name:e}){return c.jsxs("button",{type:"button",children:[c.jsx(bse,{}),c.jsx("span",{className:"package-text",children:e})]})}function _se({directoryEntry:e,Icon:t}){const{handleFileSelect:n,selectedFolderFile:o}=VC(),r=o.filePath===e.path;return c.jsxs("button",{type:"button",className:`whitespace-nowrap ${r?"text-white":""}`,onClick:()=>{r||n({filePath:e.path||"",projectName:e.project||"",entries:e.entries})},children:[t?c.jsx(t,{}):"",c.jsx("span",{className:"pl-2 filename-text",children:e.name})]})}function WU({directoryEntry:e}){const[t,n]=_.useState(!0),o=[...e.entries||[]].sort(pse),r=hse(e.name);let i;return e.path&&e.path.split("/").length===2?i=()=>gse({isOpen:t,toggleClosed:()=>n(!t)}):e.entries?i=()=>vse({isOpen:t,toggleClosed:()=>n(!t)}):i=()=>yse({extension:r}),c.jsxs(c.Fragment,{children:[e.name!=="components"?c.jsx("li",{className:`${e.entries?"folder-container":"file-container"} ${t?"folder-open":"folder-closed"}`,children:e.package?c.jsx(xse,{name:e.name}):c.jsx(_se,{Icon:i,directoryEntry:e})},e.key):null,o.map(l=>c.jsx("li",{children:c.jsx("ul",{className:"pl-2",children:c.jsx(WU,{directoryEntry:l})})},l.key))]})}function wse({files:e}){return c.jsx("div",{children:c.jsx("div",{children:c.jsx("ul",{className:"text-gray-400",children:c.jsx(WU,{directoryEntry:e})})})})}var e_="focusScope.autoFocusOnMount",t_="focusScope.autoFocusOnUnmount",Wk={bubbles:!1,cancelable:!0},Sse="FocusScope",vv=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...l}=e,[u,f]=_.useState(null),m=Kt(r),p=Kt(i),g=_.useRef(null),v=st(t,S=>f(S)),x=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(o){let S=function(N){if(x.paused||!u)return;const T=N.target;u.contains(T)?g.current=T:Ms(g.current,{select:!0})},C=function(N){if(x.paused||!u)return;const T=N.relatedTarget;T!==null&&(u.contains(T)||Ms(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const k of N)k.removedNodes.length>0&&Ms(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const j=new MutationObserver(E);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),j.disconnect()}}},[o,u,x.paused]),_.useEffect(()=>{if(u){Jk.add(x);const S=document.activeElement;if(!u.contains(S)){const E=new CustomEvent(e_,Wk);u.addEventListener(e_,m),u.dispatchEvent(E),E.defaultPrevented||(Cse(Tse(QU(u)),{select:!0}),document.activeElement===S&&Ms(u))}return()=>{u.removeEventListener(e_,m),setTimeout(()=>{const E=new CustomEvent(t_,Wk);u.addEventListener(t_,p),u.dispatchEvent(E),E.defaultPrevented||Ms(S??document.body,{select:!0}),u.removeEventListener(t_,p),Jk.remove(x)},0)}}},[u,m,p,x]);const b=_.useCallback(S=>{if(!n&&!o||x.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(C&&E){const j=S.currentTarget,[N,T]=Ese(j);N&&T?!S.shiftKey&&E===T?(S.preventDefault(),n&&Ms(N,{select:!0})):S.shiftKey&&E===N&&(S.preventDefault(),n&&Ms(T,{select:!0})):E===j&&S.preventDefault()}},[n,o,x.paused]);return c.jsx(De.div,{tabIndex:-1,...l,ref:v,onKeyDown:b})});vv.displayName=Sse;function Cse(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Ms(o,{select:t}),document.activeElement!==n)return}function Ese(e){const t=QU(e),n=Qk(t,e),o=Qk(t.reverse(),e);return[n,o]}function QU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qk(e,t){for(const n of e)if(!Rse(n,{upTo:t}))return n}function Rse(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jse(e){return e instanceof HTMLInputElement&&"select"in e}function Ms(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jse(e)&&t&&e.select()}}var Jk=Nse();function Nse(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=eO(e,t),e.unshift(t)},remove(t){e=eO(e,t),e[0]?.resume()}}}function eO(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Tse(e){return e.filter(t=>t.tagName!=="A")}var kse="Portal",tm=_.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=_.useState(!1);En(()=>i(!0),[]);const l=n||r&&globalThis?.document?.body;return l?hS.createPortal(c.jsx(De.div,{...o,ref:t}),l):null});tm.displayName=kse;var n_=0;function BC(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tO()),document.body.insertAdjacentElement("beforeend",e[1]??tO()),n_++,()=>{n_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),n_--}},[])}function tO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mi=function(){return mi=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},mi.apply(this,arguments)};function JU(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Ose(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var vp="right-scroll-bar-position",yp="width-before-scroll-bar",Ase="with-scroll-bars-hidden",Ise="--removed-body-scroll-bar-size";function r_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $se(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Mse=typeof window<"u"?_.useLayoutEffect:_.useEffect,nO=new WeakMap;function Pse(e,t){var n=$se(null,function(o){return e.forEach(function(r){return r_(r,o)})});return Mse(function(){var o=nO.get(n);if(o){var r=new Set(o),i=new Set(e),l=n.current;r.forEach(function(u){i.has(u)||r_(u,null)}),i.forEach(function(u){r.has(u)||r_(u,l)})}nO.set(n,e)},[e]),n}function Dse(e){return e}function zse(e,t){t===void 0&&(t=Dse);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,o);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(o=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var f=function(){var p=l;l=[],p.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(p){l.push(p),m()},filter:function(p){return l=l.filter(p),n}}}};return r}function Use(e){e===void 0&&(e={});var t=zse(null);return t.options=mi({async:!0,ssr:!1},e),t}var e4=function(e){var t=e.sideCar,n=JU(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,mi({},n))};e4.isSideCarExport=!0;function Lse(e,t){return e.useMedium(t),e4}var t4=Use(),o_=function(){},yv=_.forwardRef(function(e,t){var n=_.useRef(null),o=_.useState({onScrollCapture:o_,onWheelCapture:o_,onTouchMoveCapture:o_}),r=o[0],i=o[1],l=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,x=e.noRelative,b=e.noIsolation,S=e.inert,C=e.allowPinchZoom,E=e.as,j=E===void 0?"div":E,N=e.gapMode,T=JU(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,A=Pse([n,t]),I=mi(mi({},T),r);return _.createElement(_.Fragment,null,p&&_.createElement(k,{sideCar:t4,removeScrollBar:m,shards:g,noRelative:x,noIsolation:b,inert:S,setCallbacks:i,allowPinchZoom:!!C,lockRef:n,gapMode:N}),l?_.cloneElement(_.Children.only(u),mi(mi({},I),{ref:A})):_.createElement(j,mi({},I,{className:f,ref:A}),u))});yv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yv.classNames={fullWidth:yp,zeroRight:vp};var Fse=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vse(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fse();return t&&e.setAttribute("nonce",t),e}function Bse(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hse(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gse=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vse())&&(Bse(t,n),Hse(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qse=function(){var e=Gse();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n4=function(){var e=qse(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Kse={left:0,top:0,right:0,gap:0},i_=function(e){return parseInt(e||"",10)||0},Zse=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[i_(n),i_(o),i_(r)]},Yse=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kse;var t=Zse(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Xse=n4(),jc="data-scroll-locked",Wse=function(e,t,n,o){var r=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
319
+ .`.concat(Ase,` {
320
+ overflow: hidden `).concat(o,`;
321
+ padding-right: `).concat(u,"px ").concat(o,`;
322
+ }
323
+ body[`).concat(jc,`] {
324
+ overflow: hidden `).concat(o,`;
325
+ overscroll-behavior: contain;
326
+ `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
327
+ padding-left: `.concat(r,`px;
328
+ padding-top: `).concat(i,`px;
329
+ padding-right: `).concat(l,`px;
330
+ margin-left:0;
331
+ margin-top:0;
332
+ margin-right: `).concat(u,"px ").concat(o,`;
333
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
334
+ }
335
+
336
+ .`).concat(vp,` {
337
+ right: `).concat(u,"px ").concat(o,`;
338
+ }
339
+
340
+ .`).concat(yp,` {
341
+ margin-right: `).concat(u,"px ").concat(o,`;
342
+ }
343
+
344
+ .`).concat(vp," .").concat(vp,` {
345
+ right: 0 `).concat(o,`;
346
+ }
347
+
348
+ .`).concat(yp," .").concat(yp,` {
349
+ margin-right: 0 `).concat(o,`;
350
+ }
351
+
352
+ body[`).concat(jc,`] {
353
+ `).concat(Ise,": ").concat(u,`px;
354
+ }
355
+ `)},rO=function(){var e=parseInt(document.body.getAttribute(jc)||"0",10);return isFinite(e)?e:0},Qse=function(){_.useEffect(function(){return document.body.setAttribute(jc,(rO()+1).toString()),function(){var e=rO()-1;e<=0?document.body.removeAttribute(jc):document.body.setAttribute(jc,e.toString())}},[])},Jse=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Qse();var i=_.useMemo(function(){return Yse(r)},[r]);return _.createElement(Xse,{styles:Wse(i,!t,r,n?"":"!important")})},Ew=!1;if(typeof window<"u")try{var Vh=Object.defineProperty({},"passive",{get:function(){return Ew=!0,!0}});window.addEventListener("test",Vh,Vh),window.removeEventListener("test",Vh,Vh)}catch{Ew=!1}var dc=Ew?{passive:!1}:!1,eae=function(e){return e.tagName==="TEXTAREA"},r4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eae(e)&&n[t]==="visible")},tae=function(e){return r4(e,"overflowY")},nae=function(e){return r4(e,"overflowX")},oO=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=o4(e,o);if(r){var i=i4(e,o),l=i[1],u=i[2];if(l>u)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},rae=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},oae=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},o4=function(e,t){return e==="v"?tae(t):nae(t)},i4=function(e,t){return e==="v"?rae(t):oae(t)},iae=function(e,t){return e==="h"&&t==="rtl"?-1:1},sae=function(e,t,n,o,r){var i=iae(e,window.getComputedStyle(t).direction),l=i*o,u=n.target,f=t.contains(u),m=!1,p=l>0,g=0,v=0;do{if(!u)break;var x=i4(e,u),b=x[0],S=x[1],C=x[2],E=S-C-i*b;(b||E)&&o4(e,u)&&(g+=E,v+=b);var j=u.parentNode;u=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(m=!0),m},Bh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iO=function(e){return[e.deltaX,e.deltaY]},sO=function(e){return e&&"current"in e?e.current:e},aae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lae=function(e){return`
356
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
357
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
358
+ `)},cae=0,fc=[];function uae(e){var t=_.useRef([]),n=_.useRef([0,0]),o=_.useRef(),r=_.useState(cae++)[0],i=_.useState(n4)[0],l=_.useRef(e);_.useEffect(function(){l.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=Ose([e.lockRef.current],(e.shards||[]).map(sO),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var u=_.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var E=Bh(S),j=n.current,N="deltaX"in S?S.deltaX:j[0]-E[0],T="deltaY"in S?S.deltaY:j[1]-E[1],k,A=S.target,I=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in S&&I==="h"&&A.type==="range")return!1;var P=oO(I,A);if(!P)return!0;if(P?k=I:(k=I==="v"?"h":"v",P=oO(I,A)),!P)return!1;if(!o.current&&"changedTouches"in S&&(N||T)&&(o.current=k),!k)return!0;var L=o.current||k;return sae(L,C,S,L==="h"?N:T)},[]),f=_.useCallback(function(S){var C=S;if(!(!fc.length||fc[fc.length-1]!==i)){var E="deltaY"in C?iO(C):Bh(C),j=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&aae(k.delta,E)})[0];if(j&&j.should){C.cancelable&&C.preventDefault();return}if(!j){var N=(l.current.shards||[]).map(sO).filter(Boolean).filter(function(k){return k.contains(C.target)}),T=N.length>0?u(C,N[0]):!l.current.noIsolation;T&&C.cancelable&&C.preventDefault()}}},[]),m=_.useCallback(function(S,C,E,j){var N={name:S,delta:C,target:E,should:j,shadowParent:dae(E)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(T){return T!==N})},1)},[]),p=_.useCallback(function(S){n.current=Bh(S),o.current=void 0},[]),g=_.useCallback(function(S){m(S.type,iO(S),S.target,u(S,e.lockRef.current))},[]),v=_.useCallback(function(S){m(S.type,Bh(S),S.target,u(S,e.lockRef.current))},[]);_.useEffect(function(){return fc.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,dc),document.addEventListener("touchmove",f,dc),document.addEventListener("touchstart",p,dc),function(){fc=fc.filter(function(S){return S!==i}),document.removeEventListener("wheel",f,dc),document.removeEventListener("touchmove",f,dc),document.removeEventListener("touchstart",p,dc)}},[]);var x=e.removeScrollBar,b=e.inert;return _.createElement(_.Fragment,null,b?_.createElement(i,{styles:lae(r)}):null,x?_.createElement(Jse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fae=Lse(t4,uae);var bv=_.forwardRef(function(e,t){return _.createElement(yv,mi({},e,{ref:t,sideCar:fae}))});bv.classNames=yv.classNames;var mae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mc=new WeakMap,Hh=new WeakMap,Gh={},s_=0,s4=function(e){return e&&(e.host||s4(e.parentNode))},hae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=s4(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pae=function(e,t,n,o){var r=hae(t,Array.isArray(e)?e:[e]);Gh[n]||(Gh[n]=new WeakMap);var i=Gh[n],l=[],u=new Set,f=new Set(r),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};r.forEach(m);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(u.has(v))p(v);else try{var x=v.getAttribute(o),b=x!==null&&x!=="false",S=(mc.get(v)||0)+1,C=(i.get(v)||0)+1;mc.set(v,S),i.set(v,C),l.push(v),S===1&&b&&Hh.set(v,!0),C===1&&v.setAttribute(n,"true"),b||v.setAttribute(o,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return p(t),u.clear(),s_++,function(){l.forEach(function(g){var v=mc.get(g)-1,x=i.get(g)-1;mc.set(g,v),i.set(g,x),v||(Hh.has(g)||g.removeAttribute(o),Hh.delete(g)),x||g.removeAttribute(n)}),s_--,s_||(mc=new WeakMap,mc=new WeakMap,Hh=new WeakMap,Gh={})}},HC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=mae(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),pae(o,r,n,"aria-hidden")):function(){return null}},xv="Dialog",[a4,kbe]=Qo(xv),[gae,ei]=a4(xv),l4=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:l=!0}=e,u=_.useRef(null),f=_.useRef(null),[m,p]=Ci({prop:o,defaultProp:r??!1,onChange:i,caller:xv});return c.jsx(gae,{scope:t,triggerRef:u,contentRef:f,contentId:Xr(),titleId:Xr(),descriptionId:Xr(),open:m,onOpenChange:p,onOpenToggle:_.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};l4.displayName=xv;var c4="DialogTrigger",u4=_.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=ei(c4,n),i=st(t,r.triggerRef);return c.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":KC(r.open),...o,ref:i,onClick:Se(e.onClick,r.onOpenToggle)})});u4.displayName=c4;var GC="DialogPortal",[vae,d4]=a4(GC,{forceMount:void 0}),f4=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=ei(GC,t);return c.jsx(vae,{scope:t,forceMount:n,children:_.Children.map(o,l=>c.jsx(Dn,{present:n||i.open,children:c.jsx(tm,{asChild:!0,container:r,children:l})}))})};f4.displayName=GC;var og="DialogOverlay",m4=_.forwardRef((e,t)=>{const n=d4(og,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=ei(og,e.__scopeDialog);return i.modal?c.jsx(Dn,{present:o||i.open,children:c.jsx(bae,{...r,ref:t})}):null});m4.displayName=og;var yae=Ba("DialogOverlay.RemoveScroll"),bae=_.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=ei(og,n);return c.jsx(bv,{as:yae,allowPinchZoom:!0,shards:[r.contentRef],children:c.jsx(De.div,{"data-state":KC(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),el="DialogContent",h4=_.forwardRef((e,t)=>{const n=d4(el,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,i=ei(el,e.__scopeDialog);return c.jsx(Dn,{present:o||i.open,children:i.modal?c.jsx(xae,{...r,ref:t}):c.jsx(_ae,{...r,ref:t})})});h4.displayName=el;var xae=_.forwardRef((e,t)=>{const n=ei(el,e.__scopeDialog),o=_.useRef(null),r=st(t,n.contentRef,o);return _.useEffect(()=>{const i=o.current;if(i)return HC(i)},[]),c.jsx(p4,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault())})}),_ae=_.forwardRef((e,t)=>{const n=ei(el,e.__scopeDialog),o=_.useRef(!1),r=_.useRef(!1);return c.jsx(p4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),p4=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...l}=e,u=ei(el,n),f=_.useRef(null),m=st(t,f);return BC(),c.jsxs(c.Fragment,{children:[c.jsx(vv,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i,children:c.jsx(vu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":KC(u.open),...l,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(wae,{titleId:u.titleId}),c.jsx(Cae,{contentRef:f,descriptionId:u.descriptionId})]})]})}),qC="DialogTitle",g4=_.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=ei(qC,n);return c.jsx(De.h2,{id:r.titleId,...o,ref:t})});g4.displayName=qC;var v4="DialogDescription",y4=_.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=ei(v4,n);return c.jsx(De.p,{id:r.descriptionId,...o,ref:t})});y4.displayName=v4;var b4="DialogClose",x4=_.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=ei(b4,n);return c.jsx(De.button,{type:"button",...o,ref:t,onClick:Se(e.onClick,()=>r.onOpenChange(!1))})});x4.displayName=b4;function KC(e){return e?"open":"closed"}var _4="DialogTitleWarning",[Obe,w4]=IJ(_4,{contentName:el,titleName:qC,docsSlug:"dialog"}),wae=({titleId:e})=>{const t=w4(_4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
359
+
360
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
361
+
362
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Sae="DialogDescriptionWarning",Cae=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${w4(Sae).contentName}}.`;return _.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Eae=l4,Rae=u4,jae=f4,Nae=m4,Tae=h4,kae=g4,Oae=y4,Aae=x4;function Jn({...e}){return c.jsx(Eae,{"data-slot":"dialog",...e})}function ZC({...e}){return c.jsx(Rae,{"data-slot":"dialog-trigger",...e})}function Iae({...e}){return c.jsx(jae,{"data-slot":"dialog-portal",...e})}function $ae({className:e,...t}){return c.jsx(Nae,{"data-slot":"dialog-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black-dark/90",e),...t})}function er({className:e,children:t,...n}){return c.jsxs(Iae,{"data-slot":"dialog-portal",children:[c.jsx($ae,{}),c.jsxs(Tae,{"data-slot":"dialog-content",className:Me("bg-black data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,c.jsxs(Aae,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[c.jsx(AI,{className:"text-white"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Mr({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:Me("flex flex-col gap-2 text-center sm:text-left",e),...t})}function tr({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-footer",className:Me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Kn({className:e,...t}){return c.jsx(kae,{"data-slot":"dialog-title",className:Me("text-lg leading-none text-white font-semibold",e),...t})}function Io({className:e,...t}){return c.jsx(Oae,{"data-slot":"dialog-description",className:Me("text-muted-foreground text-sm",e),...t})}function Mae({isModalOpen:e=!1,setIsModalOpen:t,isPending:n,isAddingFolder:o,handleAddFolderOrFile:r}){const i=sr.object({name:sr.string().nonempty({error:"Please enter a valid name."}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:"Names can only contain letters, numbers, underscores, hyphens, periods, and spaces."}).max(50,{error:"Names cannot be longer than 50 characters."}).trim()}),l=gn({resolver:yn(i),defaultValues:{name:""}});return c.jsx(Jn,{onOpenChange:t,open:e,children:c.jsx(er,{"aria-describedby":void 0,className:"text-white",children:c.jsx(vn,{...l,children:c.jsxs("form",{children:[c.jsxs(Mr,{children:[c.jsxs(Kn,{children:["Add ",o?"Folder":"File"]}),c.jsxs(Io,{children:["Enter the name of the ",o?"folder":"file"," you want to add:"]})]}),c.jsx($e,{control:l.control,name:"name",render:({field:u})=>c.jsxs(ke,{className:"my-2",children:[c.jsxs(Oe,{children:[o?"Folder":"File"," Name"]}),c.jsx(Ie,{children:c.jsx(Le,{disabled:n,type:"text",placeholder:`${o?"New Folder":"New File"}`,className:"",...u})}),c.jsx(Ae,{})]})}),c.jsx(tr,{children:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsxs(_e,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>t(!1),children:[c.jsx(_I,{})," Cancel"]}),c.jsxs(_e,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:n,onClick:u=>{u.preventDefault(),l.handleSubmit(f=>{r?.(f.name),l.reset()})()},children:[c.jsx(lr,{})," Add ",o?"Folder":"File"]})]})})]})})})})}function Pae({isModalOpen:e=!1,setIsModalOpen:t,isPending:n,isFolderSelected:o,handleDeleteFolderOrFile:r}){return c.jsx(Jn,{onOpenChange:t,open:e,children:c.jsxs(er,{"aria-describedby":void 0,className:"text-white",children:[c.jsxs(Mr,{children:[c.jsxs(Kn,{children:["Delete ",o?"Folder":"File"]}),c.jsxs(Io,{children:["Are you sure you want to delete this ",o?"folder":"file","?"]})]}),c.jsxs("div",{className:"flex flex-col w-full gap-4",children:[c.jsxs(_e,{variant:"destructiveOutline",type:"button",className:"w-full rounded-full",disabled:n,onClick:i=>{i.preventDefault(),r()},children:[c.jsx(ls,{})," Delete ",o?"Folder":"File"]}),c.jsxs(_e,{variant:"default",className:"w-full rounded-full",onClick:()=>t(!1),children:[c.jsx(_I,{})," Cancel"]})]})]})})}async function Dae({file:e,project:t,replicated:n,instanceClient:o}){const{data:r}=await o.post("/",{operation:"drop_component",file:e||void 0,project:t,replicated:n});return r}function zae(){return at({mutationFn:Dae})}function S4({entityId:e,instanceClient:t}){return{queryKey:[e,"get_components"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_components"});return C4(n,n.name,n.name,!1)},retry:!1}}function C4(e,t,n,o=!1){if(!(!e||!e.entries)){t===n&&(e.path=n,e.key=crypto.randomUUID?.()??Math.random().toString().slice(2));for(const r of e.entries??[]){const i=`${t}/${r.name}`,[,l]=i.split("/");r.project=l,r.path=i,r.key=crypto.randomUUID?.()??Math.random().toString().slice(2),r.readOnly=o||!!r.package,C4(r,i,n,r.readOnly)}return e}}function Uae(){const e=dr(),{refetch:t}=Mn(S4(e)),[n,o]=_.useState(!1),[r,i]=_.useState(!1),[l,u]=_.useState(!1),{isFolder:f,selectedFolderFile:m,handleFileSelect:p}=VC(),{mutate:g,isPending:v}=XU(),{mutate:x,isPending:b}=zae(),S=async E=>{g({file:`${m.filePath.split("/").slice(2).join("/")}/${E}`,project:m.projectName,payload:r?void 0:"",...e},{onSuccess:()=>{t(),o(!1)}})},C=async()=>{x({file:`${m.filePath.split("/").slice(2).join("/")}`,project:m.projectName,replicated:e.entityType==="cluster",...e},{onSuccess:()=>{p({filePath:"",projectName:"",entries:[],content:""}),t(),u(!1)}})};return c.jsxs("div",{className:"p-2 border-b border-gray-700",children:[c.jsxs("div",{children:[m.filePath&&f(m.entries)?c.jsxs(c.Fragment,{children:[c.jsxs(_e,{onClick:()=>{o(!n),i(!0)},disabled:!1,variant:"positiveOutline",size:"sm",className:"mr-2 rounded-full",children:[c.jsx(lr,{className:"w-4 h-4"}),c.jsx("span",{className:"ms-1",children:" Folder"})]}),c.jsxs(_e,{onClick:()=>{o(!n),i(!1)},disabled:!1,variant:"positiveOutline",size:"sm",className:"mr-2 rounded-full",children:[c.jsx(lr,{className:"w-4 h-4"}),c.jsx("span",{className:"ms-1",children:" File"})]})]}):"",m.filePath?c.jsxs(_e,{onClick:()=>u(!l),disabled:!1,variant:"destructiveOutline",size:"sm",className:"rounded-full",children:[c.jsx(kG,{className:"w-4 h-4"}),c.jsx("span",{className:"ms-1",children:" Delete"})]}):null]}),m.filePath?null:c.jsx("span",{className:"text-gray-500",children:"Please Select a folder or file"}),c.jsx(Mae,{isModalOpen:n,setIsModalOpen:o,isAddingFolder:r,handleAddFolderOrFile:S,isPending:v}),c.jsx(Pae,{isModalOpen:l,setIsModalOpen:u,isFolderSelected:f(m.entries),isPending:b,handleDeleteFolderOrFile:C})]})}function Lae({fileTreeQueryData:e}){return c.jsxs(c.Fragment,{children:[c.jsx(Uae,{}),c.jsx(wse,{files:e})]})}const Fae=["top","right","bottom","left"],Xs=Math.min,Kr=Math.max,ig=Math.round,qh=Math.floor,_i=e=>({x:e,y:e}),Vae={left:"right",right:"left",bottom:"top",top:"bottom"},Bae={start:"end",end:"start"};function Rw(e,t,n){return Kr(e,Xs(t,n))}function os(e,t){return typeof e=="function"?e(t):e}function is(e){return e.split("-")[0]}function _u(e){return e.split("-")[1]}function YC(e){return e==="x"?"y":"x"}function XC(e){return e==="y"?"height":"width"}const Hae=new Set(["top","bottom"]);function gi(e){return Hae.has(is(e))?"y":"x"}function WC(e){return YC(gi(e))}function Gae(e,t,n){n===void 0&&(n=!1);const o=_u(e),r=WC(e),i=XC(r);let l=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=sg(l)),[l,sg(l)]}function qae(e){const t=sg(e);return[jw(e),t,jw(t)]}function jw(e){return e.replace(/start|end/g,t=>Bae[t])}const aO=["left","right"],lO=["right","left"],Kae=["top","bottom"],Zae=["bottom","top"];function Yae(e,t,n){switch(e){case"top":case"bottom":return n?t?lO:aO:t?aO:lO;case"left":case"right":return t?Kae:Zae;default:return[]}}function Xae(e,t,n,o){const r=_u(e);let i=Yae(is(e),n==="start",o);return r&&(i=i.map(l=>l+"-"+r),t&&(i=i.concat(i.map(jw)))),i}function sg(e){return e.replace(/left|right|bottom|top/g,t=>Vae[t])}function Wae(e){return{top:0,right:0,bottom:0,left:0,...e}}function E4(e){return typeof e!="number"?Wae(e):{top:e,right:e,bottom:e,left:e}}function ag(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function cO(e,t,n){let{reference:o,floating:r}=e;const i=gi(t),l=WC(t),u=XC(l),f=is(t),m=i==="y",p=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,v=o[u]/2-r[u]/2;let x;switch(f){case"top":x={x:p,y:o.y-r.height};break;case"bottom":x={x:p,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:g};break;case"left":x={x:o.x-r.width,y:g};break;default:x={x:o.x,y:o.y}}switch(_u(t)){case"start":x[l]-=v*(n&&m?-1:1);break;case"end":x[l]+=v*(n&&m?-1:1);break}return x}const Qae=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let m=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:g}=cO(m,o,f),v=o,x={},b=0;for(let S=0;S<u.length;S++){const{name:C,fn:E}=u[S],{x:j,y:N,data:T,reset:k}=await E({x:p,y:g,initialPlacement:o,placement:v,strategy:r,middlewareData:x,rects:m,platform:l,elements:{reference:e,floating:t}});p=j??p,g=N??g,x={...x,[C]:{...x[C],...T}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(m=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:r}):k.rects),{x:p,y:g}=cO(m,v,f)),S=-1)}return{x:p,y:g,placement:v,strategy:r,middlewareData:x}};async function mf(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:l,elements:u,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:x=0}=os(t,e),b=E4(x),C=u[v?g==="floating"?"reference":"floating":g],E=ag(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(C)))==null||n?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:m,rootBoundary:p,strategy:f})),j=g==="floating"?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),T=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},k=ag(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:N,strategy:f}):j);return{top:(E.top-k.top+b.top)/T.y,bottom:(k.bottom-E.bottom+b.bottom)/T.y,left:(E.left-k.left+b.left)/T.x,right:(k.right-E.right+b.right)/T.x}}const Jae=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:l,elements:u,middlewareData:f}=t,{element:m,padding:p=0}=os(e,t)||{};if(m==null)return{};const g=E4(p),v={x:n,y:o},x=WC(r),b=XC(x),S=await l.getDimensions(m),C=x==="y",E=C?"top":"left",j=C?"bottom":"right",N=C?"clientHeight":"clientWidth",T=i.reference[b]+i.reference[x]-v[x]-i.floating[b],k=v[x]-i.reference[x],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(m));let I=A?A[N]:0;(!I||!await(l.isElement==null?void 0:l.isElement(A)))&&(I=u.floating[N]||i.floating[b]);const P=T/2-k/2,L=I/2-S[b]/2-1,V=Xs(g[E],L),ie=Xs(g[j],L),se=V,ue=I-S[b]-ie,le=I/2-S[b]/2+P,ce=Rw(se,le,ue),M=!f.arrow&&_u(r)!=null&&le!==ce&&i.reference[b]/2-(le<se?V:ie)-S[b]/2<0,K=M?le<se?le-se:le-ue:0;return{[x]:v[x]+K,data:{[x]:ce,centerOffset:le-ce-K,...M&&{alignmentOffset:K}},reset:M}}}),ele=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:u,platform:f,elements:m}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=os(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=is(r),j=gi(u),N=is(u)===u,T=await(f.isRTL==null?void 0:f.isRTL(m.floating)),k=v||(N||!S?[sg(u)]:qae(u)),A=b!=="none";!v&&A&&k.push(...Xae(u,S,b,T));const I=[u,...k],P=await mf(t,C),L=[];let V=((o=i.flip)==null?void 0:o.overflows)||[];if(p&&L.push(P[E]),g){const le=Gae(r,l,T);L.push(P[le[0]],P[le[1]])}if(V=[...V,{placement:r,overflows:L}],!L.every(le=>le<=0)){var ie,se;const le=(((ie=i.flip)==null?void 0:ie.index)||0)+1,ce=I[le];if(ce&&(!(g==="alignment"?j!==gi(ce):!1)||V.every(U=>gi(U.placement)===j?U.overflows[0]>0:!0)))return{data:{index:le,overflows:V},reset:{placement:ce}};let M=(se=V.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:se.placement;if(!M)switch(x){case"bestFit":{var ue;const K=(ue=V.filter(U=>{if(A){const re=gi(U.placement);return re===j||re==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(re=>re>0).reduce((re,$)=>re+$,0)]).sort((U,re)=>U[1]-re[1])[0])==null?void 0:ue[0];K&&(M=K);break}case"initialPlacement":M=u;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function uO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dO(e){return Fae.some(t=>e[t]>=0)}const tle=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=os(e,t);switch(o){case"referenceHidden":{const i=await mf(t,{...r,elementContext:"reference"}),l=uO(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:dO(l)}}}case"escaped":{const i=await mf(t,{...r,altBoundary:!0}),l=uO(i,n.floating);return{data:{escapedOffsets:l,escaped:dO(l)}}}default:return{}}}}},R4=new Set(["left","top"]);async function nle(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=is(n),u=_u(n),f=gi(n)==="y",m=R4.has(l)?-1:1,p=i&&f?-1:1,g=os(t,e);let{mainAxis:v,crossAxis:x,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),f?{x:x*p,y:v*m}:{x:v*m,y:x*p}}const rle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:u}=t,f=await nle(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:r+f.x,y:i+f.y,data:{...f,placement:l}}}}},ole=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:C=>{let{x:E,y:j}=C;return{x:E,y:j}}},...f}=os(e,t),m={x:n,y:o},p=await mf(t,f),g=gi(is(r)),v=YC(g);let x=m[v],b=m[g];if(i){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",j=x+p[C],N=x-p[E];x=Rw(j,x,N)}if(l){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",j=b+p[C],N=b-p[E];b=Rw(j,b,N)}const S=u.fn({...t,[v]:x,[g]:b});return{...S,data:{x:S.x-n,y:S.y-o,enabled:{[v]:i,[g]:l}}}}}},ile=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:f=!0,crossAxis:m=!0}=os(e,t),p={x:n,y:o},g=gi(r),v=YC(g);let x=p[v],b=p[g];const S=os(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const N=v==="y"?"height":"width",T=i.reference[v]-i.floating[N]+C.mainAxis,k=i.reference[v]+i.reference[N]-C.mainAxis;x<T?x=T:x>k&&(x=k)}if(m){var E,j;const N=v==="y"?"width":"height",T=R4.has(is(r)),k=i.reference[g]-i.floating[N]+(T&&((E=l.offset)==null?void 0:E[g])||0)+(T?0:C.crossAxis),A=i.reference[g]+i.reference[N]+(T?0:((j=l.offset)==null?void 0:j[g])||0)-(T?C.crossAxis:0);b<k?b=k:b>A&&(b=A)}return{[v]:x,[g]:b}}}},sle=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:l,elements:u}=t,{apply:f=()=>{},...m}=os(e,t),p=await mf(t,m),g=is(r),v=_u(r),x=gi(r)==="y",{width:b,height:S}=i.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(E=g,C=v==="end"?"top":"bottom");const j=S-p.top-p.bottom,N=b-p.left-p.right,T=Xs(S-p[C],j),k=Xs(b-p[E],N),A=!t.middlewareData.shift;let I=T,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=N),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(I=j),A&&!v){const V=Kr(p.left,0),ie=Kr(p.right,0),se=Kr(p.top,0),ue=Kr(p.bottom,0);x?P=b-2*(V!==0||ie!==0?V+ie:Kr(p.left,p.right)):I=S-2*(se!==0||ue!==0?se+ue:Kr(p.top,p.bottom))}await f({...t,availableWidth:P,availableHeight:I});const L=await l.getDimensions(u.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function _v(){return typeof window<"u"}function wu(e){return j4(e)?(e.nodeName||"").toLowerCase():"#document"}function Wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ji(e){var t;return(t=(j4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j4(e){return _v()?e instanceof Node||e instanceof Wr(e).Node:!1}function Ko(e){return _v()?e instanceof Element||e instanceof Wr(e).Element:!1}function Ei(e){return _v()?e instanceof HTMLElement||e instanceof Wr(e).HTMLElement:!1}function fO(e){return!_v()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wr(e).ShadowRoot}const ale=new Set(["inline","contents"]);function nm(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ale.has(r)}const lle=new Set(["table","td","th"]);function cle(e){return lle.has(wu(e))}const ule=[":popover-open",":modal"];function wv(e){return ule.some(t=>{try{return e.matches(t)}catch{return!1}})}const dle=["transform","translate","scale","rotate","perspective"],fle=["transform","translate","scale","rotate","perspective","filter"],mle=["paint","layout","strict","content"];function QC(e){const t=JC(),n=Ko(e)?Zo(e):e;return dle.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fle.some(o=>(n.willChange||"").includes(o))||mle.some(o=>(n.contain||"").includes(o))}function hle(e){let t=Ws(e);for(;Ei(t)&&!eu(t);){if(QC(t))return t;if(wv(t))return null;t=Ws(t)}return null}function JC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ple=new Set(["html","body","#document"]);function eu(e){return ple.has(wu(e))}function Zo(e){return Wr(e).getComputedStyle(e)}function Sv(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ws(e){if(wu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fO(e)&&e.host||ji(e);return fO(t)?t.host:t}function N4(e){const t=Ws(e);return eu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ei(t)&&nm(t)?t:N4(t)}function hf(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=N4(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=Wr(r);if(i){const u=Nw(l);return t.concat(l,l.visualViewport||[],nm(r)?r:[],u&&n?hf(u):[])}return t.concat(r,hf(r,[],n))}function Nw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T4(e){const t=Zo(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ei(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,u=ig(n)!==i||ig(o)!==l;return u&&(n=i,o=l),{width:n,height:o,$:u}}function eE(e){return Ko(e)?e:e.contextElement}function Nc(e){const t=eE(e);if(!Ei(t))return _i(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=T4(t);let l=(i?ig(n.width):n.width)/o,u=(i?ig(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const gle=_i(0);function k4(e){const t=Wr(e);return!JC()||!t.visualViewport?gle:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vle(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wr(e)?!1:t}function tl(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=eE(e);let l=_i(1);t&&(o?Ko(o)&&(l=Nc(o)):l=Nc(e));const u=vle(i,n,o)?k4(i):_i(0);let f=(r.left+u.x)/l.x,m=(r.top+u.y)/l.y,p=r.width/l.x,g=r.height/l.y;if(i){const v=Wr(i),x=o&&Ko(o)?Wr(o):o;let b=v,S=Nw(b);for(;S&&o&&x!==b;){const C=Nc(S),E=S.getBoundingClientRect(),j=Zo(S),N=E.left+(S.clientLeft+parseFloat(j.paddingLeft))*C.x,T=E.top+(S.clientTop+parseFloat(j.paddingTop))*C.y;f*=C.x,m*=C.y,p*=C.x,g*=C.y,f+=N,m+=T,b=Wr(S),S=Nw(b)}}return ag({width:p,height:g,x:f,y:m})}function Cv(e,t){const n=Sv(e).scrollLeft;return t?t.left+n:tl(ji(e)).left+n}function O4(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Cv(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function yle(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=ji(o),u=t?wv(t.floating):!1;if(o===l||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=_i(1);const p=_i(0),g=Ei(o);if((g||!g&&!i)&&((wu(o)!=="body"||nm(l))&&(f=Sv(o)),Ei(o))){const x=tl(o);m=Nc(o),p.x=x.x+o.clientLeft,p.y=x.y+o.clientTop}const v=l&&!g&&!i?O4(l,f):_i(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+p.x+v.x,y:n.y*m.y-f.scrollTop*m.y+p.y+v.y}}function ble(e){return Array.from(e.getClientRects())}function xle(e){const t=ji(e),n=Sv(e),o=e.ownerDocument.body,r=Kr(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Cv(e);const u=-n.scrollTop;return Zo(o).direction==="rtl"&&(l+=Kr(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:u}}const mO=25;function _le(e,t){const n=Wr(e),o=ji(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,u=0,f=0;if(r){i=r.width,l=r.height;const p=JC();(!p||p&&t==="fixed")&&(u=r.offsetLeft,f=r.offsetTop)}const m=Cv(o);if(m<=0){const p=o.ownerDocument,g=p.body,v=getComputedStyle(g),x=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(o.clientWidth-g.clientWidth-x);b<=mO&&(i-=b)}else m<=mO&&(i+=m);return{width:i,height:l,x:u,y:f}}const wle=new Set(["absolute","fixed"]);function Sle(e,t){const n=tl(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Ei(e)?Nc(e):_i(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,f=r*i.x,m=o*i.y;return{width:l,height:u,x:f,y:m}}function hO(e,t,n){let o;if(t==="viewport")o=_le(e,n);else if(t==="document")o=xle(ji(e));else if(Ko(t))o=Sle(t,n);else{const r=k4(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ag(o)}function A4(e,t){const n=Ws(e);return n===t||!Ko(n)||eu(n)?!1:Zo(n).position==="fixed"||A4(n,t)}function Cle(e,t){const n=t.get(e);if(n)return n;let o=hf(e,[],!1).filter(u=>Ko(u)&&wu(u)!=="body"),r=null;const i=Zo(e).position==="fixed";let l=i?Ws(e):e;for(;Ko(l)&&!eu(l);){const u=Zo(l),f=QC(l);!f&&u.position==="fixed"&&(r=null),(i?!f&&!r:!f&&u.position==="static"&&!!r&&wle.has(r.position)||nm(l)&&!f&&A4(e,l))?o=o.filter(p=>p!==l):r=u,l=Ws(l)}return t.set(e,o),o}function Ele(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const l=[...n==="clippingAncestors"?wv(t)?[]:Cle(t,this._c):[].concat(n),o],u=l[0],f=l.reduce((m,p)=>{const g=hO(t,p,r);return m.top=Kr(g.top,m.top),m.right=Xs(g.right,m.right),m.bottom=Xs(g.bottom,m.bottom),m.left=Kr(g.left,m.left),m},hO(t,u,r));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Rle(e){const{width:t,height:n}=T4(e);return{width:t,height:n}}function jle(e,t,n){const o=Ei(t),r=ji(t),i=n==="fixed",l=tl(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=_i(0);function m(){f.x=Cv(r)}if(o||!o&&!i)if((wu(t)!=="body"||nm(r))&&(u=Sv(t)),o){const x=tl(t,!0,i,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}else r&&m();i&&!o&&r&&m();const p=r&&!o&&!i?O4(r,u):_i(0),g=l.left+u.scrollLeft-f.x-p.x,v=l.top+u.scrollTop-f.y-p.y;return{x:g,y:v,width:l.width,height:l.height}}function a_(e){return Zo(e).position==="static"}function pO(e,t){if(!Ei(e)||Zo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ji(e)===n&&(n=n.ownerDocument.body),n}function I4(e,t){const n=Wr(e);if(wv(e))return n;if(!Ei(e)){let r=Ws(e);for(;r&&!eu(r);){if(Ko(r)&&!a_(r))return r;r=Ws(r)}return n}let o=pO(e,t);for(;o&&cle(o)&&a_(o);)o=pO(o,t);return o&&eu(o)&&a_(o)&&!QC(o)?n:o||hle(e)||n}const Nle=async function(e){const t=this.getOffsetParent||I4,n=this.getDimensions,o=await n(e.floating);return{reference:jle(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Tle(e){return Zo(e).direction==="rtl"}const kle={convertOffsetParentRelativeRectToViewportRelativeRect:yle,getDocumentElement:ji,getClippingRect:Ele,getOffsetParent:I4,getElementRects:Nle,getClientRects:ble,getDimensions:Rle,getScale:Nc,isElement:Ko,isRTL:Tle};function $4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ole(e,t){let n=null,o;const r=ji(e);function i(){var u;clearTimeout(o),(u=n)==null||u.disconnect(),n=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const m=e.getBoundingClientRect(),{left:p,top:g,width:v,height:x}=m;if(u||t(),!v||!x)return;const b=qh(g),S=qh(r.clientWidth-(p+v)),C=qh(r.clientHeight-(g+x)),E=qh(p),N={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:Kr(0,Xs(1,f))||1};let T=!0;function k(A){const I=A[0].intersectionRatio;if(I!==f){if(!T)return l();I?l(!1,I):o=setTimeout(()=>{l(!1,1e-7)},1e3)}I===1&&!$4(m,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(k,{...N,root:r.ownerDocument})}catch{n=new IntersectionObserver(k,N)}n.observe(e)}return l(!0),i}function Ale(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,m=eE(e),p=r||i?[...m?hf(m):[],...hf(t)]:[];p.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),i&&E.addEventListener("resize",n)});const g=m&&u?Ole(m,n):null;let v=-1,x=null;l&&(x=new ResizeObserver(E=>{let[j]=E;j&&j.target===m&&x&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),m&&!f&&x.observe(m),x.observe(t));let b,S=f?tl(e):null;f&&C();function C(){const E=tl(e);S&&!$4(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(j=>{r&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),g?.(),(E=x)==null||E.disconnect(),x=null,f&&cancelAnimationFrame(b)}}const Ile=rle,$le=ole,Mle=ele,Ple=sle,Dle=tle,gO=Jae,zle=ile,Ule=(e,t,n)=>{const o=new Map,r={platform:kle,...n},i={...r.platform,_c:o};return Qae(e,t,{...r,platform:i})};var Lle=typeof document<"u",Fle=function(){},bp=Lle?_.useLayoutEffect:Fle;function lg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!lg(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!lg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function M4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vO(e,t){const n=M4(e);return Math.round(t*n)/n}function l_(e){const t=_.useRef(e);return bp(()=>{t.current=e}),t}function Vle(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:f,open:m}=e,[p,g]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=_.useState(o);lg(v,o)||x(o);const[b,S]=_.useState(null),[C,E]=_.useState(null),j=_.useCallback(U=>{U!==A.current&&(A.current=U,S(U))},[]),N=_.useCallback(U=>{U!==I.current&&(I.current=U,E(U))},[]),T=i||b,k=l||C,A=_.useRef(null),I=_.useRef(null),P=_.useRef(p),L=f!=null,V=l_(f),ie=l_(r),se=l_(m),ue=_.useCallback(()=>{if(!A.current||!I.current)return;const U={placement:t,strategy:n,middleware:v};ie.current&&(U.platform=ie.current),Ule(A.current,I.current,U).then(re=>{const $={...re,isPositioned:se.current!==!1};le.current&&!lg(P.current,$)&&(P.current=$,lu.flushSync(()=>{g($)}))})},[v,t,n,ie,se]);bp(()=>{m===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[m]);const le=_.useRef(!1);bp(()=>(le.current=!0,()=>{le.current=!1}),[]),bp(()=>{if(T&&(A.current=T),k&&(I.current=k),T&&k){if(V.current)return V.current(T,k,ue);ue()}},[T,k,ue,V,L]);const ce=_.useMemo(()=>({reference:A,floating:I,setReference:j,setFloating:N}),[j,N]),M=_.useMemo(()=>({reference:T,floating:k}),[T,k]),K=_.useMemo(()=>{const U={position:n,left:0,top:0};if(!M.floating)return U;const re=vO(M.floating,p.x),$=vO(M.floating,p.y);return u?{...U,transform:"translate("+re+"px, "+$+"px)",...M4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:re,top:$}},[n,u,M.floating,p.x,p.y]);return _.useMemo(()=>({...p,update:ue,refs:ce,elements:M,floatingStyles:K}),[p,ue,ce,M,K])}const Ble=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?gO({element:o.current,padding:r}).fn(n):{}:o?gO({element:o,padding:r}).fn(n):{}}}},Hle=(e,t)=>({...Ile(e),options:[e,t]}),Gle=(e,t)=>({...$le(e),options:[e,t]}),qle=(e,t)=>({...zle(e),options:[e,t]}),Kle=(e,t)=>({...Mle(e),options:[e,t]}),Zle=(e,t)=>({...Ple(e),options:[e,t]}),Yle=(e,t)=>({...Dle(e),options:[e,t]}),Xle=(e,t)=>({...Ble(e),options:[e,t]});var Wle="Arrow",P4=_.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return c.jsx(De.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});P4.displayName=Wle;var Qle=P4;function Jle(e){const[t,n]=_.useState(void 0);return En(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let l,u;if("borderBoxSize"in i){const f=i.borderBoxSize,m=Array.isArray(f)?f[0]:f;l=m.inlineSize,u=m.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var tE="Popper",[D4,Su]=Qo(tE),[ece,z4]=D4(tE),U4=e=>{const{__scopePopper:t,children:n}=e,[o,r]=_.useState(null);return c.jsx(ece,{scope:t,anchor:o,onAnchorChange:r,children:n})};U4.displayName=tE;var L4="PopperAnchor",F4=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=z4(L4,n),l=_.useRef(null),u=st(t,l),f=_.useRef(null);return _.useEffect(()=>{const m=f.current;f.current=o?.current||l.current,m!==f.current&&i.onAnchorChange(f.current)}),o?null:c.jsx(De.div,{...r,ref:u})});F4.displayName=L4;var nE="PopperContent",[tce,nce]=D4(nE),V4=_.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:b,...S}=e,C=z4(nE,n),[E,j]=_.useState(null),N=st(t,ae=>j(ae)),[T,k]=_.useState(null),A=Jle(T),I=A?.width??0,P=A?.height??0,L=o+(i!=="center"?"-"+i:""),V=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ie=Array.isArray(m)?m:[m],se=ie.length>0,ue={padding:V,boundary:ie.filter(oce),altBoundary:se},{refs:le,floatingStyles:ce,placement:M,isPositioned:K,middlewareData:U}=Vle({strategy:"fixed",placement:L,whileElementsMounted:(...ae)=>Ale(...ae,{animationFrame:x==="always"}),elements:{reference:C.anchor},middleware:[Hle({mainAxis:r+P,alignmentAxis:l}),f&&Gle({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qle():void 0,...ue}),f&&Kle({...ue}),Zle({...ue,apply:({elements:ae,rects:fe,availableWidth:ze,availableHeight:Ve})=>{const{width:Ye,height:He}=fe.reference,Gt=ae.floating.style;Gt.setProperty("--radix-popper-available-width",`${ze}px`),Gt.setProperty("--radix-popper-available-height",`${Ve}px`),Gt.setProperty("--radix-popper-anchor-width",`${Ye}px`),Gt.setProperty("--radix-popper-anchor-height",`${He}px`)}}),T&&Xle({element:T,padding:u}),ice({arrowWidth:I,arrowHeight:P}),v&&Yle({strategy:"referenceHidden",...ue})]}),[re,$]=G4(M),H=Kt(b);En(()=>{K&&H?.()},[K,H]);const W=U.arrow?.x,B=U.arrow?.y,J=U.arrow?.centerOffset!==0,[ge,ye]=_.useState();return En(()=>{E&&ye(window.getComputedStyle(E).zIndex)},[E]),c.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:K?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(tce,{scope:n,placedSide:re,onArrowChange:k,arrowX:W,arrowY:B,shouldHideArrow:J,children:c.jsx(De.div,{"data-side":re,"data-align":$,...S,ref:N,style:{...S.style,animation:K?void 0:"none"}})})})});V4.displayName=nE;var B4="PopperArrow",rce={top:"bottom",right:"left",bottom:"top",left:"right"},H4=_.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=nce(B4,o),l=rce[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Qle,{...r,ref:n,style:{...r.style,display:"block"}})})});H4.displayName=B4;function oce(e){return e!==null}var ice=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,l=r.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[m,p]=G4(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(r.arrow?.x??0)+u/2,x=(r.arrow?.y??0)+f/2;let b="",S="";return m==="bottom"?(b=l?g:`${v}px`,S=`${-f}px`):m==="top"?(b=l?g:`${v}px`,S=`${o.floating.height+f}px`):m==="right"?(b=`${-f}px`,S=l?g:`${x}px`):m==="left"&&(b=`${o.floating.width+f}px`,S=l?g:`${x}px`),{data:{x:b,y:S}}}});function G4(e){const[t,n="center"]=e.split("-");return[t,n]}var rE=U4,oE=F4,iE=V4,sE=H4,[Ev,Abe]=Qo("Tooltip",[Su]),Rv=Su(),q4="TooltipProvider",sce=700,Tw="tooltip.open",[ace,aE]=Ev(q4),K4=e=>{const{__scopeTooltip:t,delayDuration:n=sce,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,l=_.useRef(!0),u=_.useRef(!1),f=_.useRef(0);return _.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),c.jsx(ace,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(f.current),l.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:u,onPointerInTransitChange:_.useCallback(m=>{u.current=m},[]),disableHoverableContent:r,children:i})};K4.displayName=q4;var pf="Tooltip",[lce,rm]=Ev(pf),Z4=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,f=aE(pf,e.__scopeTooltip),m=Rv(t),[p,g]=_.useState(null),v=Xr(),x=_.useRef(0),b=l??f.disableHoverableContent,S=u??f.delayDuration,C=_.useRef(!1),[E,j]=Ci({prop:o,defaultProp:r??!1,onChange:I=>{I?(f.onOpen(),document.dispatchEvent(new CustomEvent(Tw))):f.onClose(),i?.(I)},caller:pf}),N=_.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),T=_.useCallback(()=>{window.clearTimeout(x.current),x.current=0,C.current=!1,j(!0)},[j]),k=_.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),A=_.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{C.current=!0,j(!0),x.current=0},S)},[S,j]);return _.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),c.jsx(rE,{...m,children:c.jsx(lce,{scope:t,contentId:v,open:E,stateAttribute:N,trigger:p,onTriggerChange:g,onTriggerEnter:_.useCallback(()=>{f.isOpenDelayedRef.current?A():T()},[f.isOpenDelayedRef,A,T]),onTriggerLeave:_.useCallback(()=>{b?k():(window.clearTimeout(x.current),x.current=0)},[k,b]),onOpen:T,onClose:k,disableHoverableContent:b,children:n})})};Z4.displayName=pf;var kw="TooltipTrigger",Y4=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=rm(kw,n),i=aE(kw,n),l=Rv(n),u=_.useRef(null),f=st(t,u,r.onTriggerChange),m=_.useRef(!1),p=_.useRef(!1),g=_.useCallback(()=>m.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),c.jsx(oE,{asChild:!0,...l,children:c.jsx(De.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:f,onPointerMove:Se(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),p.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{r.onTriggerLeave(),p.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{r.open&&r.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Se(e.onFocus,()=>{m.current||r.onOpen()}),onBlur:Se(e.onBlur,r.onClose),onClick:Se(e.onClick,r.onClose)})})});Y4.displayName=kw;var lE="TooltipPortal",[cce,uce]=Ev(lE,{forceMount:void 0}),X4=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=rm(lE,t);return c.jsx(cce,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||i.open,children:c.jsx(tm,{asChild:!0,container:r,children:o})})})};X4.displayName=lE;var tu="TooltipContent",W4=_.forwardRef((e,t)=>{const n=uce(tu,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,l=rm(tu,e.__scopeTooltip);return c.jsx(Dn,{present:o||l.open,children:l.disableHoverableContent?c.jsx(Q4,{side:r,...i,ref:t}):c.jsx(dce,{side:r,...i,ref:t})})}),dce=_.forwardRef((e,t)=>{const n=rm(tu,e.__scopeTooltip),o=aE(tu,e.__scopeTooltip),r=_.useRef(null),i=st(t,r),[l,u]=_.useState(null),{trigger:f,onClose:m}=n,p=r.current,{onPointerInTransitChange:g}=o,v=_.useCallback(()=>{u(null),g(!1)},[g]),x=_.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},j=pce(E,C.getBoundingClientRect()),N=gce(E,j),T=vce(S.getBoundingClientRect()),k=bce([...N,...T]);u(k),g(!0)},[g]);return _.useEffect(()=>()=>v(),[v]),_.useEffect(()=>{if(f&&p){const b=C=>x(C,p),S=C=>x(C,f);return f.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[f,p,x,v]),_.useEffect(()=>{if(l){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},j=f?.contains(C)||p?.contains(C),N=!yce(E,l);j?v():N&&(v(),m())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,p,l,m,v]),c.jsx(Q4,{...e,ref:i})}),[fce,mce]=Ev(pf,{isInside:!1}),hce=DB("TooltipContent"),Q4=_.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,f=rm(tu,n),m=Rv(n),{onClose:p}=f;return _.useEffect(()=>(document.addEventListener(Tw,p),()=>document.removeEventListener(Tw,p)),[p]),_.useEffect(()=>{if(f.trigger){const g=v=>{v.target?.contains(f.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,p]),c.jsx(vu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:c.jsxs(iE,{"data-state":f.stateAttribute,...m,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(hce,{children:o}),c.jsx(fce,{scope:n,isInside:!0,children:c.jsx($M,{id:f.contentId,role:"tooltip",children:r||o})})]})})});W4.displayName=tu;var J4="TooltipArrow",eL=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Rv(n);return mce(J4,n).isInside?null:c.jsx(sE,{...r,...o,ref:t})});eL.displayName=J4;function pce(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function gce(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function vce(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function yce(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],m=u.x,p=u.y,g=f.x,v=f.y;p>o!=v>o&&n<(g-m)*(o-p)/(v-p)+m&&(r=!r)}return r}function bce(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),xce(t)}function xce(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _ce=K4,wce=Z4,Sce=Y4,Cce=X4,Ece=W4,Rce=eL;function jce({delayDuration:e=0,...t}){return c.jsx(_ce,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function tL({...e}){return c.jsx(jce,{children:c.jsx(wce,{"data-slot":"tooltip",...e})})}function nL({...e}){return c.jsx(Sce,{"data-slot":"tooltip-trigger",...e})}function rL({className:e,sideOffset:t=0,arrowClassName:n,children:o,...r}){return c.jsx(Cce,{children:c.jsxs(Ece,{"data-slot":"tooltip-content",sideOffset:t,className:Me("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[o,c.jsx(Rce,{className:Me("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}async function Nce(e,t=3,n=1e3){let o=0;if(t<=0)throw new Error("retries must be greater than 0");let r;for(;o<t;)try{return await e()}catch(i){if(o++,r=i,o===t)break;await Ng(n)}throw r}async function oL({operation:e,replicated:t,instanceClient:n}){const{data:o}=await n.post("/",{operation:e,service:e==="restart_service"?"http":void 0,replicated:t});return await Ng(3e3),await Nce(()=>tf({instanceClient:n,timeout:1e4}),5,3e3),o}function Tce(){return at({mutationFn:oL})}function kce({onRestartedSuccessfully:e}={}){const{clusterId:t}=Ze({strict:!1}),[n,o]=_.useState(!1);return{onRestartClick:_.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");o(!0);let i=!1;const l={duration:6e4,action:{label:"Cancel",onClick:()=>{i=!0}}},u=Ee.loading("Restarting",{...l,description:yO()}),f=await r0(t);let m=!1;if(f){const p=f.instances?.map(g=>Us({id:g.id,operationsUrl:lS(g)}));if(p?.length){for(let g=0;g<p.length;g++){const v=p[g];i||(Ee.loading("Restarting",{...l,id:u,description:yO(g,p.length)}),await oL({operation:"restart",replicated:!1,instanceClient:v}))}m=!0}}o(!1),i?Ee.error("Cancelled",{id:u,description:"The restart was partially cancelled.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}):m?(e?.(),Ee.success("Success",{id:u,description:"Cluster restarted!",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})):Ee.error("Error",{id:u,description:"Failed to restart cluster.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})},[t,e]),isRestartPending:n}}function yO(e,t){return c.jsxs(c.Fragment,{children:["Restarting cluster instances.",e!==void 0&&t!==void 0&&t>0&&c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:c.jsx("div",{className:"bg-purple-600 h-2.5 rounded-full dark:bg-purple-500",style:{width:(e===0?0:e/t*100)+"%"}})})]})}function iL({targetNoun:e,operation:t,instanceClient:n,onRestartedSuccessfully:o}){const{mutate:r,isPending:i}=Tce();return{onRestartClick:_.useCallback(()=>{const u=Ee.loading("Restarting",{description:`Restarting ${e.toLowerCase()}. This may take up to 60 seconds.`,duration:6e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});r({operation:t,replicated:t==="restart_service"&&e==="Cluster",instanceClient:n},{onSuccess:()=>{Ee.dismiss(u),Ee.success("Success",{description:`${e} restarted!`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),o?.()},onError:()=>{Ee.dismiss(u),Ee.error("Error",{description:`Failed to restart ${e.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[n,o,t,r,e]),isRestartPending:i}}function sL({targetNoun:e,instanceClient:t,operation:n}){const{onRestartClick:o,isRestartPending:r}=kce(),{onRestartClick:i,isRestartPending:l}=iL({targetNoun:e,operation:n,instanceClient:t});return c.jsxs(tL,{children:[c.jsx(nL,{asChild:!0,children:c.jsxs(_e,{variant:"positiveOutline",className:"mx-0 md:mx-4 rounded-full",onClick:e==="Cluster"&&n==="restart"?o:i,disabled:l||r,children:[c.jsx(FG,{})," Restart ",e]})}),c.jsx(rL,{children:n==="restart_service"?"Restarts all service threads to apply changes. No downtime expected. Performance may be briefly slower during restart.":"This fully restarts the Harper service and causes downtime."})]})}function bO(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r)||e[r]!==t[r])return!1;return!0}function xp(e,t){const[n,o]=_.useState(t),[r,i]=_.useState(e);return _.useEffect(()=>{bO(n,t)||(o(t),i(e))},[n,t,e]),bO(n,t)?[r,i]:[e,i]}function Oce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function _O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xO(Object(n),!0).forEach(function(o){Oce(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ace(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function Ice(e,t){if(e==null)return{};var n=Ace(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function $ce(e,t){return Mce(e)||Pce(e,t)||Dce(e,t)||zce()}function Mce(e){if(Array.isArray(e))return e}function Pce(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],o=!0,r=!1,i=void 0;try{for(var l=e[Symbol.iterator](),u;!(o=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));o=!0);}catch(f){r=!0,i=f}finally{try{!o&&l.return!=null&&l.return()}finally{if(r)throw i}}return n}}function Dce(e,t){if(e){if(typeof e=="string")return wO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wO(e,t)}}function wO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function zce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
363
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function CO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SO(Object(n),!0).forEach(function(o){Uce(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return t.reduceRight(function(r,i){return i(r)},o)}}function Fd(e){return function t(){for(var n=this,o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];return r.length>=e.length?e.apply(this,r):function(){for(var l=arguments.length,u=new Array(l),f=0;f<l;f++)u[f]=arguments[f];return t.apply(n,[].concat(r,u))}}}function cg(e){return{}.toString.call(e).includes("Object")}function Fce(e){return!Object.keys(e).length}function gf(e){return typeof e=="function"}function Vce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bce(e,t){return cg(t)||Bs("changeType"),Object.keys(t).some(function(n){return!Vce(e,n)})&&Bs("changeField"),t}function Hce(e){gf(e)||Bs("selectorType")}function Gce(e){gf(e)||cg(e)||Bs("handlerType"),cg(e)&&Object.values(e).some(function(t){return!gf(t)})&&Bs("handlersType")}function qce(e){e||Bs("initialIsRequired"),cg(e)||Bs("initialType"),Fce(e)&&Bs("initialContent")}function Kce(e,t){throw new Error(e[t]||e.default)}var Zce={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Bs=Fd(Kce)(Zce),Kh={changes:Bce,selector:Hce,handler:Gce,initial:qce};function Yce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Kh.initial(e),Kh.handler(t);var n={current:e},o=Fd(Qce)(n,t),r=Fd(Wce)(n),i=Fd(Kh.changes)(e),l=Fd(Xce)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Kh.selector(m),m(n.current)}function f(m){Lce(o,r,i,l)(m)}return[u,f]}function Xce(e,t){return gf(t)?t(e.current):t}function Wce(e,t){return e.current=CO(CO({},e.current),t),t}function Qce(e,t,n){return gf(t)?t(e.current):Object.keys(n).forEach(function(o){var r;return(r=t[o])===null||r===void 0?void 0:r.call(t,e.current[o])}),n}var Jce={create:Yce},eue={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function tue(e){return function t(){for(var n=this,o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];return r.length>=e.length?e.apply(this,r):function(){for(var l=arguments.length,u=new Array(l),f=0;f<l;f++)u[f]=arguments[f];return t.apply(n,[].concat(r,u))}}}function nue(e){return{}.toString.call(e).includes("Object")}function rue(e){return e||EO("configIsRequired"),nue(e)||EO("configType"),e.urls?(oue(),{paths:{vs:e.urls.monacoBase}}):e}function oue(){console.warn(aL.deprecation)}function iue(e,t){throw new Error(e[t]||e.default)}var aL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
364
+ You are using deprecated way of configuration.
365
+
366
+ Instead of using
367
+ monaco.config({ urls: { monacoBase: '...' } })
368
+ use
369
+ monaco.config({ paths: { vs: '...' } })
370
+
371
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
372
+ `},EO=tue(iue)(aL),sue={config:rue},aue=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return function(r){return n.reduceRight(function(i,l){return l(i)},r)}};function lL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],lL(e[n],t[n]))}),_O(_O({},e),t)}var lue={type:"cancelation",msg:"operation is manually canceled"};function c_(e){var t=!1,n=new Promise(function(o,r){e.then(function(i){return t?r(lue):o(i)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var cue=Jce.create({config:eue,isInitialized:!1,resolve:null,reject:null,monaco:null}),cL=$ce(cue,2),om=cL[0],jv=cL[1];function uue(e){var t=sue.config(e),n=t.monaco,o=Ice(t,["monaco"]);jv(function(r){return{config:lL(r.config,o),monaco:n}})}function due(){var e=om(function(t){var n=t.monaco,o=t.isInitialized,r=t.resolve;return{monaco:n,isInitialized:o,resolve:r}});if(!e.isInitialized){if(jv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),c_(u_);if(window.monaco&&window.monaco.editor)return uL(window.monaco),e.resolve(window.monaco),c_(u_);aue(fue,hue)(pue)}return c_(u_)}function fue(e){return document.body.appendChild(e)}function mue(e){var t=document.createElement("script");return e&&(t.src=e),t}function hue(e){var t=om(function(o){var r=o.config,i=o.reject;return{config:r,reject:i}}),n=mue("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function pue(){var e=om(function(n){var o=n.config,r=n.resolve,i=n.reject;return{config:o,resolve:r,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){uL(n),e.resolve(n)},function(n){e.reject(n)})}function uL(e){om().monaco||jv({monaco:e})}function gue(){return om(function(e){var t=e.monaco;return t})}var u_=new Promise(function(e,t){return jv({resolve:e,reject:t})}),dL={config:uue,init:due,__getMonacoInstance:gue},vue={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},d_=vue,yue={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},bue=yue;function xue({children:e}){return q.createElement("div",{style:bue.container},e)}var _ue=xue,wue=_ue;function Sue({width:e,height:t,isEditorReady:n,loading:o,_ref:r,className:i,wrapperProps:l}){return q.createElement("section",{style:{...d_.wrapper,width:e,height:t},...l},!n&&q.createElement(wue,null,o),q.createElement("div",{ref:r,style:{...d_.fullWidth,...!n&&d_.hide},className:i}))}var Cue=Sue,fL=_.memo(Cue);function Eue(e){_.useEffect(e,[])}var mL=Eue;function Rue(e,t,n=!0){let o=_.useRef(!0);_.useEffect(o.current||!n?()=>{o.current=!1}:e,t)}var qr=Rue;function Wd(){}function xc(e,t,n,o){return jue(e,o)||Nue(e,t,n,o)}function jue(e,t){return e.editor.getModel(hL(e,t))}function Nue(e,t,n,o){return e.editor.createModel(t,n,o?hL(e,o):void 0)}function hL(e,t){return e.Uri.parse(t)}function Tue({original:e,modified:t,language:n,originalLanguage:o,modifiedLanguage:r,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:p="Loading...",options:g={},height:v="100%",width:x="100%",className:b,wrapperProps:S={},beforeMount:C=Wd,onMount:E=Wd}){let[j,N]=_.useState(!1),[T,k]=_.useState(!0),A=_.useRef(null),I=_.useRef(null),P=_.useRef(null),L=_.useRef(E),V=_.useRef(C),ie=_.useRef(!1);mL(()=>{let ce=dL.init();return ce.then(M=>(I.current=M)&&k(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>A.current?le():ce.cancel()}),qr(()=>{if(A.current&&I.current){let ce=A.current.getOriginalEditor(),M=xc(I.current,e||"",o||n||"text",i||"");M!==ce.getModel()&&ce.setModel(M)}},[i],j),qr(()=>{if(A.current&&I.current){let ce=A.current.getModifiedEditor(),M=xc(I.current,t||"",r||n||"text",l||"");M!==ce.getModel()&&ce.setModel(M)}},[l],j),qr(()=>{let ce=A.current.getModifiedEditor();ce.getOption(I.current.editor.EditorOption.readOnly)?ce.setValue(t||""):t!==ce.getValue()&&(ce.executeEdits("",[{range:ce.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),ce.pushUndoStop())},[t],j),qr(()=>{A.current?.getModel()?.original.setValue(e||"")},[e],j),qr(()=>{let{original:ce,modified:M}=A.current.getModel();I.current.editor.setModelLanguage(ce,o||n||"text"),I.current.editor.setModelLanguage(M,r||n||"text")},[n,o,r],j),qr(()=>{I.current?.editor.setTheme(m)},[m],j),qr(()=>{A.current?.updateOptions(g)},[g],j);let se=_.useCallback(()=>{if(!I.current)return;V.current(I.current);let ce=xc(I.current,e||"",o||n||"text",i||""),M=xc(I.current,t||"",r||n||"text",l||"");A.current?.setModel({original:ce,modified:M})},[n,t,r,e,o,i,l]),ue=_.useCallback(()=>{!ie.current&&P.current&&(A.current=I.current.editor.createDiffEditor(P.current,{automaticLayout:!0,...g}),se(),I.current?.editor.setTheme(m),N(!0),ie.current=!0)},[g,m,se]);_.useEffect(()=>{j&&L.current(A.current,I.current)},[j]),_.useEffect(()=>{!T&&!j&&ue()},[T,j,ue]);function le(){let ce=A.current?.getModel();u||ce?.original?.dispose(),f||ce?.modified?.dispose(),A.current?.dispose()}return q.createElement(fL,{width:x,height:v,isEditorReady:j,loading:p,_ref:P,className:b,wrapperProps:S})}var kue=Tue;_.memo(kue);function Oue(e){let t=_.useRef();return _.useEffect(()=>{t.current=e},[e]),t.current}var Aue=Oue,Zh=new Map;function Iue({defaultValue:e,defaultLanguage:t,defaultPath:n,value:o,language:r,path:i,theme:l="light",line:u,loading:f="Loading...",options:m={},overrideServices:p={},saveViewState:g=!0,keepCurrentModel:v=!1,width:x="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Wd,onMount:j=Wd,onChange:N,onValidate:T=Wd}){let[k,A]=_.useState(!1),[I,P]=_.useState(!0),L=_.useRef(null),V=_.useRef(null),ie=_.useRef(null),se=_.useRef(j),ue=_.useRef(E),le=_.useRef(),ce=_.useRef(o),M=Aue(i),K=_.useRef(!1),U=_.useRef(!1);mL(()=>{let H=dL.init();return H.then(W=>(L.current=W)&&P(!1)).catch(W=>W?.type!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>V.current?$():H.cancel()}),qr(()=>{let H=xc(L.current,e||o||"",t||r||"",i||n||"");H!==V.current?.getModel()&&(g&&Zh.set(M,V.current?.saveViewState()),V.current?.setModel(H),g&&V.current?.restoreViewState(Zh.get(i)))},[i],k),qr(()=>{V.current?.updateOptions(m)},[m],k),qr(()=>{!V.current||o===void 0||(V.current.getOption(L.current.editor.EditorOption.readOnly)?V.current.setValue(o):o!==V.current.getValue()&&(U.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),V.current.pushUndoStop(),U.current=!1))},[o],k),qr(()=>{let H=V.current?.getModel();H&&r&&L.current?.editor.setModelLanguage(H,r)},[r],k),qr(()=>{u!==void 0&&V.current?.revealLine(u)},[u],k),qr(()=>{L.current?.editor.setTheme(l)},[l],k);let re=_.useCallback(()=>{if(!(!ie.current||!L.current)&&!K.current){ue.current(L.current);let H=i||n,W=xc(L.current,o||e||"",t||r||"",H||"");V.current=L.current?.editor.create(ie.current,{model:W,automaticLayout:!0,...m},p),g&&V.current.restoreViewState(Zh.get(H)),L.current.editor.setTheme(l),u!==void 0&&V.current.revealLine(u),A(!0),K.current=!0}},[e,t,n,o,r,i,m,p,g,l,u]);_.useEffect(()=>{k&&se.current(V.current,L.current)},[k]),_.useEffect(()=>{!I&&!k&&re()},[I,k,re]),ce.current=o,_.useEffect(()=>{k&&N&&(le.current?.dispose(),le.current=V.current?.onDidChangeModelContent(H=>{U.current||N(V.current.getValue(),H)}))},[k,N]),_.useEffect(()=>{if(k){let H=L.current.editor.onDidChangeMarkers(W=>{let B=V.current.getModel()?.uri;if(B&&W.find(J=>J.path===B.path)){let J=L.current.editor.getModelMarkers({resource:B});T?.(J)}});return()=>{H?.dispose()}}return()=>{}},[k,T]);function $(){le.current?.dispose(),v?g&&Zh.set(i,V.current.saveViewState()):V.current.getModel()?.dispose(),V.current.dispose()}return q.createElement(fL,{width:x,height:b,isEditorReady:k,loading:f,_ref:ie,className:S,wrapperProps:C})}var $ue=Iue,im=_.memo($ue),Nv=im;async function Mue({newApplicationName:e,instanceClient:t,replicated:n}){const{data:o}=await t.post("/",{operation:"add_component",project:e,replicated:n});return o}function Pue(){return at({mutationFn:Mue})}const Due=Pn({newApplicationName:vt().nonempty({error:"Project name is required."}).max(75,{error:"Project name cannot be longer than 75 characters."}).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),replicated:Xc()});function zue({triggerRestart:e,isRestartPending:t}){const n=zf(),o=gn({resolver:yn(Due),defaultValues:{newApplicationName:"",replicated:n.entityType==="cluster"}}),{mutate:r}=Pue(),i=l=>{r({...l,...n},{onSuccess:()=>{Ee.success(`Project ${l.newApplicationName} created successfully`),e()}})};return c.jsx("div",{className:"mx-auto max-w-96",children:c.jsx(vn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(i),className:"text-white",children:[c.jsx($e,{control:o.control,name:"newApplicationName",render:({field:l})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1 text-center",children:"New Project Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"e-commerce-store",className:"text-center",...l})}),c.jsx(Ae,{})]})}),c.jsxs(_e,{className:"w-full mt-4",variant:"submit",type:"submit",disabled:!o.formState.isDirty||t,children:["Create ",c.jsx(Yr,{})]})]})})})}async function Uue(e){if(e&&e.pathname&&e.hostname.includes("github.com")){const t=e.pathname.split("/").filter(Boolean);try{const n=await fetch(`https://api.github.com/repos/${t[0]}/${t[1]}`),o=await n.json();return n.ok?o.name:null}catch{return null}}}function Lue(e){try{return!!new URL(e)}catch{return!1}}function Fue(e){return Lue(e)&&(e.includes(".tar")||e.includes(".tar.gz")||e.includes(".tgz"))}async function Vue({newApplicationName:e,applicationUrl:t,instanceClient:n,replicated:o}){const{data:r}=await n.post("/",{operation:"deploy_component",package:t,project:e,replicated:o,restart:"rolling"},{timeout:6e4});return r}function Bue(){return at({mutationFn:Vue})}const Hue=Pn({newApplicationName:vt().nonempty({error:"Project name is required."}).max(75,{error:"Project name cannot be longer than 75 characters."}).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),applicationUrl:vt().nonempty({error:"Please enter a Application URL."}),replicated:Xc()});function Gue({triggerRestart:e,isRestartPending:t}){const n=zf(),o=gn({resolver:yn(Hue),defaultValues:{newApplicationName:"",applicationUrl:"",replicated:n.entityType==="cluster"}}),{mutate:r,isPending:i}=Bue(),l=async f=>{r({...f,...n},{onSuccess:()=>{Ee.success(`Application ${f.newApplicationName} created successfully`),e()}})},u=async f=>{if(f.includes("github.com")){const m=await Uue(new URL(f));m?(o.setValue("newApplicationName",m),Ee.success(`Application "${m}" found successfully`)):Ee.error("Invalid GitHub repository URL")}else f&&Fue(f)&&o.setValue("newApplicationName",f)};return c.jsx("div",{className:"mx-auto max-w-96",children:c.jsx(vn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(l),className:"flex flex-col gap-4 text-white",children:[c.jsx($e,{control:o.control,name:"newApplicationName",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"New Project Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"e-commerce-store",...f})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:o.control,name:"applicationUrl",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Project URL"}),c.jsx(Ie,{children:c.jsx(Le,{type:"url",placeholder:"https://github.com/HarperDB/nextjs-example",...f,onChange:m=>{f.onChange(m.currentTarget.value),u(m.currentTarget.value)}})}),c.jsx(Ae,{})]})}),c.jsx(_e,{className:"w-full mt-4",variant:"submit",type:"submit",disabled:!o.formState.isDirty||i||t,children:i?c.jsx(wG,{className:"animate-spin"}):c.jsxs(c.Fragment,{children:["Create ",c.jsx(Yr,{})]})})]})})})}function que({isModalOpen:e=!1,setIsModalOpen:t,appType:n,setAppType:o}){const{instanceId:r}=Ze({strict:!1}),{instanceClient:i}=zf(),l="Instance",u=Xo(),f=dr(),m=_.useCallback(()=>{u.invalidateQueries({queryKey:[f.entityId,"get_components"]}),t(!1)},[t,f.entityId,u]),{onRestartClick:p,isRestartPending:g}=iL({operation:"restart_service",targetNoun:l,instanceClient:i,onRestartedSuccessfully:m});return c.jsx(Jn,{onOpenChange:t,open:e,children:c.jsxs(er,{"aria-describedby":void 0,className:"text-white",children:[c.jsxs(Mr,{children:[c.jsx(Kn,{children:"Create/Import An Application"}),c.jsx(Io,{children:"Create a new application or import an existing one."})]}),c.jsxs("div",{className:"flex justify-center my-4",children:[c.jsxs(_e,{className:"py-4",variant:"positiveOutline",onClick:()=>o("create"),children:[c.jsx(hG,{}),"Create"]}),c.jsxs(_e,{className:"py-4 ml-4",variant:"positiveOutline",onClick:()=>o("import"),children:[c.jsx(jI,{}),"Import"]})]}),c.jsx("div",{children:n==="create"?c.jsx(zue,{triggerRestart:p,isRestartPending:g}):n==="import"?c.jsx(Gue,{triggerRestart:p,isRestartPending:g}):c.jsx("p",{className:"text-center",children:"Please select an option to continue."})})]})})}function Kue(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}const Zue={js:"javascript",cjs:"javascript",jsx:"javascript",yaml:"yaml",ts:"typescript",tsx:"typescript",json:"json",md:"markdown",html:"html",css:"css",graphql:"graphql",mjs:"javascript"};function Yue(){const{selectedFolderFile:e,onSaveFile:t,isSavingFile:n,isFolder:o}=VC(),[r,i]=_.useState("javascript"),[l,u]=xp(e.content||null,[e.filePath]),{instanceId:f}=Ze({strict:!1}),m="Instance",p=zf(),[g,v]=_.useState(!1),[x,b]=_.useState("create"),S=e.filePath.split("/").slice(1).join("/").replace(/\//g," > ");return _.useEffect(()=>{const C=Kue(e.filePath),E=Zue[C]||"plaintext";i(E)},[e]),c.jsxs("div",{className:"h-[calc(100vh-theme(spacing.52))]",children:[c.jsxs("div",{className:"flex items-center justify-between py-1 border-b border-gray-700",children:[c.jsx("span",{className:"p-2",children:e.filePath?S:"Select a file"}),c.jsxs("div",{className:"flex flex-col justify-end space-y-2 md:justify-normal md:flex-row ",children:[c.jsxs(_e,{variant:"positiveOutline",className:"w-38 rounded-full",onClick:()=>{l!==null&&t({...p,file:e.filePath.split("/").slice(2).join("/"),payload:l,project:e.projectName},e.filePath)},disabled:!e.filePath||l===null||l===e.content||n,children:[c.jsx(as,{}),c.jsx("span",{className:"ms-1",children:"Save"})]}),c.jsx(sL,{targetNoun:m,instanceClient:p.instanceClient,operation:"restart_service"}),c.jsxs(_e,{variant:"defaultOutline",className:"w-38 rounded-full",onClick:()=>v(!0),children:[c.jsx(lr,{})," New Application"]})]})]}),!e.filePath||o(e.entries)?c.jsxs("div",{className:"flex flex-col items-center justify-center h-full space-y-4",children:[c.jsx("span",{className:"text-white",children:"No file selected"}),c.jsxs("div",{className:"flex flex-col space-y-4 md:flex-row md:space-y-0 md:space-x-4",children:[c.jsxs(_e,{variant:"positiveOutline",className:"ms-4",size:"lg",onClick:()=>{v(!0),b("create")},children:[c.jsx(lr,{})," Create New"]}),c.jsxs(_e,{variant:"defaultOutline",className:"ms-4",size:"lg",onClick:()=>{v(!0),b("import")},children:[c.jsx(jI,{})," Import Application"]})]})]}):c.jsx(im,{className:"w-full min-h-full h-80",language:r,theme:"vs-dark",value:e.content||"",onChange:C=>{u(C||"")},options:{automaticLayout:!0,minimap:{enabled:!1}}}),c.jsx(que,{isModalOpen:g,setIsModalOpen:v,appType:x,setAppType:b})]})}function Xue(){const e=dr(),{data:t}=Mn(S4(e));return c.jsx(mse,{children:c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 h-[calc(100vh-theme(spacing.40))]",children:[c.jsx("section",{className:"col-span-1 overflow-y-scroll min-h-48 text-white md:col-span-4 lg:col-span-3",children:c.jsx(Lae,{fileTreeQueryData:t})}),c.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:c.jsx(Yue,{})})]})})}function Wue(e){return[et({getParentRoute:()=>e,path:"/",component:Xue})]}function mn({clusterId:e,instanceId:t,organizationId:n},o){return"/"+[n,e,t&&"instance",t,o].filter(Ig).join("/")}const Tc="flex items-center p-2 rounded-lg group",kc={className:"text-white hover:bg-gray-700"},Oc={className:"text-black bg-white pointer-events-none cursor-default"};function Que(){const e=Ze({strict:!1});return c.jsxs("div",{className:"hidden md:block",children:[c.jsxs(Ue,{to:mn(e,"config"),className:Tc,activeOptions:{exact:!0},inactiveProps:kc,activeProps:Oc,children:[c.jsx(wI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Overview"})]}),c.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"config/users"),className:Tc,inactiveProps:kc,activeProps:Oc,children:[c.jsx(OI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Users"})]})}),c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"config/roles"),className:Tc,inactiveProps:kc,activeProps:Oc,children:[c.jsx(RI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Roles"})]})})]})]})}function Jue(){const e=Ze({strict:!1});return c.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"config"),className:Tc,activeOptions:{exact:!0},inactiveProps:kc,activeProps:Oc,children:[c.jsx(wI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Overview"})]})}),c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"config/users"),className:Tc,inactiveProps:kc,activeProps:Oc,children:[c.jsx(OI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Users"})]})}),c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"config/roles"),className:Tc,inactiveProps:kc,activeProps:Oc,children:[c.jsx(RI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Roles"})]})})]})}function ede(){return c.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:[c.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[c.jsx(Que,{}),c.jsx(Jue,{})]}),c.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:c.jsx(_.Suspense,{fallback:c.jsx($r,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:c.jsx(ss,{})})})]})}function Qr({className:e}={}){const t=_.useMemo(()=>`animate-pulse ${e} h-2.5 w-48 bg-gray-200 rounded-full dark:bg-gray-700 mb-4`,[e]);return c.jsx("div",{className:t})}async function tde({clusterId:e,instanceId:t}){return null}function pL(e){return{queryKey:[Cn.cluster,e.clusterId,Cn.instance,e.instanceId],queryFn:()=>tde(e),retry:!1}}const nde=({loadingRegistration:e,registrationInfo:t})=>c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold text-sm/6",children:"Harper Version"}),c.jsx("dd",{className:"text-sm/6 sm:mt-2",children:e?c.jsx(Qr,{className:"w-10"}):t.version})]});function rde({entityId:e,instanceClient:t}){return{queryKey:[e,"get_configuration"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_configuration"});return n}}}function gL({entityId:e,instanceClient:t}){return{queryKey:[e,"registration_info"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"registration_info"});return n}}}const ode=({children:e})=>c.jsx(c.Fragment,{children:e});function ide(){const{clusterId:e,instanceId:t}=Ze({strict:!1}),n="Instance",o=dr(),{data:r,isLoading:i}=Mn(pL({clusterId:e,instanceId:t}));r?.cluster,r?.instance;const{data:l,isLoading:u}=Mn(gL(o)),{data:f,isLoading:m}=Mn(rde(o));return c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(ode,{children:c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-3",children:[c.jsx("div",{className:"px-4 pb-4 sm:col-span-2 sm:px-0",children:c.jsx(nde,{loadingRegistration:u,registrationInfo:l})}),c.jsx("div",{className:"px-4 pb-4 text-right sm:col-span-1 sm:px-0",children:c.jsx(sL,{targetNoun:n,instanceClient:o.instanceClient,operation:"restart"})})]})}),c.jsx("h3",{className:"flex-none font-bold text-sm/6",children:"Instance Config (read only)"}),!t&&c.jsx("p",{className:"text-muted-foreground italic text-sm mb-2",children:"You are viewing the config for one instance in your cluster, based on what the load balancer selected for you."}),c.jsx("div",{className:"grow",children:m?c.jsxs(c.Fragment,{children:[c.jsx(Qr,{className:"w-full"}),c.jsx(Qr,{className:"w-full"}),c.jsx(Qr,{className:"w-1/2"})]}):c.jsx(Nv,{className:"w-full min-h-full h-96",language:"json",theme:"vs-dark",options:{readOnly:!0,scrollBeyondLastLine:!1},value:JSON.stringify(f,null,4)})})]})}/**
373
+ * table-core
374
+ *
375
+ * Copyright (c) TanStack
376
+ *
377
+ * This source code is licensed under the MIT license found in the
378
+ * LICENSE.md file in the root directory of this source tree.
379
+ *
380
+ * @license MIT
381
+ */function Tv(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function zs(e,t){return typeof e=="function"?e(t):e}function io(e,t){return n=>{t.setState(o=>({...o,[e]:zs(n,o[e])}))}}function kv(e){return e instanceof Function}function sde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ade(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const l=t(i);l!=null&&l.length&&o(l)})};return o(e),n}function Ge(e,t,n){let o=[],r;return i=>{let l;n.key&&n.debug&&(l=Date.now());const u=e(i);if(!(u.length!==o.length||u.some((p,g)=>o[g]!==p)))return r;o=u;let m;if(n.key&&n.debug&&(m=Date.now()),r=t(...u),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-l)*100)/100,g=Math.round((Date.now()-m)*100)/100,v=g/16,x=(b,S)=>{for(b=String(b);b.length<S;)b=" "+b;return b};console.info(`%c⏱ ${x(g,5)} /${x(p,5)} ms`,`
382
+ font-size: .6rem;
383
+ font-weight: bold;
384
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return r}}function qe(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:!1,onChange:o}}function lde(e,t,n,o){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:Ge(()=>[e,n,t,i],(l,u,f,m)=>({table:l,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),qe(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,n,t,e)},{}),i}function cde(e,t,n,o){var r,i;const u={...e._getDefaultColumnDef(),...t},f=u.accessorKey;let m=(r=(i=u.id)!=null?i:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?r:typeof u.header=="string"?u.header:void 0,p;if(u.accessorFn?p=u.accessorFn:f&&(f.includes(".")?p=v=>{let x=v;for(const S of f.split(".")){var b;x=(b=x)==null?void 0:b[S]}return x}:p=v=>v[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:p,parent:o,depth:n,columnDef:u,columns:[],getFlatColumns:Ge(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(x=>x.getFlatColumns())]},qe(e.options,"debugColumns")),getLeafColumns:Ge(()=>[e._getOrderColumnsFn()],v=>{var x;if((x=g.columns)!=null&&x.length){let b=g.columns.flatMap(S=>S.getLeafColumns());return v(b)}return[g]},qe(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(g,e);return g}const or="debugHeaders";function RO(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),l.push(f)};return u(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const ude={createTable:e=>{e.getHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,l;const u=(i=o?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?i:[],f=(l=r?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?l:[],m=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return Yh(t,[...u,...m,...f],e)},qe(e.options,or)),e.getCenterHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Yh(t,n,e,"center")),qe(e.options,or)),e.getLeftHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return Yh(t,i,e,"left")},qe(e.options,or)),e.getRightHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return Yh(t,i,e,"right")},qe(e.options,or)),e.getFooterGroups=Ge(()=>[e.getHeaderGroups()],t=>[...t].reverse(),qe(e.options,or)),e.getLeftFooterGroups=Ge(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),qe(e.options,or)),e.getCenterFooterGroups=Ge(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),qe(e.options,or)),e.getRightFooterGroups=Ge(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),qe(e.options,or)),e.getFlatHeaders=Ge(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,or)),e.getLeftFlatHeaders=Ge(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,or)),e.getCenterFlatHeaders=Ge(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,or)),e.getRightFlatHeaders=Ge(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,or)),e.getCenterLeafHeaders=Ge(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),qe(e.options,or)),e.getLeftLeafHeaders=Ge(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),qe(e.options,or)),e.getRightLeafHeaders=Ge(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),qe(e.options,or)),e.getLeafHeaders=Ge(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,l,u,f,m;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(f=(m=o[0])==null?void 0:m.headers)!=null?f:[]].map(p=>p.getLeafHeaders()).flat()},qe(e.options,or))}};function Yh(e,t,n,o){var r,i;let l=0;const u=function(v,x){x===void 0&&(x=1),l=Math.max(l,x),v.filter(b=>b.getIsVisible()).forEach(b=>{var S;(S=b.columns)!=null&&S.length&&u(b.columns,x+1)},0)};u(e);let f=[];const m=(v,x)=>{const b={depth:x,id:[o,`${x}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const E=[...S].reverse()[0],j=C.column.depth===b.depth;let N,T=!1;if(j&&C.column.parent?N=C.column.parent:(N=C.column,T=!0),E&&E?.column===N)E.subHeaders.push(C);else{const k=RO(n,N,{id:[o,x,N.id,C?.id].filter(Boolean).join("_"),isPlaceholder:T,placeholderId:T?`${S.filter(A=>A.column===N).length}`:void 0,depth:x,index:S.length});k.subHeaders.push(C),S.push(k)}b.headers.push(C),C.headerGroup=b}),f.push(b),x>0&&m(S,x-1)},p=t.map((v,x)=>RO(n,v,{depth:l,index:x}));m(p,l-1),f.reverse();const g=v=>v.filter(b=>b.column.getIsVisible()).map(b=>{let S=0,C=0,E=[0];b.subHeaders&&b.subHeaders.length?(E=[],g(b.subHeaders).forEach(N=>{let{colSpan:T,rowSpan:k}=N;S+=T,E.push(k)})):S=1;const j=Math.min(...E);return C=C+j,b.colSpan=S,b.rowSpan=C,{colSpan:S,rowSpan:C}});return g((r=(i=f[0])==null?void 0:i.headers)!=null?r:[]),f}const dde=(e,t,n,o,r,i,l)=>{let u={id:t,index:o,original:n,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return u._valuesCache[f]=m.accessorFn(u.original,o),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=m.columnDef.getUniqueValues(u.original,o),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=u.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ade(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const p=m.getParentRow();if(!p)break;f.push(p),m=p}return f.reverse()},getAllCells:Ge(()=>[e.getAllLeafColumns()],f=>f.map(m=>lde(e,u,m,m.id)),qe(e.options,"debugRows")),_getAllCellsByColumnId:Ge(()=>[u.getAllCells()],f=>f.reduce((m,p)=>(m[p.column.id]=p,m),{}),qe(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(u,e)}return u},fde={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},vL=(e,t,n)=>{var o,r;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};vL.autoRemove=e=>Ho(e);const yL=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};yL.autoRemove=e=>Ho(e);const bL=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};bL.autoRemove=e=>Ho(e);const xL=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};xL.autoRemove=e=>Ho(e);const _L=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});_L.autoRemove=e=>Ho(e)||!(e!=null&&e.length);const wL=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});wL.autoRemove=e=>Ho(e)||!(e!=null&&e.length);const SL=(e,t,n)=>e.getValue(t)===n;SL.autoRemove=e=>Ho(e);const CL=(e,t,n)=>e.getValue(t)==n;CL.autoRemove=e=>Ho(e);const cE=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};cE.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(r)?1/0:r;if(i>l){const u=i;i=l,l=u}return[i,l]};cE.autoRemove=e=>Ho(e)||Ho(e[0])&&Ho(e[1]);const Zi={includesString:vL,includesStringSensitive:yL,equalsString:bL,arrIncludes:xL,arrIncludesAll:_L,arrIncludesSome:wL,equals:SL,weakEquals:CL,inNumberRange:cE};function Ho(e){return e==null||e===""}const mde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:io("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?Zi.includesString:typeof o=="number"?Zi.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Zi.equals:Array.isArray(o)?Zi.arrIncludes:Zi.weakEquals},e.getFilterFn=()=>{var n,o;return kv(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:Zi[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(p=>p.id===e.id),l=zs(n,i?i.value:void 0);if(jO(r,l,e)){var u;return(u=o?.filter(p=>p.id!==e.id))!=null?u:[]}const f={id:e.id,value:l};if(i){var m;return(m=o?.map(p=>p.id===e.id?f:p))!=null?m:[]}return o!=null&&o.length?[...o,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=zs(t,r))==null?void 0:i.filter(l=>{const u=n.find(f=>f.id===l.id);if(u){const f=u.getFilterFn();if(jO(f,l.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function jO(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const hde=(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),pde=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},gde=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},vde=(e,t,n)=>{let o,r;return n.forEach(i=>{const l=i.getValue(e);l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r<l&&(r=l)))}),[o,r]},yde=(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},bde=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!sde(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,l)=>i-l);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},xde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),_de=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,wde=(e,t)=>t.length,f_={sum:hde,min:pde,max:gde,extent:vde,mean:yde,median:bde,unique:xde,uniqueCount:_de,count:wde},Sde={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:io("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return f_.sum;if(Object.prototype.toString.call(o)==="[object Date]")return f_.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return kv(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:f_[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function Cde(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(l=>l.id===i)).filter(Boolean),...o]}const Ede={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:io("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ge(n=>[Qd(t,n)],n=>n.findIndex(o=>o.id===e.id),qe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var o;return((o=Qd(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Qd(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ge(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const l=[...t],u=[...r];for(;u.length&&l.length;){const f=l.shift(),m=u.findIndex(p=>p.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return Cde(i,n,o)},qe(e.options,"debugTable"))}},m_=()=>({left:[],right:[]}),Rde={getInitialState:e=>({columnPinning:m_(),...e}),getDefaultOptions:e=>({onColumnPinningChange:io("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,l;if(n==="right"){var u,f;return{left:((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((f=r?.right)!=null?f:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var m,p;return{left:[...((m=r?.left)!=null?m:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((p=r?.right)!=null?p:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((l=r?.right)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,l;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(l=t.options.enableColumnPinning)!=null?l:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>r?.includes(u));return i?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(l=>!i.includes(l.column.id))},qe(t.options,"debugRows")),e.getLeftVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),qe(t.options,"debugRows")),e.getRightVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),qe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?m_():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:m_())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),qe(e.options,"debugColumns")),e.getRightLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),qe(e.options,"debugColumns")),e.getCenterLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},qe(e.options,"debugColumns"))}};function jde(e){return e||(typeof document<"u"?document:null)}const Xh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},h_=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Nde={getDefaultColumnDef:()=>Xh,getInitialState:e=>({columnSizing:{},columnSizingInfo:h_(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:io("columnSizing",e),onColumnSizingInfoChange:io("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Xh.minSize,(o=i??e.columnDef.size)!=null?o:Xh.size),(r=e.columnDef.maxSize)!=null?r:Xh.maxSize)},e.getStart=Ge(n=>[n,Qd(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),qe(t.options,"debugColumns")),e.getAfter=Ge(n=>[n,Qd(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),qe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),p_(i)&&i.touches&&i.touches.length>1))return;const l=e.getSize(),u=e?e.getLeafHeaders().map(E=>[E.column.id,E.column.getSize()]):[[o.id,o.getSize()]],f=p_(i)?Math.round(i.touches[0].clientX):i.clientX,m={},p=(E,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(N=>{var T,k;const A=t.options.columnResizeDirection==="rtl"?-1:1,I=(j-((T=N?.startOffset)!=null?T:0))*A,P=Math.max(I/((k=N?.startSize)!=null?k:0),-.999999);return N.columnSizingStart.forEach(L=>{let[V,ie]=L;m[V]=Math.round(Math.max(ie+ie*P,0)*100)/100}),{...N,deltaOffset:I,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||E==="end")&&t.setColumnSizing(N=>({...N,...m})))},g=E=>p("move",E),v=E=>{p("end",E),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=jde(n),b={moveHandler:E=>g(E.clientX),upHandler:E=>{x?.removeEventListener("mousemove",b.moveHandler),x?.removeEventListener("mouseup",b.upHandler),v(E.clientX)}},S={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),g(E.touches[0].clientX),!1),upHandler:E=>{var j;x?.removeEventListener("touchmove",S.moveHandler),x?.removeEventListener("touchend",S.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),v((j=E.touches[0])==null?void 0:j.clientX)}},C=Tde()?{passive:!1}:!1;p_(i)?(x?.addEventListener("touchmove",S.moveHandler,C),x?.addEventListener("touchend",S.upHandler,C)):(x?.addEventListener("mousemove",b.moveHandler,C),x?.addEventListener("mouseup",b.upHandler,C)),t.setColumnSizingInfo(E=>({...E,startOffset:f,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?h_():(n=e.initialState.columnSizingInfo)!=null?n:h_())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let Wh=null;function Tde(){if(typeof Wh=="boolean")return Wh;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wh=e,Wh}function p_(e){return e.type==="touchstart"}const kde={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:io("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ge(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),qe(t.options,"debugRows")),e.getVisibleCells=Ge(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],qe(t.options,"debugRows"))},createTable:e=>{const t=(n,o)=>Ge(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),qe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Qd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Ode={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Ade={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:io("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Zi.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return kv(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:Zi[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Ide={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:io("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let l={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=o,n=(r=n)!=null?r:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){const{[e.id]:u,...f}=l;return f}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Ow=0,Aw=10,g_=()=>({pageIndex:Ow,pageSize:Aw}),$de={getInitialState:e=>({...e,pagination:{...g_(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:io("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>zs(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?g_():(r=e.initialState.pagination)!=null?r:g_())},e.setPageIndex=o=>{e.setPagination(r=>{let i=zs(o,r.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Ow:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Ow)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Aw:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Aw)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,zs(o,r.pageSize)),l=r.pageSize*r.pageIndex,u=Math.floor(l/i);return{...r,pageIndex:u,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let l=zs(o,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),e.getPageOptions=Ge(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,l)=>l)),r},qe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},v_=()=>({top:[],bottom:[]}),Mde={getInitialState:e=>({rowPinning:v_(),...e}),getDefaultOptions:e=>({onRowPinningChange:io("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],l=r?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],u=new Set([...l,e.id,...i]);t.setRowPinning(f=>{var m,p;if(n==="bottom"){var g,v;return{top:((g=f?.top)!=null?g:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((v=f?.bottom)!=null?v:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(n==="top"){var x,b;return{top:[...((x=f?.top)!=null?x:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((b=f?.bottom)!=null?b:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((m=f?.top)!=null?m:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((p=f?.bottom)!=null?p:[]).filter(S=>!(u!=null&&u.has(S)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>r?.includes(u));return i?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(l=>{let{id:u}=l;return u});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?v_():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:v_())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(l=>{const u=e.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(l=>t.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:o}))},e.getTopRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),qe(e.options,"debugRows")),e.getBottomRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),qe(e.options,"debugRows")),e.getCenterRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},qe(e.options,"debugRows"))}},Pde={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:io("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Iw(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?y_(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?y_(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?y_(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const u={...i};return Iw(u,e.id,n,(l=o?.selectChildren)!=null?l:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return uE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $w(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $w(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Iw=(e,t,n,o,r)=>{var i;const l=r.getRow(t,!0);n?(l.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),l.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>Iw(e,u.id,n,o,r))};function y_(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(l,u){return l.map(f=>{var m;const p=uE(f,n);if(p&&(o.push(f),r[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),p)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function uE(e,t){var n;return(n=t[e.id])!=null?n:!1}function $w(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(l=>{if(!(i&&!r)&&(l.getCanSelect()&&(uE(l,t)?i=!0:r=!1),l.subRows&&l.subRows.length)){const u=$w(l,t);u==="all"?i=!0:(u==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Mw=/([0-9]+)/gm,Dde=(e,t,n)=>EL(Qs(e.getValue(n)).toLowerCase(),Qs(t.getValue(n)).toLowerCase()),zde=(e,t,n)=>EL(Qs(e.getValue(n)),Qs(t.getValue(n))),Ude=(e,t,n)=>dE(Qs(e.getValue(n)).toLowerCase(),Qs(t.getValue(n)).toLowerCase()),Lde=(e,t,n)=>dE(Qs(e.getValue(n)),Qs(t.getValue(n))),Fde=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},Vde=(e,t,n)=>dE(e.getValue(n),t.getValue(n));function dE(e,t){return e===t?0:e>t?1:-1}function Qs(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function EL(e,t){const n=e.split(Mw).filter(Boolean),o=t.split(Mw).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),l=parseInt(r,10),u=parseInt(i,10),f=[l,u].sort();if(isNaN(f[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(f[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return n.length-o.length}const $d={alphanumeric:Dde,alphanumericCaseSensitive:zde,text:Ude,textCaseSensitive:Lde,datetime:Fde,basic:Vde},Bde={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:io("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return $d.datetime;if(typeof i=="string"&&(o=!0,i.split(Mw).length>1))return $d.alphanumeric}return o?$d.text:$d.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return kv(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:$d[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(l=>{const u=l?.find(x=>x.id===e.id),f=l?.findIndex(x=>x.id===e.id);let m=[],p,g=i?n:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&o?u?p="toggle":p="add":l!=null&&l.length&&f!==l.length-1?p="replace":u?p="toggle":p="replace",p==="toggle"&&(i||r||(p="remove")),p==="add"){var v;m=[...l,{id:e.id,desc:g}],m.splice(0,m.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?m=l.map(x=>x.id===e.id?{...x,desc:g}:x):p==="remove"?m=l.filter(x=>x.id!==e.id):m=[{id:e.id,desc:g}];return m})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:l==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Hde=[ude,kde,Ede,Rde,fde,mde,Ode,Ade,Bde,Sde,Ide,$de,Mde,Pde,Nde];function Gde(e){var t,n;const o=[...Hde,...(t=e._features)!=null?t:[]];let r={_features:o};const i=r._features.reduce((v,x)=>Object.assign(v,x.getDefaultOptions==null?void 0:x.getDefaultOptions(r)),{}),l=v=>r.options.mergeOptions?r.options.mergeOptions(i,v):{...i,...v};let f={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(v=>{var x;f=(x=v.getInitialState==null?void 0:v.getInitialState(f))!=null?x:f});const m=[];let p=!1;const g={_features:o,options:{...i,...e},initialState:f,_queue:v=>{m.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();p=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{r.setState(r.initialState)},setOptions:v=>{const x=zs(v,r.options);r.options=l(x)},getState:()=>r.options.state,setState:v=>{r.options.onStateChange==null||r.options.onStateChange(v)},_getRowId:(v,x,b)=>{var S;return(S=r.options.getRowId==null?void 0:r.options.getRowId(v,x,b))!=null?S:`${b?[b.id,x].join("."):x}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(v,x)=>{let b=(x?r.getPrePaginationRowModel():r.getRowModel()).rowsById[v];if(!b&&(b=r.getCoreRowModel().rowsById[v],!b))throw new Error;return b},_getDefaultColumnDef:Ge(()=>[r.options.defaultColumn],v=>{var x;return v=(x=v)!=null?x:{},{header:b=>{const S=b.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:b=>{var S,C;return(S=(C=b.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...r._features.reduce((b,S)=>Object.assign(b,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},qe(e,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:Ge(()=>[r._getColumnDefs()],v=>{const x=function(b,S,C){return C===void 0&&(C=0),b.map(E=>{const j=cde(r,E,C,S),N=E;return j.columns=N.columns?x(N.columns,j,C+1):[],j})};return x(v)},qe(e,"debugColumns")),getAllFlatColumns:Ge(()=>[r.getAllColumns()],v=>v.flatMap(x=>x.getFlatColumns()),qe(e,"debugColumns")),_getAllFlatColumnsById:Ge(()=>[r.getAllFlatColumns()],v=>v.reduce((x,b)=>(x[b.id]=b,x),{}),qe(e,"debugColumns")),getAllLeafColumns:Ge(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(v,x)=>{let b=v.flatMap(S=>S.getLeafColumns());return x(b)},qe(e,"debugColumns")),getColumn:v=>r._getAllFlatColumnsById()[v]};Object.assign(r,g);for(let v=0;v<r._features.length;v++){const x=r._features[v];x==null||x.createTable==null||x.createTable(r)}return r}function Ov(){return e=>Ge(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,l){i===void 0&&(i=0);const u=[];for(let m=0;m<r.length;m++){const p=dde(e,e._getRowId(r[m],m,l),r[m],m,i,void 0,l?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,u.push(p),e.options.getSubRows){var f;p.originalSubRows=e.options.getSubRows(r[m],m),(f=p.originalSubRows)!=null&&f.length&&(p.subRows=o(p.originalSubRows,i+1,p))}}return u};return n.rows=o(t),n},qe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function qde(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Kde(e){return t=>Ge(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:l,flatRows:u,rowsById:f}=o;const m=r*i,p=m+r;l=l.slice(m,p);let g;t.options.paginateExpandedRows?g={rows:l,flatRows:u,rowsById:f}:g=qde({rows:l,flatRows:u,rowsById:f}),g.flatRows=[];const v=x=>{g.flatRows.push(x),x.subRows.length&&x.subRows.forEach(v)};return g.rows.forEach(v),g},qe(t.options,"debugTable"))}function Zde(){return e=>Ge(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(f=>{var m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),l={};i.forEach(f=>{const m=e.getColumn(f.id);m&&(l[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=f=>{const m=f.map(p=>({...p}));return m.sort((p,g)=>{for(let x=0;x<i.length;x+=1){var v;const b=i[x],S=l[b.id],C=S.sortUndefined,E=(v=b?.desc)!=null?v:!1;let j=0;if(C){const N=p.getValue(b.id),T=g.getValue(b.id),k=N===void 0,A=T===void 0;if(k||A){if(C==="first")return k?-1:1;if(C==="last")return k?1:-1;j=k&&A?0:k?C:-C}}if(j===0&&(j=S.sortingFn(p,g,b.id)),j!==0)return E&&(j*=-1),S.invertSorting&&(j*=-1),j}return p.index-g.index}),m.forEach(p=>{var g;r.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=u(p.subRows))}),m};return{rows:u(n.rows),flatRows:r,rowsById:n.rowsById}},qe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
385
+ * react-table
386
+ *
387
+ * Copyright (c) TanStack
388
+ *
389
+ * This source code is licensed under the MIT license found in the
390
+ * LICENSE.md file in the root directory of this source tree.
391
+ *
392
+ * @license MIT
393
+ */function Js(e,t){return e?Yde(e)?_.createElement(e,t):e:null}function Yde(e){return Xde(e)||typeof e=="function"||Wde(e)}function Xde(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Wde(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Av(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=_.useState(()=>({current:Gde(t)})),[o,r]=_.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}})),n.current}function Iv({className:e,containerClassName:t,...n}){return c.jsx("div",{"data-slot":"table-container",className:Me("relative w-full overflow-x-auto",t),children:c.jsx("table",{"data-slot":"table",className:Me("w-full caption-bottom text-sm",e),...n})})}function $v({className:e,...t}){return c.jsx("thead",{"data-slot":"table-header",className:Me("[&_tr]:border-b",e),...t})}function Mv({className:e,...t}){return c.jsx("tbody",{"data-slot":"table-body",className:Me("[&_tr:last-child]:border-0",e),...t})}function Ro({className:e,...t}){return c.jsx("tr",{"data-slot":"table-row",className:Me("border-b border-grey-700 transition-colors",e),...t})}function ug({className:e,...t}){return c.jsx("th",{"data-slot":"table-head",className:Me("h-10 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function RL({header:e,onColumnClick:t,...n}){const o=_.useCallback(()=>{e.column.toggleSorting(e.column.getIsSorted()==="asc");const r=e.column.getIsSorted()===!1||e.column.getIsSorted()!=="asc";t?.(e.column.columnDef.accessorKey,r)},[e,t]);return e.column.columnDef.enableSorting?c.jsx(ug,{...n,className:"px-0",children:c.jsxs(_e,{type:"button",variant:"ghost",className:Me("rounded-none",!e.column.getIsSorted()||e.column.getIsSorted()==="asc"?"cursor-n-resize":"cursor-s-resize"),onClick:o,children:[e.isPlaceholder?null:Js(e.column.columnDef.header,e.getContext()),e.column.getIsSorted()==="asc"?c.jsx(eG,{}):e.column.getIsSorted()==="desc"?c.jsx(xI,{}):c.jsx(Q9,{className:"text-gray-600"})]})}):c.jsx(ug,{...n,className:"px-2",children:e.isPlaceholder?null:Js(e.column.columnDef.header,e.getContext())})}function ea({className:e,...t}){return c.jsx("td",{"data-slot":"table-cell",className:Me("align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function sm({columns:e,data:t,isFetching:n,onRowClick:o,onColumnClick:r,sortingState:i,children:l}){const u=Av({data:t,columns:e,getCoreRowModel:Ov(),getSortedRowModel:Zde(),initialState:{sorting:i}});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[c.jsx("div",{className:"grow lg:hidden"}),l,c.jsx("div",{className:"grow hidden lg:visible"})]}),c.jsxs(Iv,{containerClassName:"rounded-md bg-black-dark",children:[c.jsx($v,{children:u.getHeaderGroups().map(f=>c.jsx(Ro,{className:"border-none",children:f.headers.map(m=>c.jsx(RL,{header:m,onColumnClick:r},m.id))},f.id))}),c.jsx(Mv,{className:"bg-black border border-grey-700",children:u.getRowModel().rows?.length?u.getRowModel().rows.map(f=>c.jsx(Ro,{"data-state":f.getIsSelected()&&"selected",onClick:()=>o?.(f),className:Me("hover:bg-muted/10 data-[state=selected]:bg-muted",o&&"cursor-pointer"),children:f.getVisibleCells().map(m=>c.jsx(ea,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:Js(m.column.columnDef.cell,m.getContext())},m.id))},f.id)):c.jsx(Ro,{children:c.jsx(ea,{colSpan:e.length,className:"h-24 text-center",children:n?c.jsx("div",{children:c.jsx($r,{className:"m-12"})}):c.jsx("span",{children:"No results."})})})})]})]})}function Hs(e,t){if(e<45)return"a few seconds ago";if(e<120)return"a minute ago";const n=Math.floor(e/60);if(n<60)return`${n} minutes ago`;if(n<120)return"an hour ago";const o=Math.floor(e/3600);return o>48?new Date(t).toLocaleString():`${o} hours ago`}const Qh=Tv(),Qde=[{header:"Role",accessorKey:"role",enableSorting:!1},Qh.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Hs((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),Qh.display({header:"Updated",id:"__updatedtime__",enableSorting:!1,cell:e=>Hs((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}),Qh.display({header:"Super User",id:"super_user",enableSorting:!1,cell:e=>e.row.original.permission.super_user?"Yes":"No"}),Qh.display({header:"Structure User",id:"structure_user",enableSorting:!1,cell:e=>e.row.original.permission.structure_user?"Yes":"No"})];async function Jde(e){const{role:t,super_user:n,structure_user:o,instanceClient:r}=e,{data:i}=await r.post("/",{operation:"add_role",role:t,permission:{super_user:n,structure_user:o}});return i}function efe(){return at({mutationFn:Jde})}const tfe=Pn({role:vt().nonempty({error:"Please enter a role."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role cannot be longer than 30 characters."}),super_user:Xc(),structure_user:Xc()});function nfe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const o=gn({resolver:yn(tfe),defaultValues:{role:"",super_user:!1,structure_user:!1}}),r=dr(),{mutate:i,isPending:l}=efe(),u=_.useCallback(async m=>{m&&i({role:m.role,super_user:m.super_user,structure_user:m.structure_user,...r},{onSuccess:()=>{o.reset(),t(m.role),Ee.success("Role added successfully!"),n(!1)}})},[i,o,r,t,n]),f=_.useCallback(()=>{o.reset(),n(!1)},[o,n]);return c.jsx(Jn,{onOpenChange:n,open:e,children:c.jsx(er,{"aria-describedby":void 0,children:c.jsx(vn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(u),className:"grid gap-4 my-4 md:grid-cols-2",children:[c.jsxs(Mr,{className:"md:col-span-2",children:[c.jsx(Kn,{children:"Add New Role"}),c.jsx(Io,{children:"After adding the role, you will be able to edit the per-table permissions."})]}),c.jsx($e,{control:o.control,name:"role",render:({field:m})=>c.jsxs(ke,{className:"md:col-span-2",children:[c.jsx(Oe,{className:"pb-1",children:"Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",...m})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:o.control,name:"super_user",render:({field:m})=>c.jsxs(ke,{className:"flex",children:[c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6",checked:m.value,onChange:p=>m.onChange(p.target.checked)})}),c.jsx(Oe,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Super User"}),c.jsx(Ae,{})]})}),c.jsx($e,{control:o.control,name:"structure_user",render:({field:m})=>c.jsxs(ke,{className:"flex",children:[c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6",checked:m.value,onChange:p=>m.onChange(p.target.checked)})}),c.jsx(Oe,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Structure User"}),c.jsx(Ae,{})]})}),c.jsx(tr,{className:"md:col-span-2",children:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx(_e,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:f,disabled:l,children:"Cancel"}),c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",disabled:l,children:[c.jsx(as,{})," Add Role"]})]})})]})})})})}function fE({entityId:e,instanceClient:t}){return{queryKey:[e,"list_roles"],queryFn:()=>rfe({instanceClient:t}),refetchInterval:1e4}}async function rfe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_roles"});return t}function pl(e){return _.useCallback(async()=>{const t=Ee.loading("Refreshing..."),n=Date.now();await e(),Date.now()-n<500&&await Ng(500),Ee.dismiss(t),Ee.success("Refreshed!")},[e])}function Pv(e,t){const n={};for(const o of e){const r=o[t];if(r!==void 0)if(Array.isArray(r))for(const i of r)n[i]=o;else n[r]=o}return n}function ofe({instanceDatabaseMap:e,currentRolePermissions:t,version:n,showAttributes:o}){const r={...t};if(t.super_user||t.structure_user||t.cluster_user)return t;const[i,l,u]=n.split(".").map(m=>parseInt(m,10)),f=n!=="2.0.000"&&i<=2&&l<=1&&u<=2;for(const m in e){r[m]={tables:{}};for(const p in e[m]){const v=e[m][p].attributes.map(x=>x.attribute).sort();if(f){const x=t&&t[m]&&t[m].tables[p];r[m].tables[p]=ife(x,v,o)}else{const x=t&&t[m]&&t[m].tables[p];r[m].tables[p]=sfe(x,v,o)}}}return r}function ife(e,t,n){const o=e&&Pv(e.attribute_restrictions,"attribute_name");return{read:e?e.read:!0,insert:e?e.insert:!0,update:e?e.update:!0,delete:e?e.delete:!0,attribute_restrictions:t.filter(()=>n).map(r=>{const i=o?.[r];return{attribute_name:r,read:i?i.read:e?e.read:!0,insert:i?i.insert:e?e.insert:!0,update:i?i.update:e?e.update:!0,delete:i?i.delete:e?e.delete:!0}})}}function sfe(e,t,n){const o=e&&Pv(e.attribute_permissions,"attribute_name");return{read:e?e.read:!1,insert:e?e.insert:!1,update:e?e.update:!1,delete:e?e.delete:!1,attribute_permissions:t.filter(()=>n).map(r=>{const i=o?.[r];return{attribute_name:r,read:i?i.read:e?.attribute_permissions.length?!1:e?.read||!1,insert:i?i.insert:e?.attribute_permissions.length?!1:e?.insert||!1,update:i?i.update:e?.attribute_permissions.length?!1:e?.update||!1}})}}async function afe({id:e,permission:t,instanceClient:n}){const{data:o}=await n.post("/",{operation:"alter_role",id:e,permission:t});return o}function lfe(){return at({mutationFn:afe})}async function cfe({id:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_role",id:e});return n}function ufe(){return at({mutationFn:cfe})}function jL({entityId:e,instanceClient:t}){return{queryKey:[e,"describe_all"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"describe_all"});return n},retry:!1}}function NL(e){const[t,n]=_.useState(e||!1),o=_.useCallback(r=>{n(r.target.checked)},[]);return[t,o]}function TL(e){try{return e==="null"||e==="undefined"||e===null||e===void 0?null:JSON.parse(e)}catch(t){return console.error("safeParse failed to parse value, returning null instead",t),null}}function dfe({data:e,instanceId:t,clusterId:n,isModalOpen:o,closeModal:r,onSelectRole:i,onChangesSaved:l}){const{role:u,permission:f}=e,[m,p]=_.useState(JSON.stringify(f,null,2)),g=dr(),[v,x]=_.useState(!0),{data:b}=wn(jL(g)),{data:S}=wn(gL(g)),E=na(t??n).user?.role?.role===e.role,[j,N]=NL(m?.includes("attribute_name")),{mutate:T,isPending:k}=lfe(),{mutate:A}=ufe(),I=_.useCallback(ue=>{x(ue.length===0)},[x]),P=_.useMemo(()=>JSON.stringify(b&&S&&ofe({instanceDatabaseMap:b,currentRolePermissions:m&&TL(m)||f,version:S.version,showAttributes:j}),null,2),[f,b,S,j]);_.useEffect(()=>{p(P)},[P]);const L=_.useCallback(ue=>{if(ue){const le=JSON.parse(ue);if(le.super_user||le.structure_user||le.cluster_user)for(const ce in le)(ce!=="super_user"&&ce!=="structure_user"&&ce!=="cluster_user"||le[ce]===!1)&&delete le[ce];T({id:e.id,permission:le,...g},{onSuccess:()=>{Ee.success("Role updated successfully!"),i(void 0),l()}})}},[T,e.id,g,l,i]),V=_.useCallback(()=>{A({id:e.id,...g},{onSuccess:()=>{Ee.success("Role deleted successfully!"),i(void 0),l()}})},[e.id,A,g,l,i]),ie=_.useCallback(()=>{m&&v&&L(m)},[m,L,v]),se=_.useCallback(()=>{V()},[V]);return c.jsx(Jn,{onOpenChange:r,open:o,children:c.jsxs(er,{className:"sm:max-w-[750px]",children:[c.jsxs(Kn,{children:[E?"View":"Edit",' Role "',u,'"']}),c.jsx(Io,{children:E?"You can view your own role, but you cannot edit it. Please assign yourself a different role to edit this role.":"Edit the role's permissions in JSON format or remove the role entirely."}),P?c.jsx(im,{theme:"vs-dark",height:"400px",defaultLanguage:"json",value:m,options:E?{readOnly:!0}:void 0,onValidate:I,onChange:p,defaultValue:P}):c.jsx(Qr,{}),c.jsx(tr,{children:!E&&c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx(_e,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:se,disabled:k,children:"Delete Role"}),c.jsx("div",{className:"grow"}),c.jsxs(n0,{className:"flex",children:[c.jsx(Le,{type:"checkbox",className:"w-6",checked:j,onChange:N}),c.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Pick Attributes"})]}),c.jsx(_e,{variant:"submit",className:"rounded-full",onClick:ie,disabled:k||!v,children:"Save Changes"})]})})]})})}function NO(){const e=pn(),{clusterId:t,instanceId:n,roleId:o}=Ze({strict:!1}),r=dr(),{data:i,refetch:l,isFetching:u,isRefetching:f}=Mn(fE(r)),m=_.useMemo(()=>i?.find(N=>N.id===o),[i,o]),p=_.useCallback(N=>{const T=[o?"..":"",N].filter(Boolean);e({to:T.join("/")})},[o,e]),g=!!o&&!!m,[v,x]=_.useState(!1),b=_.useCallback(()=>{x(!0)},[x]),S=_.useCallback(N=>{l(),x(!1),p(N)},[p,l]),C=_.useCallback(N=>{p(N.original.role)},[p]),E=_.useCallback(()=>{p(void 0)},[p]),j=pl(l);return c.jsxs(_.Suspense,{fallback:c.jsx($r,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[c.jsxs(sm,{columns:Qde,data:i,isFetching:u,onRowClick:C,children:[c.jsxs(_e,{variant:"defaultOutline",onClick:j,accessKey:"r",disabled:u||f,children:[c.jsx(Gs,{}),c.jsxs("span",{className:"hidden lg:inline-block",children:[c.jsx("u",{children:"R"}),"efresh"]})]}),c.jsxs(_e,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:v,children:[c.jsx(lr,{}),c.jsxs("span",{children:[c.jsx("u",{children:"A"}),"dd"]})]})]}),c.jsx(nfe,{isModalOpen:v,onChangesSaved:S,setIsModalOpen:x}),g&&c.jsx(dfe,{instanceId:n,clusterId:t,isModalOpen:g,closeModal:E,data:m,onSelectRole:p,onChangesSaved:()=>l()})]})}const TO=Tv(),ffe=[{header:"Username",accessorKey:"username",enableSorting:!1},TO.display({header:"Role",enableSorting:!1,id:"role",cell:e=>e.row.original.role.role}),{header:"Active",accessorKey:"active",enableSorting:!1},TO.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Hs((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),{header:"Updated",accessorKey:"__updatedtime__",enableSorting:!1,cell:e=>Hs((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}];function Pw(e,[t,n]){return Math.min(n,Math.max(t,e))}var mfe=[" ","Enter","ArrowUp","ArrowDown"],hfe=[" ","Enter"],nl="Select",[Dv,zv,pfe]=Pf(nl),[Cu,Ibe]=Qo(nl,[pfe,Su]),Uv=Su(),[gfe,ia]=Cu(nl),[vfe,yfe]=Cu(nl),kL=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:l,defaultValue:u,onValueChange:f,dir:m,name:p,autoComplete:g,disabled:v,required:x,form:b}=e,S=Uv(t),[C,E]=_.useState(null),[j,N]=_.useState(null),[T,k]=_.useState(!1),A=gu(m),[I,P]=Ci({prop:o,defaultProp:r??!1,onChange:i,caller:nl}),[L,V]=Ci({prop:l,defaultProp:u,onChange:f,caller:nl}),ie=_.useRef(null),se=C?b||!!C.closest("form"):!0,[ue,le]=_.useState(new Set),ce=Array.from(ue).map(M=>M.props.value).join(";");return c.jsx(rE,{...S,children:c.jsxs(gfe,{required:x,scope:t,trigger:C,onTriggerChange:E,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:T,onValueNodeHasChildrenChange:k,contentId:Xr(),value:L,onValueChange:V,open:I,onOpenChange:P,dir:A,triggerPointerDownPosRef:ie,disabled:v,children:[c.jsx(Dv.Provider,{scope:t,children:c.jsx(vfe,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(M=>{le(K=>new Set(K).add(M))},[]),onNativeOptionRemove:_.useCallback(M=>{le(K=>{const U=new Set(K);return U.delete(M),U})},[]),children:n})}),se?c.jsxs(eF,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:g,value:L,onChange:M=>V(M.target.value),disabled:v,form:b,children:[L===void 0?c.jsx("option",{value:""}):null,Array.from(ue)]},ce):null]})})};kL.displayName=nl;var OL="SelectTrigger",AL=_.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=Uv(n),l=ia(OL,n),u=l.disabled||o,f=st(t,l.onTriggerChange),m=zv(n),p=_.useRef("touch"),[g,v,x]=nF(S=>{const C=m().filter(N=>!N.disabled),E=C.find(N=>N.value===l.value),j=rF(C,S,E);j!==void 0&&l.onValueChange(j.value)}),b=S=>{u||(l.onOpenChange(!0),x()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return c.jsx(oE,{asChild:!0,...i,children:c.jsx(De.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":tF(l.value)?"":void 0,...r,ref:f,onClick:Se(r.onClick,S=>{S.currentTarget.focus(),p.current!=="mouse"&&b(S)}),onPointerDown:Se(r.onPointerDown,S=>{p.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(b(S),S.preventDefault())}),onKeyDown:Se(r.onKeyDown,S=>{const C=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&mfe.includes(S.key)&&(b(),S.preventDefault())})})})});AL.displayName=OL;var IL="SelectValue",$L=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:l="",...u}=e,f=ia(IL,n),{onValueNodeHasChildrenChange:m}=f,p=i!==void 0,g=st(t,f.onValueNodeChange);return En(()=>{m(p)},[m,p]),c.jsx(De.span,{...u,ref:g,style:{pointerEvents:"none"},children:tF(f.value)?c.jsx(c.Fragment,{children:l}):i})});$L.displayName=IL;var bfe="SelectIcon",ML=_.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return c.jsx(De.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});ML.displayName=bfe;var xfe="SelectPortal",PL=e=>c.jsx(tm,{asChild:!0,...e});PL.displayName=xfe;var rl="SelectContent",DL=_.forwardRef((e,t)=>{const n=ia(rl,e.__scopeSelect),[o,r]=_.useState();if(En(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?lu.createPortal(c.jsx(zL,{scope:e.__scopeSelect,children:c.jsx(Dv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(UL,{...e,ref:t})});DL.displayName=rl;var Uo=10,[zL,sa]=Cu(rl),_fe="SelectContentImpl",wfe=Ba("SelectContent.RemoveScroll"),UL=_.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:f,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:x,sticky:b,hideWhenDetached:S,avoidCollisions:C,...E}=e,j=ia(rl,n),[N,T]=_.useState(null),[k,A]=_.useState(null),I=st(t,ae=>T(ae)),[P,L]=_.useState(null),[V,ie]=_.useState(null),se=zv(n),[ue,le]=_.useState(!1),ce=_.useRef(!1);_.useEffect(()=>{if(N)return HC(N)},[N]),BC();const M=_.useCallback(ae=>{const[fe,...ze]=se().map(He=>He.ref.current),[Ve]=ze.slice(-1),Ye=document.activeElement;for(const He of ae)if(He===Ye||(He?.scrollIntoView({block:"nearest"}),He===fe&&k&&(k.scrollTop=0),He===Ve&&k&&(k.scrollTop=k.scrollHeight),He?.focus(),document.activeElement!==Ye))return},[se,k]),K=_.useCallback(()=>M([P,N]),[M,P,N]);_.useEffect(()=>{ue&&K()},[ue,K]);const{onOpenChange:U,triggerPointerDownPosRef:re}=j;_.useEffect(()=>{if(N){let ae={x:0,y:0};const fe=Ve=>{ae={x:Math.abs(Math.round(Ve.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(Ve.pageY)-(re.current?.y??0))}},ze=Ve=>{ae.x<=10&&ae.y<=10?Ve.preventDefault():N.contains(Ve.target)||U(!1),document.removeEventListener("pointermove",fe),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",ze,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",ze,{capture:!0})}}},[N,U,re]),_.useEffect(()=>{const ae=()=>U(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[U]);const[$,H]=nF(ae=>{const fe=se().filter(Ye=>!Ye.disabled),ze=fe.find(Ye=>Ye.ref.current===document.activeElement),Ve=rF(fe,ae,ze);Ve&&setTimeout(()=>Ve.ref.current.focus())}),W=_.useCallback((ae,fe,ze)=>{const Ve=!ce.current&&!ze;(j.value!==void 0&&j.value===fe||Ve)&&(L(ae),Ve&&(ce.current=!0))},[j.value]),B=_.useCallback(()=>N?.focus(),[N]),J=_.useCallback((ae,fe,ze)=>{const Ve=!ce.current&&!ze;(j.value!==void 0&&j.value===fe||Ve)&&ie(ae)},[j.value]),ge=o==="popper"?Dw:LL,ye=ge===Dw?{side:u,sideOffset:f,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:x,sticky:b,hideWhenDetached:S,avoidCollisions:C}:{};return c.jsx(zL,{scope:n,content:N,viewport:k,onViewportChange:A,itemRefCallback:W,selectedItem:P,onItemLeave:B,itemTextRefCallback:J,focusSelectedItem:K,selectedItemText:V,position:o,isPositioned:ue,searchRef:$,children:c.jsx(bv,{as:wfe,allowPinchZoom:!0,children:c.jsx(vv,{asChild:!0,trapped:j.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Se(r,ae=>{j.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:c.jsx(vu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ae=>ae.preventDefault(),...E,...ye,onPlaced:()=>le(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Se(E.onKeyDown,ae=>{const fe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!fe&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let Ve=se().filter(Ye=>!Ye.disabled).map(Ye=>Ye.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(Ve=Ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ye=ae.target,He=Ve.indexOf(Ye);Ve=Ve.slice(He+1)}setTimeout(()=>M(Ve)),ae.preventDefault()}})})})})})})});UL.displayName=_fe;var Sfe="SelectItemAlignedPosition",LL=_.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=ia(rl,n),l=sa(rl,n),[u,f]=_.useState(null),[m,p]=_.useState(null),g=st(t,I=>p(I)),v=zv(n),x=_.useRef(!1),b=_.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:E,focusSelectedItem:j}=l,N=_.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&S&&C&&E){const I=i.trigger.getBoundingClientRect(),P=m.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),V=E.getBoundingClientRect();if(i.dir!=="rtl"){const Ye=V.left-P.left,He=L.left-Ye,Gt=I.left-He,Yt=I.width+Gt,Zn=Math.max(Yt,P.width),fr=window.innerWidth-Uo,Mt=Pw(He,[Uo,Math.max(Uo,fr-Zn)]);u.style.minWidth=Yt+"px",u.style.left=Mt+"px"}else{const Ye=P.right-V.right,He=window.innerWidth-L.right-Ye,Gt=window.innerWidth-I.right-He,Yt=I.width+Gt,Zn=Math.max(Yt,P.width),fr=window.innerWidth-Uo,Mt=Pw(He,[Uo,Math.max(Uo,fr-Zn)]);u.style.minWidth=Yt+"px",u.style.right=Mt+"px"}const ie=v(),se=window.innerHeight-Uo*2,ue=S.scrollHeight,le=window.getComputedStyle(m),ce=parseInt(le.borderTopWidth,10),M=parseInt(le.paddingTop,10),K=parseInt(le.borderBottomWidth,10),U=parseInt(le.paddingBottom,10),re=ce+M+ue+U+K,$=Math.min(C.offsetHeight*5,re),H=window.getComputedStyle(S),W=parseInt(H.paddingTop,10),B=parseInt(H.paddingBottom,10),J=I.top+I.height/2-Uo,ge=se-J,ye=C.offsetHeight/2,ae=C.offsetTop+ye,fe=ce+M+ae,ze=re-fe;if(fe<=J){const Ye=ie.length>0&&C===ie[ie.length-1].ref.current;u.style.bottom="0px";const He=m.clientHeight-S.offsetTop-S.offsetHeight,Gt=Math.max(ge,ye+(Ye?B:0)+He+K),Yt=fe+Gt;u.style.height=Yt+"px"}else{const Ye=ie.length>0&&C===ie[0].ref.current;u.style.top="0px";const Gt=Math.max(J,ce+S.offsetTop+(Ye?W:0)+ye)+ze;u.style.height=Gt+"px",S.scrollTop=fe-J+S.offsetTop}u.style.margin=`${Uo}px 0`,u.style.minHeight=$+"px",u.style.maxHeight=se+"px",o?.(),requestAnimationFrame(()=>x.current=!0)}},[v,i.trigger,i.valueNode,u,m,S,C,E,i.dir,o]);En(()=>N(),[N]);const[T,k]=_.useState();En(()=>{m&&k(window.getComputedStyle(m).zIndex)},[m]);const A=_.useCallback(I=>{I&&b.current===!0&&(N(),j?.(),b.current=!1)},[N,j]);return c.jsx(Efe,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:A,children:c.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:c.jsx(De.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});LL.displayName=Sfe;var Cfe="SelectPopperPosition",Dw=_.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Uo,...i}=e,l=Uv(n);return c.jsx(iE,{...l,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Dw.displayName=Cfe;var[Efe,mE]=Cu(rl,{}),zw="SelectViewport",FL=_.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=sa(zw,n),l=mE(zw,n),u=st(t,i.onViewportChange),f=_.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(Dv.Slot,{scope:n,children:c.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:Se(r.onScroll,m=>{const p=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:v}=l;if(v?.current&&g){const x=Math.abs(f.current-p.scrollTop);if(x>0){const b=window.innerHeight-Uo*2,S=parseFloat(g.style.minHeight),C=parseFloat(g.style.height),E=Math.max(S,C);if(E<b){const j=E+x,N=Math.min(b,j),T=j-N;g.style.height=N+"px",g.style.bottom==="0px"&&(p.scrollTop=T>0?T:0,g.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});FL.displayName=zw;var VL="SelectGroup",[Rfe,jfe]=Cu(VL),BL=_.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Xr();return c.jsx(Rfe,{scope:n,id:r,children:c.jsx(De.div,{role:"group","aria-labelledby":r,...o,ref:t})})});BL.displayName=VL;var HL="SelectLabel",GL=_.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=jfe(HL,n);return c.jsx(De.div,{id:r.id,...o,ref:t})});GL.displayName=HL;var dg="SelectItem",[Nfe,qL]=Cu(dg),KL=_.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...l}=e,u=ia(dg,n),f=sa(dg,n),m=u.value===o,[p,g]=_.useState(i??""),[v,x]=_.useState(!1),b=st(t,j=>f.itemRefCallback?.(j,o,r)),S=Xr(),C=_.useRef("touch"),E=()=>{r||(u.onValueChange(o),u.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Nfe,{scope:n,value:o,disabled:r,textId:S,isSelected:m,onItemTextChange:_.useCallback(j=>{g(N=>N||(j?.textContent??"").trim())},[]),children:c.jsx(Dv.ItemSlot,{scope:n,value:o,disabled:r,textValue:p,children:c.jsx(De.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":m&&v,"data-state":m?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:b,onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1)),onClick:Se(l.onClick,()=>{C.current!=="mouse"&&E()}),onPointerUp:Se(l.onPointerUp,()=>{C.current==="mouse"&&E()}),onPointerDown:Se(l.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:Se(l.onPointerMove,j=>{C.current=j.pointerType,r?f.onItemLeave?.():C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,j=>{j.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Se(l.onKeyDown,j=>{f.searchRef?.current!==""&&j.key===" "||(hfe.includes(j.key)&&E(),j.key===" "&&j.preventDefault())})})})})});KL.displayName=dg;var Vd="SelectItemText",ZL=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,l=ia(Vd,n),u=sa(Vd,n),f=qL(Vd,n),m=yfe(Vd,n),[p,g]=_.useState(null),v=st(t,E=>g(E),f.onItemTextChange,E=>u.itemTextRefCallback?.(E,f.value,f.disabled)),x=p?.textContent,b=_.useMemo(()=>c.jsx("option",{value:f.value,disabled:f.disabled,children:x},f.value),[f.disabled,f.value,x]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=m;return En(()=>(S(b),()=>C(b)),[S,C,b]),c.jsxs(c.Fragment,{children:[c.jsx(De.span,{id:f.textId,...i,ref:v}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?lu.createPortal(i.children,l.valueNode):null]})});ZL.displayName=Vd;var YL="SelectItemIndicator",XL=_.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return qL(YL,n).isSelected?c.jsx(De.span,{"aria-hidden":!0,...o,ref:t}):null});XL.displayName=YL;var Uw="SelectScrollUpButton",WL=_.forwardRef((e,t)=>{const n=sa(Uw,e.__scopeSelect),o=mE(Uw,e.__scopeSelect),[r,i]=_.useState(!1),l=st(t,o.onScrollButtonChange);return En(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;i(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),r?c.jsx(JL,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});WL.displayName=Uw;var Lw="SelectScrollDownButton",QL=_.forwardRef((e,t)=>{const n=sa(Lw,e.__scopeSelect),o=mE(Lw,e.__scopeSelect),[r,i]=_.useState(!1),l=st(t,o.onScrollButtonChange);return En(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<m;i(p)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),r?c.jsx(JL,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});QL.displayName=Lw;var JL=_.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=sa("SelectScrollButton",n),l=_.useRef(null),u=zv(n),f=_.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),En(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),c.jsx(De.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:Se(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:Se(r.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:Se(r.onPointerLeave,()=>{f()})})}),Tfe="SelectSeparator",kfe=_.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return c.jsx(De.div,{"aria-hidden":!0,...o,ref:t})});kfe.displayName=Tfe;var Fw="SelectArrow",Ofe=_.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Uv(n),i=ia(Fw,n),l=sa(Fw,n);return i.open&&l.position==="popper"?c.jsx(sE,{...r,...o,ref:t}):null});Ofe.displayName=Fw;var Afe="SelectBubbleInput",eF=_.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=_.useRef(null),i=st(o,r),l=OM(t);return _.useEffect(()=>{const u=r.current;if(!u)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&p){const g=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(g)}},[l,t]),c.jsx(De.select,{...n,style:{...AM,...n.style},ref:i,defaultValue:t})});eF.displayName=Afe;function tF(e){return e===""||e===void 0}function nF(e){const t=Kt(e),n=_.useRef(""),o=_.useRef(0),r=_.useCallback(l=>{const u=n.current+l;t(u),(function f(m){n.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),i=_.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function rF(e,t,n){const r=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Ife(e,Math.max(i,0));r.length===1&&(l=l.filter(m=>m!==n));const f=l.find(m=>m.textValue.toLowerCase().startsWith(r.toLowerCase()));return f!==n?f:void 0}function Ife(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var $fe=kL,Mfe=AL,Pfe=$L,Dfe=ML,zfe=PL,Ufe=DL,Lfe=FL,Ffe=BL,Vfe=GL,Bfe=KL,Hfe=ZL,Gfe=XL,qfe=WL,Kfe=QL;function Jr({...e}){return c.jsx($fe,{"data-slot":"select",...e})}function jo({...e}){return c.jsx(Ffe,{"data-slot":"select-group",...e})}function eo({...e}){return c.jsx(Pfe,{"data-slot":"select-value",...e})}function to({className:e,children:t,...n}){return c.jsxs(Mfe,{"data-slot":"select-trigger",className:Me("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-grey-700 px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:truncate *:data-[slot=select-value]:block *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[t,c.jsx(Dfe,{asChild:!0,children:c.jsx(SI,{className:"opacity-50 size-4"})})]})}function no({className:e,children:t,position:n="popper",...o}){return c.jsx(zfe,{children:c.jsxs(Ufe,{"data-slot":"select-content",className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[c.jsx(Zfe,{}),c.jsx(Lfe,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(Yfe,{})]})})}function hE({className:e,...t}){return c.jsx(Vfe,{"data-slot":"select-label",className:Me("px-2 py-1.5 text-sm font-medium",e),...t})}function Vt({className:e,children:t,...n}){return c.jsxs(Bfe,{"data-slot":"select-item",className:Me("focus:bg-grey-200 focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[c.jsx(Hfe,{children:t}),c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(Gfe,{children:c.jsx(iG,{className:"size-4"})})})]})}function Zfe({className:e,...t}){return c.jsx(qfe,{"data-slot":"select-scroll-up-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(lG,{className:"size-4"})})}function Yfe({className:e,...t}){return c.jsx(Kfe,{"data-slot":"select-scroll-down-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(SI,{className:"size-4"})})}async function oF(e){const{instanceClient:t,...n}=e,{data:o}=await t.post("/",{operation:"add_user",...n});return o}function Xfe(){return at({mutationFn:oF})}const _c=Pn({username:vt().trim().toLowerCase().nonempty({error:"Please enter a username."}),role:vt().nonempty({error:"Please select a role."}),password:vt().min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:vt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function Wfe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const o=dr(),{data:r}=Mn(fE(o)),i=gn({resolver:yn(_c),defaultValues:{username:"",role:"",password:"",confirmPassword:""}}),{mutate:l,isPending:u}=Xfe(),f=_.useCallback(async m=>{m&&l({active:!0,password:m.password,role:m.role,username:m.username,...o},{onSuccess:()=>{const p=m.role;i.reset(),i.setValue("role",p),t(),Ee.success("User added successfully!"),n(!1)}})},[l,i,o,t,n]);return c.jsx(Jn,{onOpenChange:n,open:e,children:c.jsx(er,{"aria-describedby":void 0,children:c.jsx(vn,{...i,children:c.jsxs("form",{onSubmit:i.handleSubmit(f),className:"grid gap-4 my-4",children:[c.jsx(Mr,{children:c.jsx(Kn,{children:"Add New User"})}),c.jsx($e,{control:i.control,name:"username",render:({field:m})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Username"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",enterKeyHint:"next",autoComplete:"username",...m})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:i.control,name:"password",render:({field:m})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...m})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:i.control,name:"confirmPassword",render:({field:m})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Confirm Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...m})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:i.control,name:"role",render:({field:m})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Role"}),c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Ie,{children:c.jsxs(Jr,{...m,onValueChange:p=>m.onChange(p),children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Choose Role"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(hE,{children:"Role"}),r?.map(p=>c.jsx(Vt,{value:p.id,children:p.role},p.id))]})})]})})}),c.jsx(Ae,{})]})}),c.jsx(tr,{children:c.jsx("div",{className:"flex justify-between w-full",children:c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",disabled:u,children:[c.jsx(as,{})," Add User"]})})})]})})})})}async function iF({username:e,password:t,role:n,active:o,instanceClient:r}){const{data:i}=await r.post("/",{operation:"alter_user",username:e,password:t,role:n,active:o});return i}function Qfe(){return at({mutationFn:iF})}const Jfe=Pn({username:_c.shape.username,role:_c.shape.role,newPassword:_c.shape.password.or(eg()).optional(),confirmPassword:_c.shape.confirmPassword}).refine(e=>!e.newPassword||e.newPassword.length>=8,{error:"Password must be at least 8 characters long.",path:["password"]}).refine(e=>!e.newPassword||e.newPassword===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function eme({data:e,onUserUpdated:t}){const n=dr(),{data:o}=Mn(fE(n)),{mutate:r,isPending:i}=Qfe(),l=gn({resolver:yn(Jfe),defaultValues:{username:e.username,role:e.role.role,newPassword:"",confirmPassword:""}}),u=_.useCallback(f=>{const m={username:e.username,role:f.role,...n};f.newPassword&&(m.password=f.newPassword),r(m,{onSuccess:()=>{l.reset(),Ee.success("User edited successfully!"),t()}})},[l,r,e.username,n,t]);return c.jsx(vn,{...l,children:c.jsxs("form",{onSubmit:l.handleSubmit(u),className:"grid gap-4 my-4",children:[c.jsx(Mr,{children:c.jsx(Kn,{children:"Edit User"})}),c.jsx($e,{control:l.control,name:"username",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Username"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",enterKeyHint:"next",autoComplete:"username",disabled:!0,readOnly:!0,...f})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:l.control,name:"newPassword",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Change Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:l.control,name:"confirmPassword",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Confirm Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:l.control,name:"role",render:({field:f})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Role"}),c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Ie,{children:c.jsxs(Jr,{...f,onValueChange:m=>f.onChange(m),children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Choose Role"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(hE,{children:"Role"}),o?.map(m=>c.jsx(Vt,{value:m.id,children:m.role},m.id))]})})]})})}),c.jsx(Ae,{})]})}),c.jsx(tr,{children:c.jsx("div",{className:"flex justify-between w-full",children:c.jsxs(_e,{variant:"submit",className:"rounded-full",disabled:i,children:[c.jsx(as,{})," Save Changes"]})})})]})})}async function sF({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function tme(){return at({mutationFn:sF})}const nme=Pn({username:vt().nonempty({error:"Please enter a username."}),confirmUsernameForDeletion:vt().nonempty({error:"Please type the username again to confirm deletion."})}).refine(e=>e.username===e.confirmUsernameForDeletion,{error:"Username does not match.",path:["confirmUsernameForDeletion"]});function rme({data:e,onUserDeleted:t}){const{mutate:n,isPending:o}=tme(),r=gn({resolver:yn(nme),defaultValues:{username:e.username,confirmUsernameForDeletion:""}}),i=zf(),l=_.useCallback(()=>{n({username:e.username,...i},{onSuccess:()=>{r.reset(),Ee.success("User deleted successfully!"),t()}})},[e.username,r,n,i,t]);return c.jsx(vn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(l),className:"grid gap-4 my-4",children:[c.jsx($e,{control:r.control,name:"confirmUsernameForDeletion",render:({field:u})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Confirm Username"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",enterKeyHint:"next",autoComplete:"username",...u})}),c.jsx(Ae,{})]})}),c.jsx(tr,{children:c.jsx("div",{className:"flex justify-between w-full",children:c.jsxs(_e,{variant:"destructive",className:"rounded-full",disabled:o||!r.formState.isValid,children:[c.jsx(ls,{})," Delete User"]})})})]})})}function ome({closeModal:e,clusterId:t,instanceId:n,data:o,isModalOpen:r,onUserDeleted:i,onUserUpdated:l}){const m=!(na(n??t).user?.username===o.username);return c.jsx(Jn,{onOpenChange:e,open:r,children:c.jsxs(er,{className:"sm:max-w-[750px]",children:[c.jsx(eme,{data:o,onUserUpdated:l}),m&&c.jsx(rme,{data:o,onUserDeleted:i})]})})}function ime({entityId:e,instanceClient:t}){return{queryKey:[e,"list_users"],queryFn:()=>sme({instanceClient:t}),refetchInterval:1e4}}async function sme({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_users"});return t}function kO(){const e=pn(),{instanceId:t,clusterId:n,username:o}=Ze({strict:!1}),r=dr(),{data:i,refetch:l,isFetching:u,isRefetching:f}=Mn(ime(r)),m=_.useMemo(()=>i?.find(I=>I.username===o),[i,o]),p=_.useCallback(I=>{const P=[o?"..":"",I].filter(Boolean);e({to:P.join("/")})},[o,e]),g=!!o&&!!m,[v,x]=_.useState(!1),[b]=_.useState({attribute:"username",descending:!1}),S=_.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=_.useCallback(()=>{x(!0)},[x]),E=_.useCallback(()=>{l(),x(!1)},[l,x]),j=_.useCallback(I=>{p(I.original.username)},[p]),N=_.useCallback(()=>{p(void 0)},[p]),T=_.useCallback(()=>{l(),p(void 0)},[p,l]),k=_.useCallback(()=>{l(),p(void 0)},[p,l]),A=pl(l);return c.jsxs(_.Suspense,{fallback:c.jsx($r,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[c.jsxs(sm,{data:i,isFetching:u||f,columns:ffe,onRowClick:j,sortingState:S,children:[c.jsxs(_e,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:u||f,children:[c.jsx(Gs,{})," ",c.jsxs("span",{className:"hidden lg:inline-block",children:[c.jsx("u",{children:"R"}),"efresh"]})]}),c.jsxs(_e,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[c.jsx(lr,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"A"}),"dd"]})]})]}),c.jsx(Wfe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:x}),g&&c.jsx(ome,{instanceId:t,clusterId:n,closeModal:N,data:m,isModalOpen:g,onUserDeleted:k,onUserUpdated:T})]})}function ame(e){const t=et({getParentRoute:()=>e,path:"config",component:ede}),n=et({getParentRoute:()=>t,path:"/",component:ide}),o=et({getParentRoute:()=>t,path:"roles",component:NO}),r=et({getParentRoute:()=>t,path:"roles/$roleId",component:NO}),i=et({getParentRoute:()=>t,path:"users",component:kO}),l=et({getParentRoute:()=>t,path:"users/$username",component:kO});return t.addChildren([n,o,r,i,l])}function lme(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var pE="ScrollArea",[aF,$be]=Qo(pE),[cme,$o]=aF(pE),lF=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:i=600,...l}=e,[u,f]=_.useState(null),[m,p]=_.useState(null),[g,v]=_.useState(null),[x,b]=_.useState(null),[S,C]=_.useState(null),[E,j]=_.useState(0),[N,T]=_.useState(0),[k,A]=_.useState(!1),[I,P]=_.useState(!1),L=st(t,ie=>f(ie)),V=gu(r);return c.jsx(cme,{scope:n,type:o,dir:V,scrollHideDelay:i,scrollArea:u,viewport:m,onViewportChange:p,content:g,onContentChange:v,scrollbarX:x,onScrollbarXChange:b,scrollbarXEnabled:k,onScrollbarXEnabledChange:A,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:I,onScrollbarYEnabledChange:P,onCornerWidthChange:j,onCornerHeightChange:T,children:c.jsx(De.div,{dir:V,...l,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});lF.displayName=pE;var cF="ScrollAreaViewport",uF=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:o,nonce:r,...i}=e,l=$o(cF,n),u=_.useRef(null),f=st(t,u,l.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(De.div,{"data-radix-scroll-area-viewport":"",...i,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});uF.displayName=cF;var Ni="ScrollAreaScrollbar",dF=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=$o(Ni,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=r,u=e.orientation==="horizontal";return _.useEffect(()=>(u?i(!0):l(!0),()=>{u?i(!1):l(!1)}),[u,i,l]),r.type==="hover"?c.jsx(ume,{...o,ref:t,forceMount:n}):r.type==="scroll"?c.jsx(dme,{...o,ref:t,forceMount:n}):r.type==="auto"?c.jsx(fF,{...o,ref:t,forceMount:n}):r.type==="always"?c.jsx(gE,{...o,ref:t}):null});dF.displayName=Ni;var ume=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=$o(Ni,e.__scopeScrollArea),[i,l]=_.useState(!1);return _.useEffect(()=>{const u=r.scrollArea;let f=0;if(u){const m=()=>{window.clearTimeout(f),l(!0)},p=()=>{f=window.setTimeout(()=>l(!1),r.scrollHideDelay)};return u.addEventListener("pointerenter",m),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",m),u.removeEventListener("pointerleave",p)}}},[r.scrollArea,r.scrollHideDelay]),c.jsx(Dn,{present:n||i,children:c.jsx(fF,{"data-state":i?"visible":"hidden",...o,ref:t})})}),dme=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=$o(Ni,e.__scopeScrollArea),i=e.orientation==="horizontal",l=Fv(()=>f("SCROLL_END"),100),[u,f]=lme("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(u==="idle"){const m=window.setTimeout(()=>f("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(m)}},[u,r.scrollHideDelay,f]),_.useEffect(()=>{const m=r.viewport,p=i?"scrollLeft":"scrollTop";if(m){let g=m[p];const v=()=>{const x=m[p];g!==x&&(f("SCROLL"),l()),g=x};return m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[r.viewport,i,f,l]),c.jsx(Dn,{present:n||u!=="hidden",children:c.jsx(gE,{"data-state":u==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),fF=_.forwardRef((e,t)=>{const n=$o(Ni,e.__scopeScrollArea),{forceMount:o,...r}=e,[i,l]=_.useState(!1),u=e.orientation==="horizontal",f=Fv(()=>{if(n.viewport){const m=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?m:p)}},10);return nu(n.viewport,f),nu(n.content,f),c.jsx(Dn,{present:o||i,children:c.jsx(gE,{"data-state":i?"visible":"hidden",...r,ref:t})})}),gE=_.forwardRef((e,t)=>{const{orientation:n="vertical",...o}=e,r=$o(Ni,e.__scopeScrollArea),i=_.useRef(null),l=_.useRef(0),[u,f]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=vF(u.viewport,u.content),p={...o,sizes:u,onSizesChange:f,hasThumb:m>0&&m<1,onThumbChange:v=>i.current=v,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:v=>l.current=v};function g(v,x){return vme(v,l.current,u,x)}return n==="horizontal"?c.jsx(fme,{...p,ref:t,onThumbPositionChange:()=>{if(r.viewport&&i.current){const v=r.viewport.scrollLeft,x=OO(v,u,r.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=g(v,r.dir))}}):n==="vertical"?c.jsx(mme,{...p,ref:t,onThumbPositionChange:()=>{if(r.viewport&&i.current){const v=r.viewport.scrollTop,x=OO(v,u);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=g(v))}}):null}),fme=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,i=$o(Ni,e.__scopeScrollArea),[l,u]=_.useState(),f=_.useRef(null),m=st(t,f,i.onScrollbarXChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),c.jsx(hF,{"data-orientation":"horizontal",...r,ref:m,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Lv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,g)=>{if(i.viewport){const v=i.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),bF(v,g)&&p.preventDefault()}},onResize:()=>{f.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:mg(l.paddingLeft),paddingEnd:mg(l.paddingRight)}})}})}),mme=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,i=$o(Ni,e.__scopeScrollArea),[l,u]=_.useState(),f=_.useRef(null),m=st(t,f,i.onScrollbarYChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),c.jsx(hF,{"data-orientation":"vertical",...r,ref:m,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Lv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,g)=>{if(i.viewport){const v=i.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),bF(v,g)&&p.preventDefault()}},onResize:()=>{f.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:mg(l.paddingTop),paddingEnd:mg(l.paddingBottom)}})}})}),[hme,mF]=aF(Ni),hF=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:m,onWheelScroll:p,onResize:g,...v}=e,x=$o(Ni,n),[b,S]=_.useState(null),C=st(t,L=>S(L)),E=_.useRef(null),j=_.useRef(""),N=x.viewport,T=o.content-o.viewport,k=Kt(p),A=Kt(f),I=Fv(g,10);function P(L){if(E.current){const V=L.clientX-E.current.left,ie=L.clientY-E.current.top;m({x:V,y:ie})}}return _.useEffect(()=>{const L=V=>{const ie=V.target;b?.contains(ie)&&k(V,T)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[N,b,T,k]),_.useEffect(A,[o,A]),nu(b,I),nu(x.content,I),c.jsx(hme,{scope:n,scrollbar:b,hasThumb:r,onThumbChange:Kt(i),onThumbPointerUp:Kt(l),onThumbPositionChange:A,onThumbPointerDown:Kt(u),children:c.jsx(De.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:Se(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),E.current=b.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P(L))}),onPointerMove:Se(e.onPointerMove,P),onPointerUp:Se(e.onPointerUp,L=>{const V=L.target;V.hasPointerCapture(L.pointerId)&&V.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),E.current=null})})})}),fg="ScrollAreaThumb",pF=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=mF(fg,e.__scopeScrollArea);return c.jsx(Dn,{present:n||r.hasThumb,children:c.jsx(pme,{ref:t,...o})})}),pme=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:o,...r}=e,i=$o(fg,n),l=mF(fg,n),{onThumbPositionChange:u}=l,f=st(t,g=>l.onThumbChange(g)),m=_.useRef(void 0),p=Fv(()=>{m.current&&(m.current(),m.current=void 0)},100);return _.useEffect(()=>{const g=i.viewport;if(g){const v=()=>{if(p(),!m.current){const x=yme(g,u);m.current=x,u()}};return u(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[i.viewport,p,u]),c.jsx(De.div,{"data-state":l.hasThumb?"visible":"hidden",...r,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Se(e.onPointerDownCapture,g=>{const x=g.target.getBoundingClientRect(),b=g.clientX-x.left,S=g.clientY-x.top;l.onThumbPointerDown({x:b,y:S})}),onPointerUp:Se(e.onPointerUp,l.onThumbPointerUp)})});pF.displayName=fg;var vE="ScrollAreaCorner",gF=_.forwardRef((e,t)=>{const n=$o(vE,e.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?c.jsx(gme,{...e,ref:t}):null});gF.displayName=vE;var gme=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...o}=e,r=$o(vE,n),[i,l]=_.useState(0),[u,f]=_.useState(0),m=!!(i&&u);return nu(r.scrollbarX,()=>{const p=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(p),f(p)}),nu(r.scrollbarY,()=>{const p=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(p),l(p)}),m?c.jsx(De.div,{...o,ref:t,style:{width:i,height:u,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function mg(e){return e?parseInt(e,10):0}function vF(e,t){const n=e/t;return isNaN(n)?0:n}function Lv(e){const t=vF(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-n)*t;return Math.max(o,18)}function vme(e,t,n,o="ltr"){const r=Lv(n),i=r/2,l=t||i,u=r-l,f=n.scrollbar.paddingStart+l,m=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,g=o==="ltr"?[0,p]:[p*-1,0];return yF([f,m],g)(e)}function OO(e,t,n="ltr"){const o=Lv(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-r,l=t.content-t.viewport,u=i-o,f=n==="ltr"?[0,l]:[l*-1,0],m=Pw(e,f);return yF([0,l],[0,u])(m)}function yF(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function bF(e,t){return e>0&&e<t}var yme=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},o=0;return(function r(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,o=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(o)};function Fv(e,t){const n=Kt(e),o=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(o.current),[]),_.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function nu(e,t){const n=Kt(t);En(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}var bme=lF,xme=uF,_me=gF;function wme({className:e,children:t,...n}){return c.jsxs(bme,{"data-slot":"scroll-area",className:Me("relative",e),...n,children:[c.jsx(xme,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),c.jsx(Sme,{}),c.jsx(_me,{})]})}function Sme({className:e,orientation:t="vertical",...n}){return c.jsx(dF,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Me("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:c.jsx(pF,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var b_="rovingFocusGroup.onEntryFocus",Cme={bubbles:!1,cancelable:!0},am="RovingFocusGroup",[Vw,xF,Eme]=Pf(am),[Rme,Vv]=Qo(am,[Eme]),[jme,Nme]=Rme(am),_F=_.forwardRef((e,t)=>c.jsx(Vw.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Vw.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Tme,{...e,ref:t})})}));_F.displayName=am;var Tme=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:p=!1,...g}=e,v=_.useRef(null),x=st(t,v),b=gu(i),[S,C]=Ci({prop:l,defaultProp:u??null,onChange:f,caller:am}),[E,j]=_.useState(!1),N=Kt(m),T=xF(n),k=_.useRef(!1),[A,I]=_.useState(0);return _.useEffect(()=>{const P=v.current;if(P)return P.addEventListener(b_,N),()=>P.removeEventListener(b_,N)},[N]),c.jsx(jme,{scope:n,orientation:o,dir:b,loop:r,currentTabStopId:S,onItemFocus:_.useCallback(P=>C(P),[C]),onItemShiftTab:_.useCallback(()=>j(!0),[]),onFocusableItemAdd:_.useCallback(()=>I(P=>P+1),[]),onFocusableItemRemove:_.useCallback(()=>I(P=>P-1),[]),children:c.jsx(De.div,{tabIndex:E||A===0?-1:0,"data-orientation":o,...g,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{k.current=!0}),onFocus:Se(e.onFocus,P=>{const L=!k.current;if(P.target===P.currentTarget&&L&&!E){const V=new CustomEvent(b_,Cme);if(P.currentTarget.dispatchEvent(V),!V.defaultPrevented){const ie=T().filter(M=>M.focusable),se=ie.find(M=>M.active),ue=ie.find(M=>M.id===S),ce=[se,ue,...ie].filter(Boolean).map(M=>M.ref.current);CF(ce,p)}}k.current=!1}),onBlur:Se(e.onBlur,()=>j(!1))})})}),wF="RovingFocusGroupItem",SF=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:l,...u}=e,f=Xr(),m=i||f,p=Nme(wF,n),g=p.currentTabStopId===m,v=xF(n),{onFocusableItemAdd:x,onFocusableItemRemove:b,currentTabStopId:S}=p;return _.useEffect(()=>{if(o)return x(),()=>b()},[o,x,b]),c.jsx(Vw.ItemSlot,{scope:n,id:m,focusable:o,active:r,children:c.jsx(De.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Se(e.onMouseDown,C=>{o?p.onItemFocus(m):C.preventDefault()}),onFocus:Se(e.onFocus,()=>p.onItemFocus(m)),onKeyDown:Se(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=Ame(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let N=v().filter(T=>T.focusable).map(T=>T.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const T=N.indexOf(C.currentTarget);N=p.loop?Ime(N,T+1):N.slice(T+1)}setTimeout(()=>CF(N))}}),children:typeof l=="function"?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});SF.displayName=wF;var kme={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ome(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ame(e,t,n){const o=Ome(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return kme[o]}function CF(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Ime(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var EF=_F,RF=SF,Bv="Tabs",[$me,Mbe]=Qo(Bv,[Vv]),jF=Vv(),[Mme,yE]=$me(Bv),NF=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:f="automatic",...m}=e,p=gu(u),[g,v]=Ci({prop:o,onChange:r,defaultProp:i??"",caller:Bv});return c.jsx(Mme,{scope:n,baseId:Xr(),value:g,onValueChange:v,orientation:l,dir:p,activationMode:f,children:c.jsx(De.div,{dir:p,"data-orientation":l,...m,ref:t})})});NF.displayName=Bv;var TF="TabsList",kF=_.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=yE(TF,n),l=jF(n);return c.jsx(EF,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:o,children:c.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});kF.displayName=TF;var OF="TabsTrigger",AF=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,l=yE(OF,n),u=jF(n),f=MF(l.baseId,o),m=PF(l.baseId,o),p=o===l.value;return c.jsx(RF,{asChild:!0,...u,focusable:!r,active:p,children:c.jsx(De.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...i,ref:t,onMouseDown:Se(e.onMouseDown,g=>{!r&&g.button===0&&g.ctrlKey===!1?l.onValueChange(o):g.preventDefault()}),onKeyDown:Se(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(o)}),onFocus:Se(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!r&&g&&l.onValueChange(o)})})})});AF.displayName=OF;var IF="TabsContent",$F=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...l}=e,u=yE(IF,n),f=MF(u.baseId,o),m=PF(u.baseId,o),p=o===u.value,g=_.useRef(p);return _.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),c.jsx(Dn,{present:r||p,children:({present:v})=>c.jsx(De.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:m,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:v&&i})})});$F.displayName=IF;function MF(e,t){return`${e}-trigger-${t}`}function PF(e,t){return`${e}-content-${t}`}var Pme=NF,Dme=kF,zme=AF,Ume=$F;function Lme({className:e,...t}){return c.jsx(Pme,{"data-slot":"tabs",className:Me("flex flex-col gap-2",e),...t})}function Fme({className:e,...t}){return c.jsx(Dme,{"data-slot":"tabs-list",className:Me("text-muted-foreground inline-flex h-9 w-fit items-center justify-center px-[3px]",e),...t})}function Vme({className:e,...t}){return c.jsx(zme,{"data-slot":"tabs-trigger",className:Me("data-[state=inactive]:border-b-4 data-[state=inactive]:border-b-grey-700 data-[state=active]:text-white data-[state=active]:border-b-4 data-[state=active]:border-b-purple dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 border border-transparent px-2 py-1 font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Bme({className:e,...t}){return c.jsx(Ume,{"data-slot":"tabs-content",className:Me("flex-1 outline-none",e),...t})}function Bw({clusterId:e,databaseName:t,instanceId:n,organizationId:o,tableName:r}){const i=["databases",t,r].filter(Ig).join("/");return mn({organizationId:o,instanceId:n,clusterId:e},i)}async function Hme({databaseName:e,tableName:t,primaryKey:n,replicated:o,instanceClient:r}){const{data:i}=await r.post("/",{operation:"create_table",database:e,table:t,primary_key:n,replicated:o});return i}function Gme(){return at({mutationFn:Hme})}const x_=/^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/,Jh=Pn({databaseName:vt().regex(x_,{error:"Database name cannot include backticks or forward slashes."}).max(75,{error:"Database name cannot be longer than 75 characters."}),tableName:vt().nonempty({error:"Table name is required."}).regex(x_,{error:"Table name cannot include backticks or forward slashes."}).max(250,{error:"Table name cannot be longer than 250 characters."}),primaryKey:vt().regex(x_,{error:"Primary key cannot include backticks or forward slashes."}).max(250,{error:"Primary key cannot be longer than 250 characters."})});function qme({databaseName:e,onSelectTable:t}){const n=Xo(),o=dr(),r=Rn(),[i,l]=_.useState(!1),u=gn({resolver:yn(Jh),defaultValues:{databaseName:e||"",tableName:"",primaryKey:""}}),{mutate:f}=Gme(),m=async p=>{const g=p.databaseName||"data",v=p.tableName;f({databaseName:g,tableName:v,primaryKey:p.primaryKey||"id",...o,replicated:o.entityType==="cluster"},{onSuccess:async()=>{await n.invalidateQueries({queryKey:[o.entityId,"describe_all"],refetchType:"all"}),Ee.success(`Table ${v} created successfully`),l(!1),u.reset(),t(g,v),await r.invalidate()}})};return c.jsxs(Jn,{open:i,onOpenChange:l,children:[c.jsx(ZC,{asChild:!0,children:c.jsxs(_e,{variant:"positiveOutline",className:"w-full rounded-full",size:"lg",accessKey:"t",children:[c.jsx(lr,{}),c.jsxs("span",{children:["Create a ",c.jsx("u",{children:"T"}),"able"]})]})}),c.jsxs(er,{className:"sm:max-w-[425px]",children:[c.jsxs(Mr,{children:[c.jsx(Kn,{children:"Create a New Table"}),c.jsx(Io,{children:"What would you like to create?"})]}),c.jsx(vn,{...u,children:c.jsxs("form",{onSubmit:u.handleSubmit(m),className:"grid gap-6 text-white",children:[c.jsx($e,{control:u.control,name:"tableName",render:({field:p})=>c.jsxs(ke,{className:"",children:[c.jsx(Oe,{className:"pb-1",children:"Table Name"}),c.jsx(Ie,{children:c.jsx(Le,{...p,type:"text",placeholder:"ex. Users",maxLength:Jh.shape.tableName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:u.control,name:"primaryKey",render:({field:p})=>c.jsxs(ke,{className:"",children:[c.jsx(Oe,{className:"pb-1",children:"Primary Key"}),c.jsx(Ie,{children:c.jsx(Le,{...p,placeholder:"id",type:"text",maxLength:Jh.shape.primaryKey.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:u.control,name:"databaseName",render:({field:p})=>c.jsxs(ke,{className:"",children:[c.jsx(Oe,{className:"pb-1",children:"Database Name"}),c.jsx(Ie,{children:c.jsx(Le,{...p,type:"text",placeholder:"data",maxLength:Jh.shape.databaseName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),c.jsx(Ae,{})]})}),c.jsx(tr,{children:c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",children:[c.jsx(qG,{}),"Create New Table"]})})]})})]})]})}function Hv({typeOfThingBeingDeleted:e,nameOfThingBeingDeleted:t,isModalOpen:n,setIsModalOpen:o,deletionConfirmed:r,deletionPending:i,trigger:l,presentParticiple:u="Deleting",transitiveVerb:f="Delete"}){return c.jsxs(Jn,{open:n,onOpenChange:o,children:[l&&c.jsx(ZC,{asChild:!0,children:l}),c.jsxs(er,{className:"sm:max-w-[750px]",children:[c.jsxs(Mr,{children:[c.jsxs(Kn,{children:["Are you sure you want to ",f.toLowerCase()," this ",e,"?"]}),c.jsx(Io,{children:"This action cannot be undone."})]}),c.jsxs("div",{className:"p-3 my-5 text-white rounded-md bg-amber-600",children:[c.jsxs("p",{className:"flex space-x-1 font-semibold align-baseline",children:[c.jsx(YG,{className:"inline-block size-5"})," ",c.jsx("span",{children:"Warning"})]}),c.jsxs("p",{className:"pt-2 text-base",children:["By ",u.toLowerCase()," ",e," ",c.jsxs("span",{className:"font-semibold",children:[t," "]}),"you will lose the data stored in it permanently."]})]}),c.jsx(tr,{children:c.jsxs("div",{className:"flex justify-center space-x-5",children:[c.jsxs(_e,{className:"rounded-full",onClick:()=>o(!1),children:[c.jsx(Za,{})," Cancel"]}),c.jsxs(_e,{variant:"destructive",className:"rounded-full",onClick:r,disabled:i,children:[c.jsx(ls,{})," ",f]})]})})]})]})}async function Kme({databaseName:e,replicated:t,instanceClient:n}){const{data:o}=await n.post("/",{operation:"drop_database",database:e,replicated:t});return o}function Zme(){return at({mutationFn:Kme})}function Yme({databaseName:e,onDeleted:t}){const n=qS(),o=Xo(),r=dr(),i=Rn(),[l,u]=_.useState(!1),{mutate:f,isPending:m}=Zme(),p=_.useCallback(()=>{f({databaseName:e,...r,replicated:r.entityType==="cluster"},{onSuccess:async()=>{u(!1),await o.invalidateQueries({queryKey:[r.entityId,"describe_all"],refetchType:"all"}),await i.invalidate(),Ee.success(`Database ${e} dropped successfully`),t()}})},[e,f,r,t,o,i]);return!n||!e?c.jsx(c.Fragment,{}):c.jsx(Hv,{typeOfThingBeingDeleted:"database",nameOfThingBeingDeleted:e,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:l,setIsModalOpen:u,deletionConfirmed:p,deletionPending:m,trigger:c.jsxs(_e,{className:"w-full rounded-full",size:"sm","aria-label":"Delete selected database",variant:"destructiveOutline",disabled:m,onClick:()=>u(!0),children:[c.jsx(ls,{})," Drop Database"]})})}function Xme(){const e=Rn(),t=Ze({strict:!1}),n=Ag({strict:!1}),o=pn(),r=qS(),{databaseNames:i,tableNames:l}=_.useMemo(()=>{const p=Object.keys(n||{}).sort(),g=t.databaseName?Object.keys(n[t.databaseName]||[]).sort():[];return{databaseNames:p,tableNames:g}},[n,t.databaseName]),u=_.useCallback(p=>{const g=p?Object.keys(n[p]||[]).sort():[];t.databaseName?o({to:Bw({...t,databaseName:p,tableName:g[0]})}):e.invalidate()},[n,t,e,o]),f=_.useCallback(()=>{u(void 0)},[u]),m=_.useCallback((p,g)=>{o({to:Bw({...t,databaseName:p,tableName:g})})},[o,t]);return c.jsxs("div",{children:[c.jsx("h1",{className:"pb-6 text-3xl",children:"Databases"}),c.jsx("div",{className:"",children:i?.length>0&&c.jsx("div",{className:"flex space-x-2",children:c.jsxs(Jr,{name:"databaseSelect",value:t.databaseName||"",onValueChange:p=>{u(p)},children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Select a Database"})}),c.jsx(no,{children:c.jsx(jo,{children:i?.map(p=>c.jsx(Vt,{value:p,children:p},p))})})]})})}),c.jsxs(Lme,{defaultValue:"tables",className:"py-6",children:[c.jsx(Fme,{className:"w-full",children:c.jsx(Vme,{value:"tables",children:"Tables"})}),c.jsx(wme,{className:"border rounded-md h-80 border-grey-700",children:c.jsxs(Bme,{value:"tables",className:"h-full",children:[(l??[]).length===0&&t.databaseName?.length?c.jsxs("div",{className:"w-full h-full text-center",children:[c.jsx("p",{className:"py-6",children:"No tables found in this database."}),r&&c.jsx("p",{children:'Tap "Create a Table" below!'})]}):(l??[]).length===0&&!t.databaseName?.length?c.jsxs("p",{className:"pt-2 text-sm text-center",children:["Please ",i?.length===0?"create":"select"," a table."]}):"",c.jsx("ul",{children:(l??[]).map(p=>c.jsx("li",{className:"flex items-center p-2 border-b hover:bg-grey-700/80 border-grey-700",children:c.jsxs(_e,{onClick:()=>m(t.databaseName,p),size:"lg",className:"items-center justify-between w-full bg-transparent border-none shadow-none hover:bg-transparent",children:[p,c.jsx("span",{children:t.tableName===p&&c.jsx(Yr,{})})]})},p))})]})})]}),r&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(qme,{databaseName:t.databaseName,onSelectTable:m}),t.databaseName?.length&&c.jsxs(c.Fragment,{children:[c.jsx("div",{"aria-hidden":"true",className:"w-full border-t border-gray-700 dark:border-white/15 my-4"}),c.jsx(Yme,{databaseName:t.databaseName,onDeleted:f})]})]})]})}function Wme(){return c.jsxs("main",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:[c.jsx("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3",children:c.jsx(Xme,{})}),c.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 flex flex-col",children:c.jsx(_.Suspense,{fallback:c.jsx($r,{centered:!0,text:"Loading Data"}),children:c.jsx(ss,{})})})]})}function _p(e){return new Intl.NumberFormat().format(e)}function Qme({columns:e,data:t,isFetching:n,totalPages:o,totalRecords:r,onRowClick:i,onColumnClick:l,pageIndex:u,setPageIndex:f,pageSize:m,setPageSize:p,children:g}){const v=Av({data:t,columns:e,manualPagination:!0,pageCount:o,rowCount:r,getCoreRowModel:Ov(),getPaginationRowModel:Kde()}),x=_.useCallback(()=>{f(u-1)},[u,f]),b=_.useCallback(()=>{f(u+1)},[u,f]);return c.jsxs(c.Fragment,{children:[g,c.jsxs(Iv,{containerClassName:"rounded-md bg-black-dark grow max-h-[calc(100vh-128px-16px-112px-80px)]",children:[c.jsx($v,{children:v.getHeaderGroups().map(S=>c.jsx(Ro,{className:"border-none",children:S.headers.map(C=>c.jsx(RL,{header:C,onColumnClick:l},C.id))},S.id))}),c.jsx(Mv,{className:"bg-black border border-grey-700",children:v.getRowModel().rows?.length?v.getRowModel().rows.map(S=>c.jsx(Ro,{"data-state":S.getIsSelected()&&"selected",onClick:()=>i?.(S),className:Me("hover:bg-muted/10 data-[state=selected]:bg-muted",i&&"cursor-pointer"),children:S.getVisibleCells().map(C=>c.jsx(ea,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:Js(C.column.columnDef.cell,C.getContext())},C.id))},S.id)):c.jsx(Ro,{children:c.jsx(ea,{colSpan:e.length,className:"h-24 text-center",children:n?c.jsx("div",{children:c.jsx($r,{className:"m-12"})}):c.jsx("span",{children:"No results."})})})})]}),c.jsxs("div",{className:"flex items-center justify-end py-4 space-x-2",children:[c.jsxs(_e,{variant:"defaultOutline",size:"sm",onClick:x,className:"select-none",disabled:u===0,children:[c.jsx(Za,{}),"Previous"]}),c.jsx("div",{className:"grow"}),c.jsxs("div",{className:"text-center",children:[c.jsx("dt",{className:"text-sm/6 font-medium text-gray-500 dark:text-gray-400",children:"Records"}),c.jsx("dd",{className:"font-semibold tracking-tight",children:_p(r)})]}),r>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsxs(Jr,{defaultValue:m.toString(),onValueChange:S=>{p(Number(S))},children:[c.jsx(to,{className:"h-10 w-[80px]",children:c.jsx(eo,{})}),c.jsx(no,{side:"top",children:[20,50,100,250].map(S=>c.jsx(Vt,{value:`${S}`,children:S},S))})]})}),o>1&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"text-center",children:[c.jsx("dt",{className:"text-sm/6 font-medium text-gray-500 dark:text-gray-400",children:"Pages"}),c.jsx("dd",{className:"font-semibold tracking-tight",children:_p(o)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("dt",{className:"text-sm/6 font-medium text-gray-500 dark:text-gray-400",children:"Page"}),c.jsx("dd",{className:"font-semibold tracking-tight",children:_p(u+1)})]})]})]}),c.jsx("div",{className:"grow"}),c.jsxs(_e,{variant:"defaultOutline",size:"sm",onClick:b,className:"select-none",disabled:u===o-1,children:["Next",c.jsx(Yr,{})]})]})]})}function Jme(e){const{hash_attribute:t,attributes:n}=e,o=[],r=[],i=[],l=[];for(let u=n.length-1;u>=0;u--){const{attribute:f,is_primary_key:m,indexed:p}=n[u],g={header:f,accessorKey:f,enableSorting:!!(m||p)};m?o.push(g):f==="__createdtime__"||f==="__updatedtime__"?l.push(g):g.enableSorting?r.push(g):i.push(g)}return{dataTableColumns:[...o,...r,...i,...l],hashAttribute:t}}function ehe({isAddTableRecordsPending:e,isModalOpen:t,onSaveChanges:n,instanceTable:o,setIsModalOpen:r}){const[i,l]=_.useState(!0),[u,f]=_.useState(),m=_.useCallback(()=>{u&&i&&n(JSON.parse(u))},[u,n,i]),[p,g]=_.useState(!1),v=_.useCallback(b=>{g(!0),l(b.length===0)},[l]),x=_.useMemo(()=>{const b={};for(const S of o.attributes)S.is_primary_key||S.attribute==="__createdtime__"||S.attribute==="__updatedtime__"||(b[S.attribute]=the(S.type));return JSON.stringify(b,null,4)},[o]);return c.jsx(Jn,{onOpenChange:r,open:t,children:c.jsxs(er,{"aria-describedby":void 0,onEscapeKeyDown:b=>{p&&b.preventDefault()},children:[c.jsx(Mr,{children:c.jsxs(Kn,{children:["Add New ",o.name]})}),o?.hash_attribute&&c.jsxs("div",{className:"text-sm text-gray-500",children:["The hash_attribute for this table is ",c.jsxs("strong",{children:["“",o.hash_attribute,"”"]}),", and will auto-generate. You may manually add it if you want to specify its value."]}),c.jsx(Nv,{className:"w-full h-96",language:"json",theme:"vs-dark",value:x,onValidate:v,onChange:b=>{f(b)}}),c.jsxs("div",{className:"text-sm text-gray-500",children:[c.jsx("strong",{children:"You may paste in an array"})," if you want to add more than one record at a time."]}),c.jsx(tr,{children:c.jsx("div",{className:"flex justify-between w-full",children:c.jsxs(_e,{variant:"submit",className:"rounded-full",onClick:m,accessKey:"s",disabled:!i||e,children:[c.jsx(as,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"S"}),"ave Changes"]})]})})})]})})}function the(e){switch(e){case"Date":return new Date().toISOString();case"Id":case"ID":case"String":return"";case"Boolean":return!1;case"Int":case"Long":case"Float":case"BigInt":return 0;default:return null}}function nhe({canEditRecords:e,canDeleteRecords:t,setIsModalOpen:n,isModalOpen:o,hashAttribute:r,data:i,onSaveChanges:l,onDeleteRecord:u,isUpdateTableRecordsPending:f,isDeleteTableRecordsPending:m}){const[p,g]=_.useState(!0),[v,x]=_.useState(!1),[b,S]=_.useState(),C=_.useMemo(()=>{const j=i?.map(({__createdtime__:N,__updatedtime__:T,...k})=>k);return JSON.stringify(j,null,4)},[i]),E=_.useCallback(j=>{x(!0),g(j.length===0)},[g]);return c.jsx(Jn,{onOpenChange:n,open:o,children:c.jsxs(er,{"aria-describedby":void 0,onEscapeKeyDown:e?j=>{v&&j.preventDefault()}:void 0,children:[c.jsx(Mr,{children:c.jsxs(Kn,{children:[e?"Edit":"View"," Row"]})}),i?c.jsx(Nv,{className:"w-full h-96",language:"json",theme:"vs-dark",options:e?void 0:{readOnly:!0},value:C,onValidate:E,onChange:j=>{S(j)}}):c.jsx($r,{}),c.jsx(tr,{children:c.jsxs("div",{className:"flex justify-between w-full",children:[t&&c.jsxs(_e,{variant:"destructive",className:"rounded-full",onClick:()=>{const j=i[0]?.[r];j&&u([j])},disabled:m,children:[c.jsx(ls,{})," Delete Row"]}),e&&c.jsxs(_e,{variant:"submit",className:"rounded-full",accessKey:"s",onClick:()=>{b&&p&&l(JSON.parse(b))},disabled:!p||f,children:[c.jsx(as,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"S"}),"ave Changes"]})]})]})})]})})}async function rhe({databaseName:e,tableName:t,replicated:n,instanceClient:o}){const{data:r}=await o.post("/",{operation:"drop_table",database:e,table:t,replicated:n});return r}function ohe(){return at({mutationFn:rhe})}async function ihe({databaseName:e,tableName:t,hashValues:n,instanceClient:o}){const{data:r}=await o.post("/",{operation:"delete",database:e,table:t,hash_values:n});return r}function she(){return at({mutationFn:ihe})}async function ahe({databaseName:e,tableName:t,records:n,instanceClient:o}){const{data:r}=await o.post("/",{operation:"insert",database:e,table:t,records:n});return r}function lhe(){return at({mutationFn:ahe})}async function che(e){const{databaseName:t,tableName:n,records:o,instanceClient:r}=e,{data:i}=await r.post("/",{operation:"update",database:t,table:n,records:o});return i}function uhe(){return at({mutationFn:che})}function dhe({databaseName:e,tableName:t,entityId:n,instanceClient:o}){return{queryKey:[n,"describe_table",e,t],queryFn:async()=>{const{data:r}=await o.post("/",{operation:"describe_table",database:e,table:t});return r},staleTime:5e3,enabled:!!e&&!!t,retry:!1}}function fhe({isEditModalOpen:e,entityId:t,instanceClient:n,databaseName:o,tableName:r,ids:i}){return{queryKey:[t,"search_by_id",o,r,i],queryFn:()=>n.post("/",{get_attributes:["*"],ids:i,noCacheStore:!0,onlyIfCached:!0,operation:"search_by_id",database:o,table:r}),enabled:e&&!!i?.length,retry:!1}}function mhe({entityId:e,instanceClient:t,databaseName:n,tableName:o,searchAttribute:r,sortTableDataParams:i,pageSize:l,pageIndex:u}){return{queryKey:[e,"search_by_value",r,u||0,l||0,n,i.attribute||"default",i.descending||!1,o],staleTime:5e3,queryFn:()=>t.post("/",{operation:"search_by_value",get_attributes:["*"],database:n,table:o,search_attribute:r,search_value:"*",sort:i.attribute.length?i:void 0,limit:l,offset:u*l})}}function hhe(){const e=Ze({strict:!1}),t=pn(),n=dr(),{clusterId:o,instanceId:r,databaseName:i,tableName:l}=e,u=Hx(r??o,i,l,"insert"),f=Hx(r??o,i,l,"update"),m=Hx(r??o,i,l,"delete"),p=qS(),{data:g,refetch:v}=Mn(dhe({...n,databaseName:i,tableName:l})),[x,b]=xp(null,e),[S,C]=_.useState(!1),{data:E}=wn(fhe({...n,isEditModalOpen:S,databaseName:i,tableName:l,ids:x})),{dataTableColumns:j,hashAttribute:N}=Jme(g),[T,k]=_.useState(!1),[A,I]=xp({attribute:N,descending:!1},e),[P,L]=_.useState(g.record_count),[V,ie]=xp(0,[i,l]),[se,ue]=_.useState(20),[le,ce]=_.useState(Math.ceil(g.record_count/se)),{data:M,refetch:K,isFetching:U}=wn(mhe({...n,databaseName:i,tableName:l,searchAttribute:N,sortTableDataParams:A,pageSize:se,pageIndex:V})),{mutate:re,isPending:$}=lhe(),{mutate:H,isPending:W}=uhe(),{mutate:B,isPending:J}=she(),{mutate:ge,isPending:ye}=ohe();_.useEffect(()=>{L(g.record_count),ce(Math.ceil(g.record_count/se))},[g,se]);const ae=nn=>{re({...n,databaseName:i,tableName:l,records:Array.isArray(nn)?nn:[nn]},{onSuccess:()=>{v(),K(),k(!1),Ee.success("Record added successfully")}})},fe=nn=>{H({...n,databaseName:i,tableName:l,records:nn},{onSuccess:()=>{v(),K(),C(!1),Ee.success("Record updated successfully")}})},ze=nn=>{B({...n,databaseName:i,tableName:l,hashValues:nn},{onSuccess:()=>{v(),K(),C(!1),Ee.success("Record deleted successfully")}})},Ve=nn=>{b([nn.original[N]]),C(!S)},Ye=(nn,Pt)=>{I({attribute:nn,descending:!Pt})},He=pl(K),Gt=_.useCallback(()=>{k(!0)},[k]),[Yt,Zn]=_.useState(!1),fr=_.useCallback((nn,Pt)=>{ge({databaseName:nn,tableName:Pt,...n,replicated:n.entityType==="cluster"},{onSuccess:async()=>{Zn(!1),await nf.invalidateQueries({queryKey:[n.entityId,"describe_all"],refetchType:"all"}),Ee.success(`Table ${Pt} dropped successfully`),Pt===l&&t({to:"../"})}})},[ge,n,t,l]),Mt=_.useCallback(()=>{i&&l&&fr(i,l)},[i,fr,l]);return c.jsxs(c.Fragment,{children:[c.jsx(Qme,{data:M?.data||[],isFetching:U,columns:j,onRowClick:Ve,onColumnClick:Ye,totalPages:le,totalRecords:P,pageIndex:V,pageSize:se,setPageIndex:ie,setPageSize:ue,children:c.jsxs("div",{className:"flex items-center justify-start space-x-2 pt-15 pb-4",children:[u&&c.jsxs(_e,{variant:"positiveOutline",onClick:Gt,disabled:T||$,accessKey:"n",children:[c.jsx(lr,{}),c.jsxs("span",{children:["Add ",c.jsx("u",{children:"N"}),"ew Record(s)"]})]}),c.jsx(_e,{variant:"defaultOutline",onClick:He,disabled:U,children:c.jsx(Gs,{})}),c.jsx("div",{className:"grow"}),p&&c.jsxs(_e,{variant:"destructiveOutline",onClick:()=>Zn(!0),children:[c.jsx(ls,{className:"inline-block "}),"Drop Table"]})]})}),u&&c.jsx(ehe,{instanceTable:g,setIsModalOpen:k,isModalOpen:T,onSaveChanges:ae,isAddTableRecordsPending:$}),c.jsx(nhe,{canEditRecords:f,canDeleteRecords:m,setIsModalOpen:C,isModalOpen:S,hashAttribute:N,data:E?.data,onSaveChanges:fe,onDeleteRecord:ze,isUpdateTableRecordsPending:W,isDeleteTableRecordsPending:J}),c.jsx(Hv,{typeOfThingBeingDeleted:"table",nameOfThingBeingDeleted:l,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:Yt,setIsModalOpen:()=>Zn(!1),deletionConfirmed:Mt,deletionPending:ye})]})}async function __(e,t,n){const o=t.instanceId??t.clusterId??Sn,r=await e.ensureQueryData(jL({entityId:o,instanceClient:Us({id:o})}));let i,l;if(r){t.databaseName||(i=Object.keys(r).sort()[0]);const u=t.databaseName??i;!t.tableName&&u&&r[u]&&(l=Object.keys(r[u]).sort()[0])}if((i||l)&&!n)throw il({to:Bw({...t,databaseName:i??t.databaseName,tableName:l}),replace:!0});return r}function phe(e){const t=et({getParentRoute:()=>e,path:"/databases",component:Wme,loader:({context:r,params:i,preload:l})=>__(r.queryClient,i,l)}),n=et({getParentRoute:()=>t,path:"$databaseName",loader:({context:r,params:i,preload:l})=>__(r.queryClient,i,l)}),o=et({getParentRoute:()=>t,path:"$databaseName/$tableName",component:hhe,loader:({context:r,params:i,preload:l})=>__(r.queryClient,i,l)});return t.addChildren([n,o])}function ghe(){return c.jsx(ss,{})}async function vhe(e){await kt.patch(`/ResetPasswordUpdater/${e}`)}async function yhe({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:o,tempPassword:r,instanceClient:i}){if(!r)throw new Error("You may not have permission to set the password on this cluster.");try{const l=await vw({username:t,password:r,instanceClient:i});return n===$_?await iF({username:n,password:o,instanceClient:i}):(await oF({username:n,password:o,role:"super_user",active:!0,instanceClient:i}),await sF({username:$_,instanceClient:i}),await vw({username:n,password:o,instanceClient:i})),await vhe(e),l}catch(l){throw await jf({instanceClient:i}),l}}function bhe(){return at({mutationFn:yhe})}function xhe(){const{clusterId:e}=Ze({strict:!1}),{data:t}=wn(Vf(e,!0)),n=pn(),o=_.useMemo(()=>aS(t),[t]),r=Df(o),{redirect:i}=Ri({strict:!1}),l=Rn(),u=gn({resolver:yn(_c),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:""}}),f=t?.instances?.find(v=>v.tempPassword)?.tempPassword,{mutate:m,isPending:p}=bhe(),g=_.useCallback(async v=>{if(!o){Ee.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}m({instanceClient:r,clusterId:e,newPassword:v.password,tempPassword:f,initialUsername:$_,desiredUsername:v.username},{onSuccess:async x=>{Ee.success(x.message);const b=await tf({instanceClient:r});Gn.setUserForEntity(t||null,b),l.invalidate(),await n({to:i?.startsWith("/")?i:Jw})}})},[t,e,r,n,o,i,l,m,f]);return t&&!t.resetPassword?c.jsx(Q_,{to:"../sign-in",replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:c.jsx(Zg,{})}),c.jsx("div",{className:"h-screen items-center justify-center flex",children:c.jsxs("div",{className:"text-white w-xs",children:[c.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),c.jsx(vn,{...u,children:c.jsxs("form",{onSubmit:u.handleSubmit(g),className:"my-4",children:[c.jsx($e,{control:u.control,name:"username",render:({field:v})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Username"}),c.jsx(Ie,{children:c.jsx(Le,{autoComplete:"username",type:"text",...v})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:u.control,name:"password",render:({field:v})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",...v})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:u.control,name:"confirmPassword",render:({field:v})=>c.jsxs(ke,{className:"my-4",children:[c.jsx(Oe,{children:"Confirm Password"}),c.jsx(Ie,{children:c.jsx(Le,{type:"password",...v})}),c.jsx(Ae,{})]})}),c.jsx(_e,{disabled:p,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})})]})})]})}function _he({columns:e,data:t}){const n=Av({data:t,columns:e,getCoreRowModel:Ov()});return c.jsx("div",{className:"bg-black-dark rounded-md",children:c.jsxs(Iv,{children:[c.jsx($v,{children:n.getHeaderGroups().map(o=>c.jsx(Ro,{className:"border-none",children:o.headers.map(r=>c.jsx(ug,{className:"p-4",children:r.isPlaceholder?null:Js(r.column.columnDef.header,r.getContext())},r.id))},o.id))}),c.jsx(Mv,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(o=>c.jsx(Ro,{"data-state":o.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:o.getVisibleCells().map(r=>c.jsx(ea,{className:"p-4",children:Js(r.column.columnDef.cell,r.getContext())},r.id))},o.id)):c.jsx(Ro,{children:c.jsx(ea,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function gl({children:e}){return c.jsx("nav",{className:"fixed top-20 w-full md:h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:c.jsxs("div",{className:"md:flex items-center h-full space-x-8",children:[c.jsx(Zg,{}),e]})})}const whe=Yw("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-auto",{variants:{variant:{default:"border-primary bg-primary/40 text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-secondary bg-secondary/40 text-secondary-foreground [a&]:hover:bg-secondary/90",warning:"border-yellow bg-yellow/40 text-white [a&]:hover:bg-yellow/90",success:"border-green bg-green/40 text-white [a&]:hover:bg-green/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-white [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function No({className:e,variant:t,asChild:n=!1,...o}){const r=n?Ww:"span";return c.jsx(r,{"data-slot":"badge",className:Me(whe({variant:t}),e),...o})}const bE=e=>{switch(e){case"PROVISIONING":case"CLONE_PENDING":case"CLONE_READY":case"UPDATING_HDB_NODES":case"UPDATING":return"warning";case"RUNNING":case"UPDATED":return"success";case"STOPPED":return"secondary";case"TERMINATED":case"TERMINATING":case"ERROR":case"REMOVED":default:return"destructive"}},She={PROVISIONING:"Provisioning",RUNNING:"Running",STOPPED:"Stopped",TERMINATED:"Terminated",CLONE_PENDING:"Clone Pending",UPDATING_HDB_NODES:"Updating HDB Nodes",UPDATING:"Updating",UPDATED:"Updated",ERROR:"Error",TERMINATING:"Terminating",CLONE_READY:"Clone Ready",REMOVED:"Removed"},xE=e=>{const t=She[e];if(t)return t;throw new Error("Unsupported Status")};function Che(){return c.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:c.jsx("p",{children:"No instances found."})})}function Ehe({instance:e}){const{user:t,isLoading:n}=na(e.id),o=_.useMemo(()=>lS(e),[e]),r=Df(o),i=_.useCallback(async()=>{await jf({instanceClient:r}),Gn.setUserForEntity(e,null)},[e,r]);return["CLONE_READY","RUNNING","UPDATED"].includes(e.status)?n?c.jsx(Qr,{}):t?c.jsxs("span",{className:"flex gap-4",children:[c.jsx(Ue,{to:`../instance/${e.id}${ta}`,className:"text-sm","aria-label":`Go to ${e.name} instance`,title:`Go to ${e.name} instance`,children:c.jsx(_e,{variant:"positiveOutline",children:"View"})}),c.jsx(_e,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${e.name} instance`,title:`Sign out from ${e.name} instance`,onClick:i,children:"Sign Out"})]}):c.jsx(Ue,{to:`../instance/${e.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${e.name} instance`,title:`Sign in to ${e.name} instance`,children:c.jsx(_e,{variant:"positiveOutline",children:"Sign In"})}):c.jsx("p",{children:"N/A"})}const AO=["KB","MB","GB","TB","PB","EB","ZB","YB"];function fi(e,t=1){let r=e*t;if(Math.abs(r)<1024)return r+" B";let i=-1;const l=10;do r/=1024,++i;while(Math.round(Math.abs(r)*l)/l>=1024&&i<AO.length-1);return`${new Intl.NumberFormat().format(Math.round(r))} ${AO[i]}`}const Rhe=e=>{switch(e){case"typ-1":return"Self-Hosted";case"typ-2":return"Config 1";case"typ-3":return"Config 2";default:return"N/A"}};function jhe(){const{clusterId:e}=Ze({strict:!1}),{data:t,isLoading:n}=wn(Vf(e,!0)),o=_.useMemo(()=>[{accessorKey:"name",header:"Name"},{accessorKey:"instanceFqdn",header:"Instance Url",cell:r=>c.jsx(Ehe,{instance:r.row.original})},{accessorKey:"instanceTypeId",header:"Instance Type",cell:r=>Rhe(r.getValue())},{accessorKey:"status",header:"Status",cell:r=>{const i=r.getValue();return c.jsx(No,{variant:bE(i),children:xE(i)})}},{accessorKey:"version",header:"Version"},{accessorKey:"storageGb",header:"Storage",cell:r=>{const i=r.getValue();return fi(i,Math.pow(1024,3))}},{accessorKey:"cpuCores",header:"Cores/Threads",cell:r=>c.jsxs(c.Fragment,{children:[r.row.original.cpuCores," / ",r.row.original.threads]})},{accessorKey:"memoryMb",header:"Memory",cell:r=>{const i=r.getValue();return fi(i,Math.pow(1024,2))}}],[]);return c.jsxs(c.Fragment,{children:[c.jsx(gl,{}),c.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsx(_f,{className:"p-0 mt-4 min-h-96",children:c.jsx(wf,{className:"p-0 min-h-96",children:n?c.jsx(Qr,{}):t?.instances?.length?c.jsx(_he,{data:t.instances,columns:o}):c.jsx(Che,{})})})})]})}var Hw=["Enter"," "],Nhe=["ArrowDown","PageUp","Home"],DF=["ArrowUp","PageDown","End"],The=[...Nhe,...DF],khe={ltr:[...Hw,"ArrowRight"],rtl:[...Hw,"ArrowLeft"]},Ohe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},lm="Menu",[vf,Ahe,Ihe]=Pf(lm),[vl,zF]=Qo(lm,[Ihe,Su,Vv]),Gv=Su(),UF=Vv(),[$he,yl]=vl(lm),[Mhe,cm]=vl(lm),LF=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:l=!0}=e,u=Gv(t),[f,m]=_.useState(null),p=_.useRef(!1),g=Kt(i),v=gu(r);return _.useEffect(()=>{const x=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.jsx(rE,{...u,children:c.jsx($he,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:c.jsx(Mhe,{scope:t,onClose:_.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:l,children:o})})})};LF.displayName=lm;var Phe="MenuAnchor",_E=_.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Gv(n);return c.jsx(oE,{...r,...o,ref:t})});_E.displayName=Phe;var wE="MenuPortal",[Dhe,FF]=vl(wE,{forceMount:void 0}),VF=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=yl(wE,t);return c.jsx(Dhe,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||i.open,children:c.jsx(tm,{asChild:!0,container:r,children:o})})})};VF.displayName=wE;var To="MenuContent",[zhe,SE]=vl(To),BF=_.forwardRef((e,t)=>{const n=FF(To,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=yl(To,e.__scopeMenu),l=cm(To,e.__scopeMenu);return c.jsx(vf.Provider,{scope:e.__scopeMenu,children:c.jsx(Dn,{present:o||i.open,children:c.jsx(vf.Slot,{scope:e.__scopeMenu,children:l.modal?c.jsx(Uhe,{...r,ref:t}):c.jsx(Lhe,{...r,ref:t})})})})}),Uhe=_.forwardRef((e,t)=>{const n=yl(To,e.__scopeMenu),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return HC(i)},[]),c.jsx(CE,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Lhe=_.forwardRef((e,t)=>{const n=yl(To,e.__scopeMenu);return c.jsx(CE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fhe=Ba("MenuContent.ScrollLock"),CE=_.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:x,disableOutsideScroll:b,...S}=e,C=yl(To,n),E=cm(To,n),j=Gv(n),N=UF(n),T=Ahe(n),[k,A]=_.useState(null),I=_.useRef(null),P=st(t,I,C.onContentChange),L=_.useRef(0),V=_.useRef(""),ie=_.useRef(0),se=_.useRef(null),ue=_.useRef("right"),le=_.useRef(0),ce=b?bv:_.Fragment,M=b?{as:Fhe,allowPinchZoom:!0}:void 0,K=re=>{const $=V.current+re,H=T().filter(ae=>!ae.disabled),W=document.activeElement,B=H.find(ae=>ae.ref.current===W)?.textValue,J=H.map(ae=>ae.textValue),ge=Jhe(J,$,B),ye=H.find(ae=>ae.textValue===ge)?.ref.current;(function ae(fe){V.current=fe,window.clearTimeout(L.current),fe!==""&&(L.current=window.setTimeout(()=>ae(""),1e3))})($),ye&&setTimeout(()=>ye.focus())};_.useEffect(()=>()=>window.clearTimeout(L.current),[]),BC();const U=_.useCallback(re=>ue.current===se.current?.side&&tpe(re,se.current?.area),[]);return c.jsx(zhe,{scope:n,searchRef:V,onItemEnter:_.useCallback(re=>{U(re)&&re.preventDefault()},[U]),onItemLeave:_.useCallback(re=>{U(re)||(I.current?.focus(),A(null))},[U]),onTriggerLeave:_.useCallback(re=>{U(re)&&re.preventDefault()},[U]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:_.useCallback(re=>{se.current=re},[]),children:c.jsx(ce,{...M,children:c.jsx(vv,{asChild:!0,trapped:r,onMountAutoFocus:Se(i,re=>{re.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:c.jsx(vu,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:x,children:c.jsx(EF,{asChild:!0,...N,dir:E.dir,orientation:"vertical",loop:o,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:Se(f,re=>{E.isUsingKeyboardRef.current||re.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(iE,{role:"menu","aria-orientation":"vertical","data-state":i6(C.open),"data-radix-menu-content":"",dir:E.dir,...j,...S,ref:P,style:{outline:"none",...S.style},onKeyDown:Se(S.onKeyDown,re=>{const H=re.target.closest("[data-radix-menu-content]")===re.currentTarget,W=re.ctrlKey||re.altKey||re.metaKey,B=re.key.length===1;H&&(re.key==="Tab"&&re.preventDefault(),!W&&B&&K(re.key));const J=I.current;if(re.target!==J||!The.includes(re.key))return;re.preventDefault();const ye=T().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);DF.includes(re.key)&&ye.reverse(),Whe(ye)}),onBlur:Se(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(L.current),V.current="")}),onPointerMove:Se(e.onPointerMove,yf(re=>{const $=re.target,H=le.current!==re.clientX;if(re.currentTarget.contains($)&&H){const W=re.clientX>le.current?"right":"left";ue.current=W,le.current=re.clientX}}))})})})})})})});BF.displayName=To;var Vhe="MenuGroup",EE=_.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return c.jsx(De.div,{role:"group",...o,ref:t})});EE.displayName=Vhe;var Bhe="MenuLabel",HF=_.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return c.jsx(De.div,{...o,ref:t})});HF.displayName=Bhe;var hg="MenuItem",IO="menu.itemSelect",qv=_.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,i=_.useRef(null),l=cm(hg,e.__scopeMenu),u=SE(hg,e.__scopeMenu),f=st(t,i),m=_.useRef(!1),p=()=>{const g=i.current;if(!n&&g){const v=new CustomEvent(IO,{bubbles:!0,cancelable:!0});g.addEventListener(IO,x=>o?.(x),{once:!0}),zp(g,v),v.defaultPrevented?m.current=!1:l.onClose()}};return c.jsx(GF,{...r,ref:f,disabled:n,onClick:Se(e.onClick,p),onPointerDown:g=>{e.onPointerDown?.(g),m.current=!0},onPointerUp:Se(e.onPointerUp,g=>{m.current||g.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,g=>{const v=u.searchRef.current!=="";n||v&&g.key===" "||Hw.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});qv.displayName=hg;var GF=_.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...i}=e,l=SE(hg,n),u=UF(n),f=_.useRef(null),m=st(t,f),[p,g]=_.useState(!1),[v,x]=_.useState("");return _.useEffect(()=>{const b=f.current;b&&x((b.textContent??"").trim())},[i.children]),c.jsx(vf.ItemSlot,{scope:n,disabled:o,textValue:r??v,children:c.jsx(RF,{asChild:!0,...u,focusable:!o,children:c.jsx(De.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:m,onPointerMove:Se(e.onPointerMove,yf(b=>{o?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,yf(b=>l.onItemLeave(b))),onFocus:Se(e.onFocus,()=>g(!0)),onBlur:Se(e.onBlur,()=>g(!1))})})})}),Hhe="MenuCheckboxItem",qF=_.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return c.jsx(WF,{scope:e.__scopeMenu,checked:n,children:c.jsx(qv,{role:"menuitemcheckbox","aria-checked":pg(n)?"mixed":n,...r,ref:t,"data-state":jE(n),onSelect:Se(r.onSelect,()=>o?.(pg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});qF.displayName=Hhe;var KF="MenuRadioGroup",[Ghe,qhe]=vl(KF,{value:void 0,onValueChange:()=>{}}),ZF=_.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,i=Kt(o);return c.jsx(Ghe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:c.jsx(EE,{...r,ref:t})})});ZF.displayName=KF;var YF="MenuRadioItem",XF=_.forwardRef((e,t)=>{const{value:n,...o}=e,r=qhe(YF,e.__scopeMenu),i=n===r.value;return c.jsx(WF,{scope:e.__scopeMenu,checked:i,children:c.jsx(qv,{role:"menuitemradio","aria-checked":i,...o,ref:t,"data-state":jE(i),onSelect:Se(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});XF.displayName=YF;var RE="MenuItemIndicator",[WF,Khe]=vl(RE,{checked:!1}),QF=_.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,i=Khe(RE,n);return c.jsx(Dn,{present:o||pg(i.checked)||i.checked===!0,children:c.jsx(De.span,{...r,ref:t,"data-state":jE(i.checked)})})});QF.displayName=RE;var Zhe="MenuSeparator",JF=_.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return c.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});JF.displayName=Zhe;var Yhe="MenuArrow",e6=_.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Gv(n);return c.jsx(sE,{...r,...o,ref:t})});e6.displayName=Yhe;var Xhe="MenuSub",[Pbe,t6]=vl(Xhe),Bd="MenuSubTrigger",n6=_.forwardRef((e,t)=>{const n=yl(Bd,e.__scopeMenu),o=cm(Bd,e.__scopeMenu),r=t6(Bd,e.__scopeMenu),i=SE(Bd,e.__scopeMenu),l=_.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},p=_.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return _.useEffect(()=>p,[p]),_.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),c.jsx(_E,{asChild:!0,...m,children:c.jsx(GF,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":i6(n.open),...e,ref:xf(t,r.onTriggerChange),onClick:g=>{e.onClick?.(g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,yf(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Se(e.onPointerLeave,yf(g=>{p();const v=n.content?.getBoundingClientRect();if(v){const x=n.content?.dataset.side,b=x==="right",S=b?-5:5,C=v[b?"left":"right"],E=v[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+S,y:g.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,g=>{const v=i.searchRef.current!=="";e.disabled||v&&g.key===" "||khe[o.dir].includes(g.key)&&(n.onOpenChange(!0),n.content?.focus(),g.preventDefault())})})})});n6.displayName=Bd;var r6="MenuSubContent",o6=_.forwardRef((e,t)=>{const n=FF(To,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=yl(To,e.__scopeMenu),l=cm(To,e.__scopeMenu),u=t6(r6,e.__scopeMenu),f=_.useRef(null),m=st(t,f);return c.jsx(vf.Provider,{scope:e.__scopeMenu,children:c.jsx(Dn,{present:o||i.open,children:c.jsx(vf.Slot,{scope:e.__scopeMenu,children:c.jsx(CE,{id:u.contentId,"aria-labelledby":u.triggerId,...r,ref:m,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&f.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Se(e.onFocusOutside,p=>{p.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),v=Ohe[l.dir].includes(p.key);g&&v&&(i.onOpenChange(!1),u.trigger?.focus(),p.preventDefault())})})})})})});o6.displayName=r6;function i6(e){return e?"open":"closed"}function pg(e){return e==="indeterminate"}function jE(e){return pg(e)?"indeterminate":e?"checked":"unchecked"}function Whe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Qhe(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Jhe(e,t,n){const r=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Qhe(e,Math.max(i,0));r.length===1&&(l=l.filter(m=>m!==n));const f=l.find(m=>m.toLowerCase().startsWith(r.toLowerCase()));return f!==n?f:void 0}function epe(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],m=u.x,p=u.y,g=f.x,v=f.y;p>o!=v>o&&n<(g-m)*(o-p)/(v-p)+m&&(r=!r)}return r}function tpe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return epe(n,t)}function yf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var npe=LF,rpe=_E,ope=VF,ipe=BF,spe=EE,ape=HF,lpe=qv,cpe=qF,upe=ZF,dpe=XF,fpe=QF,mpe=JF,hpe=e6,ppe=n6,gpe=o6,Kv="DropdownMenu",[vpe,Dbe]=Qo(Kv,[zF]),Cr=zF(),[ype,s6]=vpe(Kv),a6=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=Cr(t),m=_.useRef(null),[p,g]=Ci({prop:r,defaultProp:i??!1,onChange:l,caller:Kv});return c.jsx(ype,{scope:t,triggerId:Xr(),triggerRef:m,contentId:Xr(),open:p,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(v=>!v),[g]),modal:u,children:c.jsx(npe,{...f,open:p,onOpenChange:g,dir:o,modal:u,children:n})})};a6.displayName=Kv;var l6="DropdownMenuTrigger",c6=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,i=s6(l6,n),l=Cr(n);return c.jsx(rpe,{asChild:!0,...l,children:c.jsx(De.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:xf(t,i.triggerRef),onPointerDown:Se(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Se(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});c6.displayName=l6;var bpe="DropdownMenuPortal",u6=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Cr(t);return c.jsx(ope,{...o,...n})};u6.displayName=bpe;var d6="DropdownMenuContent",f6=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=s6(d6,n),i=Cr(n),l=_.useRef(!1);return c.jsx(ipe,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...o,ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,u=>{l.current||r.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,p=f.button===2||m;(!r.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});f6.displayName=d6;var xpe="DropdownMenuGroup",_pe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(spe,{...r,...o,ref:t})});_pe.displayName=xpe;var wpe="DropdownMenuLabel",m6=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(ape,{...r,...o,ref:t})});m6.displayName=wpe;var Spe="DropdownMenuItem",h6=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(lpe,{...r,...o,ref:t})});h6.displayName=Spe;var Cpe="DropdownMenuCheckboxItem",Epe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(cpe,{...r,...o,ref:t})});Epe.displayName=Cpe;var Rpe="DropdownMenuRadioGroup",jpe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(upe,{...r,...o,ref:t})});jpe.displayName=Rpe;var Npe="DropdownMenuRadioItem",Tpe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(dpe,{...r,...o,ref:t})});Tpe.displayName=Npe;var kpe="DropdownMenuItemIndicator",Ope=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(fpe,{...r,...o,ref:t})});Ope.displayName=kpe;var Ape="DropdownMenuSeparator",p6=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(mpe,{...r,...o,ref:t})});p6.displayName=Ape;var Ipe="DropdownMenuArrow",$pe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(hpe,{...r,...o,ref:t})});$pe.displayName=Ipe;var Mpe="DropdownMenuSubTrigger",Ppe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(ppe,{...r,...o,ref:t})});Ppe.displayName=Mpe;var Dpe="DropdownMenuSubContent",zpe=_.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cr(n);return c.jsx(gpe,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zpe.displayName=Dpe;var Upe=a6,Lpe=c6,Fpe=u6,Vpe=f6,Bpe=m6,Hpe=h6,Gpe=p6;function NE({...e}){return c.jsx(Upe,{"data-slot":"dropdown-menu",...e})}function TE({...e}){return c.jsx(Lpe,{"data-slot":"dropdown-menu-trigger",...e})}function kE({className:e,sideOffset:t=4,...n}){return c.jsx(Fpe,{children:c.jsx(Vpe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-grey-700 p-1 shadow-md",e),...n})})}function Fo({className:e,inset:t,variant:n="default",...o}){return c.jsx(Hpe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Me("focus:bg-accent focus:text-grey data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function gg({className:e,inset:t,...n}){return c.jsx(Bpe,{"data-slot":"dropdown-menu-label","data-inset":t,className:Me("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function OE({className:e,...t}){return c.jsx(Gpe,{"data-slot":"dropdown-menu-separator",className:Me("bg-grey-700 -mx-1 my-1 h-px",e),...t})}function qpe({cluster:e}){const t=na(e.id),{view:n,update:o}=GS(e.organizationId,e.id),r=_.useMemo(()=>e.resetPassword,[e]);if(n){if(!e.fqdn)return c.jsx(Ue,{to:`${e.id}/instances`,className:"text-sm","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:c.jsxs("span",{className:"py-2 hover:border-b-2",children:["Instances ",c.jsx(Yr,{className:"inline-block"})]})});if(r)return o?c.jsx(Ue,{to:`${e.id}/set-password`,className:"text-sm","aria-label":`Set Password on ${e.name}`,title:`Set Password on ${e.name}`,children:c.jsxs("span",{className:"py-2 hover:border-b-2",children:["Set Password ",c.jsx(Yr,{className:"inline-block"})]})}):c.jsx("span",{className:"py-2",children:"Pending Owner Setup"});if(!t.isLoading)return t.user?c.jsx(Ue,{to:`${e.id}${ta}`,className:"text-sm","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:c.jsxs("span",{className:"py-2 hover:border-b-2",children:["View ",c.jsx(Yr,{className:"inline-block"})]})}):c.jsx(Ue,{to:`${e.id}/sign-in`,className:"text-sm","aria-label":`Sign In to ${e.name}`,title:`Sign In to ${e.name}`,children:c.jsxs("span",{className:"py-2 hover:border-b-2",children:["Sign In ",c.jsx(Yr,{className:"inline-block"})]})})}}const Kpe=["RUNNING"],Zpe=["TERMINATING","TERMINATED","REMOVED"];function Ype({cluster:e,onTerminateClusterModal:t}){const{view:n,update:o,remove:r}=GS(e.organizationId,e.id),i=na(e.id),l=_.useMemo(()=>e.status&&Kpe.includes(e.status),[e.status]),u=_.useMemo(()=>e.status&&Zpe.includes(e.status),[e.status]),f=_.useMemo(()=>aS(e),[e]),m=Df(f),[p,g]=_.useState(!1),v=_.useCallback(async()=>{g(!0);const C=await r0(e.id).catch(E=>(console.error("Failed to lookup cluster details, proceeding without checking instances.",E),null));if(await jf({instanceClient:m}),C?.instances?.length)for(const E of C.instances)Gn.setUserForEntity(E,null);Gn.setUserForEntity(e,null)},[e,m]),x=_.useCallback(()=>{t(e)},[e,t]),b=_.useCallback(()=>{navigator.clipboard.writeText(e.fqdn||""),Ee.info("FQDN url copied to clipboard")},[e.fqdn]),S=[l&&o&&c.jsx(Ue,{to:`${e.id}/edit`,disabled:p,children:c.jsx(Fo,{children:"Edit"})}),l&&n&&c.jsx(Ue,{to:`${e.id}/instances`,disabled:p,children:c.jsx(Fo,{children:"Instances"})}),l&&n&&c.jsx(Fo,{onClick:b,disabled:p,children:"Copy FQDN Url"}),l&&n&&!!f&&!i.isLoading&&i.user&&c.jsx(Fo,{onClick:v,disabled:p,children:"Sign Out"}),!u&&r&&c.jsx(Fo,{className:"bg-red focus:bg-red/70 focus:text-white",onClick:x,children:"Terminate"})].filter(Ig);return c.jsxs(_f,{className:"relative h-full justify-between",children:[c.jsxs(_g,{children:[c.jsxs(Qw,{className:"flex items-center justify-between",children:[c.jsx("span",{className:"truncate",children:e.id}),!u&&c.jsxs(NE,{children:[c.jsx(TE,{children:c.jsx(EI,{"aria-label":"Cluster options"})}),c.jsxs(kE,{children:[c.jsx(gg,{className:"text-gray-600 text-xs",children:"Plans"}),e.plans?.map(C=>c.jsxs(gg,{children:[C.planId," / ",C.regionId,c.jsx("br",{}),"Auto Renewal"," ",C.autoRenew?c.jsx(No,{variant:"success",children:"ON"}):c.jsx(No,{variant:"warning",children:"OFF"})]},C.planId)),S.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(OE,{}),...S]})]})]})]}),c.jsx(wg,{children:c.jsx("h2",{children:e.name})})]}),c.jsxs(wf,{className:"flex justify-between",children:[e.status&&c.jsx(No,{variant:bE(e.status),children:xE(e.status)}),l&&n&&c.jsx(qpe,{cluster:e})]})]})}async function Xpe(e){const{data:t}=await kt.delete(`/Cluster/${e}`);return t}function Wpe(){return at({mutationFn:e=>Xpe(e)})}async function Qpe(e){const{data:t}=await kt.get(`/Organization/${e}`);return t}function aa(e){return{queryKey:[Cn.organization,e],queryFn:()=>Qpe(e),retry:!1,refetchInterval:1e4}}const Gw={UPDATING:0,PROVISIONING:1,RUNNING:2,TERMINATED:3},ep=Gw.RUNNING;function Jpe(e,t){if(e.status===t.status)return e.name.localeCompare(t.name);const n=e.status?Gw[e.status]??ep:ep,o=t.status?Gw[t.status]??ep:ep;return n-o}function g6(e,t){const n={};for(const o of e){const r=o[t];if(r!==void 0)if(Array.isArray(r))for(const i of r)n[i]||(n[i]=[]),n[i].push(o);else n[r]||(n[r]=[]),n[r].push(o)}return n}function v6(e,t){const n=t.toLowerCase();return o=>{for(const r of e){const i=o[r];if(i!=null)if(typeof i=="string"){if(i.toLowerCase().includes(n))return!0}else if(typeof i=="boolean"){if(i&&(n==="yes"||n==="true"||n==="1")||!i&&(n==="no"||n==="false"||n==="0"))return!0}else throw new Error("curryFilterByFuzzySearch has not implemented support for "+typeof i+" fields yet!")}return!1}}function ege(){const e=Xo(),{organizationId:t}=Ze({strict:!1}),{create:n}=GS(t),{data:o,isSuccess:r}=Mn(aa(t)),{mutate:i,isPending:l}=Wpe(),[u,f]=_.useState(!1),[m,p]=_.useState({id:"",name:""}),[g,v]=_.useState(""),x=_.useCallback(E=>{v(E.currentTarget.value?.toLowerCase()||"")},[]),b=_.useMemo(()=>{const E=g6(o?.clusters?.slice().filter(v6(["id","name"],g)).sort(Jpe)||[],"status");return{keys:Object.keys(E),groups:E}},[g,o?.clusters]),S=_.useCallback(E=>{E&&i(E.id,{onSuccess:()=>{Ee.success("Success",{description:"Cluster successfully terminated.",duration:5e3,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e.invalidateQueries({queryKey:[Cn.organization],refetchType:"active"}),f(!1)},onError:()=>{Ee.error("Error",{description:`Failed to terminate cluster: ${E.name}.`,duration:5e3,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),f(!1)}})},[i,e,f]),C=_.useCallback(E=>{p({id:E.id,name:E.name}),f(!0)},[]);return c.jsxs(c.Fragment,{children:[c.jsx(gl,{children:r&&o?.clusters?.length?c.jsxs("div",{className:"flex w-full justify-between",children:[c.jsx(Le,{placeholder:"Filter by name",className:"inline-block w-full md:w-64 bg-black border",onChange:x}),n&&c.jsx(Ue,{to:"new-cluster",children:c.jsxs(_e,{variant:"positive",className:"w-full rounded-full md:w-44",accessKey:"n",children:[c.jsx(lr,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"N"}),"ew Cluster"]})]})})]}):null}),c.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:b.keys.length?b.keys.map(E=>c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2",children:c.jsx(No,{variant:bE(E),children:xE(E)})}),c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 mb-4",children:b.groups[E].map(j=>c.jsx("div",{className:"cols-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:c.jsx(Ype,{cluster:j,onTerminateClusterModal:C})},j.id))})]},E)):c.jsxs("div",{className:"flex-col space-y-5 items-center justify-center text-center",children:[c.jsxs("h2",{className:"text-2xl text-center text-white",children:["No clusters found.",n&&" Create a new cluster."]}),n&&c.jsx(Ue,{to:"new-cluster",children:c.jsxs(_e,{variant:"positive",className:"w-full rounded-full md:w-44",accessKey:"n",children:[c.jsx(lr,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"N"}),"ew Cluster"]})]})})]})}),c.jsx(Hv,{typeOfThingBeingDeleted:"cluster",transitiveVerb:"Terminate",presentParticiple:"Terminating",nameOfThingBeingDeleted:m.name,isModalOpen:u,setIsModalOpen:E=>f(E),deletionConfirmed:()=>S(m),deletionPending:l})]})}function ol(){return c.jsx("a",{href:"https://www.harpersystems.dev/contact",target:"_blank",className:"underline",children:"Contact us"})}function w_({children:e}){return c.jsxs(c.Fragment,{children:[c.jsx(gl,{}),c.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] relative",children:e})]})}async function tge(e){const{data:t}=await kt.get("/Plan/",{params:{organizationId:e}});return t}function nge(e){return{queryKey:[Cn.organization,e,"instancePlan"],queryFn:()=>tge(e),retry:!1}}async function rge({organizationId:e,availableHosts:t}={}){const{data:n}=await kt.get("/Region/",{params:{availableHosts:t,organizationId:e}});return n}function $O({organizationId:e,availableHosts:t}={}){return{queryKey:[Cn.cluster,"regionLocations",e,t],queryFn:()=>rge({organizationId:e,availableHosts:t}),retry:!1}}function oge({duration:e,message:t,lateMessage:n}){const o=_.useRef(0),r=_.useRef(0),[i,l]=_.useState(!1),u=5,[f,m]=_.useState({width:`${u}%`}),p=_.useCallback(g=>{r.current||(r.current=g);const v=g-r.current,x=Math.min(v/e,1);m({width:Math.max(u,x*100)+"%"}),x<1?o.current=requestAnimationFrame(p):l(!0)},[e]);return _.useEffect(()=>(o.current=requestAnimationFrame(p),()=>cancelAnimationFrame(o.current)),[p]),c.jsxs(c.Fragment,{children:[i?n:t,c.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:c.jsx("div",{className:"bg-purple-600 h-2.5 rounded-full dark:bg-purple-500 mt-2",style:f})})]})}async function ige(e){const{data:t}=await kt.post("/Cluster/",e,{timeout:12e4});return t}function sge(){return at({mutationFn:e=>ige(e)})}async function age(e){const{data:t}=await kt.put(`/Cluster/${e.id}`,{regionPlans:e.regionPlans},{timeout:12e4});return t}function lge(){return at({mutationFn:e=>age(e)})}async function cge(e){await kt.put("/Payment/",e)}function uge(){return at({mutationFn:e=>cge(e)})}function y6(e){const{mutate:t}=uge();return _.useCallback((n,o)=>{t({paymentMethodId:typeof n=="string"?n:n.id,organizationId:e},{onSuccess:()=>{Ee.success("Success! Your payment method has been saved."),o(!0)},onError:()=>{Ee.error("Failed to process payment method details. Please try another payment method."),o(!1)}})},[t,e])}const dge=_.createContext(null);function fge(){return _.useContext(dge)}var S_={exports:{}},C_,MO;function mge(){if(MO)return C_;MO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return C_=e,C_}var E_,PO;function hge(){if(PO)return E_;PO=1;var e=mge();function t(){}function n(){}return n.resetWarningCache=t,E_=function(){function o(l,u,f,m,p,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},E_}var DO;function pge(){return DO||(DO=1,S_.exports=hge()()),S_.exports}var gge=pge();const Lt=Zw(gge);function zO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function UO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zO(Object(n),!0).forEach(function(o){b6(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zO(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function wp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wp=function(t){return typeof t}:wp=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wp(e)}function b6(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vge(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function yge(e,t){if(e==null)return{};var n=vge(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function bge(e,t){return xge(e)||_ge(e,t)||wge(e,t)||Sge()}function xge(e){if(Array.isArray(e))return e}function _ge(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var o=[],r=!0,i=!1,l,u;try{for(n=n.call(e);!(r=(l=n.next()).done)&&(o.push(l.value),!(t&&o.length===t));r=!0);}catch(f){i=!0,u=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(i)throw u}}return o}}function wge(e,t){if(e){if(typeof e=="string")return LO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LO(e,t)}}function LO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Sge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
394
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var gr=function(t,n,o){var r=!!o,i=q.useRef(o);q.useEffect(function(){i.current=o},[o]),q.useEffect(function(){if(!r||!t)return function(){};var l=function(){i.current&&i.current.apply(i,arguments)};return t.on(n,l),function(){t.off(n,l)}},[r,n,t,i])},Cge=function(t){var n=q.useRef(t);return q.useEffect(function(){n.current=t},[t]),n.current},vg=function(t){return t!==null&&wp(t)==="object"},FO="[object Object]",Ege=function e(t,n){if(!vg(t)||!vg(n))return t===n;var o=Array.isArray(t),r=Array.isArray(n);if(o!==r)return!1;var i=Object.prototype.toString.call(t)===FO,l=Object.prototype.toString.call(n)===FO;if(i!==l)return!1;if(!i&&!o)return t===n;var u=Object.keys(t),f=Object.keys(n);if(u.length!==f.length)return!1;for(var m={},p=0;p<u.length;p+=1)m[u[p]]=!0;for(var g=0;g<f.length;g+=1)m[f[g]]=!0;var v=Object.keys(m);if(v.length!==u.length)return!1;var x=t,b=n,S=function(E){return e(x[E],b[E])};return v.every(S)},Rge=function(t,n,o){return vg(t)?Object.keys(t).reduce(function(r,i){var l=!vg(n)||!Ege(t[i],n[i]);return o.includes(i)?(l&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),r):l?UO(UO({},r||{}),{},b6({},i,t[i])):r},null):null},AE=q.createContext(null);AE.displayName="ElementsContext";var x6=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t};Lt.any,Lt.object;var jge=function(t){var n=q.useContext(AE);return x6(n,t)},Nge=function(){var t=jge("calls useElements()"),n=t.elements;return n};Lt.func.isRequired;var _6=q.createContext(null);_6.displayName="CheckoutContext";Lt.any,Lt.shape({fetchClientSecret:Lt.func.isRequired,elementsOptions:Lt.object}).isRequired;var qw=function(t){var n=q.useContext(_6),o=q.useContext(AE);if(n){if(o)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return n}else return x6(o,t)},Tge=["mode"],kge=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},jn=function(t,n){var o="".concat(kge(t),"Element"),r=function(f){var m=f.id,p=f.className,g=f.options,v=g===void 0?{}:g,x=f.onBlur,b=f.onFocus,S=f.onReady,C=f.onChange,E=f.onEscape,j=f.onClick,N=f.onLoadError,T=f.onLoaderStart,k=f.onNetworksChange,A=f.onConfirm,I=f.onCancel,P=f.onShippingAddressChange,L=f.onShippingRateChange,V=f.onSavedPaymentMethodRemove,ie=f.onSavedPaymentMethodUpdate,se=qw("mounts <".concat(o,">")),ue="elements"in se?se.elements:null,le="checkoutState"in se?se.checkoutState:null,ce=le?.type==="success"?le.checkout:null,M=q.useState(null),K=bge(M,2),U=K[0],re=K[1],$=q.useRef(null),H=q.useRef(null);gr(U,"blur",x),gr(U,"focus",b),gr(U,"escape",E),gr(U,"click",j),gr(U,"loaderror",N),gr(U,"loaderstart",T),gr(U,"networkschange",k),gr(U,"confirm",A),gr(U,"cancel",I),gr(U,"shippingaddresschange",P),gr(U,"shippingratechange",L),gr(U,"savedpaymentmethodremove",V),gr(U,"savedpaymentmethodupdate",ie),gr(U,"change",C);var W;S&&(t==="expressCheckout"?W=S:W=function(){S(U)}),gr(U,"ready",W),q.useLayoutEffect(function(){if($.current===null&&H.current!==null&&(ue||ce)){var J=null;if(ce)switch(t){case"payment":J=ce.createPaymentElement(v);break;case"address":if("mode"in v){var ge=v.mode,ye=yge(v,Tge);if(ge==="shipping")J=ce.createShippingAddressElement(ye);else if(ge==="billing")J=ce.createBillingAddressElement(ye);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":J=ce.createExpressCheckoutElement(v);break;case"currencySelector":J=ce.createCurrencySelectorElement();break;case"taxId":J=ce.createTaxIdElement(v);break;default:throw new Error("Invalid Element type ".concat(o,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else ue&&(J=ue.create(t,v));$.current=J,re(J),J&&J.mount(H.current)}},[ue,ce,v]);var B=Cge(v);return q.useEffect(function(){if($.current){var J=Rge(v,B,["paymentRequest"]);J&&"update"in $.current&&$.current.update(J)}},[v,B]),q.useLayoutEffect(function(){return function(){if($.current&&typeof $.current.destroy=="function")try{$.current.destroy(),$.current=null}catch{}}},[]),q.createElement("div",{id:m,className:p,ref:H})},i=function(f){qw("mounts <".concat(o,">"));var m=f.id,p=f.className;return q.createElement("div",{id:m,className:p})},l=n?i:r;return l.propTypes={id:Lt.string,className:Lt.string,onChange:Lt.func,onBlur:Lt.func,onFocus:Lt.func,onReady:Lt.func,onEscape:Lt.func,onClick:Lt.func,onLoadError:Lt.func,onLoaderStart:Lt.func,onNetworksChange:Lt.func,onConfirm:Lt.func,onCancel:Lt.func,onShippingAddressChange:Lt.func,onShippingRateChange:Lt.func,onSavedPaymentMethodRemove:Lt.func,onSavedPaymentMethodUpdate:Lt.func,options:Lt.object},l.displayName=o,l.__elementType=t,l},Nn=typeof window>"u",Oge=q.createContext(null);Oge.displayName="EmbeddedCheckoutProviderContext";var w6=function(){var t=qw("calls useStripe()"),n=t.stripe;return n};jn("auBankAccount",Nn);jn("card",Nn);jn("cardNumber",Nn);jn("cardExpiry",Nn);jn("cardCvc",Nn);jn("fpxBank",Nn);jn("iban",Nn);jn("idealBank",Nn);jn("p24Bank",Nn);jn("epsBank",Nn);var Age=jn("payment",Nn);jn("expressCheckout",Nn);jn("paymentRequestButton",Nn);jn("linkAuthentication",Nn);var Ige=jn("address",Nn);jn("shippingAddress",Nn);jn("paymentMethodMessaging",Nn);jn("affirmMessage",Nn);jn("afterpayClearpayMessage",Nn);jn("taxId",Nn);function $ge({hasExistingBilling:e,onPaymentAdded:t,onSaveStateForBillingRedirect:n}){const{organizationId:o}=Ze({strict:!1}),r=w6(),i=fge(),l=Nge(),[u,f]=_.useState(!1),m=y6(o),p=_.useCallback(()=>{t(!1)},[t]),g=_.useCallback(async v=>{if(v.preventDefault(),!r||!l)return;f(!0),await l.submit(),n?.(!0);const x=await r.confirmSetup({clientSecret:i.clientSecret,elements:l,redirect:"if_required",confirmParams:{return_url:`${window.location.origin}/#/${o}/billing/confirm`}});x.error?(console.error(x.error.message),Ee.error(x.error.message),f(!1),n?.(!1)):x.setupIntent.payment_method&&(m(x.setupIntent.payment_method,t),n?.(!1))},[l,t,n,o,m,r,i.clientSecret]);return c.jsxs("form",{onSubmit:g,className:"max-w-xl",children:[c.jsx(Age,{}),c.jsx(Ige,{options:{mode:"billing"}}),c.jsxs("div",{className:"mt-4 flex gap-8 items-center",children:[c.jsxs(_e,{disabled:!r||!l||u,variant:"submit",className:"rounded-full",children:[c.jsx(as,{})," Add Payment Method"]}),e&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-xs text-gray-600",children:"Your existing payment method will be overwritten."}),c.jsx(_e,{variant:"defaultOutline",type:"button",onClick:p,children:"Cancel"})]})]})]})}var Mge="basil",S6="https://js.stripe.com",Pge="".concat(S6,"/").concat(Mge,"/stripe.js"),Dge=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,zge=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var Uge=function(t){return Dge.test(t)||zge.test(t)},Lge=function(){for(var t=document.querySelectorAll('script[src^="'.concat(S6,'"]')),n=0;n<t.length;n++){var o=t[n];if(Uge(o.src))return o}return null},VO=function(t){var n="",o=document.createElement("script");o.src="".concat(Pge).concat(n);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(o),o},Md=null,tp=null,np=null,Fge=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Vge=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Bge=function(t){return Md!==null?Md:(Md=new Promise(function(n,o){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe){n(window.Stripe);return}try{var r=Lge();if(!(r&&t)){if(!r)r=VO(t);else if(r&&np!==null&&tp!==null){var i;r.removeEventListener("load",np),r.removeEventListener("error",tp),(i=r.parentNode)===null||i===void 0||i.removeChild(r),r=VO(t)}}np=Vge(n,o),tp=Fge(o),r.addEventListener("load",np),r.addEventListener("error",tp)}catch(l){o(l);return}}),Md.catch(function(n){return Md=null,Promise.reject(n)}))},Pd,Hge=function(){return Pd||(Pd=Bge(null).catch(function(t){return Pd=null,Promise.reject(t)}),Pd)};Promise.resolve().then(function(){return Hge()}).catch(function(e){console.warn(e)});async function Gge(e){const{data:t}=await kt.post("/StripeAccount/",e);return t}function qge(){return at({mutationFn:e=>Gge(e)})}async function Kge(e){const{data:t}=await kt.post("/Payment/",{organizationId:e.organizationId});return t}function Zge(){return at({mutationFn:e=>Kge(e)})}function Yge(e){const{enabled:t,existingStripeId:n,organizationId:o}=e,{mutate:r}=qge(),{mutate:i}=Zge(),[l,u]=_.useState(void 0),f=_.useCallback(m=>{u(m.clientSecret)},[]);return _.useEffect(()=>{},[r,t,n,i,f,o]),l}function C6({children:e}){const{organizationId:t}=Ze({strict:!1}),{data:n}=wn(aa(t)),o=Yge({organizationId:t,enabled:!!n,existingStripeId:n?.stripeId});return _.useMemo(()=>({clientSecret:o||"",appearance:{theme:"night"}}),[o]),console.error("No VITE_PUBLIC_STRIPE_KEY is configured for this environment."),c.jsx("div",{className:"mt-20 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"Setting up your billing is currently disabled. Please check back again later."})}function Xge({onPaymentAdded:e,onSaveStateForBillingRedirect:t}){const{organizationId:n}=Ze({strict:!1}),{data:o}=wn(aa(n)),r=o?.billing,i=r?.paymentMethod;return c.jsxs(C6,{children:[c.jsx("div",{className:"mt-2 mb-6",children:!i&&"You currently have no payment method on file. Please fill out the secure form below."}),c.jsx($ge,{hasExistingBilling:!!r,onSaveStateForBillingRedirect:t,onPaymentAdded:e})]})}var vi=(e=>(e.PASS="pass",e.FAIL="fail",e.PENDING="pending",e.ERROR="error",e))(vi||{});function Wge(e){switch(e){case vi.PASS:return"success";case vi.FAIL:case vi.ERROR:return"destructive";case vi.PENDING:default:return"default"}}function Qge(e){switch(e){case vi.PASS:return"READY";case vi.FAIL:case vi.ERROR:case vi.PENDING:default:return e.toUpperCase()}}function Jge(e,t){const n=String(e).padStart(2,"0"),o=String(t%100).padStart(2,"0");return`${n}/${o}`}function E6(e){const{onSaveStateForBillingRedirect:t,onReplacingPaymentMethod:n}=e??{},{organizationId:o}=Ze({strict:!1}),{update:r}=Uf(o),{data:i,refetch:l}=wn(aa(o)),f=i?.billing?.paymentMethod,[m,p]=_.useState(!1),g=_.useCallback(()=>{p(!m),n?.(!m)},[n,m]),v=_.useCallback(x=>{p(!1),n?.(!1),x&&l()},[n,l]);return i?.type==="ENTERPRISE"?c.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your payment methods on this page. Want to explore your solution with Harper more? ",c.jsx(ol,{}),", we would love to talk!"]}):f&&!m?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mt-2",children:[f.brand?.toUpperCase()??"Card"," ending in ",f.last4??"••••",f.expMonth&&f.expYear?c.jsxs(c.Fragment,{children:[" (exp ",Jge(f.expMonth,f.expYear),")"]}):null,f.status?c.jsxs(c.Fragment,{children:[" — ",c.jsx(No,{variant:Wge(f.status),children:Qge(f.status)})]}):null]}),r&&c.jsx("div",{className:"mt-2 mb-6",children:c.jsx(_e,{variant:"defaultOutline",type:"button",onClick:g,children:"Replace Payment Method"})})]}):r?c.jsx(Xge,{onSaveStateForBillingRedirect:t,onPaymentAdded:v}):c.jsx("div",{children:"This org doesn't have a payment method, and you don't have access to add one. Please contact your administrator."})}function Sp(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function cn(e){return e!==void 0&&e>0}function eve({clusterId:e,isPending:t,onGoBackToDetails:n,onSaveStateForBillingRedirect:o,onSubmit:r,organizationId:i,selectedPlan:l}){const{data:u}=wn(aa(i)),f=u?.billing,m=u?.type==="ENTERPRISE",p=m||f?.paymentMethod?.status===vi.PASS,[g,v]=_.useState(!1),x=cn(l?.planLimits?.expirationMonths)&&l.planLimits.expirationMonths<1e3&&l.planLimits.expirationMonths,b=c.jsx(c.Fragment,{children:c.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-3 max-w-xl",children:[c.jsxs(_e,{type:"button",variant:"defaultOutline",className:"rounded-full",disabled:t,onClick:n,children:[c.jsx(Za,{})," Back to Details"]}),c.jsxs(_e,{disabled:t||!p||g,type:"submit",variant:"submit",className:"rounded-full",onClick:r,children:[e?"Edit Cluster":"Create New Cluster"," ",c.jsx(Yr,{})]})]})});if(m)return c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"list-disc ml-6",children:[c.jsx("li",{children:"Your organization’s enterprise agreement with Harper can adjust the retail price you see on this page."}),c.jsxs("li",{children:["Your account representative can work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",c.jsx(ol,{}),", we are here to help."]})]}),b]});const S=x&&`, or ${Sp(x,"month","months")} elapse`;return c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"list-disc ml-6 mb-6",children:[c.jsx("li",{children:"You will be billed for this cluster today, and will receive a license for the block of usage you've requested."}),e&&c.jsx("li",{children:"If you scale up, you'll be charged for the additional blocks you've purchased now, and your next auto renewal will be for all purchased blocks."}),e&&c.jsx("li",{children:"If you remove a region, that region's usage block will not be used anymore (because it is specific to that region)."}),c.jsxs("li",{children:["When that block is used up",S,", you will be automatically renewed."]}),c.jsx("li",{children:"While refunds are not available, we’d be happy to assist you with troubleshooting."}),c.jsxs("li",{children:["We would love to work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",c.jsx(ol,{}),", we are here to help."]})]}),c.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Payment method:"}),c.jsx(E6,{onSaveStateForBillingRedirect:o,onReplacingPaymentMethod:v}),b]})}const BO=new RegExp(/^\d+/);function tve(e,t){const n=parseInt(e.match(BO)?.[0]||"0",10),o=parseInt(t.match(BO)?.[0]||"0",10);return n===o?0:n>o?1:-1}const HO=["K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","Dc"];function bo(e){let n=e;if(Math.abs(n)<1e3)return String(Math.round(n));let o=-1;const r=10;do n/=1e3,++o;while(Math.round(Math.abs(n)*r)/r>=1e3&&o<HO.length-1);return`${_p(Math.round(n))} ${HO[o]}`}function nve({planLimits:e,resourcesPerInstance:t,selectedRegion:n}){const[o,r]=_.useState(!1),i=_.useCallback(()=>{r(!o)},[o,r]),l=cn(e?.expirationMonths)&&e.expirationMonths<1e3&&e.expirationMonths,u=n?.purchasedBlockMultiplier??1,f=_.useMemo(()=>!e||!t?[]:[cn(e.totalReadCount)&&{label:"Total Reads",value:`${bo(e.totalReadCount*u)} reads`},cn(e.totalReadsBytes)&&{label:"Total Read Transfer",value:`${fi(e.totalReadsBytes*u)}`},cn(e.readsPerMinuteCount)&&{label:"Read Rate",value:`${bo(e.readsPerMinuteCount*60*u)}/min`},cn(e.readsPerMinuteBytes)&&{label:"Read Bandwidth",value:`${fi(e.readsPerMinuteBytes*60*u)}/min`},cn(e.totalWriteCount)&&{label:"Total Writes",value:`${bo(e.totalWriteCount)} reads`},cn(e.totalWritesBytes)&&{label:"Total Write Transfer",value:`${fi(e.totalWritesBytes)}`},cn(e.writesPerMinuteCount)&&{label:"Write Rate",value:`${bo(e.writesPerMinuteCount*60)}/min`},cn(e.writesPerMinuteBytes)&&{label:"Write Bandwidth",value:`${fi(e.writesPerMinuteBytes*60)}/min`},cn(e.totalRealTimeMessageDeliveries)&&{label:"Total Real-Time Messages",value:`${bo(e.totalRealTimeMessageDeliveries*u)} messages`},cn(e.totalRealTimeMessageDeliveryBytes)&&{label:"Total Real-Time Message Transfer",value:`${fi(e.totalRealTimeMessageDeliveryBytes*u)}`},cn(e.realTimeMessageDeliveriesPerMinute)&&{label:"Real-Time Message Rate",value:`${bo(e.realTimeMessageDeliveriesPerMinute*60*u)}/min`},cn(e.realTimeMessageDeliveryBytesPerMinute)&&{label:"Real-Time Message Bandwidth",value:`${fi(e.realTimeMessageDeliveryBytesPerMinute*60*u)}/min`},cn(e.tlsHandshakes)&&{label:"TLS Handshakes",value:`${bo(e.tlsHandshakes*60*u)}`},cn(e.applicationComputeHours)&&{label:"Application Compute Hours",value:`${bo(e.applicationComputeHours*60*u)}`},cn(t?.storageGb)&&{label:"Storage",value:`${fi(t.storageGb*1e9)}`},l&&{label:"Expiration",value:Sp(l,"month","months")}].filter(Ig),[l,e,t,u]);return!e||!t?"":cn(e.totalReadCount)?c.jsxs(ke,{className:"col-span-3 md:col-span-6",children:[c.jsxs(Oe,{children:["Purchasing usage block for ",cn(e.readsPerMinuteCount)?`${bo(e.readsPerMinuteCount*u)} reads/min & `:"",bo(e.totalReadCount*u)," total reads ",cn(e.readsPerMinuteCount)?"in "+(n?.region??"")+" region":"per server",",",c.jsx("br",{className:"hidden sm:block"}),cn(e.writesPerMinuteCount)?` ${bo(e.writesPerMinuteCount)} writes/min & `:" ",bo(e.totalWriteCount)," total writes",l&&`, for ${Sp(l,"month","months")}`,".",c.jsx("br",{className:"block sm:hidden"}),c.jsxs(_e,{type:"button",variant:"link",className:"text-white",onClick:i,children:["Learn More ",o?c.jsx(xI,{}):c.jsx(Yr,{})]})]}),c.jsx(Ie,{children:c.jsxs("dl",{className:Me("divide-y divide-black overflow-hidden transition-[max-height] duration-200 ease-in",o?"max-h-fit":"max-h-0"),children:["This plan licenses Harper for the usage limits below, for the price listed above. The usage license expires ",l&&`in ${Sp(l,"month","months")} or `,"when any usage limit is reached. Usage blocks can be purchased as they are consumed.",f.map((m,p)=>c.jsxs("div",{className:Me("px-4 py-1 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-3",p%2===0&&"bg-gray-700"),children:[c.jsx("dt",{className:"text-sm/6 font-medium text-gray-300",children:m.label}),c.jsx("dd",{className:"mt-1 text-sm/6 sm:col-span-2 sm:mt-0",children:m.value})]},m.label))]})}),c.jsx(Ae,{})]}):"This plan has no usage limits."}function rve({control:e,fieldArray:t,form:n,index:o,regionNameToLatencyToRegion:r,selectedPlan:i}){const l=_.useMemo(()=>Object.keys(r).sort(),[r]),u=n.watch("deploymentDescription")?.startsWith("Dedicated"),f=n.watch(`regionPlans.${o}.regionName`),m=n.watch(`regionPlans.${o}.latencyDescription`),p=_.useMemo(()=>Object.keys(r[f]||{}).sort(tve).reverse(),[r,f]);_.useEffect(function(){if(f&&p?.length&&!p?.includes(m)){const x=m?.split(" ")[0].toLowerCase(),b=p.find(S=>x?S.split(" ")[0].toLowerCase()===x:!0)||p[0];n.setValue(`regionPlans.${o}.latencyDescription`,b),n.trigger()}},[p,n,o,m,f]);const g=_.useCallback(()=>{t?.remove(o),n.trigger()},[t,n,o]);return c.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[c.jsx($e,{control:e,name:`regionPlans.${o}.regionName`,render:({field:v})=>c.jsxs(ke,{className:"flex-1",children:[c.jsxs(Oe,{children:["Region ",t.fields.length>1?o+1:""]}),c.jsx(Ie,{children:c.jsxs(Jr,{onValueChange:x=>{v.onChange(x),n.trigger()},...v,children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Choose Region"})}),c.jsx(no,{children:c.jsx(jo,{children:l.map(x=>c.jsx(Vt,{value:x,children:x},x))})})]})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e,name:`regionPlans.${o}.latencyDescription`,render:({field:v})=>c.jsxs(ke,{className:"flex-1",children:[c.jsxs(Oe,{children:["Estimated ",u?"P95":"P90"," Latency, Distribution"]}),c.jsx(Ie,{children:c.jsxs(Jr,{onValueChange:x=>{v.onChange(x),n.trigger()},...v,disabled:!p?.length,children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Choose Latency Tier"})}),c.jsx(no,{children:c.jsx(jo,{children:p.map(x=>c.jsx(Vt,{value:x,children:x},x))})})]})}),c.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&c.jsx("div",{className:"flex-none mt-6",children:c.jsxs(_e,{type:"button",variant:"destructiveOutline",size:"sm",onClick:g,children:[c.jsx(ls,{})," ",c.jsx("span",{className:"sr-only",children:"Remove"})]})}),c.jsx(nve,{planLimits:i?.planLimits,resourcesPerInstance:i?.resourcesPerInstance,selectedRegion:r[f]?.[m]})]})}function ove({form:e,regionLocations:t,regionNameToLatencyToRegion:n,selectedPlan:o}){const r=e.watch("regionPlans"),i=fP({control:e.control,name:"regionPlans"}),l=_.useMemo(()=>{const f=r.map(m=>n?.[m.regionName]?.[m.latencyDescription]?.region);return t?.find(m=>!f.includes(m.region))},[t,n,r]),u=_.useCallback(()=>{l&&(i.append({regionName:l.region,latencyDescription:l.latencyDescription}),e.trigger())},[e,l,i]);return t?.length?c.jsxs(c.Fragment,{children:[i.fields.map((f,m)=>c.jsx(rve,{control:e.control,fieldArray:i,form:e,index:m,regionNameToLatencyToRegion:n,selectedPlan:o},f.id)),l&&c.jsx("div",{className:"md:col-span-6 col-span-3",children:c.jsxs(_e,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:u,children:[c.jsx(lr,{}),"Add Additional Region Usage"]})})]}):c.jsx("div",{className:"md:col-span-6 col-span-3",children:c.jsx(gS,{className:"mt-0 m-0",title:"No Regions Available",showReturnToHome:!1,error:{message:c.jsxs(c.Fragment,{children:["The deployment type you selected currently has no available regions. Please try a different deployment type, try again later, or ",c.jsx(ol,{}),"."]})}})})}const R6=0,j6=65535;function ive({control:e,fieldArray:t,form:n,index:o}){const r=_.useCallback(()=>{t?.remove(o)},[t,o]);return c.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[c.jsx($e,{control:e,name:`instances.${o}.secure`,render:({field:i})=>c.jsxs(ke,{children:[c.jsxs(Oe,{children:["Instance ",t.fields.length>1?o+1:""]}),c.jsx(Ie,{children:c.jsxs(Jr,{...i,onValueChange:l=>{i.onChange(l),n.trigger()},children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"https://"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(Vt,{value:"true",children:"https://"}),c.jsx(Vt,{value:"false",children:"http://"})]})})]})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e,name:`instances.${o}.fqdn`,render:({field:i})=>c.jsxs(ke,{className:"flex-3",children:[c.jsx(Oe,{children:"Host Name"}),c.jsx(Ie,{children:c.jsx(Le,{...i,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e,name:`instances.${o}.port`,render:({field:i})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"Operations API Port"}),c.jsx(Ie,{children:c.jsx(Le,{...i,type:"number",min:R6,max:j6,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:String(Ic),onChange:l=>{i.onChange(l.target.value?parseInt(l.target.value,10):void 0),n.trigger()}})}),c.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&c.jsx("div",{className:"flex-none mt-6",children:c.jsxs(_e,{type:"button",variant:"destructiveOutline",size:"sm",onClick:r,children:[c.jsx(ls,{})," ",c.jsx("span",{className:"sr-only",children:"Remove"})]})})]})}function sve({form:e}){const t=fP({control:e.control,name:"instances"}),n=_.useCallback(()=>{t.append({secure:"true",fqdn:"",port:Ic})},[t]);return c.jsxs(c.Fragment,{children:[t.fields.map((o,r)=>c.jsx(ive,{control:e.control,fieldArray:t,form:e,index:r},o.id)),c.jsx("div",{className:"md:col-span-6 col-span-3",children:c.jsxs(_e,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:n,children:[c.jsx(lr,{}),"Add Instance"]})})]})}const GO=/(^$|^(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,})$)/i,yg=Pn({systemName:vt().nonempty("Please enter a system name.").max(255,"System name cannot be longer than 255 characters long."),abbreviatedName:vt().max(20,"Must be at most 20 characters long.").regex(/^[a-zA-Z0-9-]*$/,"Can only contain letters, numbers and dashes"),fqdn:vt().regex(GO,"Please enter a valid host name without the port or any path.").optional(),deploymentDescription:vt().nonempty("Please select a deployment tier."),performanceDescription:vt().nonempty("Please select a performance tier."),regionPlans:Qc(Pn({regionName:vt().nonempty("Please select a region."),latencyDescription:vt().nonempty("Please select a latency tier.")})).max(50,{error:"A maximum of 50 regions can be selected for each cluster. "}),instances:Qc(Pn({secure:Jc(["true","false"]),fqdn:vt().nonempty("Please enter the host name of your instance.").regex(GO,"Please enter a valid host name without the port or any path."),port:TC().min(R6,"Positive thinking only, please.").max(j6,"That port number is too high.").optional()})).max(100,{error:"A maximum of 100 instances can be added to each cluster."})}),qO={Colocated:"Shared infrastructure for optimized value",Dedicated:"Dedicated infrastructure for consistent performance","Self-Hosted":"Your own infrastructure"};function ave({calculatedNames:e,clusterId:t,deploymentToPerformanceToPlan:n,form:o,isPending:r,regionLocations:i,regionNameToLatencyToRegion:l,selectedDeployment:u,selectedPerformance:f,selectedPlan:m,totalPrice:p}){const{isDirty:g,isValid:v}=WS(),x=_.useMemo(()=>Object.keys(n[u]||{}).map(C=>{const E=C.slice(0,-1).split("(");if(E.length>1)return{performanceTier:C,name:E[0],description:E[1]};const j=C.split(" for ");return j.length>1?{performanceTier:C,name:j[0],description:"For "+j[1]}:{performanceTier:C,name:C,description:""}}),[n,u]),b=_.useMemo(()=>Object.keys(n).sort(),[n]);_.useEffect(function(){x?.length&&!x.find(E=>E.performanceTier===f)&&(o.setValue("performanceDescription",x[0].performanceTier),o.trigger())},[u,f,x,o]);const S=u==="Self-Hosted";return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-3 gap-6 text-white md:grid-cols-6",children:[c.jsx($e,{control:o.control,name:"systemName",render:({field:C})=>c.jsxs(ke,{className:"col-span-3 md:col-span-6",children:[c.jsx(Oe,{className:"pb-1",children:"Harper System Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",maxLength:yg.shape.systemName.maxLength,autoCapitalize:"words",disabled:!!t,...C})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:o.control,name:"deploymentDescription",render:({field:C})=>c.jsxs(ke,{className:"col-span-3",children:[c.jsx(Oe,{className:"pb-1",children:"Harper Deployment"}),c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Ie,{children:c.jsxs(Jr,{...C,disabled:!!t,onValueChange:E=>{C.onChange(E),o.trigger()},children:[c.jsx(to,{className:"w-full h-auto",children:c.jsx(eo,{placeholder:"Choose Tier"})}),c.jsx(no,{children:c.jsx(jo,{children:b.map(E=>c.jsxs(Vt,{value:E,children:[c.jsx("dt",{className:"text-left font-bold text-sm/6",children:E}),qO[E]&&c.jsx("dd",{className:"font-light",children:qO[E]})]},E))})})]})})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:o.control,name:"performanceDescription",render:({field:C})=>c.jsxs(ke,{className:"col-span-3",children:[c.jsxs(Oe,{className:"pb-1",children:[u.startsWith("Self")?"Support":"Performance"," & Usage"]}),c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Ie,{children:c.jsxs(Jr,{...C,onValueChange:E=>{C.onChange(E),o.trigger()},disabled:!x?.length,children:[c.jsx(to,{className:"w-full h-auto",children:c.jsx(eo,{placeholder:"Choose Tier"})}),c.jsx(no,{children:c.jsx(jo,{children:x.map(E=>c.jsxs(Vt,{value:E.performanceTier,children:[c.jsx("dt",{className:"text-left font-bold text-sm/6",children:E.name}),E.description&&c.jsx("dd",{className:"font-light",children:E.description})]},E.name))})})]})})}),c.jsx(Ae,{})]})}),S?c.jsx(c.Fragment,{children:c.jsx($e,{control:o.control,name:"fqdn",render:({field:C})=>c.jsxs(ke,{className:"md:col-span-6 col-span-3",children:[c.jsx(Oe,{className:"pb-1",children:"Optional Cluster Load Balancer Host Name"}),c.jsx(Ie,{children:c.jsx(Le,{...C,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"example.your-company.com",disabled:!!t})}),c.jsx(Ae,{})]})})}):c.jsxs(c.Fragment,{children:[c.jsx($e,{control:o.control,name:"abbreviatedName",render:({field:C})=>c.jsxs(ke,{className:"col-span-3",children:[c.jsx(Oe,{className:"pb-1",children:"Host Name"}),c.jsx(Ie,{children:c.jsx(Le,{...C,type:"text",maxLength:yg.shape.abbreviatedName.maxLength,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:e.suggestedAbbreviatedName,disabled:!!t})}),c.jsx(Ae,{})]})}),c.jsxs(ke,{className:"col-span-3 ",children:[c.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),c.jsx(Ie,{children:c.jsx("span",{children:e.fullHostName})}),c.jsx(Ae,{})]})]}),S?c.jsx(sve,{form:o}):c.jsx(ove,{form:o,regionLocations:i,regionNameToLatencyToRegion:l,selectedPlan:m})]}),c.jsx(tr,{className:"mt-3 mb-12",children:c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",disabled:r||!g||!v,children:[p>0?"Confirm Payment Details":t?"Edit Cluster":"Create New Cluster",c.jsx(Yr,{})]})})]})}function lve(e){let{secure:t,fqdn:n,port:o}=e;return o||(o=Ic),n==="127.0.0.1"&&(n="localhost"),o===443&&t==="false"&&(t="true"),o===80&&t==="true"&&(t="false"),`${t==="true"?"https":"http"}://${n}${o===443||o===80?"":":"+o}`.toLowerCase()}function N6(e,t){const n=e.find(r=>!r.priceUsd&&r.deploymentType==="colocated")||e.find(r=>r.deploymentType==="colocated")||e[0],o=n?.allowedRegionIds;if(n){const r=o?t.filter(l=>o.includes(l.id)):t,i=r.find(l=>l.region==="Global")||r[0];if(i)return{deploymentDescription:n.deploymentDescription,performanceDescription:n.performanceDescription,regionPlans:[{regionName:i.region,latencyDescription:i.latencyDescription}]}}return null}function cve(e,t,n){if(t&&n){const o=e.getValues();if(!o.deploymentDescription||!o.performanceDescription||!o.regionPlans.length){const r=N6(t,n);r&&(!o.deploymentDescription&&!o.performanceDescription&&(e.setValue("deploymentDescription",r.deploymentDescription),e.setValue("performanceDescription",r.performanceDescription)),o.regionPlans.length||e.setValue("regionPlans",r.regionPlans))}}}function uve({price:e}){const n=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).formatToParts(e||0);return c.jsx("span",{className:"text-4xl",children:n.map((o,r)=>c.jsx(dve,{type:o.type,value:o.value},r))})}function dve({type:e,value:t}){switch(e){case"currency":case"decimal":case"fraction":return c.jsx("sup",{className:"font-light text-xl",children:t});default:return t}}function T6(e,t){if(t<=0)return"";if(e.length<=t)return e;const n=e.split("-");if(n.length===1)return n[0].slice(0,t);const o=[n[0],...n.slice(1).map(f=>f.charAt(0))],r=o.join("-");if(r.length<=t)return r;const i=o.slice(1).join("").length,l=o.length-1,u=t-i-l;if(u>0)return o[0]=o[0].slice(0,u),o.join("-");{const f=[];let m=0;t>0&&(f.push(n[0].charAt(0)),m=1);for(let p=1;p<o.length&&m+2<=t;p++)f.push(o[p]),m+=2;return f.join("-")}}function fve(e,t,n="-"){const o=t.split(n)[0];return e.findIndex(r=>r.startsWith(o))!==-1}function k6(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function mve({clusterId:e,defaultValues:t,deploymentToPerformanceToPlan:n,organization:o,organizationId:r,planTypes:i,regionLocations:l,regionNameToLatencyToRegion:u,setOnlyShowAvailableHosts:f,setSavedClusterState:m,startOffOnBilling:p}){const g=pn(),v=Xo(),{mutate:x,isPending:b}=sge(),{mutate:S,isPending:C}=lge(),[E,j]=_.useState(p),N=_.useCallback((W,B)=>{const J=new Set,ge=n?.[W.deploymentDescription]?.[W.performanceDescription];if(W.deploymentDescription==="Self-Hosted")for(let ae=0;ae<W.instances.length;ae++){const fe=lve(W.instances[ae]);J.has(fe)?B.addIssue({code:"custom",path:[`instances.${ae}.fqdn`],message:"Every instance url must be unique!"}):J.add(fe)}else for(let ae=0;ae<W.regionPlans.length;ae++){const fe=W.regionPlans[ae],ze=u[fe.regionName]?.[fe.latencyDescription];J.has(fe.regionName)?B.addIssue({code:"custom",path:[`regionPlans.${ae}.regionName`],message:"You can only select a region once!"}):J.add(fe.regionName),ge?.allowedRegionIds?.length&&ze?.id&&!ge.allowedRegionIds.includes(ze.id)&&(fve(ge.allowedRegionIds,ze.id)?B.addIssue({code:"custom",path:[`regionPlans.${ae}.latencyDescription`],message:"This latency is not available with the selected performance tier!"}):B.addIssue({code:"custom",path:[`regionPlans.${ae}.regionName`],message:"This region is not available with the selected performance tier!"}))}},[n,u]),T=gn({mode:"onChange",resolver:yn(yg.superRefine(N)),defaultValues:t}),[k,A]=_.useState(!0);_.useEffect(()=>{k&&t&&(m(null),A(!1))},[t,k,m]);const I=T.watch("systemName"),P=T.watch("abbreviatedName"),L=T.watch("deploymentDescription"),V=T.watch("performanceDescription"),ie=T.watch("regionPlans"),se=T.watch("instances");_.useEffect(function(){f(L!=="Dedicated")},[r,L,f]),_.useEffect(function(){const B=T.getValues(),J=L==="Self-Hosted";L&&(J?(B.abbreviatedName&&T.setValue("abbreviatedName",""),B.regionPlans.length&&T.setValue("regionPlans",[]),B.instances.length||T.setValue("instances",[{secure:"true",fqdn:"",port:Ic}])):(B.fqdn&&T.setValue("fqdn",""),B.instances.length&&T.setValue("instances",[]),B.regionPlans.length||cve(T,i,l)))},[T,i,l,L]);const ue=_.useMemo(()=>{const W=T6(k6(I),yg.shape.abbreviatedName.maxLength);return{suggestedAbbreviatedName:W,fullHostName:`${P||W}.${o.subdomain||"your-org"}.harperfabric.com`}},[I,P,o]),le=_.useMemo(()=>n?.[L]?.[V],[n,L,V]);_.useEffect(function(){const B=le?.allowedRegionIds;if(B?.length&&ie?.length===1){const J=ie[0],ge=u?.[J.regionName]?.[J.latencyDescription];if(!B.includes(ge?.id)){const ye=l?.filter(fe=>B.includes(fe.id)),ae=ye?.find(fe=>fe.region==="Global")||ye?.[0];ae&&(T.setValue("regionPlans.0.regionName",ae.region),T.setValue("regionPlans.0.latencyDescription",ae.latencyDescription),T.trigger())}}},[le,ie,T,u,l]),_.useEffect(function(){if(!(L==="Self-Hosted")&&Object.keys(u).length&&ie.length)for(let J=0;J<ie.length;J++){const ge=ie[J];u[ge.regionName]||T.setValue(`regionPlans.${J}.regionName`,"")}},[T,u,L,ie]);const ce=le?.priceUsd?L==="Self-Hosted"?se.length*le.priceUsd:ie.reduce((W,B)=>{const J=u?.[B.regionName]?.[B.latencyDescription];return W+(J?le.priceUsd*J.instanceCount/2:0)},0):0,M=_.useCallback(({creating:W,deploymentDescription:B})=>Ee.message(W?"Creating Cluster":"Updating Cluster",{description:c.jsx(oge,{message:"This may take a little bit, hold tight!",lateMessage:"Still working on it... why don't you grab a coffee, and I'll let you know when it's done?",duration:B==="Dedicated"?6e4:5e3}),duration:12e4}),[]),K=_.useCallback(({creating:W,toastId:B,isSelfManaged:J})=>{v.invalidateQueries({queryKey:[Cn.organization],refetchType:"active"}),g({to:W?"../":"../../"}),Ee.success(W?"Cluster Created":"Cluster Updated",{id:B,description:J?void 0:W?"It is being provisioned now.":"The updates are being provisioned now.",duration:5e3})},[g,v]),U=_.useCallback(async()=>{const W=T.getValues(),B=[],J=n[W.deploymentDescription][W.performanceDescription],ge=W.deploymentDescription==="Self-Hosted";if(ge)for(const fe of W.instances)B.push({autoRenew:!0,instanceFqdn:fe.fqdn,operationsApiPort:fe.port||Ic,operationsApiSecure:fe.secure==="true",planId:J.id});else for(const fe of W.regionPlans){const ze=u[fe.regionName][fe.latencyDescription];B.push({autoRenew:!0,planId:J.id,regionId:ze.id})}m(null);const ye=M({creating:!e,deploymentDescription:W.deploymentDescription}),ae=()=>Ee.dismiss(ye);e?S({id:e,regionPlans:B},{onSuccess:()=>K({isSelfManaged:ge,creating:!1,toastId:ye}),onError:ae}):x({abbreviatedName:ge?void 0:W.abbreviatedName||ue.suggestedAbbreviatedName,autoRenew:!0,fqdn:ge&&W.fqdn||void 0,name:W.systemName,organizationId:r,regionPlans:B},{onSuccess:()=>K({isSelfManaged:ge,creating:!0,toastId:ye}),onError:ae})},[ue.suggestedAbbreviatedName,e,n,T,K,M,r,u,m,S,x]),re=_.useCallback(()=>{if(ce>0){j(!0);return}return U()},[U,ce]),$=_.useCallback(W=>{m(W?{clusterId:e,...T.getValues()}:null)},[e,T,m]),H=_.useCallback(()=>{j(!1)},[]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"absolute top-3 right-12 text-right",children:[c.jsx("dt",{className:"font-light",children:"Total Price"}),c.jsx("dd",{className:"font-bold",children:c.jsx(uve,{price:ce})})]}),c.jsx(vn,{...T,children:E?c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Billing"}),c.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:"Please confirm the following billing details:"}),c.jsx(eve,{clusterId:e,isPending:b||C,onGoBackToDetails:H,onSaveStateForBillingRedirect:$,onSubmit:U,organizationId:r,selectedPlan:le})]}):c.jsxs(c.Fragment,{children:[c.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Configuration"}),c.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Configure your Harper system and define deployment plans."}),c.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"System"}),c.jsx("form",{onSubmit:T.handleSubmit(re),children:c.jsx(ave,{calculatedNames:ue,clusterId:e,deploymentToPerformanceToPlan:n,form:T,isPending:b||C,regionLocations:l,regionNameToLatencyToRegion:u,selectedDeployment:L,selectedPerformance:V,selectedPlan:le,totalPrice:ce})})]})})]})}var IE=(e=>(e.SavedClusterState="SavedClusterState",e))(IE||{});function O6(e,t){const n=TL(localStorage.getItem(e)),o=_.useState(n??t),[r]=o;return _.useEffect(()=>{r==null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(r))},[e,r]),o}function KO(e){return(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1}function ZO(e,t,n){const o=g6(e,t),r={};for(const i in o)r[i]=Pv(o[i],n);return r}function A6(){const{organizationId:e,clusterId:t}=Ze({strict:!1}),[n,o]=_.useState(!0),[r,i]=O6(IE.SavedClusterState,null),{data:l}=wn(Vf(t)),{data:u}=wn(aa(e)),{data:f}=wn(nge(e)),{data:m}=wn($O({availableHosts:!0,organizationId:e})),{data:p}=wn($O({organizationId:e})),g=n?m:p,v=_.useMemo(()=>ZO(f?.sort(KO("priceUsd"))||[],"deploymentDescription","performanceDescription"),[f]),x=_.useMemo(()=>ZO(g?.sort(KO("latencyDescription"))||[],"region","latencyDescription"),[g]),b=_.useMemo(()=>{if(r)return r;if(!f||!m||!p||t&&!l)return null;const C=f?.find(A=>A.id===l?.plans?.[0].planId),E=[],j=[],N=n?m:p,T=N6(f,N);let k=!1;if(f&&N)if(l){if(l.plans){for(const A of l.plans)if(A.regionId){const I=N.find(P=>P.id===A.regionId);I&&E.push({regionName:I.region,latencyDescription:I.latencyDescription})}}if(!E.length&&l.instances)for(const A of l.instances)k=!0,j.push({fqdn:A.instanceFqdn,port:A.operationsApiPort,secure:A.operationsApiSecure?"true":"false"})}else T&&E.push(...T.regionPlans);return!k&&!E.length&&E.push({regionName:"",latencyDescription:""}),{autoRenew:l?.plans?.[0]?.autoRenew??!0,systemName:l?.name??"",abbreviatedName:l?.abbreviatedName??"",deploymentDescription:C?.deploymentDescription??T?.deploymentDescription??"",performanceDescription:C?.performanceDescription??T?.performanceDescription??"",fqdn:k?l?.fqdn??"":"",instances:j,regionPlans:E}},[l,t,n,f,p,m,r]);return!b||!u||!f||!g?c.jsx(w_,{children:c.jsx($r,{centered:!0,text:"Loading..."})}):f.length===0?c.jsx(w_,{children:c.jsx(gS,{title:`Cluster ${t?"Modification":"Creation"} Not Currently Allowed`,error:{message:c.jsxs(c.Fragment,{children:["There are no available deployment types right now! Please try again later, or ",c.jsx(ol,{}),"."]})}})}):c.jsx(w_,{children:c.jsx(mve,{clusterId:t,defaultValues:b,deploymentToPerformanceToPlan:v,organization:u,organizationId:e,planTypes:f,regionLocations:g,regionNameToLatencyToRegion:x,setOnlyShowAvailableHosts:o,setSavedClusterState:i,startOffOnBilling:!!r})})}function hve(){return"/#"+ZU()}function pve(){const{organizationId:e}=Ze({strict:!1}),t=pn(),o=new URLSearchParams(window.location.search).get("setup_intent_client_secret"),{setup_intent_client_secret:r}=Ri({strict:!1}),[i]=O6(IE.SavedClusterState,null),l=o||r,u=w6(),f=y6(e),m=_.useCallback(()=>{const p=i?i.clusterId?`../../${i.clusterId}/edit`:"../../new-cluster":"../";window.history.replaceState(null,"",hve()),t({search:void 0,to:p})},[t,i]);return _.useEffect(()=>{!u||!l||!f||!e||!m||(async function(){try{const{setupIntent:p}=await u.retrieveSetupIntent(l);switch(p?.status){case"succeeded":p.payment_method!==null?f(p.payment_method,m):(Ee.error("Failed to process payment method details. Please try another payment method."),m());break;case"processing":Ee.warning("Processing payment method. Please check back later."),m();break;case"requires_payment_method":Ee.error("Failed to process payment method details. Please try another payment method."),m();break;default:Ee.error("Failed to process payment method details. Please try another payment method."),m();break}}catch(p){console.error(p),Ee.error("Failed to process payment method details. Please try another payment method."),m()}})()},[l,m,e,f,u]),c.jsx($r,{centered:!0})}function gve(){return c.jsx(C6,{children:c.jsx(pve,{})})}const Jd="flex items-center p-2 rounded-lg group",bg={className:"text-white hover:bg-gray-700"},xg={className:"text-black bg-white pointer-events-none cursor-default"};function vve(){const{organizationId:e}=Ze({strict:!1}),{update:t}=Uf(e);return t?c.jsxs(c.Fragment,{children:[c.jsx(gl,{}),c.jsx("div",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))] mb-12",children:[c.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[c.jsx(yve,{}),c.jsx(bve,{})]}),c.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:c.jsx(ss,{})})]})})]}):c.jsx("div",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"You don't have access to manage payments for this organization. Please contact your administrator."})}function yve(){const e=Ze({strict:!1});return c.jsxs("div",{className:"hidden md:block",children:[c.jsxs("span",{className:Jd,children:[c.jsx(zG,{className:"inline-block"}),c.jsx("h3",{className:"ms-3 text-2xl font-extrabold dark:text-white",children:"Billing"})]}),c.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"billing"),className:Jd,activeOptions:{exact:!0},inactiveProps:bg,activeProps:xg,children:[c.jsx(CI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"billing/invoices"),className:Jd,inactiveProps:bg,activeProps:xg,children:[c.jsx(kI,{className:"inline-block"}),c.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})]})}function bve(){const e=Ze({strict:!1});return c.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"billing"),className:Jd,activeOptions:{exact:!0},inactiveProps:bg,activeProps:xg,children:[c.jsx(CI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),c.jsx("li",{children:c.jsxs(Ue,{to:mn(e,"billing/invoices"),className:Jd,inactiveProps:bg,activeProps:xg,children:[c.jsx(kI,{className:"inline-block"})," ",c.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})}function xve(e){switch(e){case"paid":return"success";case"void":case"uncollectible":return"destructive";case"draft":case"open":default:return"default"}}function R_(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e)}const _ve=[{header:"Invoice Id",accessorKey:"id",enableSorting:!1},{header:"Status",accessorKey:"status",enableSorting:!1,cell:({cell:e})=>c.jsx(No,{variant:xve(e.getValue()),children:e.getValue()})},{header:"Date",accessorKey:"periodStart",enableSorting:!1,cell:({cell:e})=>{const t=e.row.original.periodStart*1e3,n=e.row.original.periodEnd*1e3,o=(Date.now()-t)/1e3,r=(Date.now()-n)/1e3;return Math.abs(o-r)<1e3?Hs(o,t):[t?Hs(o,t):"-",n?Hs(r,n):"-"].join(" to ")}},{header:"Amount Due",accessorKey:"amountDue",enableSorting:!1,cell:({cell:e})=>R_(e.getValue()?e.getValue()/100:0)},{header:"Amount Paid",accessorKey:"amountPaid",enableSorting:!1,cell:({cell:e})=>R_(e.getValue()?e.getValue()/100:0)},{header:"Lines",accessorKey:"lines",enableSorting:!1,cell:({cell:e})=>{const t=e.getValue(),n=[];for(const o of t)n.push(`${o.quantity}x ${o.description} @ ${R_(o.amount/100)}`);return n.join(`
395
+ `)}}];async function wve(e){const{data:t}=await kt.get(`/Invoice/${e}`);return t}function Sve(e,t){return{queryKey:[Cn.organization,e,"invoices"],queryFn:()=>wve(e),retry:!1,enabled:!!e,refetchInterval:void 0}}function Cve(){const{organizationId:e}=Ze({strict:!1}),{data:t}=wn(aa(e)),{data:n,refetch:o,isLoading:r,isFetching:i,isRefetching:l}=wn(Sve(t?.type!=="ENTERPRISE"&&t?.id)),u=pl(o);return t?.type==="ENTERPRISE"?c.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your invoices on this page. Want to explore your solution with Harper more? ",c.jsx(ol,{}),", we would love to talk!"]}):r?c.jsx($r,{centered:!0}):!n||!n.length?c.jsxs("span",{children:["Your invoices will be shown here once one is available! Want to explore your solution with Harper more? ",c.jsx(ol,{}),", we would love to talk!"]}):c.jsx(sm,{data:n,columns:_ve,children:c.jsxs(_e,{variant:"defaultOutline",onClick:u,accessKey:"r",disabled:i||l,children:[c.jsx(Gs,{}),c.jsxs("span",{className:"hidden lg:inline-block",children:[c.jsx("u",{children:"R"}),"efresh"]})]})})}function Eve(e){const t=et({getParentRoute:()=>e,path:"billing",component:vve}),n=et({getParentRoute:()=>t,path:"/",component:E6}),o=et({getParentRoute:()=>t,path:"invoices",component:Cve}),r=et({getParentRoute:()=>t,path:"confirm",component:gve});return t.addChildren([n,o,r])}async function Rve(e){const{data:t}=await kt.get(`/OrganizationRole/${e}`);return t}function Zv(e){return{queryKey:[Cn.organization,e,Cn.roles],queryFn:()=>Rve(e),retry:!1,refetchInterval:10*1e3}}const jve=Tv(),Nve=[{header:"Role Name",accessorKey:"roleName",enableSorting:!1},jve.display({header:"Users Assigned",enableSorting:!1,id:"userIds",cell:e=>!e.row.original.userIds||e.row.original.userIds.length===0?"No users assigned":e.row.original.userIds.length})],Tve=sr.object({roleName:sr.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:sr.boolean(),deleteOrganization:sr.boolean()});async function kve(e){const{data:t}=await kt.post("/Role/",e);return t}function Ove(){return at({mutationFn:e=>kve(e)})}const YO={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function Ave({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:o}=Ze({strict:!1}),[r,i]=_.useState(!0),[l,u]=_.useState(JSON.stringify(YO,null,2)),{mutate:f,isPending:m}=Ove(),p=gn({resolver:yn(Tve),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),g=_.useCallback(x=>{i(x.length===0)},[i]),v=_.useCallback(async x=>{const b={organizationId:o,name:x.roleName,update:x.updateOrganization,delete:x.deleteOrganization,...JSON.parse(l)};x&&r&&f(b,{onSuccess:()=>{p.reset(),t(),Ee.success("Organization role added successfully!")},onError:S=>{Ee.error(`Failed to add organization role: ${S.message}`)}})},[r,l,f,p,t,o]);return c.jsx(Jn,{onOpenChange:n,open:e,children:c.jsxs(er,{children:[c.jsx(Kn,{children:"Add New Organization Role"}),c.jsx(Io,{children:"Set the new organization role permissions."}),c.jsx(vn,{...p,children:c.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[c.jsx($e,{control:p.control,name:"roleName",render:({field:x})=>c.jsxs(ke,{className:"col-span-2",children:[c.jsx(Oe,{className:"pb-1",children:"Role Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"Developer",className:"",...x})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:p.control,name:"updateOrganization",render:({field:x})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6 ml-2",checked:x.value,onChange:b=>x.onChange(b.target.checked)})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:p.control,name:"deleteOrganization",render:({field:x})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6 ml-2",checked:x.value,onChange:b=>x.onChange(b.target.checked)})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"col-span-2",children:c.jsx(im,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:g,onChange:x=>{x&&u(x)},defaultValue:JSON.stringify(YO,null,2)})}),c.jsx(tr,{className:"col-span-2",children:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx(_e,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:m,children:"Cancel"}),c.jsx(_e,{variant:"submit",className:"rounded-full",disabled:m||!r,children:"Save Changes"})]})})]})})]})})}async function Ive({roleId:e}){const{data:t}=await kt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function $ve(){return at({mutationFn:({roleId:e})=>Ive({roleId:e})})}const Mve=sr.object({roleName:sr.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:sr.boolean(),deleteOrganization:sr.boolean()});async function Pve({roleId:e,updatedRoleInfo:t}){const{data:n}=await kt.put(`/Role/${e}`,t);return n}function Dve(){return at({mutationFn:({roleId:e,updatedRoleInfo:t})=>Pve({roleId:e,updatedRoleInfo:t})})}function zve({organizationId:e,roleId:t}){return{queryKey:[Cn.organization,e,Cn.roles,t],queryFn:()=>Uve(t),refetchInterval:10*1e3}}async function Uve(e){const{data:t}=await kt.get(`/Role/${e}`);return t}const Lve=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>c.jsxs(c.Fragment,{children:[c.jsx(Kn,{children:"Confirm Role Deletion"}),c.jsx(Io,{children:"Are you sure you want to delete this role? This action cannot be undone."}),c.jsxs(tr,{children:[c.jsx(_e,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),c.jsx(_e,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function Fve({data:e,isModalOpen:t,closeModal:n,roleDeleted:o}){const{data:r}=Mn(zve({roleId:e.id,organizationId:e.organizationId})),i=Nf(),l=i.user&&i.user?.roles?.[e.organizationId]?.role===e.roleName,{update:u,remove:f}=yu(e.organizationId),{mutate:m,isPending:p}=Dve(),{mutate:g,isPending:v}=$ve(),[x,b]=_.useState(!1),S=_.useCallback(()=>{g({roleId:e.id},{onSuccess:()=>{Ee.success("Role deleted successfully!"),o(),n()},onError:I=>{Ee.error("Error",{description:`Failed to delete role: ${I instanceof Error?I.message:String(I)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[e.id,g,o,n]),[C,E]=_.useState(!0),[j,N]=_.useState(JSON.stringify({roles:{...r.organization.roles},clusters:{...r.organization.clusters}},null,2)),T=gn({resolver:yn(Mve),defaultValues:{roleName:r.role,updateOrganization:r?.organization.update||!1,deleteOrganization:r?.organization.delete||!1}}),k=_.useCallback(I=>{E(I.length===0)},[E]),A=_.useCallback(async I=>{if(!u)return;const P={...r};P.organizationId=e.organizationId,P.name=I.roleName,P.role=I.roleName,P.organization.roles=JSON.parse(j).roles,P.organization.clusters=JSON.parse(j).clusters,P.organization.update=I.updateOrganization,P.organization.delete=I.deleteOrganization,j&&C&&m({roleId:e.id,updatedRoleInfo:P},{onSuccess:()=>{Ee.success("Role updated successfully!"),n()},onError:L=>{Ee.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[u,r,e.organizationId,e.id,j,C,m,n]);return c.jsx(Jn,{onOpenChange:n,open:t,children:c.jsx(er,{children:x?c.jsx(Lve,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):c.jsxs(c.Fragment,{children:[c.jsxs(Kn,{children:[l||!u?"View":"Edit",' Organization Role "',r.role,'"']}),c.jsx(vn,{...T,children:c.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:T.handleSubmit(A),children:[c.jsx($e,{control:T.control,name:"roleName",render:({field:I})=>c.jsxs(ke,{className:"col-span-2",children:[c.jsx(Oe,{className:"pb-1",children:"Role Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",placeholder:"Developer",className:"",...I,disabled:l||!u,readOnly:l||!u})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:T.control,name:"updateOrganization",render:({field:I})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6 ml-2",disabled:l||!u,readOnly:l||!u,checked:I.value,onChange:P=>I.onChange(P.target.checked)})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:T.control,name:"deleteOrganization",render:({field:I})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),c.jsx(Ie,{children:c.jsx(Le,{type:"checkbox",className:"w-6 ml-2",disabled:l||!u,readOnly:l||!u,checked:I.value,onChange:P=>I.onChange(P.target.checked)})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"col-span-2",children:c.jsx(im,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:k,onChange:I=>{I&&N(I)},options:l||!u?{readOnly:!0}:void 0,defaultValue:j})}),(f||u)&&c.jsx(tr,{className:"col-span-2",children:c.jsxs("div",{className:"flex justify-between w-full",children:[f&&c.jsx(_e,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),u&&c.jsx(_e,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function I6(){const e=pn(),{organizationId:t,orgRoleId:n}=Ze({strict:!1}),{create:o}=yu(t),{data:r,refetch:i,isFetching:l,isRefetching:u}=Mn(Zv(t)),f=_.useMemo(()=>r&&r?.find(N=>N.id===n),[r,n]),m=!!n&&!!f,[p,g]=_.useState(!1),v=_.useCallback(N=>{const T=[n?"..":"",N].filter(Boolean);e({to:T.join("/")})},[n,e]),x=_.useCallback(()=>{i(),g(!1)},[i,g]),b=_.useCallback(()=>{g(!0)},[g]),S=_.useCallback(()=>{i(),g(!1)},[i,g]),C=_.useCallback(N=>{v(N.original.id)},[v]),E=_.useCallback(()=>{v(void 0)},[v]),j=pl(i);return c.jsxs(c.Fragment,{children:[c.jsx(gl,{}),c.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsxs(_.Suspense,{fallback:c.jsx($r,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[c.jsxs(sm,{data:r,columns:Nve,onRowClick:C,children:[c.jsxs(_e,{variant:"defaultOutline",onClick:j,accessKey:"r",disabled:l||u,children:[c.jsx(Gs,{}),c.jsxs("span",{className:"hidden lg:inline-block",children:[c.jsx("u",{children:"R"}),"efresh"]})]}),o&&c.jsxs(_e,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[c.jsx(lr,{}),c.jsxs("span",{children:[c.jsx("u",{children:"A"}),"dd"]})]})]}),o&&c.jsx(Ave,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:g}),m&&c.jsx(Fve,{roleDeleted:x,data:f,isModalOpen:m,closeModal:E})]})})]})}const Vve=Tv(),Bve=[{header:"User Id",accessorKey:"id",enableSorting:!1},{header:"Email",accessorKey:"email",enableSorting:!1},{header:"First Name",accessorKey:"firstname",enableSorting:!1},{header:"Last Name",accessorKey:"lastname",enableSorting:!1},Vve.display({header:"Roles",enableSorting:!1,id:"roles",cell:e=>e.row.original.roles?.map(t=>t.roleName)?.sort()?.join(", ")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],Hve=sr.object({email:sr.email({error:"Please enter a valid email address."}).max(75,{error:"Email cannot be longer than 75 characters."}),roleId:sr.string().nonempty({error:"Please select a role."})});async function Gve(e){const{data:t}=await kt.post("/OrganizationRole/",e);return t}function $6(){return at({mutationFn:e=>Gve(e)})}sr.object({email:sr.email({error:"Please enter a valid email address."}).max(75,{error:"Email cannot be longer than 75 characters."}),roleId:sr.string().nonempty({error:"Please select a role."})});async function qve(e){const{data:t}=await kt.post("/UserInvite/",e);return t}function Kve(){return at({mutationFn:e=>qve(e)})}function Zve({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:o}=Ze({strict:!1}),{data:r}=Mn(Zv(o)),[i,l]=_.useState(!1),u=gn({resolver:yn(Hve),defaultValues:{email:"",roleId:""}}),{mutate:f,isPending:m}=$6(),{mutate:p,isPending:g}=Kve(),v=_.useCallback(async x=>{x&&(i?p:f)(x,{onSuccess:()=>{const b=x.roleId;u.reset(),u.setValue("roleId",b),t(),Ee.success("User invited successfully!"),n(!1),l(!1)},onError:b=>{b?.status===404&&l(!0)}})},[f,u,p,t,n,i]);return c.jsx(Jn,{onOpenChange:()=>{n(!1),l(!1),u.reset()},open:e,children:c.jsx(er,{"aria-describedby":void 0,children:c.jsx(vn,{...u,children:c.jsxs("form",{onSubmit:u.handleSubmit(v),className:"grid gap-4 my-4",children:[c.jsx(Mr,{children:c.jsx(Kn,{children:i?"Invite User":"Add User"})}),c.jsx($e,{control:u.control,name:"email",render:({field:x})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Email"}),c.jsx(Ie,{children:c.jsx(Le,{type:"email",enterKeyHint:"next",autoComplete:"email",...x})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:u.control,name:"roleId",render:({field:x})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Roles"}),c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Ie,{children:c.jsxs(Jr,{...x,onValueChange:b=>x.onChange(b),children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Choose Role"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(hE,{children:"Role"}),r?.map(b=>c.jsx(Vt,{value:b.id,children:b.roleName},b.id))]})})]})})}),c.jsx(Ae,{})]})}),i&&c.jsxs(Io,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[c.jsx(jG,{className:"inline-block size-12 pr-2"}),c.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),c.jsx(tr,{children:c.jsx("div",{className:"flex justify-between w-full",children:c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",disabled:m||g,children:[c.jsx(as,{})," ",i?"Invite User":"Add User"]})})})]})})})})}async function Yve({roleId:e,userId:t}){const{data:n}=await kt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function Xve(){return at({mutationFn:({roleId:e,userId:t})=>Yve({roleId:e,userId:t})})}function Wve({data:e,readOnly:t,canRemove:n,orgRole:o,selectedRoles:r,setChangesMade:i}){const{mutate:l,isPending:u}=$6(),{mutate:f,isPending:m}=Xve(),p=!!r[o.roleName],[g,v]=_.useState(p),[x,b]=NL(p);return _.useEffect(()=>{x!==g&&(x?l({email:e.email,roleId:o.id},{onSuccess:()=>{v(x),i(!0),Ee.success("Role added successfully")}}):f({userId:e.id,roleId:o.id},{onSuccess:()=>{v(x),i(!0),Ee.success("Role removed successfully")}}))},[l,e.email,e.id,x,o.id,f,i,g]),c.jsxs(n0,{className:"flex",children:[c.jsx(Le,{type:"checkbox",className:"w-6",disabled:t||u||m||!n&&x,checked:x,onChange:b}),c.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:o.roleName})]},o.id)}function Qve({closeModal:e,data:t,isModalOpen:n,onUserUpdated:o}){const{organizationId:r}=Ze({strict:!1}),i=Nf(),{update:l,remove:u}=yu(r),f=i.user?.email===t.email,{data:m}=Mn(Zv(r)),p=_.useMemo(()=>t.roles?Pv(t.roles,"roleName"):{},[t]),[g,v]=_.useState(!1);return c.jsx(Jn,{onOpenChange:g?o:e,open:n,children:c.jsxs(er,{className:"sm:max-w-[750px]",children:[c.jsx(Mr,{children:c.jsx(Kn,{children:f?"View Your Roles":l?"Edit User Roles":"View User Roles"})}),!f&&l&&c.jsx(Io,{children:"To remove this user from the organization, uncheck all of the boxes below."}),m.map(x=>c.jsx(Wve,{readOnly:f||!l,canRemove:u,data:t,orgRole:x,selectedRoles:p,setChangesMade:v},x.id))]})})}function Jve(e,t){return e.email>t.email?1:-1}function M6(){const e=pn(),{organizationId:t,orgUserId:n}=Ze({strict:!1}),{update:o}=yu(t),{data:r,refetch:i,isFetching:l,isRefetching:u}=Mn(Zv(t)),f=_.useMemo(()=>{const A={};for(const I of r)if(I.users)for(const P of I.users)A[P.id]||(A[P.id]={...P,roles:[]}),A[P.id].roles.push(I);return Object.values(A).sort(Jve)},[r]),m=_.useMemo(()=>f?.find(A=>A.id===n),[f,n]),p=_.useCallback(A=>{const I=[n?"..":"",A].filter(Boolean);e({to:I.join("/")})},[n,e]),g=!!n&&!!m,[v,x]=_.useState(!1),[b]=_.useState({attribute:"email",descending:!1}),S=_.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=_.useCallback(()=>{x(!0)},[x]),E=_.useCallback(()=>{i(),x(!1)},[i,x]),j=_.useCallback(A=>{p(A.original.id)},[p]),N=_.useCallback(()=>{p(void 0)},[p]),T=_.useCallback(()=>{i(),p(void 0)},[p,i]),k=pl(i);return c.jsxs(c.Fragment,{children:[c.jsx(gl,{}),c.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsxs(_.Suspense,{fallback:c.jsx($r,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[c.jsxs(sm,{data:f,isFetching:l||u,columns:Bve,onRowClick:j,sortingState:S,children:[c.jsxs(_e,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:l||u,children:[c.jsx(Gs,{})," ",c.jsxs("span",{className:"hidden lg:inline-block",children:[c.jsx("u",{children:"R"}),"efresh"]})]}),o&&c.jsxs(_e,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[c.jsx(lr,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"A"}),"dd"]})]})]}),o&&c.jsx(Zve,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:x}),g&&c.jsx(Qve,{closeModal:N,data:m,isModalOpen:g,onUserUpdated:T})]})})]})}function eye({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:o,roleName:r}=e,{remove:i}=Uf(n),l=_.useCallback(()=>{t(e)},[t,e]);return c.jsxs(_f,{className:"relative h-full justify-between",children:[c.jsxs(_g,{children:[c.jsxs(Qw,{className:"flex items-center justify-between",children:[c.jsx("span",{className:"truncate",children:n}),i&&c.jsxs(NE,{children:[c.jsx(TE,{className:"p-4 -m-4 -mr-6 hover:text-white",children:c.jsx(EI,{"aria-label":"Options"})}),c.jsxs(kE,{children:[c.jsx(gg,{className:"text-gray-600 text-xs",children:"Options"}),c.jsx(OE,{}),i&&c.jsx(Fo,{className:"bg-red focus:bg-red/70 focus:text-white",onClick:l,children:"Delete"})]})]})]}),c.jsx(wg,{children:c.jsx("h2",{children:o})})]}),c.jsxs(wf,{className:"flex justify-between",children:[c.jsx(No,{children:r}),c.jsx(Ue,{to:n,className:"text-sm","aria-label":`View ${o}`,title:`View ${o}`,children:c.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",c.jsx(Yr,{className:"inline-block"})]})})]})]})}async function tye(e){const{data:t}=await kt.post("/Organization/",{...e});return t}function nye(){return at({mutationFn:e=>tye(e)})}const rp=Pn({name:vt().nonempty({error:"Please enter a name."}).max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:vt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function rye(){const[e,t]=_.useState(!1),n=gn({resolver:yn(rp),defaultValues:{name:"",subdomain:""}}),o=n.watch("name"),r=n.watch("subdomain"),i=_.useMemo(()=>{const p=T6(k6(o),rp.shape.subdomain.maxLength);return{suggestedSubdomain:p,fullHostName:`future-cluster-names.${r||p}.harperfabric.com`}},[o,r]),{mutate:l,isPending:u}=nye(),f=Xo(),m=_.useCallback(async p=>{l({name:p.name,subdomain:p.subdomain||i.suggestedSubdomain},{onSuccess:()=>{f.invalidateQueries({queryKey:[Cn.user],refetchType:"active"}),Gn.reloadUser(Sn),t(!1)}})},[i.suggestedSubdomain,f,l]);return c.jsxs(Jn,{open:e,onOpenChange:t,children:[c.jsx(ZC,{asChild:!0,children:c.jsxs(_e,{variant:"positive",className:"rounded-full md:w-44 w-full",accessKey:"n",children:[c.jsx(lr,{})," ",c.jsxs("span",{children:[c.jsx("u",{children:"N"}),"ew Organization"]})]})}),c.jsxs(er,{className:"sm:max-w-[525px]",children:[c.jsxs(Mr,{children:[c.jsx(Kn,{children:"Create a New Organization"}),c.jsx(Io,{children:"Create a new organization here."})]}),c.jsx(vn,{...n,children:c.jsxs("form",{onSubmit:n.handleSubmit(m),className:"grid gap-6 text-white",children:[c.jsx($e,{control:n.control,name:"name",render:({field:p})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Name"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",maxLength:rp.shape.name.maxLength,autoCapitalize:"words",...p})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:n.control,name:"subdomain",render:({field:p})=>c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Subdomain"}),c.jsx(Ie,{children:c.jsx(Le,{type:"text",maxLength:rp.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:i.suggestedSubdomain,...p})}),c.jsx(Ae,{})]})}),c.jsxs(ke,{children:[c.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),c.jsx(Ie,{children:c.jsx("span",{children:i.fullHostName})}),c.jsx(Ae,{})]}),c.jsx(tr,{children:c.jsxs(_e,{type:"submit",variant:"submit",className:"rounded-full",disabled:u,children:["Create New Organization ",c.jsx(Yr,{})]})})]})})]})]})}async function oye(e){const{data:t}=await kt.delete(`/Organization/${e}`);return t}function iye(){return at({mutationFn:e=>oye(e)})}function sye(){const e=Xo(),{data:t}=Mn(YH()),{mutate:n,isPending:o}=iye(),[r,i]=_.useState(!1),[l,u]=_.useState(null),[f,m]=_.useState(""),p=_.useMemo(()=>{const b=t?.roles||{},S=Object.values(b);return Object.keys(b).map((E,j)=>({organizationId:E,organizationName:S[j].organizationName,roleName:S[j].role})).filter(v6(["organizationId","organizationName"],f)).sort((E,j)=>(E.organizationName||"")>(j.organizationName||"")?1:-1)||[]},[f,t?.roles]),g=_.useCallback(b=>{m(b.currentTarget.value?.toLowerCase()||"")},[]),v=_.useCallback(b=>{b?.organizationId&&n(b.organizationId,{onSuccess:()=>{Ee.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e.invalidateQueries({queryKey:[Cn.user],refetchType:"active"}),e.invalidateQueries({queryKey:[Cn.organization],refetchType:"active"}),i(!1)},onError:()=>i(!1)})},[n,e,i]),x=_.useCallback(b=>{u(b),i(!0)},[]);return c.jsxs(c.Fragment,{children:[c.jsx(gl,{children:c.jsxs("div",{className:"flex w-full justify-between",children:[c.jsx(Le,{placeholder:"Filter by name",className:"inline-block w-full md:w-64 bg-black border",onChange:g}),c.jsx(rye,{})]})}),c.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:p.map(b=>c.jsx("div",{className:"cols-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:c.jsx(eye,{organizationRole:b,onDeleteOrgModal:x})},b.organizationId))})}),l&&c.jsx(Hv,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:l.organizationName,isModalOpen:r,setIsModalOpen:()=>i(!1),deletionConfirmed:()=>v(l),deletionPending:o})]})}const P6=et({getParentRoute:()=>gv,id:"_orgsLayout"});et({getParentRoute:()=>P6,path:"/",component:sye});const la=et({getParentRoute:()=>P6,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(aa(e.params.organizationId))})}),aye=et({getParentRoute:()=>la,path:"/roles",component:I6}),lye=et({getParentRoute:()=>la,path:"/roles/$orgRoleId",component:I6}),cye=et({getParentRoute:()=>la,path:"/users",component:M6}),uye=et({getParentRoute:()=>la,path:"/users/$orgUserId",component:M6});Eve(la);const D6=et({getParentRoute:()=>la,id:"_clusterLayout"});et({getParentRoute:()=>D6,path:"/",component:ege});et({getParentRoute:()=>la,path:"/new-cluster",component:A6});et({getParentRoute:()=>la,path:"$clusterId/edit",component:A6});const Yv=et({getParentRoute:()=>D6,path:"$clusterId",component:ghe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Vf(t.clusterId))})});et({getParentRoute:()=>Yv,path:"instances",component:jhe});et({getParentRoute:()=>Yv,path:"sign-in",component:FC,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.clusterId]?.user){const o=t?.search;throw il({to:o?.redirect?.startsWith("/")?o.redirect:Jw})}}});et({getParentRoute:()=>Yv,path:"instance/$instanceId/sign-in",component:FC,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.instanceId||n.clusterId]?.user){const o=t?.search;throw il({to:o?.redirect?.startsWith("/")?o.redirect:Jw})}}});et({getParentRoute:()=>Yv,path:"set-password",component:xhe});function dye(){const e=QM(),t=Ze({strict:!1});return c.jsxs("div",{className:"hidden md:flex items-center justify-between h-full text-sm text-white",children:[c.jsx(Zg,{}),c.jsxs("div",{className:"flex space-x-2 *:hover:text-grey",children:[c.jsxs(Ue,{to:mn(t),className:"p-2 text-center",children:[c.jsx($G,{className:"inline-block"}),c.jsx("span",{className:"hidden xl:inline-block ml-1",children:"Applications"}),c.jsx("span",{className:"visible xl:hidden ml-1",children:" Apps"})]}),c.jsxs(Ue,{to:mn(t,"databases"),className:"p-2 text-center",children:[c.jsx(dG,{className:"inline-block"}),c.jsx("span",{className:"hidden xl:inline-block ml-1",children:" Databases"})]}),e&&c.jsxs(c.Fragment,{children:[c.jsxs(Ue,{to:mn(t,"status"),className:"p-2 text-center",children:[c.jsx(gG,{className:"inline-block"}),c.jsx("span",{className:"hidden xl:inline-block ml-1",children:"Status"})]}),c.jsxs(Ue,{to:mn(t,"logs"),className:"p-2 text-center",children:[c.jsx(AG,{className:"inline-block"}),c.jsx("span",{className:"hidden xl:inline-block ml-1",children:"Logs"})]}),c.jsxs(Ue,{to:mn(t,"config"),className:"p-2 text-center",children:[c.jsx(HG,{className:"inline-block"}),c.jsx("span",{className:"hidden xl:inline-block ml-1",children:"Config"})]})]})]})]})}function fye(){const e=QM(),t=Ze({strict:!1});return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"flex md:hidden items-center justify-between p-2 text-white",children:[c.jsx(Zg,{}),c.jsxs(NE,{children:[c.jsx(TE,{asChild:!0,children:c.jsx(_e,{variant:"ghost",className:"p-0",children:c.jsx(TI,{className:"h-8 w-8"})})}),c.jsxs(kE,{children:[c.jsx(gg,{children:"Instance Menu"}),c.jsx(OE,{}),c.jsx(Fo,{asChild:!0,children:c.jsx(Ue,{to:mn(t),children:"Applications"})}),c.jsx(Fo,{asChild:!0,children:c.jsx(Ue,{to:mn(t,"databases"),children:"Databases"})}),e&&c.jsxs(c.Fragment,{children:[c.jsx(Fo,{asChild:!0,children:c.jsx(Ue,{to:mn(t,"status"),children:"Status"})}),c.jsx(Fo,{asChild:!0,children:c.jsx(Ue,{to:mn(t,"config"),children:"Config"})}),c.jsx(Fo,{asChild:!0,children:c.jsx(Ue,{to:mn(t,"logs"),children:"Logs"})})]})]})]})]})})}function mye(){return c.jsxs(c.Fragment,{children:[c.jsx(dye,{}),c.jsx(fye,{})]})}function hye(){const e=Ze({strict:!1}),{isSuccess:t}=Mn(pL(e));if(!t)throw new Error("Instance info not found");return c.jsxs(c.Fragment,{children:[c.jsx("nav",{className:"fixed top-20 w-full z-39 md:px-12 md:py-1 bg-grey-700",children:c.jsx(mye,{})}),c.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:c.jsx(ss,{})})]})}function pye(e){return et({getParentRoute:()=>gv,id:"_instanceLayout",component:hye})}const z6=e=>{switch(e){case"warn":return"warning";case"notify":return"success";case"info":case"debug":case"trace":case void 0:case"stdout":return"secondary";case"stderr":case"error":return"destructive";default:return e}},gye={notify:"Notify",error:"Error",warn:"Warn",info:"Info",debug:"Debug",trace:"Trace",stdout:"Stdout",stderr:"Stderr",undefined:"Unknown"},U6=e=>{const t=gye[e];if(t)return t;throw new Error("Unsupported Status")};function vye({columns:e,data:t,onRowClick:n}){const o=Av({data:t,columns:e,getCoreRowModel:Ov()});return c.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:c.jsxs(Iv,{className:"text-xs",children:[c.jsx($v,{children:o.getHeaderGroups().map(r=>c.jsx(Ro,{className:"border-none",children:r.headers.map(i=>c.jsx(ug,{className:"p-4 max-w-96",children:i.isPlaceholder?null:Js(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),c.jsx(Mv,{className:"bg-black",children:o.getRowModel().rows?.length?o.getRowModel().rows.map(r=>c.jsx(Ro,{"data-state":r.getIsSelected()&&"selected",className:Me("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(r),children:r.getVisibleCells().map(i=>c.jsx(ea,{className:"p-1",children:Js(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):c.jsx(Ro,{children:c.jsx(ea,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}const XO=["secondary","default","warning","outline","success","destructive"];let WO=0;const j_=new Map,L6=e=>{if(j_.has(e))return j_.get(e);WO++;const t=WO%XO.length,n=XO[t];return j_.set(e,n),n};function yye(e){try{JSON.parse(e)}catch{return!1}return!0}function bye({setIsModalOpen:e,isModalOpen:t,data:n}){const o=n?L6(n.node):"default";return c.jsx(Jn,{onOpenChange:e,open:t,children:c.jsxs(er,{"aria-describedby":void 0,children:[c.jsx(Mr,{children:c.jsx(Kn,{children:"Edit Row"})}),n?c.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),c.jsx(No,{variant:z6(n.level),children:U6(n.level)})]}),c.jsxs("div",{children:[c.jsx("h3",{children:"Timestamp:"}),c.jsx("p",{className:"text-sm",children:n.timestamp})]}),c.jsxs("div",{children:[c.jsx("h3",{children:"Thread:"}),c.jsx("p",{className:"text-sm",children:n.thread})]}),c.jsxs("div",{children:[c.jsx("h3",{children:"Node:"}),c.jsx(No,{variant:o,children:n.node})]}),c.jsxs("div",{children:[c.jsx("h3",{children:"Tags:"}),c.jsx("p",{className:"text-sm",children:n.tags&&n.tags.length>0?c.jsx("span",{children:n.tags}):"N/A"})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-bold",children:"Message"}),c.jsx(Nv,{className:"w-full h-72",language:yye(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):c.jsx($r,{}),c.jsx(tr,{children:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsxs(_e,{type:"button",variant:"destructive",className:"rounded-full",children:[c.jsx(ls,{})," Delete Row"]}),c.jsxs(_e,{variant:"submit",className:"rounded-full",children:[c.jsx(as,{})," Save Changes"]})]})})]})})}function xye({entityId:e,instanceClient:t,logFilters:n,replicated:o,isAutoRefreshEnabled:r}){return n.level==="undefined"&&(n.level=void 0),{queryKey:[e,"read_log",n.limit,n.level,n.from,n.until,n.order,o],queryFn:async()=>{const i={...n,limit:n.limit?parseInt(n.limit,10):void 0,from:n.from?new Date(n.from).toISOString():void 0,until:n.until?new Date(n.until).toISOString():void 0},{data:l}=await t.post("/",{operation:"read_log",start:0,replicated:o,...i});return l},retry:!1,refetchInterval:r?5e3:!1}}const _ye=Pn({limit:vt().optional(),level:Jc(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:vt().or(eg()).optional(),until:vt().or(eg()).optional(),order:Jc(["asc","desc"]).optional()});function wye({form:e,resetFilters:t,submitFilters:n}){return c.jsx("div",{children:c.jsx(vn,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[c.jsx($e,{control:e.control,name:"limit",render:({field:o})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"Log Limit:"}),c.jsxs(Jr,{onValueChange:o.onChange,value:o.value,children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Select log limit"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(Vt,{value:"1000",children:"1000"}),c.jsx(Vt,{value:"500",children:"500"}),c.jsx(Vt,{value:"250",children:"250"}),c.jsx(Vt,{value:"100",children:"100"}),c.jsx(Vt,{value:"10",children:"10"})]})})]}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e.control,name:"level",render:({field:o})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"Log Level:"}),c.jsxs(Jr,{onValueChange:o.onChange,value:o.value,children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Select log level"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(Vt,{value:"undefined",children:"All"}),c.jsx(Vt,{value:"notify",children:"Notify"}),c.jsx(Vt,{value:"error",children:"Error"}),c.jsx(Vt,{value:"warn",children:"Warn"}),c.jsx(Vt,{value:"info",children:"Info"}),c.jsx(Vt,{value:"debug",children:"Debug"}),c.jsx(Vt,{value:"trace",children:"Trace"})]})})]}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e.control,name:"from",render:({field:o})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"Start Date:"}),c.jsx(Ie,{children:c.jsx(Le,{type:"datetime-local",value:o.value,onChange:o.onChange})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e.control,name:"until",render:({field:o})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"End Date:"}),c.jsx(Ie,{children:c.jsx(Le,{type:"datetime-local",value:o.value,onChange:o.onChange})}),c.jsx(Ae,{})]})}),c.jsx($e,{control:e.control,name:"order",render:({field:o})=>c.jsxs(ke,{children:[c.jsx(Oe,{children:"Log Order:"}),c.jsxs(Jr,{onValueChange:o.onChange,value:o.value,children:[c.jsx(to,{className:"w-full",children:c.jsx(eo,{placeholder:"Log order"})}),c.jsx(no,{children:c.jsxs(jo,{children:[c.jsx(Vt,{value:"asc",children:"Ascending"}),c.jsx(Vt,{value:"desc",children:"Descending"})]})})]}),c.jsx(Ae,{})]})}),c.jsx(_e,{type:"submit",variant:"positiveOutline",className:"w-full mt-4",children:"Apply Filters"}),c.jsx(_e,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),className:"w-full mt-2",children:"Clear Filters"})]})})})}const Sye=Yw(`inline-flex
396
+ items-center
397
+ justify-center
398
+ gap-2
399
+ whitespace-nowrap
400
+ rounded-lg
401
+ text-sm
402
+ transition-[color,box-shadow]
403
+ disabled:pointer-events-none
404
+ disabled:opacity-50
405
+ [&_svg]:pointer-events-none
406
+ [&_svg:not([class*='size-'])]:size-4
407
+ [&_svg]:shrink-0
408
+ ring-ring/10
409
+ dark:ring-ring/20
410
+ dark:outline-ring/40
411
+ outline-ring/50
412
+ focus-visible:ring-1
413
+ focus-visible:outline-1
414
+ focus-visible:ring-purple-200
415
+ aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var F6="Toggle",V6=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[l,u]=Ci({prop:n,onChange:r,defaultProp:o??!1,caller:F6});return c.jsx(De.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Se(e.onClick,()=>{e.disabled||u(!l)})})});V6.displayName=F6;var Cye=V6;function Eye({className:e,variant:t,size:n,...o}){return c.jsx(Cye,{"data-slot":"toggle",className:Me(Sye({variant:t,size:n,className:e})),...o})}const QO={limit:"100",level:"undefined",from:"",until:"",order:"asc"},Rye=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(No,{variant:z6(t),children:U6(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=L6(t);return c.jsx(c.Fragment,{children:t?c.jsxs(tL,{children:[c.jsx(nL,{asChild:!0,children:c.jsxs(No,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(rL,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),c.jsx("pre",{children:c.jsx("code",{children:t})})}}],jye=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function Nye(){const[e,t]=_.useState({limit:"100",level:"undefined",from:"",until:"",order:"asc"}),[n,o]=_.useState(!1),[r,i]=_.useState(),[l,u]=_.useState(!1),f=dr(),{data:m,isLoading:p,refetch:g,isFetching:v}=wn(xye({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:l})),x=gn({resolver:yn(_ye),defaultValues:QO,mode:"onChange"}),b=j=>{i(j.original),o(!0)},S=async j=>{if(!jye(j.from,j.until)){x.setError("from",{type:"onChange",message:"Start date must be before end date"}),x.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(j)},C=async()=>{x.reset(),t(QO)},E=pl(g);return c.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[c.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3",children:[c.jsx("h2",{className:"pb-6 text-2xl",children:"Log Filters"}),c.jsx(wye,{form:x,resetFilters:C,submitFilters:S})]}),c.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?c.jsx("div",{children:"Loading..."}):c.jsxs("div",{className:"h-32",children:[c.jsxs("div",{className:"flex items-center justify-between md:justify-normal md:space-x-2",children:[c.jsx(_e,{variant:"defaultOutline",onClick:E,disabled:v||p||l,children:c.jsx(Gs,{})}),c.jsxs(Eye,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:u,children:[c.jsx(Gs,{}),"Auto Refresh ",l?"On":"Off"]})]}),c.jsx(vye,{columns:Rye,data:m||[],onRowClick:b})]})}),c.jsx(bye,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function Tye(e){return et({getParentRoute:()=>e,path:"logs",component:Nye})}const kye=new Date(2025,0).getTime(),Oye=1440*60*1e3;function Aye(e){const t=[];for(const n in e){const o=e[n];t.push(...Kw(n,o,0))}return t}function Iye(e){return!!e.title}function Kw(e,t,n,o){if(t&&Array.isArray(t)){const r=t;return t.map((i,l)=>Kw(r.length>1?e+" "+(l+1):e,i,n+1,e)).flat(1)}if($ye(t)){const r=t;return[{title:e,depth:n},...Object.keys(t).map(i=>Kw(String(i),r[i],n+1,e)).flat(1)]}if((e==="__updatedtime__"||e==="__createdtime__")&&(e=e.replace(/_/g,"").replace("time","")),typeof t=="number")if(t>kye&&t<Date.now()+Oye){const r=Date.now()-t;t=Hs(r,t)}else o==="memory"?t=fi(t):!e.startsWith("raw")&&e.toLowerCase().includes("load")&&(t=Math.round(t*10)/10+"%");else typeof t=="boolean"&&(t=t?"Yes":"No");return[{name:e,value:String(t),depth:n}]}function $ye(e){return!!e&&typeof e=="object"}function Mye({data:e}){const t=_.useMemo(()=>Aye(e),[e]);return c.jsx("div",{className:"max-w-96 grid mb-12",children:t.map((n,o)=>Iye(n)?c.jsx("div",{className:Me("font-semibold text-xl",o!==0&&"mt-4"),style:{paddingLeft:n.depth*12+"px"},children:n.title},o):c.jsx(c.Fragment,{children:c.jsxs("div",{style:{paddingLeft:n.depth*12+"px"},children:[c.jsxs("span",{className:"text-muted-foreground",children:[n.name,": "]}),n.value]},o)}))})}function Pye({entityId:e,instanceClient:t}){return{queryKey:[e,"system_information"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"system_information",attributes:["network","disk","cpu","memory","system"]});return n}}}function Dye(){const e=dr(),{data:t}=Mn(Pye(e));return c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx(Mye,{data:t})})}function zye(){return c.jsx(Dye,{})}function Uye(e){return et({getParentRoute:()=>e,path:"status",component:zye})}function Lye(e){const t=pye(),n=[Tye(t),...Wue(t),Uye(t),ame(t),phe(t)];return t.addChildren(n)}et({getParentRoute:()=>gv,path:"profile",component:R9(async()=>zS(()=>import("./index-C5STWiTE.js"),[]),"ProfileIndex")});const Fye=Kg.addChildren([...sse,gv.addChildren([Lye()])]);function Vye(){const e=F9(),t=t8(),n=M9({routeTree:Fye,history:t,defaultNotFoundComponent:QG,defaultErrorComponent:gS,defaultPreload:JG()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:nf,authentication:e}});return c.jsxs(c.Fragment,{children:[c.jsx(z9,{router:n,context:{authentication:e}}),!1]})}const Bye=({...e})=>c.jsx(Rq,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var Hye=function(){return null};function Gye(){return zie(),OJ(),c.jsxs(c.Fragment,{children:[c.jsxs(PH,{client:nf,children:[c.jsx(Vye,{}),c.jsx(Hye,{buttonPosition:"bottom-right"})]}),c.jsx(Bye,{richColors:!0})]})}var N_={exports:{}},Dd={},T_={exports:{}},k_={};/**
416
+ * @license React
417
+ * scheduler.production.js
418
+ *
419
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
420
+ *
421
+ * This source code is licensed under the MIT license found in the
422
+ * LICENSE file in the root directory of this source tree.
423
+ */var JO;function qye(){return JO||(JO=1,(function(e){function t(M,K){var U=M.length;M.push(K);e:for(;0<U;){var re=U-1>>>1,$=M[re];if(0<r($,K))M[re]=K,M[U]=$,U=re;else break e}}function n(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var K=M[0],U=M.pop();if(U!==K){M[0]=U;e:for(var re=0,$=M.length,H=$>>>1;re<H;){var W=2*(re+1)-1,B=M[W],J=W+1,ge=M[J];if(0>r(B,U))J<$&&0>r(ge,B)?(M[re]=ge,M[J]=U,re=J):(M[re]=B,M[W]=U,re=W);else if(J<$&&0>r(ge,U))M[re]=ge,M[J]=U,re=J;else break e}}return K}function r(M,K){var U=M.sortIndex-K.sortIndex;return U!==0?U:M.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],m=[],p=1,g=null,v=3,x=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(M){for(var K=n(m);K!==null;){if(K.callback===null)o(m);else if(K.startTime<=M)o(m),K.sortIndex=K.expirationTime,t(f,K);else break;K=n(m)}}function k(M){if(S=!1,T(M),!b)if(n(f)!==null)b=!0,A||(A=!0,se());else{var K=n(m);K!==null&&ce(k,K.startTime-M)}}var A=!1,I=-1,P=5,L=-1;function V(){return C?!0:!(e.unstable_now()-L<P)}function ie(){if(C=!1,A){var M=e.unstable_now();L=M;var K=!0;try{e:{b=!1,S&&(S=!1,j(I),I=-1),x=!0;var U=v;try{t:{for(T(M),g=n(f);g!==null&&!(g.expirationTime>M&&V());){var re=g.callback;if(typeof re=="function"){g.callback=null,v=g.priorityLevel;var $=re(g.expirationTime<=M);if(M=e.unstable_now(),typeof $=="function"){g.callback=$,T(M),K=!0;break t}g===n(f)&&o(f),T(M)}else o(f);g=n(f)}if(g!==null)K=!0;else{var H=n(m);H!==null&&ce(k,H.startTime-M),K=!1}}break e}finally{g=null,v=U,x=!1}K=void 0}}finally{K?se():A=!1}}}var se;if(typeof N=="function")se=function(){N(ie)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,le=ue.port2;ue.port1.onmessage=ie,se=function(){le.postMessage(null)}}else se=function(){E(ie,0)};function ce(M,K){I=E(function(){M(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var U=v;v=K;try{return M()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=v;v=M;try{return K()}finally{v=U}},e.unstable_scheduleCallback=function(M,K,U){var re=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?re+U:re):U=re,M){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=U+$,M={id:p++,callback:K,priorityLevel:M,startTime:U,expirationTime:$,sortIndex:-1},U>re?(M.sortIndex=U,t(m,M),n(f)===null&&M===n(m)&&(S?(j(I),I=-1):S=!0,ce(k,U-re))):(M.sortIndex=$,t(f,M),b||x||(b=!0,A||(A=!0,se()))),M},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(M){var K=v;return function(){var U=v;v=K;try{return M.apply(this,arguments)}finally{v=U}}}})(k_)),k_}var eA;function Kye(){return eA||(eA=1,T_.exports=qye()),T_.exports}/**
424
+ * @license React
425
+ * react-dom-client.production.js
426
+ *
427
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
428
+ *
429
+ * This source code is licensed under the MIT license found in the
430
+ * LICENSE file in the root directory of this source tree.
431
+ */var tA;function Zye(){if(tA)return Dd;tA=1;var e=Kye(),t=bf(),n=gI();function o(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var a=s,d=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(d=a.return),s=a.return;while(s)}return a.tag===3?d:null}function l(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function u(s){if(i(s)!==s)throw Error(o(188))}function f(s){var a=s.alternate;if(!a){if(a=i(s),a===null)throw Error(o(188));return a!==s?null:s}for(var d=s,h=a;;){var y=d.return;if(y===null)break;var w=y.alternate;if(w===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===d)return u(y),s;if(w===h)return u(y),a;w=w.sibling}throw Error(o(188))}if(d.return!==h.return)d=y,h=w;else{for(var R=!1,O=y.child;O;){if(O===d){R=!0,d=y,h=w;break}if(O===h){R=!0,h=y,d=w;break}O=O.sibling}if(!R){for(O=w.child;O;){if(O===d){R=!0,d=w,h=y;break}if(O===h){R=!0,h=w,d=y;break}O=O.sibling}if(!R)throw Error(o(189))}}if(d.alternate!==h)throw Error(o(190))}if(d.tag!==3)throw Error(o(188));return d.stateNode.current===d?s:a}function m(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s;for(s=s.child;s!==null;){if(a=m(s),a!==null)return a;s=s.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),N=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function se(s){return s===null||typeof s!="object"?null:(s=ie&&s[ie]||s["@@iterator"],typeof s=="function"?s:null)}var ue=Symbol.for("react.client.reference");function le(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===ue?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case C:return"Profiler";case S:return"StrictMode";case k:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case N:return(s.displayName||"Context")+".Provider";case j:return(s._context.displayName||"Context")+".Consumer";case T:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case I:return a=s.displayName||null,a!==null?a:le(s.type)||"Memo";case P:a=s._payload,s=s._init;try{return le(s(a))}catch{}}return null}var ce=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},re=[],$=-1;function H(s){return{current:s}}function W(s){0>$||(s.current=re[$],re[$]=null,$--)}function B(s,a){$++,re[$]=s.current,s.current=a}var J=H(null),ge=H(null),ye=H(null),ae=H(null);function fe(s,a){switch(B(ye,a),B(ge,s),B(J,null),a.nodeType){case 9:case 11:s=(s=a.documentElement)&&(s=s.namespaceURI)?Kj(s):0;break;default:if(s=a.tagName,a=a.namespaceURI)a=Kj(a),s=Zj(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}W(J),B(J,s)}function ze(){W(J),W(ge),W(ye)}function Ve(s){s.memoizedState!==null&&B(ae,s);var a=J.current,d=Zj(a,s.type);a!==d&&(B(ge,s),B(J,d))}function Ye(s){ge.current===s&&(W(J),W(ge)),ae.current===s&&(W(ae),pd._currentValue=U)}var He=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Yt=e.unstable_cancelCallback,Zn=e.unstable_shouldYield,fr=e.unstable_requestPaint,Mt=e.unstable_now,nn=e.unstable_getCurrentPriorityLevel,Pt=e.unstable_ImmediatePriority,z=e.unstable_UserBlockingPriority,X=e.unstable_NormalPriority,oe=e.unstable_LowPriority,ve=e.unstable_IdlePriority,xe=e.log,be=e.unstable_setDisableYieldValue,Re=null,We=null;function ft(s){if(typeof xe=="function"&&be(s),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(Re,s)}catch{}}var Rt=Math.clz32?Math.clz32:ti,Pr=Math.log,Dr=Math.LN2;function ti(s){return s>>>=0,s===0?32:31-(Pr(s)/Dr|0)|0}var ni=256,ri=4194304;function lo(s){var a=s&42;if(a!==0)return a;switch(s&-s){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:case 262144:case 524288:case 1048576:case 2097152:return s&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function oi(s,a,d){var h=s.pendingLanes;if(h===0)return 0;var y=0,w=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var O=h&134217727;return O!==0?(h=O&~w,h!==0?y=lo(h):(R&=O,R!==0?y=lo(R):d||(d=O&~s,d!==0&&(y=lo(d))))):(O=h&~w,O!==0?y=lo(O):R!==0?y=lo(R):d||(d=h&~s,d!==0&&(y=lo(d)))),y===0?0:a!==0&&a!==y&&(a&w)===0&&(w=y&-y,d=a&-a,w>=d||w===32&&(d&4194048)!==0)?a:y}function Ti(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function cs(s,a){switch(s){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Mo(){var s=ni;return ni<<=1,(ni&4194048)===0&&(ni=256),s}function um(){var s=ri;return ri<<=1,(ri&62914560)===0&&(ri=4194304),s}function Eu(s){for(var a=[],d=0;31>d;d++)a.push(s);return a}function us(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function dm(s,a,d,h,y,w){var R=s.pendingLanes;s.pendingLanes=d,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=d,s.entangledLanes&=d,s.errorRecoveryDisabledLanes&=d,s.shellSuspendCounter=0;var O=s.entanglements,D=s.expirationTimes,Q=s.hiddenUpdates;for(d=R&~d;0<d;){var de=31-Rt(d),he=1<<de;O[de]=0,D[de]=-1;var ee=Q[de];if(ee!==null)for(Q[de]=null,de=0;de<ee.length;de++){var te=ee[de];te!==null&&(te.lane&=-536870913)}d&=~he}h!==0&&Qe(s,h,0),w!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=w&~(R&~a))}function Qe(s,a,d){s.pendingLanes|=a,s.suspendedLanes&=~a;var h=31-Rt(a);s.entangledLanes|=a,s.entanglements[h]=s.entanglements[h]|1073741824|d&4194090}function rn(s,a){var d=s.entangledLanes|=a;for(s=s.entanglements;d;){var h=31-Rt(d),y=1<<h;y&a|s[h]&a&&(s[h]|=a),d&=~y}}function bn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Yn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ca(){var s=K.p;return s!==0?s:(s=window.event,s===void 0?32:mN(s.type))}function Tn(s,a){var d=K.p;try{return K.p=s,a()}finally{K.p=d}}var on=Math.random().toString(36).slice(2),sn="__reactFiber$"+on,Dt="__reactProps$"+on,zn="__reactContainer$"+on,bl="__reactEvents$"+on,ki="__reactListeners$"+on,$E="__reactHandles$"+on,ME="__reactResources$"+on,Ru="__reactMarker$"+on;function Xv(s){delete s[sn],delete s[Dt],delete s[bl],delete s[ki],delete s[$E]}function xl(s){var a=s[sn];if(a)return a;for(var d=s.parentNode;d;){if(a=d[zn]||d[sn]){if(d=a.alternate,a.child!==null||d!==null&&d.child!==null)for(s=Qj(s);s!==null;){if(d=s[sn])return d;s=Qj(s)}return a}s=d,d=s.parentNode}return null}function _l(s){if(s=s[sn]||s[zn]){var a=s.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return s}return null}function ju(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(o(33))}function wl(s){var a=s[ME];return a||(a=s[ME]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Un(s){s[Ru]=!0}var PE=new Set,DE={};function ua(s,a){Sl(s,a),Sl(s+"Capture",a)}function Sl(s,a){for(DE[s]=a,s=0;s<a.length;s++)PE.add(a[s])}var B6=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]*$"),zE={},UE={};function H6(s){return He.call(UE,s)?!0:He.call(zE,s)?!1:B6.test(s)?UE[s]=!0:(zE[s]=!0,!1)}function fm(s,a,d){if(H6(a))if(d===null)s.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,""+d)}}function mm(s,a,d){if(d===null)s.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,""+d)}}function Oi(s,a,d,h){if(h===null)s.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(d);return}s.setAttributeNS(a,d,""+h)}}var Wv,LE;function Cl(s){if(Wv===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);Wv=a&&a[1]||"",LE=-1<d.stack.indexOf(`
432
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
433
+ `+Wv+s+LE}var Qv=!1;function Jv(s,a){if(!s||Qv)return"";Qv=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(te){var ee=te}Reflect.construct(s,[],he)}else{try{he.call()}catch(te){ee=te}s.call(he.prototype)}}else{try{throw Error()}catch(te){ee=te}(he=s())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(te){if(te&&ee&&typeof te.stack=="string")return[te.stack,ee.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),R=w[0],O=w[1];if(R&&O){var D=R.split(`
434
+ `),Q=O.split(`
435
+ `);for(y=h=0;h<D.length&&!D[h].includes("DetermineComponentFrameRoot");)h++;for(;y<Q.length&&!Q[y].includes("DetermineComponentFrameRoot");)y++;if(h===D.length||y===Q.length)for(h=D.length-1,y=Q.length-1;1<=h&&0<=y&&D[h]!==Q[y];)y--;for(;1<=h&&0<=y;h--,y--)if(D[h]!==Q[y]){if(h!==1||y!==1)do if(h--,y--,0>y||D[h]!==Q[y]){var de=`
436
+ `+D[h].replace(" at new "," at ");return s.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",s.displayName)),de}while(1<=h&&0<=y);break}}}finally{Qv=!1,Error.prepareStackTrace=d}return(d=s?s.displayName||s.name:"")?Cl(d):""}function G6(s){switch(s.tag){case 26:case 27:case 5:return Cl(s.type);case 16:return Cl("Lazy");case 13:return Cl("Suspense");case 19:return Cl("SuspenseList");case 0:case 15:return Jv(s.type,!1);case 11:return Jv(s.type.render,!1);case 1:return Jv(s.type,!0);case 31:return Cl("Activity");default:return""}}function FE(s){try{var a="";do a+=G6(s),s=s.return;while(s);return a}catch(d){return`
437
+ Error generating stack: `+d.message+`
438
+ `+d.stack}}function co(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function VE(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function q6(s){var a=VE(s)?"checked":"value",d=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),h=""+s[a];if(!s.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,w=d.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return y.call(this)},set:function(R){h=""+R,w.call(this,R)}}),Object.defineProperty(s,a,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(R){h=""+R},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function hm(s){s._valueTracker||(s._valueTracker=q6(s))}function BE(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var d=a.getValue(),h="";return s&&(h=VE(s)?s.checked?"true":"false":s.value),s=h,s!==d?(a.setValue(s),!0):!1}function pm(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var K6=/[\n"\\]/g;function uo(s){return s.replace(K6,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ey(s,a,d,h,y,w,R,O){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),a!=null?R==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+co(a)):s.value!==""+co(a)&&(s.value=""+co(a)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),a!=null?ty(s,R,co(a)):d!=null?ty(s,R,co(d)):h!=null&&s.removeAttribute("value"),y==null&&w!=null&&(s.defaultChecked=!!w),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.name=""+co(O):s.removeAttribute("name")}function HE(s,a,d,h,y,w,R,O){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.type=w),a!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||a!=null))return;d=d!=null?""+co(d):"",a=a!=null?""+co(a):d,O||a===s.value||(s.value=a),s.defaultValue=a}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=O?s.checked:!!h,s.defaultChecked=!!h,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R)}function ty(s,a,d){a==="number"&&pm(s.ownerDocument)===s||s.defaultValue===""+d||(s.defaultValue=""+d)}function El(s,a,d,h){if(s=s.options,a){a={};for(var y=0;y<d.length;y++)a["$"+d[y]]=!0;for(d=0;d<s.length;d++)y=a.hasOwnProperty("$"+s[d].value),s[d].selected!==y&&(s[d].selected=y),y&&h&&(s[d].defaultSelected=!0)}else{for(d=""+co(d),a=null,y=0;y<s.length;y++){if(s[y].value===d){s[y].selected=!0,h&&(s[y].defaultSelected=!0);return}a!==null||s[y].disabled||(a=s[y])}a!==null&&(a.selected=!0)}}function GE(s,a,d){if(a!=null&&(a=""+co(a),a!==s.value&&(s.value=a),d==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=d!=null?""+co(d):""}function qE(s,a,d,h){if(a==null){if(h!=null){if(d!=null)throw Error(o(92));if(ce(h)){if(1<h.length)throw Error(o(93));h=h[0]}d=h}d==null&&(d=""),a=d}d=co(a),s.defaultValue=d,h=s.textContent,h===d&&h!==""&&h!==null&&(s.value=h)}function Rl(s,a){if(a){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=a;return}}s.textContent=a}var Z6=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(" "));function KE(s,a,d){var h=a.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":h?s.setProperty(a,d):typeof d!="number"||d===0||Z6.has(a)?a==="float"?s.cssFloat=d:s[a]=(""+d).trim():s[a]=d+"px"}function ZE(s,a,d){if(a!=null&&typeof a!="object")throw Error(o(62));if(s=s.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var y in a)h=a[y],a.hasOwnProperty(y)&&d[y]!==h&&KE(s,y,h)}else for(var w in a)a.hasOwnProperty(w)&&KE(s,w,a[w])}function ny(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Y6=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"]]),X6=/^[\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 gm(s){return X6.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}var ry=null;function oy(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var jl=null,Nl=null;function YE(s){var a=_l(s);if(a&&(s=a.stateNode)){var d=s[Dt]||null;e:switch(s=a.stateNode,a.type){case"input":if(ey(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),a=d.name,d.type==="radio"&&a!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+uo(""+a)+'"][type="radio"]'),a=0;a<d.length;a++){var h=d[a];if(h!==s&&h.form===s.form){var y=h[Dt]||null;if(!y)throw Error(o(90));ey(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<d.length;a++)h=d[a],h.form===s.form&&BE(h)}break e;case"textarea":GE(s,d.value,d.defaultValue);break e;case"select":a=d.value,a!=null&&El(s,!!d.multiple,a,!1)}}}var iy=!1;function XE(s,a,d){if(iy)return s(a,d);iy=!0;try{var h=s(a);return h}finally{if(iy=!1,(jl!==null||Nl!==null)&&(th(),jl&&(a=jl,s=Nl,Nl=jl=null,YE(a),s)))for(a=0;a<s.length;a++)YE(s[a])}}function Nu(s,a){var d=s.stateNode;if(d===null)return null;var h=d[Dt]||null;if(h===null)return null;d=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(o(231,a,typeof d));return d}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sy=!1;if(Ai)try{var Tu={};Object.defineProperty(Tu,"passive",{get:function(){sy=!0}}),window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{sy=!1}var ds=null,ay=null,vm=null;function WE(){if(vm)return vm;var s,a=ay,d=a.length,h,y="value"in ds?ds.value:ds.textContent,w=y.length;for(s=0;s<d&&a[s]===y[s];s++);var R=d-s;for(h=1;h<=R&&a[d-h]===y[w-h];h++);return vm=y.slice(s,1<h?1-h:void 0)}function ym(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function bm(){return!0}function QE(){return!1}function Er(s){function a(d,h,y,w,R){this._reactName=d,this._targetInst=y,this.type=h,this.nativeEvent=w,this.target=R,this.currentTarget=null;for(var O in s)s.hasOwnProperty(O)&&(d=s[O],this[O]=d?d(w):w[O]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?bm:QE,this.isPropagationStopped=QE,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=bm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=bm)},persist:function(){},isPersistent:bm}),a}var da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xm=Er(da),ku=p({},da,{view:0,detail:0}),W6=Er(ku),ly,cy,Ou,_m=p({},ku,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dy,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ou&&(Ou&&s.type==="mousemove"?(ly=s.screenX-Ou.screenX,cy=s.screenY-Ou.screenY):cy=ly=0,Ou=s),ly)},movementY:function(s){return"movementY"in s?s.movementY:cy}}),JE=Er(_m),Q6=p({},_m,{dataTransfer:0}),J6=Er(Q6),eV=p({},ku,{relatedTarget:0}),uy=Er(eV),tV=p({},da,{animationName:0,elapsedTime:0,pseudoElement:0}),nV=Er(tV),rV=p({},da,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),oV=Er(rV),iV=p({},da,{data:0}),eR=Er(iV),sV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aV={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},lV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cV(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=lV[s])?!!a[s]:!1}function dy(){return cV}var uV=p({},ku,{key:function(s){if(s.key){var a=sV[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=ym(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?aV[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dy,charCode:function(s){return s.type==="keypress"?ym(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ym(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),dV=Er(uV),fV=p({},_m,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tR=Er(fV),mV=p({},ku,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dy}),hV=Er(mV),pV=p({},da,{propertyName:0,elapsedTime:0,pseudoElement:0}),gV=Er(pV),vV=p({},_m,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),yV=Er(vV),bV=p({},da,{newState:0,oldState:0}),xV=Er(bV),_V=[9,13,27,32],fy=Ai&&"CompositionEvent"in window,Au=null;Ai&&"documentMode"in document&&(Au=document.documentMode);var wV=Ai&&"TextEvent"in window&&!Au,nR=Ai&&(!fy||Au&&8<Au&&11>=Au),rR=" ",oR=!1;function iR(s,a){switch(s){case"keyup":return _V.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sR(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Tl=!1;function SV(s,a){switch(s){case"compositionend":return sR(a);case"keypress":return a.which!==32?null:(oR=!0,rR);case"textInput":return s=a.data,s===rR&&oR?null:s;default:return null}}function CV(s,a){if(Tl)return s==="compositionend"||!fy&&iR(s,a)?(s=WE(),vm=ay=ds=null,Tl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return nR&&a.locale!=="ko"?null:a.data;default:return null}}var EV={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function aR(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!EV[s.type]:a==="textarea"}function lR(s,a,d,h){jl?Nl?Nl.push(h):Nl=[h]:jl=h,a=ah(a,"onChange"),0<a.length&&(d=new xm("onChange","change",null,d,h),s.push({event:d,listeners:a}))}var Iu=null,$u=null;function RV(s){Vj(s,0)}function wm(s){var a=ju(s);if(BE(a))return s}function cR(s,a){if(s==="change")return a}var uR=!1;if(Ai){var my;if(Ai){var hy="oninput"in document;if(!hy){var dR=document.createElement("div");dR.setAttribute("oninput","return;"),hy=typeof dR.oninput=="function"}my=hy}else my=!1;uR=my&&(!document.documentMode||9<document.documentMode)}function fR(){Iu&&(Iu.detachEvent("onpropertychange",mR),$u=Iu=null)}function mR(s){if(s.propertyName==="value"&&wm($u)){var a=[];lR(a,$u,s,oy(s)),XE(RV,a)}}function jV(s,a,d){s==="focusin"?(fR(),Iu=a,$u=d,Iu.attachEvent("onpropertychange",mR)):s==="focusout"&&fR()}function NV(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return wm($u)}function TV(s,a){if(s==="click")return wm(a)}function kV(s,a){if(s==="input"||s==="change")return wm(a)}function OV(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var zr=typeof Object.is=="function"?Object.is:OV;function Mu(s,a){if(zr(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var d=Object.keys(s),h=Object.keys(a);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var y=d[h];if(!He.call(a,y)||!zr(s[y],a[y]))return!1}return!0}function hR(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function pR(s,a){var d=hR(s);s=0;for(var h;d;){if(d.nodeType===3){if(h=s+d.textContent.length,s<=a&&h>=a)return{node:d,offset:a-s};s=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=hR(d)}}function gR(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?gR(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function vR(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=pm(s.document);a instanceof s.HTMLIFrameElement;){try{var d=typeof a.contentWindow.location.href=="string"}catch{d=!1}if(d)s=a.contentWindow;else break;a=pm(s.document)}return a}function py(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var AV=Ai&&"documentMode"in document&&11>=document.documentMode,kl=null,gy=null,Pu=null,vy=!1;function yR(s,a,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;vy||kl==null||kl!==pm(h)||(h=kl,"selectionStart"in h&&py(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Pu&&Mu(Pu,h)||(Pu=h,h=ah(gy,"onSelect"),0<h.length&&(a=new xm("onSelect","select",null,a,d),s.push({event:a,listeners:h}),a.target=kl)))}function fa(s,a){var d={};return d[s.toLowerCase()]=a.toLowerCase(),d["Webkit"+s]="webkit"+a,d["Moz"+s]="moz"+a,d}var Ol={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},yy={},bR={};Ai&&(bR=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function ma(s){if(yy[s])return yy[s];if(!Ol[s])return s;var a=Ol[s],d;for(d in a)if(a.hasOwnProperty(d)&&d in bR)return yy[s]=a[d];return s}var xR=ma("animationend"),_R=ma("animationiteration"),wR=ma("animationstart"),IV=ma("transitionrun"),$V=ma("transitionstart"),MV=ma("transitioncancel"),SR=ma("transitionend"),CR=new Map,by="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");by.push("scrollEnd");function Po(s,a){CR.set(s,a),ua(a,[s])}var ER=new WeakMap;function fo(s,a){if(typeof s=="object"&&s!==null){var d=ER.get(s);return d!==void 0?d:(a={value:s,source:a,stack:FE(a)},ER.set(s,a),a)}return{value:s,source:a,stack:FE(a)}}var mo=[],Al=0,xy=0;function Sm(){for(var s=Al,a=xy=Al=0;a<s;){var d=mo[a];mo[a++]=null;var h=mo[a];mo[a++]=null;var y=mo[a];mo[a++]=null;var w=mo[a];if(mo[a++]=null,h!==null&&y!==null){var R=h.pending;R===null?y.next=y:(y.next=R.next,R.next=y),h.pending=y}w!==0&&RR(d,y,w)}}function Cm(s,a,d,h){mo[Al++]=s,mo[Al++]=a,mo[Al++]=d,mo[Al++]=h,xy|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function _y(s,a,d,h){return Cm(s,a,d,h),Em(s)}function Il(s,a){return Cm(s,null,null,a),Em(s)}function RR(s,a,d){s.lanes|=d;var h=s.alternate;h!==null&&(h.lanes|=d);for(var y=!1,w=s.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.childLanes|=d),w.tag===22&&(s=w.stateNode,s===null||s._visibility&1||(y=!0)),s=w,w=w.return;return s.tag===3?(w=s.stateNode,y&&a!==null&&(y=31-Rt(d),s=w.hiddenUpdates,h=s[y],h===null?s[y]=[a]:h.push(a),a.lane=d|536870912),w):null}function Em(s){if(50<ad)throw ad=0,jb=null,Error(o(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var $l={};function PV(s,a,d,h){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(s,a,d,h){return new PV(s,a,d,h)}function wy(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ii(s,a){var d=s.alternate;return d===null?(d=Ur(s.tag,a,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=a,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&65011712,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,a=s.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d.refCleanup=s.refCleanup,d}function jR(s,a){s.flags&=65011714;var d=s.alternate;return d===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=d.childLanes,s.lanes=d.lanes,s.child=d.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=d.memoizedProps,s.memoizedState=d.memoizedState,s.updateQueue=d.updateQueue,s.type=d.type,a=d.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function Rm(s,a,d,h,y,w){var R=0;if(h=s,typeof s=="function")wy(s)&&(R=1);else if(typeof s=="string")R=z3(s,d,J.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=Ur(31,d,a,y),s.elementType=L,s.lanes=w,s;case b:return ha(d.children,y,w,a);case S:R=8,y|=24;break;case C:return s=Ur(12,d,a,y|2),s.elementType=C,s.lanes=w,s;case k:return s=Ur(13,d,a,y),s.elementType=k,s.lanes=w,s;case A:return s=Ur(19,d,a,y),s.elementType=A,s.lanes=w,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:case N:R=10;break e;case j:R=9;break e;case T:R=11;break e;case I:R=14;break e;case P:R=16,h=null;break e}R=29,d=Error(o(130,s===null?"null":typeof s,"")),h=null}return a=Ur(R,d,a,y),a.elementType=s,a.type=h,a.lanes=w,a}function ha(s,a,d,h){return s=Ur(7,s,h,a),s.lanes=d,s}function Sy(s,a,d){return s=Ur(6,s,null,a),s.lanes=d,s}function Cy(s,a,d){return a=Ur(4,s.children!==null?s.children:[],s.key,a),a.lanes=d,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var Ml=[],Pl=0,jm=null,Nm=0,ho=[],po=0,pa=null,$i=1,Mi="";function ga(s,a){Ml[Pl++]=Nm,Ml[Pl++]=jm,jm=s,Nm=a}function NR(s,a,d){ho[po++]=$i,ho[po++]=Mi,ho[po++]=pa,pa=s;var h=$i;s=Mi;var y=32-Rt(h)-1;h&=~(1<<y),d+=1;var w=32-Rt(a)+y;if(30<w){var R=y-y%5;w=(h&(1<<R)-1).toString(32),h>>=R,y-=R,$i=1<<32-Rt(a)+y|d<<y|h,Mi=w+s}else $i=1<<w|d<<y|h,Mi=s}function Ey(s){s.return!==null&&(ga(s,1),NR(s,1,0))}function Ry(s){for(;s===jm;)jm=Ml[--Pl],Ml[Pl]=null,Nm=Ml[--Pl],Ml[Pl]=null;for(;s===pa;)pa=ho[--po],ho[po]=null,Mi=ho[--po],ho[po]=null,$i=ho[--po],ho[po]=null}var mr=null,Xt=null,St=!1,va=null,ii=!1,jy=Error(o(519));function ya(s){var a=Error(o(418,""));throw Uu(fo(a,s)),jy}function TR(s){var a=s.stateNode,d=s.type,h=s.memoizedProps;switch(a[sn]=s,a[Dt]=h,d){case"dialog":gt("cancel",a),gt("close",a);break;case"iframe":case"object":case"embed":gt("load",a);break;case"video":case"audio":for(d=0;d<cd.length;d++)gt(cd[d],a);break;case"source":gt("error",a);break;case"img":case"image":case"link":gt("error",a),gt("load",a);break;case"details":gt("toggle",a);break;case"input":gt("invalid",a),HE(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),hm(a);break;case"select":gt("invalid",a);break;case"textarea":gt("invalid",a),qE(a,h.value,h.defaultValue,h.children),hm(a)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||a.textContent===""+d||h.suppressHydrationWarning===!0||qj(a.textContent,d)?(h.popover!=null&&(gt("beforetoggle",a),gt("toggle",a)),h.onScroll!=null&&gt("scroll",a),h.onScrollEnd!=null&&gt("scrollend",a),h.onClick!=null&&(a.onclick=lh),a=!0):a=!1,a||ya(s)}function kR(s){for(mr=s.return;mr;)switch(mr.tag){case 5:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:mr=mr.return}}function Du(s){if(s!==mr)return!1;if(!St)return kR(s),St=!0,!1;var a=s.tag,d;if((d=a!==3&&a!==27)&&((d=a===5)&&(d=s.type,d=!(d!=="form"&&d!=="button")||Bb(s.type,s.memoizedProps)),d=!d),d&&Xt&&ya(s),kR(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8)if(d=s.data,d==="/$"){if(a===0){Xt=zo(s.nextSibling);break e}a--}else d!=="$"&&d!=="$!"&&d!=="$?"||a++;s=s.nextSibling}Xt=null}}else a===27?(a=Xt,js(s.type)?(s=Kb,Kb=null,Xt=s):Xt=a):Xt=mr?zo(s.stateNode.nextSibling):null;return!0}function zu(){Xt=mr=null,St=!1}function OR(){var s=va;return s!==null&&(Nr===null?Nr=s:Nr.push.apply(Nr,s),va=null),s}function Uu(s){va===null?va=[s]:va.push(s)}var Ny=H(null),ba=null,Pi=null;function fs(s,a,d){B(Ny,a._currentValue),a._currentValue=d}function Di(s){s._currentValue=Ny.current,W(Ny)}function Ty(s,a,d){for(;s!==null;){var h=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),s===d)break;s=s.return}}function ky(s,a,d,h){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var w=y.dependencies;if(w!==null){var R=y.child;w=w.firstContext;e:for(;w!==null;){var O=w;w=y;for(var D=0;D<a.length;D++)if(O.context===a[D]){w.lanes|=d,O=w.alternate,O!==null&&(O.lanes|=d),Ty(w.return,d,s),h||(R=null);break e}w=O.next}}else if(y.tag===18){if(R=y.return,R===null)throw Error(o(341));R.lanes|=d,w=R.alternate,w!==null&&(w.lanes|=d),Ty(R,d,s),R=null}else R=y.child;if(R!==null)R.return=y;else for(R=y;R!==null;){if(R===s){R=null;break}if(y=R.sibling,y!==null){y.return=R.return,R=y;break}R=R.return}y=R}}function Lu(s,a,d,h){s=null;for(var y=a,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var R=y.alternate;if(R===null)throw Error(o(387));if(R=R.memoizedProps,R!==null){var O=y.type;zr(y.pendingProps.value,R.value)||(s!==null?s.push(O):s=[O])}}else if(y===ae.current){if(R=y.alternate,R===null)throw Error(o(387));R.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(pd):s=[pd])}y=y.return}s!==null&&ky(a,s,d,h),a.flags|=262144}function Tm(s){for(s=s.firstContext;s!==null;){if(!zr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function xa(s){ba=s,Pi=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function nr(s){return AR(ba,s)}function km(s,a){return ba===null&&xa(s),AR(s,a)}function AR(s,a){var d=a._currentValue;if(a={context:a,memoizedValue:d,next:null},Pi===null){if(s===null)throw Error(o(308));Pi=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else Pi=Pi.next=a;return d}var DV=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(d,h){s.push(h)}};this.abort=function(){a.aborted=!0,s.forEach(function(d){return d()})}},zV=e.unstable_scheduleCallback,UV=e.unstable_NormalPriority,kn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oy(){return{controller:new DV,data:new Map,refCount:0}}function Fu(s){s.refCount--,s.refCount===0&&zV(UV,function(){s.controller.abort()})}var Vu=null,Ay=0,Dl=0,zl=null;function LV(s,a){if(Vu===null){var d=Vu=[];Ay=0,Dl=$b(),zl={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Ay++,a.then(IR,IR),a}function IR(){if(--Ay===0&&Vu!==null){zl!==null&&(zl.status="fulfilled");var s=Vu;Vu=null,Dl=0,zl=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function FV(s,a){var d=[],h={status:"pending",value:null,reason:null,then:function(y){d.push(y)}};return s.then(function(){h.status="fulfilled",h.value=a;for(var y=0;y<d.length;y++)(0,d[y])(a)},function(y){for(h.status="rejected",h.reason=y,y=0;y<d.length;y++)(0,d[y])(void 0)}),h}var $R=M.S;M.S=function(s,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&LV(s,a),$R!==null&&$R(s,a)};var _a=H(null);function Iy(){var s=_a.current;return s!==null?s:zt.pooledCache}function Om(s,a){a===null?B(_a,_a.current):B(_a,a.pool)}function MR(){var s=Iy();return s===null?null:{parent:kn._currentValue,pool:s}}var Bu=Error(o(460)),PR=Error(o(474)),Am=Error(o(542)),$y={then:function(){}};function DR(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Im(){}function zR(s,a,d){switch(d=s[d],d===void 0?s.push(a):d!==a&&(a.then(Im,Im),a=d),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,LR(s),s;default:if(typeof a.status=="string")a.then(Im,Im);else{if(s=zt,s!==null&&100<s.shellSuspendCounter)throw Error(o(482));s=a,s.status="pending",s.then(function(h){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=h}},function(h){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,LR(s),s}throw Hu=a,Bu}}var Hu=null;function UR(){if(Hu===null)throw Error(o(459));var s=Hu;return Hu=null,s}function LR(s){if(s===Bu||s===Am)throw Error(o(483))}var ms=!1;function My(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Py(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function hs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ps(s,a,d){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(jt&2)!==0){var y=h.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),h.pending=a,a=Em(s),RR(s,null,d),a}return Cm(s,h,a,d),Em(s)}function Gu(s,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194048)!==0)){var h=a.lanes;h&=s.pendingLanes,d|=h,a.lanes=d,rn(s,d)}}function Dy(s,a){var d=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var y=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var R={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?y=w=R:w=w.next=R,d=d.next}while(d!==null);w===null?y=w=a:w=w.next=a}else y=w=a;d={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=a:s.next=a,d.lastBaseUpdate=a}var zy=!1;function qu(){if(zy){var s=zl;if(s!==null)throw s}}function Ku(s,a,d,h){zy=!1;var y=s.updateQueue;ms=!1;var w=y.firstBaseUpdate,R=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var D=O,Q=D.next;D.next=null,R===null?w=Q:R.next=Q,R=D;var de=s.alternate;de!==null&&(de=de.updateQueue,O=de.lastBaseUpdate,O!==R&&(O===null?de.firstBaseUpdate=Q:O.next=Q,de.lastBaseUpdate=D))}if(w!==null){var he=y.baseState;R=0,de=Q=D=null,O=w;do{var ee=O.lane&-536870913,te=ee!==O.lane;if(te?(bt&ee)===ee:(h&ee)===ee){ee!==0&&ee===Dl&&(zy=!0),de!==null&&(de=de.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ke=s,Fe=O;ee=a;var It=d;switch(Fe.tag){case 1:if(Ke=Fe.payload,typeof Ke=="function"){he=Ke.call(It,he,ee);break e}he=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=Fe.payload,ee=typeof Ke=="function"?Ke.call(It,he,ee):Ke,ee==null)break e;he=p({},he,ee);break e;case 2:ms=!0}}ee=O.callback,ee!==null&&(s.flags|=64,te&&(s.flags|=8192),te=y.callbacks,te===null?y.callbacks=[ee]:te.push(ee))}else te={lane:ee,tag:O.tag,payload:O.payload,callback:O.callback,next:null},de===null?(Q=de=te,D=he):de=de.next=te,R|=ee;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;te=O,O=te.next,te.next=null,y.lastBaseUpdate=te,y.shared.pending=null}}while(!0);de===null&&(D=he),y.baseState=D,y.firstBaseUpdate=Q,y.lastBaseUpdate=de,w===null&&(y.shared.lanes=0),Ss|=R,s.lanes=R,s.memoizedState=he}}function FR(s,a){if(typeof s!="function")throw Error(o(191,s));s.call(a)}function VR(s,a){var d=s.callbacks;if(d!==null)for(s.callbacks=null,s=0;s<d.length;s++)FR(d[s],a)}var Ul=H(null),$m=H(0);function BR(s,a){s=Hi,B($m,s),B(Ul,a),Hi=s|a.baseLanes}function Uy(){B($m,Hi),B(Ul,Ul.current)}function Ly(){Hi=$m.current,W(Ul),W($m)}var gs=0,ct=null,Ot=null,xn=null,Mm=!1,Ll=!1,wa=!1,Pm=0,Zu=0,Fl=null,VV=0;function an(){throw Error(o(321))}function Fy(s,a){if(a===null)return!1;for(var d=0;d<a.length&&d<s.length;d++)if(!zr(s[d],a[d]))return!1;return!0}function Vy(s,a,d,h,y,w){return gs=w,ct=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=s===null||s.memoizedState===null?R1:j1,wa=!1,w=d(h,y),wa=!1,Ll&&(w=GR(a,d,h,y)),HR(s),w}function HR(s){M.H=Vm;var a=Ot!==null&&Ot.next!==null;if(gs=0,xn=Ot=ct=null,Mm=!1,Zu=0,Fl=null,a)throw Error(o(300));s===null||Ln||(s=s.dependencies,s!==null&&Tm(s)&&(Ln=!0))}function GR(s,a,d,h){ct=s;var y=0;do{if(Ll&&(Fl=null),Zu=0,Ll=!1,25<=y)throw Error(o(301));if(y+=1,xn=Ot=null,s.updateQueue!=null){var w=s.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=YV,w=a(d,h)}while(Ll);return w}function BV(){var s=M.H,a=s.useState()[0];return a=typeof a.then=="function"?Yu(a):a,s=s.useState()[0],(Ot!==null?Ot.memoizedState:null)!==s&&(ct.flags|=1024),a}function By(){var s=Pm!==0;return Pm=0,s}function Hy(s,a,d){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~d}function Gy(s){if(Mm){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}Mm=!1}gs=0,xn=Ot=ct=null,Ll=!1,Zu=Pm=0,Fl=null}function Rr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xn===null?ct.memoizedState=xn=s:xn=xn.next=s,xn}function _n(){if(Ot===null){var s=ct.alternate;s=s!==null?s.memoizedState:null}else s=Ot.next;var a=xn===null?ct.memoizedState:xn.next;if(a!==null)xn=a,Ot=s;else{if(s===null)throw ct.alternate===null?Error(o(467)):Error(o(310));Ot=s,s={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},xn===null?ct.memoizedState=xn=s:xn=xn.next=s}return xn}function qy(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yu(s){var a=Zu;return Zu+=1,Fl===null&&(Fl=[]),s=zR(Fl,s,a),a=ct,(xn===null?a.memoizedState:xn.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?R1:j1),s}function Dm(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Yu(s);if(s.$$typeof===N)return nr(s)}throw Error(o(438,String(s)))}function Ky(s){var a=null,d=ct.updateQueue;if(d!==null&&(a=d.memoCache),a==null){var h=ct.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),d===null&&(d=qy(),ct.updateQueue=d),d.memoCache=a,d=a.data[a.index],d===void 0)for(d=a.data[a.index]=Array(s),h=0;h<s;h++)d[h]=V;return a.index++,d}function zi(s,a){return typeof a=="function"?a(s):a}function zm(s){var a=_n();return Zy(a,Ot,s)}function Zy(s,a,d){var h=s.queue;if(h===null)throw Error(o(311));h.lastRenderedReducer=d;var y=s.baseQueue,w=h.pending;if(w!==null){if(y!==null){var R=y.next;y.next=w.next,w.next=R}a.baseQueue=y=w,h.pending=null}if(w=s.baseState,y===null)s.memoizedState=w;else{a=y.next;var O=R=null,D=null,Q=a,de=!1;do{var he=Q.lane&-536870913;if(he!==Q.lane?(bt&he)===he:(gs&he)===he){var ee=Q.revertLane;if(ee===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),he===Dl&&(de=!0);else if((gs&ee)===ee){Q=Q.next,ee===Dl&&(de=!0);continue}else he={lane:0,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},D===null?(O=D=he,R=w):D=D.next=he,ct.lanes|=ee,Ss|=ee;he=Q.action,wa&&d(w,he),w=Q.hasEagerState?Q.eagerState:d(w,he)}else ee={lane:he,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},D===null?(O=D=ee,R=w):D=D.next=ee,ct.lanes|=he,Ss|=he;Q=Q.next}while(Q!==null&&Q!==a);if(D===null?R=w:D.next=O,!zr(w,s.memoizedState)&&(Ln=!0,de&&(d=zl,d!==null)))throw d;s.memoizedState=w,s.baseState=R,s.baseQueue=D,h.lastRenderedState=w}return y===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function Yy(s){var a=_n(),d=a.queue;if(d===null)throw Error(o(311));d.lastRenderedReducer=s;var h=d.dispatch,y=d.pending,w=a.memoizedState;if(y!==null){d.pending=null;var R=y=y.next;do w=s(w,R.action),R=R.next;while(R!==y);zr(w,a.memoizedState)||(Ln=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),d.lastRenderedState=w}return[w,h]}function qR(s,a,d){var h=ct,y=_n(),w=St;if(w){if(d===void 0)throw Error(o(407));d=d()}else d=a();var R=!zr((Ot||y).memoizedState,d);R&&(y.memoizedState=d,Ln=!0),y=y.queue;var O=YR.bind(null,h,y,s);if(Xu(2048,8,O,[s]),y.getSnapshot!==a||R||xn!==null&&xn.memoizedState.tag&1){if(h.flags|=2048,Vl(9,Um(),ZR.bind(null,h,y,d,a),null),zt===null)throw Error(o(349));w||(gs&124)!==0||KR(h,a,d)}return d}function KR(s,a,d){s.flags|=16384,s={getSnapshot:a,value:d},a=ct.updateQueue,a===null?(a=qy(),ct.updateQueue=a,a.stores=[s]):(d=a.stores,d===null?a.stores=[s]:d.push(s))}function ZR(s,a,d,h){a.value=d,a.getSnapshot=h,XR(a)&&WR(s)}function YR(s,a,d){return d(function(){XR(a)&&WR(s)})}function XR(s){var a=s.getSnapshot;s=s.value;try{var d=a();return!zr(s,d)}catch{return!0}}function WR(s){var a=Il(s,2);a!==null&&Hr(a,s,2)}function Xy(s){var a=Rr();if(typeof s=="function"){var d=s;if(s=d(),wa){ft(!0);try{d()}finally{ft(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:s},a}function QR(s,a,d,h){return s.baseState=d,Zy(s,Ot,typeof h=="function"?h:zi)}function HV(s,a,d,h,y){if(Fm(s))throw Error(o(485));if(s=a.action,s!==null){var w={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){w.listeners.push(R)}};M.T!==null?d(!0):w.isTransition=!1,h(w),d=a.pending,d===null?(w.next=a.pending=w,JR(a,w)):(w.next=d.next,a.pending=d.next=w)}}function JR(s,a){var d=a.action,h=a.payload,y=s.state;if(a.isTransition){var w=M.T,R={};M.T=R;try{var O=d(y,h),D=M.S;D!==null&&D(R,O),e1(s,a,O)}catch(Q){Wy(s,a,Q)}finally{M.T=w}}else try{w=d(y,h),e1(s,a,w)}catch(Q){Wy(s,a,Q)}}function e1(s,a,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){t1(s,a,h)},function(h){return Wy(s,a,h)}):t1(s,a,d)}function t1(s,a,d){a.status="fulfilled",a.value=d,n1(a),s.state=d,a=s.pending,a!==null&&(d=a.next,d===a?s.pending=null:(d=d.next,a.next=d,JR(s,d)))}function Wy(s,a,d){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=d,n1(a),a=a.next;while(a!==h)}s.action=null}function n1(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function r1(s,a){return a}function o1(s,a){if(St){var d=zt.formState;if(d!==null){e:{var h=ct;if(St){if(Xt){t:{for(var y=Xt,w=ii;y.nodeType!==8;){if(!w){y=null;break t}if(y=zo(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Xt=zo(y.nextSibling),h=y.data==="F!";break e}}ya(h)}h=!1}h&&(a=d[0])}}return d=Rr(),d.memoizedState=d.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r1,lastRenderedState:a},d.queue=h,d=S1.bind(null,ct,h),h.dispatch=d,h=Xy(!1),w=nb.bind(null,ct,!1,h.queue),h=Rr(),y={state:a,dispatch:null,action:s,pending:null},h.queue=y,d=HV.bind(null,ct,y,w,d),y.dispatch=d,h.memoizedState=s,[a,d,!1]}function i1(s){var a=_n();return s1(a,Ot,s)}function s1(s,a,d){if(a=Zy(s,a,r1)[0],s=zm(zi)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Yu(a)}catch(R){throw R===Bu?Am:R}else h=a;a=_n();var y=a.queue,w=y.dispatch;return d!==a.memoizedState&&(ct.flags|=2048,Vl(9,Um(),GV.bind(null,y,d),null)),[h,w,s]}function GV(s,a){s.action=a}function a1(s){var a=_n(),d=Ot;if(d!==null)return s1(a,d,s);_n(),a=a.memoizedState,d=_n();var h=d.queue.dispatch;return d.memoizedState=s,[a,h,!1]}function Vl(s,a,d,h){return s={tag:s,create:d,deps:h,inst:a,next:null},a=ct.updateQueue,a===null&&(a=qy(),ct.updateQueue=a),d=a.lastEffect,d===null?a.lastEffect=s.next=s:(h=d.next,d.next=s,s.next=h,a.lastEffect=s),s}function Um(){return{destroy:void 0,resource:void 0}}function l1(){return _n().memoizedState}function Lm(s,a,d,h){var y=Rr();h=h===void 0?null:h,ct.flags|=s,y.memoizedState=Vl(1|a,Um(),d,h)}function Xu(s,a,d,h){var y=_n();h=h===void 0?null:h;var w=y.memoizedState.inst;Ot!==null&&h!==null&&Fy(h,Ot.memoizedState.deps)?y.memoizedState=Vl(a,w,d,h):(ct.flags|=s,y.memoizedState=Vl(1|a,w,d,h))}function c1(s,a){Lm(8390656,8,s,a)}function u1(s,a){Xu(2048,8,s,a)}function d1(s,a){return Xu(4,2,s,a)}function f1(s,a){return Xu(4,4,s,a)}function m1(s,a){if(typeof a=="function"){s=s();var d=a(s);return function(){typeof d=="function"?d():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function h1(s,a,d){d=d!=null?d.concat([s]):null,Xu(4,4,m1.bind(null,a,s),d)}function Qy(){}function p1(s,a){var d=_n();a=a===void 0?null:a;var h=d.memoizedState;return a!==null&&Fy(a,h[1])?h[0]:(d.memoizedState=[s,a],s)}function g1(s,a){var d=_n();a=a===void 0?null:a;var h=d.memoizedState;if(a!==null&&Fy(a,h[1]))return h[0];if(h=s(),wa){ft(!0);try{s()}finally{ft(!1)}}return d.memoizedState=[h,a],h}function Jy(s,a,d){return d===void 0||(gs&1073741824)!==0?s.memoizedState=a:(s.memoizedState=d,s=bj(),ct.lanes|=s,Ss|=s,d)}function v1(s,a,d,h){return zr(d,a)?d:Ul.current!==null?(s=Jy(s,d,h),zr(s,a)||(Ln=!0),s):(gs&42)===0?(Ln=!0,s.memoizedState=d):(s=bj(),ct.lanes|=s,Ss|=s,a)}function y1(s,a,d,h,y){var w=K.p;K.p=w!==0&&8>w?w:8;var R=M.T,O={};M.T=O,nb(s,!1,a,d);try{var D=y(),Q=M.S;if(Q!==null&&Q(O,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var de=FV(D,h);Wu(s,a,de,Br(s))}else Wu(s,a,h,Br(s))}catch(he){Wu(s,a,{then:function(){},status:"rejected",reason:he},Br())}finally{K.p=w,M.T=R}}function qV(){}function eb(s,a,d,h){if(s.tag!==5)throw Error(o(476));var y=b1(s).queue;y1(s,y,a,U,d===null?qV:function(){return x1(s),d(h)})}function b1(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:U},next:null};var d={};return a.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:d},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function x1(s){var a=b1(s).next.queue;Wu(s,a,{},Br())}function tb(){return nr(pd)}function _1(){return _n().memoizedState}function w1(){return _n().memoizedState}function KV(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var d=Br();s=hs(d);var h=ps(a,s,d);h!==null&&(Hr(h,a,d),Gu(h,a,d)),a={cache:Oy()},s.payload=a;return}a=a.return}}function ZV(s,a,d){var h=Br();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},Fm(s)?C1(a,d):(d=_y(s,a,d,h),d!==null&&(Hr(d,s,h),E1(d,a,h)))}function S1(s,a,d){var h=Br();Wu(s,a,d,h)}function Wu(s,a,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(Fm(s))C1(a,y);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var R=a.lastRenderedState,O=w(R,d);if(y.hasEagerState=!0,y.eagerState=O,zr(O,R))return Cm(s,a,y,0),zt===null&&Sm(),!1}catch{}finally{}if(d=_y(s,a,y,h),d!==null)return Hr(d,s,h),E1(d,a,h),!0}return!1}function nb(s,a,d,h){if(h={lane:2,revertLane:$b(),action:h,hasEagerState:!1,eagerState:null,next:null},Fm(s)){if(a)throw Error(o(479))}else a=_y(s,d,h,2),a!==null&&Hr(a,s,2)}function Fm(s){var a=s.alternate;return s===ct||a!==null&&a===ct}function C1(s,a){Ll=Mm=!0;var d=s.pending;d===null?a.next=a:(a.next=d.next,d.next=a),s.pending=a}function E1(s,a,d){if((d&4194048)!==0){var h=a.lanes;h&=s.pendingLanes,d|=h,a.lanes=d,rn(s,d)}}var Vm={readContext:nr,use:Dm,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an},R1={readContext:nr,use:Dm,useCallback:function(s,a){return Rr().memoizedState=[s,a===void 0?null:a],s},useContext:nr,useEffect:c1,useImperativeHandle:function(s,a,d){d=d!=null?d.concat([s]):null,Lm(4194308,4,m1.bind(null,a,s),d)},useLayoutEffect:function(s,a){return Lm(4194308,4,s,a)},useInsertionEffect:function(s,a){Lm(4,2,s,a)},useMemo:function(s,a){var d=Rr();a=a===void 0?null:a;var h=s();if(wa){ft(!0);try{s()}finally{ft(!1)}}return d.memoizedState=[h,a],h},useReducer:function(s,a,d){var h=Rr();if(d!==void 0){var y=d(a);if(wa){ft(!0);try{d(a)}finally{ft(!1)}}}else y=a;return h.memoizedState=h.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},h.queue=s,s=s.dispatch=ZV.bind(null,ct,s),[h.memoizedState,s]},useRef:function(s){var a=Rr();return s={current:s},a.memoizedState=s},useState:function(s){s=Xy(s);var a=s.queue,d=S1.bind(null,ct,a);return a.dispatch=d,[s.memoizedState,d]},useDebugValue:Qy,useDeferredValue:function(s,a){var d=Rr();return Jy(d,s,a)},useTransition:function(){var s=Xy(!1);return s=y1.bind(null,ct,s.queue,!0,!1),Rr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,d){var h=ct,y=Rr();if(St){if(d===void 0)throw Error(o(407));d=d()}else{if(d=a(),zt===null)throw Error(o(349));(bt&124)!==0||KR(h,a,d)}y.memoizedState=d;var w={value:d,getSnapshot:a};return y.queue=w,c1(YR.bind(null,h,w,s),[s]),h.flags|=2048,Vl(9,Um(),ZR.bind(null,h,w,d,a),null),d},useId:function(){var s=Rr(),a=zt.identifierPrefix;if(St){var d=Mi,h=$i;d=(h&~(1<<32-Rt(h)-1)).toString(32)+d,a="«"+a+"R"+d,d=Pm++,0<d&&(a+="H"+d.toString(32)),a+="»"}else d=VV++,a="«"+a+"r"+d.toString(32)+"»";return s.memoizedState=a},useHostTransitionStatus:tb,useFormState:o1,useActionState:o1,useOptimistic:function(s){var a=Rr();a.memoizedState=a.baseState=s;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=d,a=nb.bind(null,ct,!0,d),d.dispatch=a,[s,a]},useMemoCache:Ky,useCacheRefresh:function(){return Rr().memoizedState=KV.bind(null,ct)}},j1={readContext:nr,use:Dm,useCallback:p1,useContext:nr,useEffect:u1,useImperativeHandle:h1,useInsertionEffect:d1,useLayoutEffect:f1,useMemo:g1,useReducer:zm,useRef:l1,useState:function(){return zm(zi)},useDebugValue:Qy,useDeferredValue:function(s,a){var d=_n();return v1(d,Ot.memoizedState,s,a)},useTransition:function(){var s=zm(zi)[0],a=_n().memoizedState;return[typeof s=="boolean"?s:Yu(s),a]},useSyncExternalStore:qR,useId:_1,useHostTransitionStatus:tb,useFormState:i1,useActionState:i1,useOptimistic:function(s,a){var d=_n();return QR(d,Ot,s,a)},useMemoCache:Ky,useCacheRefresh:w1},YV={readContext:nr,use:Dm,useCallback:p1,useContext:nr,useEffect:u1,useImperativeHandle:h1,useInsertionEffect:d1,useLayoutEffect:f1,useMemo:g1,useReducer:Yy,useRef:l1,useState:function(){return Yy(zi)},useDebugValue:Qy,useDeferredValue:function(s,a){var d=_n();return Ot===null?Jy(d,s,a):v1(d,Ot.memoizedState,s,a)},useTransition:function(){var s=Yy(zi)[0],a=_n().memoizedState;return[typeof s=="boolean"?s:Yu(s),a]},useSyncExternalStore:qR,useId:_1,useHostTransitionStatus:tb,useFormState:a1,useActionState:a1,useOptimistic:function(s,a){var d=_n();return Ot!==null?QR(d,Ot,s,a):(d.baseState=s,[s,d.queue.dispatch])},useMemoCache:Ky,useCacheRefresh:w1},Bl=null,Qu=0;function Bm(s){var a=Qu;return Qu+=1,Bl===null&&(Bl=[]),zR(Bl,s,a)}function Ju(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function Hm(s,a){throw a.$$typeof===g?Error(o(525)):(s=Object.prototype.toString.call(a),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function N1(s){var a=s._init;return a(s._payload)}function T1(s){function a(G,F){if(s){var Y=G.deletions;Y===null?(G.deletions=[F],G.flags|=16):Y.push(F)}}function d(G,F){if(!s)return null;for(;F!==null;)a(G,F),F=F.sibling;return null}function h(G){for(var F=new Map;G!==null;)G.key!==null?F.set(G.key,G):F.set(G.index,G),G=G.sibling;return F}function y(G,F){return G=Ii(G,F),G.index=0,G.sibling=null,G}function w(G,F,Y){return G.index=Y,s?(Y=G.alternate,Y!==null?(Y=Y.index,Y<F?(G.flags|=67108866,F):Y):(G.flags|=67108866,F)):(G.flags|=1048576,F)}function R(G){return s&&G.alternate===null&&(G.flags|=67108866),G}function O(G,F,Y,me){return F===null||F.tag!==6?(F=Sy(Y,G.mode,me),F.return=G,F):(F=y(F,Y),F.return=G,F)}function D(G,F,Y,me){var je=Y.type;return je===b?de(G,F,Y.props.children,me,Y.key):F!==null&&(F.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===P&&N1(je)===F.type)?(F=y(F,Y.props),Ju(F,Y),F.return=G,F):(F=Rm(Y.type,Y.key,Y.props,null,G.mode,me),Ju(F,Y),F.return=G,F)}function Q(G,F,Y,me){return F===null||F.tag!==4||F.stateNode.containerInfo!==Y.containerInfo||F.stateNode.implementation!==Y.implementation?(F=Cy(Y,G.mode,me),F.return=G,F):(F=y(F,Y.children||[]),F.return=G,F)}function de(G,F,Y,me,je){return F===null||F.tag!==7?(F=ha(Y,G.mode,me,je),F.return=G,F):(F=y(F,Y),F.return=G,F)}function he(G,F,Y){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Sy(""+F,G.mode,Y),F.return=G,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return Y=Rm(F.type,F.key,F.props,null,G.mode,Y),Ju(Y,F),Y.return=G,Y;case x:return F=Cy(F,G.mode,Y),F.return=G,F;case P:var me=F._init;return F=me(F._payload),he(G,F,Y)}if(ce(F)||se(F))return F=ha(F,G.mode,Y,null),F.return=G,F;if(typeof F.then=="function")return he(G,Bm(F),Y);if(F.$$typeof===N)return he(G,km(G,F),Y);Hm(G,F)}return null}function ee(G,F,Y,me){var je=F!==null?F.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return je!==null?null:O(G,F,""+Y,me);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return Y.key===je?D(G,F,Y,me):null;case x:return Y.key===je?Q(G,F,Y,me):null;case P:return je=Y._init,Y=je(Y._payload),ee(G,F,Y,me)}if(ce(Y)||se(Y))return je!==null?null:de(G,F,Y,me,null);if(typeof Y.then=="function")return ee(G,F,Bm(Y),me);if(Y.$$typeof===N)return ee(G,F,km(G,Y),me);Hm(G,Y)}return null}function te(G,F,Y,me,je){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return G=G.get(Y)||null,O(F,G,""+me,je);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case v:return G=G.get(me.key===null?Y:me.key)||null,D(F,G,me,je);case x:return G=G.get(me.key===null?Y:me.key)||null,Q(F,G,me,je);case P:var mt=me._init;return me=mt(me._payload),te(G,F,Y,me,je)}if(ce(me)||se(me))return G=G.get(Y)||null,de(F,G,me,je,null);if(typeof me.then=="function")return te(G,F,Y,Bm(me),je);if(me.$$typeof===N)return te(G,F,Y,km(F,me),je);Hm(F,me)}return null}function Ke(G,F,Y,me){for(var je=null,mt=null,Pe=F,Be=F=0,Vn=null;Pe!==null&&Be<Y.length;Be++){Pe.index>Be?(Vn=Pe,Pe=null):Vn=Pe.sibling;var _t=ee(G,Pe,Y[Be],me);if(_t===null){Pe===null&&(Pe=Vn);break}s&&Pe&&_t.alternate===null&&a(G,Pe),F=w(_t,F,Be),mt===null?je=_t:mt.sibling=_t,mt=_t,Pe=Vn}if(Be===Y.length)return d(G,Pe),St&&ga(G,Be),je;if(Pe===null){for(;Be<Y.length;Be++)Pe=he(G,Y[Be],me),Pe!==null&&(F=w(Pe,F,Be),mt===null?je=Pe:mt.sibling=Pe,mt=Pe);return St&&ga(G,Be),je}for(Pe=h(Pe);Be<Y.length;Be++)Vn=te(Pe,G,Be,Y[Be],me),Vn!==null&&(s&&Vn.alternate!==null&&Pe.delete(Vn.key===null?Be:Vn.key),F=w(Vn,F,Be),mt===null?je=Vn:mt.sibling=Vn,mt=Vn);return s&&Pe.forEach(function(As){return a(G,As)}),St&&ga(G,Be),je}function Fe(G,F,Y,me){if(Y==null)throw Error(o(151));for(var je=null,mt=null,Pe=F,Be=F=0,Vn=null,_t=Y.next();Pe!==null&&!_t.done;Be++,_t=Y.next()){Pe.index>Be?(Vn=Pe,Pe=null):Vn=Pe.sibling;var As=ee(G,Pe,_t.value,me);if(As===null){Pe===null&&(Pe=Vn);break}s&&Pe&&As.alternate===null&&a(G,Pe),F=w(As,F,Be),mt===null?je=As:mt.sibling=As,mt=As,Pe=Vn}if(_t.done)return d(G,Pe),St&&ga(G,Be),je;if(Pe===null){for(;!_t.done;Be++,_t=Y.next())_t=he(G,_t.value,me),_t!==null&&(F=w(_t,F,Be),mt===null?je=_t:mt.sibling=_t,mt=_t);return St&&ga(G,Be),je}for(Pe=h(Pe);!_t.done;Be++,_t=Y.next())_t=te(Pe,G,Be,_t.value,me),_t!==null&&(s&&_t.alternate!==null&&Pe.delete(_t.key===null?Be:_t.key),F=w(_t,F,Be),mt===null?je=_t:mt.sibling=_t,mt=_t);return s&&Pe.forEach(function(X3){return a(G,X3)}),St&&ga(G,Be),je}function It(G,F,Y,me){if(typeof Y=="object"&&Y!==null&&Y.type===b&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:e:{for(var je=Y.key;F!==null;){if(F.key===je){if(je=Y.type,je===b){if(F.tag===7){d(G,F.sibling),me=y(F,Y.props.children),me.return=G,G=me;break e}}else if(F.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===P&&N1(je)===F.type){d(G,F.sibling),me=y(F,Y.props),Ju(me,Y),me.return=G,G=me;break e}d(G,F);break}else a(G,F);F=F.sibling}Y.type===b?(me=ha(Y.props.children,G.mode,me,Y.key),me.return=G,G=me):(me=Rm(Y.type,Y.key,Y.props,null,G.mode,me),Ju(me,Y),me.return=G,G=me)}return R(G);case x:e:{for(je=Y.key;F!==null;){if(F.key===je)if(F.tag===4&&F.stateNode.containerInfo===Y.containerInfo&&F.stateNode.implementation===Y.implementation){d(G,F.sibling),me=y(F,Y.children||[]),me.return=G,G=me;break e}else{d(G,F);break}else a(G,F);F=F.sibling}me=Cy(Y,G.mode,me),me.return=G,G=me}return R(G);case P:return je=Y._init,Y=je(Y._payload),It(G,F,Y,me)}if(ce(Y))return Ke(G,F,Y,me);if(se(Y)){if(je=se(Y),typeof je!="function")throw Error(o(150));return Y=je.call(Y),Fe(G,F,Y,me)}if(typeof Y.then=="function")return It(G,F,Bm(Y),me);if(Y.$$typeof===N)return It(G,F,km(G,Y),me);Hm(G,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,F!==null&&F.tag===6?(d(G,F.sibling),me=y(F,Y),me.return=G,G=me):(d(G,F),me=Sy(Y,G.mode,me),me.return=G,G=me),R(G)):d(G,F)}return function(G,F,Y,me){try{Qu=0;var je=It(G,F,Y,me);return Bl=null,je}catch(Pe){if(Pe===Bu||Pe===Am)throw Pe;var mt=Ur(29,Pe,null,G.mode);return mt.lanes=me,mt.return=G,mt}finally{}}}var Hl=T1(!0),k1=T1(!1),go=H(null),si=null;function vs(s){var a=s.alternate;B(On,On.current&1),B(go,s),si===null&&(a===null||Ul.current!==null||a.memoizedState!==null)&&(si=s)}function O1(s){if(s.tag===22){if(B(On,On.current),B(go,s),si===null){var a=s.alternate;a!==null&&a.memoizedState!==null&&(si=s)}}else ys()}function ys(){B(On,On.current),B(go,go.current)}function Ui(s){W(go),si===s&&(si=null),W(On)}var On=H(0);function Gm(s){for(var a=s;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||qb(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function rb(s,a,d,h){a=s.memoizedState,d=d(h,a),d=d==null?a:p({},a,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var ob={enqueueSetState:function(s,a,d){s=s._reactInternals;var h=Br(),y=hs(h);y.payload=a,d!=null&&(y.callback=d),a=ps(s,y,h),a!==null&&(Hr(a,s,h),Gu(a,s,h))},enqueueReplaceState:function(s,a,d){s=s._reactInternals;var h=Br(),y=hs(h);y.tag=1,y.payload=a,d!=null&&(y.callback=d),a=ps(s,y,h),a!==null&&(Hr(a,s,h),Gu(a,s,h))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var d=Br(),h=hs(d);h.tag=2,a!=null&&(h.callback=a),a=ps(s,h,d),a!==null&&(Hr(a,s,d),Gu(a,s,d))}};function A1(s,a,d,h,y,w,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,w,R):a.prototype&&a.prototype.isPureReactComponent?!Mu(d,h)||!Mu(y,w):!0}function I1(s,a,d,h){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,h),a.state!==s&&ob.enqueueReplaceState(a,a.state,null)}function Sa(s,a){var d=a;if("ref"in a){d={};for(var h in a)h!=="ref"&&(d[h]=a[h])}if(s=s.defaultProps){d===a&&(d=p({},d));for(var y in s)d[y]===void 0&&(d[y]=s[y])}return d}var qm=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)};function $1(s){qm(s)}function M1(s){console.error(s)}function P1(s){qm(s)}function Km(s,a){try{var d=s.onUncaughtError;d(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function D1(s,a,d){try{var h=s.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function ib(s,a,d){return d=hs(d),d.tag=3,d.payload={element:null},d.callback=function(){Km(s,a)},d}function z1(s){return s=hs(s),s.tag=3,s}function U1(s,a,d,h){var y=d.type.getDerivedStateFromError;if(typeof y=="function"){var w=h.value;s.payload=function(){return y(w)},s.callback=function(){D1(a,d,h)}}var R=d.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){D1(a,d,h),typeof y!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})})}function XV(s,a,d,h,y){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=d.alternate,a!==null&&Lu(a,d,y,!0),d=go.current,d!==null){switch(d.tag){case 13:return si===null?Tb():d.alternate===null&&Wt===0&&(Wt=3),d.flags&=-257,d.flags|=65536,d.lanes=y,h===$y?d.flags|=16384:(a=d.updateQueue,a===null?d.updateQueue=new Set([h]):a.add(h),Ob(s,h,y)),!1;case 22:return d.flags|=65536,h===$y?d.flags|=16384:(a=d.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=a):(d=a.retryQueue,d===null?a.retryQueue=new Set([h]):d.add(h)),Ob(s,h,y)),!1}throw Error(o(435,d.tag))}return Ob(s,h,y),Tb(),!1}if(St)return a=go.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,h!==jy&&(s=Error(o(422),{cause:h}),Uu(fo(s,d)))):(h!==jy&&(a=Error(o(423),{cause:h}),Uu(fo(a,d))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,h=fo(h,d),y=ib(s.stateNode,h,y),Dy(s,y),Wt!==4&&(Wt=2)),!1;var w=Error(o(520),{cause:h});if(w=fo(w,d),sd===null?sd=[w]:sd.push(w),Wt!==4&&(Wt=2),a===null)return!0;h=fo(h,d),d=a;do{switch(d.tag){case 3:return d.flags|=65536,s=y&-y,d.lanes|=s,s=ib(d.stateNode,h,s),Dy(d,s),!1;case 1:if(a=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Cs===null||!Cs.has(w))))return d.flags|=65536,y&=-y,d.lanes|=y,y=z1(y),U1(y,s,d,h),Dy(d,y),!1}d=d.return}while(d!==null);return!1}var L1=Error(o(461)),Ln=!1;function Xn(s,a,d,h){a.child=s===null?k1(a,null,d,h):Hl(a,s.child,d,h)}function F1(s,a,d,h,y){d=d.render;var w=a.ref;if("ref"in h){var R={};for(var O in h)O!=="ref"&&(R[O]=h[O])}else R=h;return xa(a),h=Vy(s,a,d,R,w,y),O=By(),s!==null&&!Ln?(Hy(s,a,y),Li(s,a,y)):(St&&O&&Ey(a),a.flags|=1,Xn(s,a,h,y),a.child)}function V1(s,a,d,h,y){if(s===null){var w=d.type;return typeof w=="function"&&!wy(w)&&w.defaultProps===void 0&&d.compare===null?(a.tag=15,a.type=w,B1(s,a,w,h,y)):(s=Rm(d.type,null,h,a,a.mode,y),s.ref=a.ref,s.return=a,a.child=s)}if(w=s.child,!mb(s,y)){var R=w.memoizedProps;if(d=d.compare,d=d!==null?d:Mu,d(R,h)&&s.ref===a.ref)return Li(s,a,y)}return a.flags|=1,s=Ii(w,h),s.ref=a.ref,s.return=a,a.child=s}function B1(s,a,d,h,y){if(s!==null){var w=s.memoizedProps;if(Mu(w,h)&&s.ref===a.ref)if(Ln=!1,a.pendingProps=h=w,mb(s,y))(s.flags&131072)!==0&&(Ln=!0);else return a.lanes=s.lanes,Li(s,a,y)}return sb(s,a,d,h,y)}function H1(s,a,d){var h=a.pendingProps,y=h.children,w=s!==null?s.memoizedState:null;if(h.mode==="hidden"){if((a.flags&128)!==0){if(h=w!==null?w.baseLanes|d:d,s!==null){for(y=a.child=s.child,w=0;y!==null;)w=w|y.lanes|y.childLanes,y=y.sibling;a.childLanes=w&~h}else a.childLanes=0,a.child=null;return G1(s,a,h,d)}if((d&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&Om(a,w!==null?w.cachePool:null),w!==null?BR(a,w):Uy(),O1(a);else return a.lanes=a.childLanes=536870912,G1(s,a,w!==null?w.baseLanes|d:d,d)}else w!==null?(Om(a,w.cachePool),BR(a,w),ys(),a.memoizedState=null):(s!==null&&Om(a,null),Uy(),ys());return Xn(s,a,y,d),a.child}function G1(s,a,d,h){var y=Iy();return y=y===null?null:{parent:kn._currentValue,pool:y},a.memoizedState={baseLanes:d,cachePool:y},s!==null&&Om(a,null),Uy(),O1(a),s!==null&&Lu(s,a,h,!0),null}function Zm(s,a){var d=a.ref;if(d===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(o(284));(s===null||s.ref!==d)&&(a.flags|=4194816)}}function sb(s,a,d,h,y){return xa(a),d=Vy(s,a,d,h,void 0,y),h=By(),s!==null&&!Ln?(Hy(s,a,y),Li(s,a,y)):(St&&h&&Ey(a),a.flags|=1,Xn(s,a,d,y),a.child)}function q1(s,a,d,h,y,w){return xa(a),a.updateQueue=null,d=GR(a,h,d,y),HR(s),h=By(),s!==null&&!Ln?(Hy(s,a,w),Li(s,a,w)):(St&&h&&Ey(a),a.flags|=1,Xn(s,a,d,w),a.child)}function K1(s,a,d,h,y){if(xa(a),a.stateNode===null){var w=$l,R=d.contextType;typeof R=="object"&&R!==null&&(w=nr(R)),w=new d(h,w),a.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=ob,a.stateNode=w,w._reactInternals=a,w=a.stateNode,w.props=h,w.state=a.memoizedState,w.refs={},My(a),R=d.contextType,w.context=typeof R=="object"&&R!==null?nr(R):$l,w.state=a.memoizedState,R=d.getDerivedStateFromProps,typeof R=="function"&&(rb(a,d,R,h),w.state=a.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(R=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),R!==w.state&&ob.enqueueReplaceState(w,w.state,null),Ku(a,h,w,y),qu(),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(s===null){w=a.stateNode;var O=a.memoizedProps,D=Sa(d,O);w.props=D;var Q=w.context,de=d.contextType;R=$l,typeof de=="object"&&de!==null&&(R=nr(de));var he=d.getDerivedStateFromProps;de=typeof he=="function"||typeof w.getSnapshotBeforeUpdate=="function",O=a.pendingProps!==O,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O||Q!==R)&&I1(a,w,h,R),ms=!1;var ee=a.memoizedState;w.state=ee,Ku(a,h,w,y),qu(),Q=a.memoizedState,O||ee!==Q||ms?(typeof he=="function"&&(rb(a,d,he,h),Q=a.memoizedState),(D=ms||A1(a,d,D,h,ee,Q,R))?(de||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(a.flags|=4194308)):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=Q),w.props=h,w.state=Q,w.context=R,h=D):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{w=a.stateNode,Py(s,a),R=a.memoizedProps,de=Sa(d,R),w.props=de,he=a.pendingProps,ee=w.context,Q=d.contextType,D=$l,typeof Q=="object"&&Q!==null&&(D=nr(Q)),O=d.getDerivedStateFromProps,(Q=typeof O=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(R!==he||ee!==D)&&I1(a,w,h,D),ms=!1,ee=a.memoizedState,w.state=ee,Ku(a,h,w,y),qu();var te=a.memoizedState;R!==he||ee!==te||ms||s!==null&&s.dependencies!==null&&Tm(s.dependencies)?(typeof O=="function"&&(rb(a,d,O,h),te=a.memoizedState),(de=ms||A1(a,d,de,h,ee,te,D)||s!==null&&s.dependencies!==null&&Tm(s.dependencies))?(Q||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,te,D),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,te,D)),typeof w.componentDidUpdate=="function"&&(a.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof w.componentDidUpdate!="function"||R===s.memoizedProps&&ee===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ee===s.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=te),w.props=h,w.state=te,w.context=D,h=de):(typeof w.componentDidUpdate!="function"||R===s.memoizedProps&&ee===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ee===s.memoizedState||(a.flags|=1024),h=!1)}return w=h,Zm(s,a),h=(a.flags&128)!==0,w||h?(w=a.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),a.flags|=1,s!==null&&h?(a.child=Hl(a,s.child,null,y),a.child=Hl(a,null,d,y)):Xn(s,a,d,y),a.memoizedState=w.state,s=a.child):s=Li(s,a,y),s}function Z1(s,a,d,h){return zu(),a.flags|=256,Xn(s,a,d,h),a.child}var ab={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lb(s){return{baseLanes:s,cachePool:MR()}}function cb(s,a,d){return s=s!==null?s.childLanes&~d:0,a&&(s|=vo),s}function Y1(s,a,d){var h=a.pendingProps,y=!1,w=(a.flags&128)!==0,R;if((R=w)||(R=s!==null&&s.memoizedState===null?!1:(On.current&2)!==0),R&&(y=!0,a.flags&=-129),R=(a.flags&32)!==0,a.flags&=-33,s===null){if(St){if(y?vs(a):ys(),St){var O=Xt,D;if(D=O){e:{for(D=O,O=ii;D.nodeType!==8;){if(!O){O=null;break e}if(D=zo(D.nextSibling),D===null){O=null;break e}}O=D}O!==null?(a.memoizedState={dehydrated:O,treeContext:pa!==null?{id:$i,overflow:Mi}:null,retryLane:536870912,hydrationErrors:null},D=Ur(18,null,null,0),D.stateNode=O,D.return=a,a.child=D,mr=a,Xt=null,D=!0):D=!1}D||ya(a)}if(O=a.memoizedState,O!==null&&(O=O.dehydrated,O!==null))return qb(O)?a.lanes=32:a.lanes=536870912,null;Ui(a)}return O=h.children,h=h.fallback,y?(ys(),y=a.mode,O=Ym({mode:"hidden",children:O},y),h=ha(h,y,d,null),O.return=a,h.return=a,O.sibling=h,a.child=O,y=a.child,y.memoizedState=lb(d),y.childLanes=cb(s,R,d),a.memoizedState=ab,h):(vs(a),ub(a,O))}if(D=s.memoizedState,D!==null&&(O=D.dehydrated,O!==null)){if(w)a.flags&256?(vs(a),a.flags&=-257,a=db(s,a,d)):a.memoizedState!==null?(ys(),a.child=s.child,a.flags|=128,a=null):(ys(),y=h.fallback,O=a.mode,h=Ym({mode:"visible",children:h.children},O),y=ha(y,O,d,null),y.flags|=2,h.return=a,y.return=a,h.sibling=y,a.child=h,Hl(a,s.child,null,d),h=a.child,h.memoizedState=lb(d),h.childLanes=cb(s,R,d),a.memoizedState=ab,a=y);else if(vs(a),qb(O)){if(R=O.nextSibling&&O.nextSibling.dataset,R)var Q=R.dgst;R=Q,h=Error(o(419)),h.stack="",h.digest=R,Uu({value:h,source:null,stack:null}),a=db(s,a,d)}else if(Ln||Lu(s,a,d,!1),R=(d&s.childLanes)!==0,Ln||R){if(R=zt,R!==null&&(h=d&-d,h=(h&42)!==0?1:bn(h),h=(h&(R.suspendedLanes|d))!==0?0:h,h!==0&&h!==D.retryLane))throw D.retryLane=h,Il(s,h),Hr(R,s,h),L1;O.data==="$?"||Tb(),a=db(s,a,d)}else O.data==="$?"?(a.flags|=192,a.child=s.child,a=null):(s=D.treeContext,Xt=zo(O.nextSibling),mr=a,St=!0,va=null,ii=!1,s!==null&&(ho[po++]=$i,ho[po++]=Mi,ho[po++]=pa,$i=s.id,Mi=s.overflow,pa=a),a=ub(a,h.children),a.flags|=4096);return a}return y?(ys(),y=h.fallback,O=a.mode,D=s.child,Q=D.sibling,h=Ii(D,{mode:"hidden",children:h.children}),h.subtreeFlags=D.subtreeFlags&65011712,Q!==null?y=Ii(Q,y):(y=ha(y,O,d,null),y.flags|=2),y.return=a,h.return=a,h.sibling=y,a.child=h,h=y,y=a.child,O=s.child.memoizedState,O===null?O=lb(d):(D=O.cachePool,D!==null?(Q=kn._currentValue,D=D.parent!==Q?{parent:Q,pool:Q}:D):D=MR(),O={baseLanes:O.baseLanes|d,cachePool:D}),y.memoizedState=O,y.childLanes=cb(s,R,d),a.memoizedState=ab,h):(vs(a),d=s.child,s=d.sibling,d=Ii(d,{mode:"visible",children:h.children}),d.return=a,d.sibling=null,s!==null&&(R=a.deletions,R===null?(a.deletions=[s],a.flags|=16):R.push(s)),a.child=d,a.memoizedState=null,d)}function ub(s,a){return a=Ym({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function Ym(s,a){return s=Ur(22,s,null,a),s.lanes=0,s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},s}function db(s,a,d){return Hl(a,s.child,null,d),s=ub(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function X1(s,a,d){s.lanes|=a;var h=s.alternate;h!==null&&(h.lanes|=a),Ty(s.return,a,d)}function fb(s,a,d,h,y){var w=s.memoizedState;w===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:y}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=d,w.tailMode=y)}function W1(s,a,d){var h=a.pendingProps,y=h.revealOrder,w=h.tail;if(Xn(s,a,h.children,d),h=On.current,(h&2)!==0)h=h&1|2,a.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&X1(s,d,a);else if(s.tag===19)X1(s,d,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}h&=1}switch(B(On,h),y){case"forwards":for(d=a.child,y=null;d!==null;)s=d.alternate,s!==null&&Gm(s)===null&&(y=d),d=d.sibling;d=y,d===null?(y=a.child,a.child=null):(y=d.sibling,d.sibling=null),fb(a,!1,y,d,w);break;case"backwards":for(d=null,y=a.child,a.child=null;y!==null;){if(s=y.alternate,s!==null&&Gm(s)===null){a.child=y;break}s=y.sibling,y.sibling=d,d=y,y=s}fb(a,!0,d,null,w);break;case"together":fb(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Li(s,a,d){if(s!==null&&(a.dependencies=s.dependencies),Ss|=a.lanes,(d&a.childLanes)===0)if(s!==null){if(Lu(s,a,d,!1),(d&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(o(153));if(a.child!==null){for(s=a.child,d=Ii(s,s.pendingProps),a.child=d,d.return=a;s.sibling!==null;)s=s.sibling,d=d.sibling=Ii(s,s.pendingProps),d.return=a;d.sibling=null}return a.child}function mb(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&Tm(s)))}function WV(s,a,d){switch(a.tag){case 3:fe(a,a.stateNode.containerInfo),fs(a,kn,s.memoizedState.cache),zu();break;case 27:case 5:Ve(a);break;case 4:fe(a,a.stateNode.containerInfo);break;case 10:fs(a,a.type,a.memoizedProps.value);break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(vs(a),a.flags|=128,null):(d&a.child.childLanes)!==0?Y1(s,a,d):(vs(a),s=Li(s,a,d),s!==null?s.sibling:null);vs(a);break;case 19:var y=(s.flags&128)!==0;if(h=(d&a.childLanes)!==0,h||(Lu(s,a,d,!1),h=(d&a.childLanes)!==0),y){if(h)return W1(s,a,d);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),B(On,On.current),h)break;return null;case 22:case 23:return a.lanes=0,H1(s,a,d);case 24:fs(a,kn,s.memoizedState.cache)}return Li(s,a,d)}function Q1(s,a,d){if(s!==null)if(s.memoizedProps!==a.pendingProps)Ln=!0;else{if(!mb(s,d)&&(a.flags&128)===0)return Ln=!1,WV(s,a,d);Ln=(s.flags&131072)!==0}else Ln=!1,St&&(a.flags&1048576)!==0&&NR(a,Nm,a.index);switch(a.lanes=0,a.tag){case 16:e:{s=a.pendingProps;var h=a.elementType,y=h._init;if(h=y(h._payload),a.type=h,typeof h=="function")wy(h)?(s=Sa(h,s),a.tag=1,a=K1(null,a,h,s,d)):(a.tag=0,a=sb(null,a,h,s,d));else{if(h!=null){if(y=h.$$typeof,y===T){a.tag=11,a=F1(null,a,h,s,d);break e}else if(y===I){a.tag=14,a=V1(null,a,h,s,d);break e}}throw a=le(h)||h,Error(o(306,a,""))}}return a;case 0:return sb(s,a,a.type,a.pendingProps,d);case 1:return h=a.type,y=Sa(h,a.pendingProps),K1(s,a,h,y,d);case 3:e:{if(fe(a,a.stateNode.containerInfo),s===null)throw Error(o(387));h=a.pendingProps;var w=a.memoizedState;y=w.element,Py(s,a),Ku(a,h,null,d);var R=a.memoizedState;if(h=R.cache,fs(a,kn,h),h!==w.cache&&ky(a,[kn],d,!0),qu(),h=R.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:R.cache},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){a=Z1(s,a,h,d);break e}else if(h!==y){y=fo(Error(o(424)),a),Uu(y),a=Z1(s,a,h,d);break e}else{switch(s=a.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Xt=zo(s.firstChild),mr=a,St=!0,va=null,ii=!0,d=k1(a,null,h,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(zu(),h===y){a=Li(s,a,d);break e}Xn(s,a,h,d)}a=a.child}return a;case 26:return Zm(s,a),s===null?(d=nN(a.type,null,a.pendingProps,null))?a.memoizedState=d:St||(d=a.type,s=a.pendingProps,h=ch(ye.current).createElement(d),h[sn]=a,h[Dt]=s,Qn(h,d,s),Un(h),a.stateNode=h):a.memoizedState=nN(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return Ve(a),s===null&&St&&(h=a.stateNode=Jj(a.type,a.pendingProps,ye.current),mr=a,ii=!0,y=Xt,js(a.type)?(Kb=y,Xt=zo(h.firstChild)):Xt=y),Xn(s,a,a.pendingProps.children,d),Zm(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&St&&((y=h=Xt)&&(h=E3(h,a.type,a.pendingProps,ii),h!==null?(a.stateNode=h,mr=a,Xt=zo(h.firstChild),ii=!1,y=!0):y=!1),y||ya(a)),Ve(a),y=a.type,w=a.pendingProps,R=s!==null?s.memoizedProps:null,h=w.children,Bb(y,w)?h=null:R!==null&&Bb(y,R)&&(a.flags|=32),a.memoizedState!==null&&(y=Vy(s,a,BV,null,null,d),pd._currentValue=y),Zm(s,a),Xn(s,a,h,d),a.child;case 6:return s===null&&St&&((s=d=Xt)&&(d=R3(d,a.pendingProps,ii),d!==null?(a.stateNode=d,mr=a,Xt=null,s=!0):s=!1),s||ya(a)),null;case 13:return Y1(s,a,d);case 4:return fe(a,a.stateNode.containerInfo),h=a.pendingProps,s===null?a.child=Hl(a,null,h,d):Xn(s,a,h,d),a.child;case 11:return F1(s,a,a.type,a.pendingProps,d);case 7:return Xn(s,a,a.pendingProps,d),a.child;case 8:return Xn(s,a,a.pendingProps.children,d),a.child;case 12:return Xn(s,a,a.pendingProps.children,d),a.child;case 10:return h=a.pendingProps,fs(a,a.type,h.value),Xn(s,a,h.children,d),a.child;case 9:return y=a.type._context,h=a.pendingProps.children,xa(a),y=nr(y),h=h(y),a.flags|=1,Xn(s,a,h,d),a.child;case 14:return V1(s,a,a.type,a.pendingProps,d);case 15:return B1(s,a,a.type,a.pendingProps,d);case 19:return W1(s,a,d);case 31:return h=a.pendingProps,d=a.mode,h={mode:h.mode,children:h.children},s===null?(d=Ym(h,d),d.ref=a.ref,a.child=d,d.return=a,a=d):(d=Ii(s.child,h),d.ref=a.ref,a.child=d,d.return=a,a=d),a;case 22:return H1(s,a,d);case 24:return xa(a),h=nr(kn),s===null?(y=Iy(),y===null&&(y=zt,w=Oy(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=d),y=w),a.memoizedState={parent:h,cache:y},My(a),fs(a,kn,y)):((s.lanes&d)!==0&&(Py(s,a),Ku(a,null,null,d),qu()),y=s.memoizedState,w=a.memoizedState,y.parent!==h?(y={parent:h,cache:h},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),fs(a,kn,h)):(h=w.cache,fs(a,kn,h),h!==y.cache&&ky(a,[kn],d,!0))),Xn(s,a,a.pendingProps.children,d),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Fi(s){s.flags|=4}function J1(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!aN(a)){if(a=go.current,a!==null&&((bt&4194048)===bt?si!==null:(bt&62914560)!==bt&&(bt&536870912)===0||a!==si))throw Hu=$y,PR;s.flags|=8192}}function Xm(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?um():536870912,s.lanes|=a,Zl|=a)}function ed(s,a){if(!St)switch(s.tailMode){case"hidden":a=s.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Zt(s){var a=s.alternate!==null&&s.alternate.child===s.child,d=0,h=0;if(a)for(var y=s.child;y!==null;)d|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)d|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=h,s.childLanes=d,a}function QV(s,a,d){var h=a.pendingProps;switch(Ry(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(a),null;case 1:return Zt(a),null;case 3:return d=a.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),Di(kn),ze(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(s===null||s.child===null)&&(Du(a)?Fi(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,OR())),Zt(a),null;case 26:return d=a.memoizedState,s===null?(Fi(a),d!==null?(Zt(a),J1(a,d)):(Zt(a),a.flags&=-16777217)):d?d!==s.memoizedState?(Fi(a),Zt(a),J1(a,d)):(Zt(a),a.flags&=-16777217):(s.memoizedProps!==h&&Fi(a),Zt(a),a.flags&=-16777217),null;case 27:Ye(a),d=ye.current;var y=a.type;if(s!==null&&a.stateNode!=null)s.memoizedProps!==h&&Fi(a);else{if(!h){if(a.stateNode===null)throw Error(o(166));return Zt(a),null}s=J.current,Du(a)?TR(a):(s=Jj(y,h,d),a.stateNode=s,Fi(a))}return Zt(a),null;case 5:if(Ye(a),d=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==h&&Fi(a);else{if(!h){if(a.stateNode===null)throw Error(o(166));return Zt(a),null}if(s=J.current,Du(a))TR(a);else{switch(y=ch(ye.current),s){case 1:s=y.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:s=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":s=y.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":s=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":s=y.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?s.multiple=!0:h.size&&(s.size=h.size);break;default:s=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}s[sn]=a,s[Dt]=h;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)s.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=s;e:switch(Qn(s,d,h),d){case"button":case"input":case"select":case"textarea":s=!!h.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Fi(a)}}return Zt(a),a.flags&=-16777217,null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==h&&Fi(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(o(166));if(s=ye.current,Du(a)){if(s=a.stateNode,d=a.memoizedProps,h=null,y=mr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}s[sn]=a,s=!!(s.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||qj(s.nodeValue,d)),s||ya(a)}else s=ch(s).createTextNode(h),s[sn]=a,a.stateNode=s}return Zt(a),null;case 13:if(h=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Du(a),h!==null&&h.dehydrated!==null){if(s===null){if(!y)throw Error(o(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(o(317));y[sn]=a}else zu(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Zt(a),y=!1}else y=OR(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Ui(a),a):(Ui(a),null)}if(Ui(a),(a.flags&128)!==0)return a.lanes=d,a;if(d=h!==null,s=s!==null&&s.memoizedState!==null,d){h=a.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==y&&(h.flags|=2048)}return d!==s&&d&&(a.child.flags|=8192),Xm(a,a.updateQueue),Zt(a),null;case 4:return ze(),s===null&&zb(a.stateNode.containerInfo),Zt(a),null;case 10:return Di(a.type),Zt(a),null;case 19:if(W(On),y=a.memoizedState,y===null)return Zt(a),null;if(h=(a.flags&128)!==0,w=y.rendering,w===null)if(h)ed(y,!1);else{if(Wt!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(w=Gm(s),w!==null){for(a.flags|=128,ed(y,!1),s=w.updateQueue,a.updateQueue=s,Xm(a,s),a.subtreeFlags=0,s=d,d=a.child;d!==null;)jR(d,s),d=d.sibling;return B(On,On.current&1|2),a.child}s=s.sibling}y.tail!==null&&Mt()>Jm&&(a.flags|=128,h=!0,ed(y,!1),a.lanes=4194304)}else{if(!h)if(s=Gm(w),s!==null){if(a.flags|=128,h=!0,s=s.updateQueue,a.updateQueue=s,Xm(a,s),ed(y,!0),y.tail===null&&y.tailMode==="hidden"&&!w.alternate&&!St)return Zt(a),null}else 2*Mt()-y.renderingStartTime>Jm&&d!==536870912&&(a.flags|=128,h=!0,ed(y,!1),a.lanes=4194304);y.isBackwards?(w.sibling=a.child,a.child=w):(s=y.last,s!==null?s.sibling=w:a.child=w,y.last=w)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=Mt(),a.sibling=null,s=On.current,B(On,h?s&1|2:s&1),a):(Zt(a),null);case 22:case 23:return Ui(a),Ly(),h=a.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(d&536870912)!==0&&(a.flags&128)===0&&(Zt(a),a.subtreeFlags&6&&(a.flags|=8192)):Zt(a),d=a.updateQueue,d!==null&&Xm(a,d.retryQueue),d=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==d&&(a.flags|=2048),s!==null&&W(_a),null;case 24:return d=null,s!==null&&(d=s.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Di(kn),Zt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function JV(s,a){switch(Ry(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return Di(kn),ze(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return Ye(a),null;case 13:if(Ui(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(o(340));zu()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return W(On),null;case 4:return ze(),null;case 10:return Di(a.type),null;case 22:case 23:return Ui(a),Ly(),s!==null&&W(_a),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return Di(kn),null;case 25:return null;default:return null}}function ej(s,a){switch(Ry(a),a.tag){case 3:Di(kn),ze();break;case 26:case 27:case 5:Ye(a);break;case 4:ze();break;case 13:Ui(a);break;case 19:W(On);break;case 10:Di(a.type);break;case 22:case 23:Ui(a),Ly(),s!==null&&W(_a);break;case 24:Di(kn)}}function td(s,a){try{var d=a.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var y=h.next;d=y;do{if((d.tag&s)===s){h=void 0;var w=d.create,R=d.inst;h=w(),R.destroy=h}d=d.next}while(d!==y)}}catch(O){$t(a,a.return,O)}}function bs(s,a,d){try{var h=a.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var w=y.next;h=w;do{if((h.tag&s)===s){var R=h.inst,O=R.destroy;if(O!==void 0){R.destroy=void 0,y=a;var D=d,Q=O;try{Q()}catch(de){$t(y,D,de)}}}h=h.next}while(h!==w)}}catch(de){$t(a,a.return,de)}}function tj(s){var a=s.updateQueue;if(a!==null){var d=s.stateNode;try{VR(a,d)}catch(h){$t(s,s.return,h)}}}function nj(s,a,d){d.props=Sa(s.type,s.memoizedProps),d.state=s.memoizedState;try{d.componentWillUnmount()}catch(h){$t(s,a,h)}}function nd(s,a){try{var d=s.ref;if(d!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof d=="function"?s.refCleanup=d(h):d.current=h}}catch(y){$t(s,a,y)}}function ai(s,a){var d=s.ref,h=s.refCleanup;if(d!==null)if(typeof h=="function")try{h()}catch(y){$t(s,a,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(y){$t(s,a,y)}else d.current=null}function rj(s){var a=s.type,d=s.memoizedProps,h=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(y){$t(s,s.return,y)}}function hb(s,a,d){try{var h=s.stateNode;x3(h,s.type,d,a),h[Dt]=a}catch(y){$t(s,s.return,y)}}function oj(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&js(s.type)||s.tag===4}function pb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||oj(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&js(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function gb(s,a,d){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(s,a):(a=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,a.appendChild(s),d=d._reactRootContainer,d!=null||a.onclick!==null||(a.onclick=lh));else if(h!==4&&(h===27&&js(s.type)&&(d=s.stateNode,a=null),s=s.child,s!==null))for(gb(s,a,d),s=s.sibling;s!==null;)gb(s,a,d),s=s.sibling}function Wm(s,a,d){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?d.insertBefore(s,a):d.appendChild(s);else if(h!==4&&(h===27&&js(s.type)&&(d=s.stateNode),s=s.child,s!==null))for(Wm(s,a,d),s=s.sibling;s!==null;)Wm(s,a,d),s=s.sibling}function ij(s){var a=s.stateNode,d=s.memoizedProps;try{for(var h=s.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);Qn(a,h,d),a[sn]=s,a[Dt]=d}catch(w){$t(s,s.return,w)}}var Vi=!1,ln=!1,vb=!1,sj=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function e3(s,a){if(s=s.containerInfo,Fb=ph,s=vR(s),py(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var y=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var R=0,O=-1,D=-1,Q=0,de=0,he=s,ee=null;t:for(;;){for(var te;he!==d||y!==0&&he.nodeType!==3||(O=R+y),he!==w||h!==0&&he.nodeType!==3||(D=R+h),he.nodeType===3&&(R+=he.nodeValue.length),(te=he.firstChild)!==null;)ee=he,he=te;for(;;){if(he===s)break t;if(ee===d&&++Q===y&&(O=R),ee===w&&++de===h&&(D=R),(te=he.nextSibling)!==null)break;he=ee,ee=he.parentNode}he=te}d=O===-1||D===-1?null:{start:O,end:D}}else d=null}d=d||{start:0,end:0}}else d=null;for(Vb={focusedElem:s,selectionRange:d},ph=!1,Fn=a;Fn!==null;)if(a=Fn,s=a.child,(a.subtreeFlags&1024)!==0&&s!==null)s.return=a,Fn=s;else for(;Fn!==null;){switch(a=Fn,w=a.alternate,s=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((s&1024)!==0&&w!==null){s=void 0,d=a,y=w.memoizedProps,w=w.memoizedState,h=d.stateNode;try{var Ke=Sa(d.type,y,d.elementType===d.type);s=h.getSnapshotBeforeUpdate(Ke,w),h.__reactInternalSnapshotBeforeUpdate=s}catch(Fe){$t(d,d.return,Fe)}}break;case 3:if((s&1024)!==0){if(s=a.stateNode.containerInfo,d=s.nodeType,d===9)Gb(s);else if(d===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Gb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(o(163))}if(s=a.sibling,s!==null){s.return=a.return,Fn=s;break}Fn=a.return}}function aj(s,a,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:xs(s,d),h&4&&td(5,d);break;case 1:if(xs(s,d),h&4)if(s=d.stateNode,a===null)try{s.componentDidMount()}catch(R){$t(d,d.return,R)}else{var y=Sa(d.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(y,a,s.__reactInternalSnapshotBeforeUpdate)}catch(R){$t(d,d.return,R)}}h&64&&tj(d),h&512&&nd(d,d.return);break;case 3:if(xs(s,d),h&64&&(s=d.updateQueue,s!==null)){if(a=null,d.child!==null)switch(d.child.tag){case 27:case 5:a=d.child.stateNode;break;case 1:a=d.child.stateNode}try{VR(s,a)}catch(R){$t(d,d.return,R)}}break;case 27:a===null&&h&4&&ij(d);case 26:case 5:xs(s,d),a===null&&h&4&&rj(d),h&512&&nd(d,d.return);break;case 12:xs(s,d);break;case 13:xs(s,d),h&4&&uj(s,d),h&64&&(s=d.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(d=c3.bind(null,d),j3(s,d))));break;case 22:if(h=d.memoizedState!==null||Vi,!h){a=a!==null&&a.memoizedState!==null||ln,y=Vi;var w=ln;Vi=h,(ln=a)&&!w?_s(s,d,(d.subtreeFlags&8772)!==0):xs(s,d),Vi=y,ln=w}break;case 30:break;default:xs(s,d)}}function lj(s){var a=s.alternate;a!==null&&(s.alternate=null,lj(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&Xv(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var qt=null,jr=!1;function Bi(s,a,d){for(d=d.child;d!==null;)cj(s,a,d),d=d.sibling}function cj(s,a,d){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(Re,d)}catch{}switch(d.tag){case 26:ln||ai(d,a),Bi(s,a,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ln||ai(d,a);var h=qt,y=jr;js(d.type)&&(qt=d.stateNode,jr=!1),Bi(s,a,d),dd(d.stateNode),qt=h,jr=y;break;case 5:ln||ai(d,a);case 6:if(h=qt,y=jr,qt=null,Bi(s,a,d),qt=h,jr=y,qt!==null)if(jr)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(d.stateNode)}catch(w){$t(d,a,w)}else try{qt.removeChild(d.stateNode)}catch(w){$t(d,a,w)}break;case 18:qt!==null&&(jr?(s=qt,Wj(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,d.stateNode),bd(s)):Wj(qt,d.stateNode));break;case 4:h=qt,y=jr,qt=d.stateNode.containerInfo,jr=!0,Bi(s,a,d),qt=h,jr=y;break;case 0:case 11:case 14:case 15:ln||bs(2,d,a),ln||bs(4,d,a),Bi(s,a,d);break;case 1:ln||(ai(d,a),h=d.stateNode,typeof h.componentWillUnmount=="function"&&nj(d,a,h)),Bi(s,a,d);break;case 21:Bi(s,a,d);break;case 22:ln=(h=ln)||d.memoizedState!==null,Bi(s,a,d),ln=h;break;default:Bi(s,a,d)}}function uj(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{bd(s)}catch(d){$t(a,a.return,d)}}function t3(s){switch(s.tag){case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new sj),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new sj),a;default:throw Error(o(435,s.tag))}}function yb(s,a){var d=t3(s);a.forEach(function(h){var y=u3.bind(null,s,h);d.has(h)||(d.add(h),h.then(y,y))})}function Lr(s,a){var d=a.deletions;if(d!==null)for(var h=0;h<d.length;h++){var y=d[h],w=s,R=a,O=R;e:for(;O!==null;){switch(O.tag){case 27:if(js(O.type)){qt=O.stateNode,jr=!1;break e}break;case 5:qt=O.stateNode,jr=!1;break e;case 3:case 4:qt=O.stateNode.containerInfo,jr=!0;break e}O=O.return}if(qt===null)throw Error(o(160));cj(w,R,y),qt=null,jr=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)dj(a,s),a=a.sibling}var Do=null;function dj(s,a){var d=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Lr(a,s),Fr(s),h&4&&(bs(3,s,s.return),td(3,s),bs(5,s,s.return));break;case 1:Lr(a,s),Fr(s),h&512&&(ln||d===null||ai(d,d.return)),h&64&&Vi&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(d=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var y=Do;if(Lr(a,s),Fr(s),h&512&&(ln||d===null||ai(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=s.memoizedState,d===null)if(h===null)if(s.stateNode===null){e:{h=s.type,d=s.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":w=y.getElementsByTagName("title")[0],(!w||w[Ru]||w[sn]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(h),y.head.insertBefore(w,y.querySelector("head > title"))),Qn(w,h,d),w[sn]=s,Un(w),h=w;break e;case"link":var R=iN("link","href",y).get(h+(d.href||""));if(R){for(var O=0;O<R.length;O++)if(w=R[O],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){R.splice(O,1);break t}}w=y.createElement(h),Qn(w,h,d),y.head.appendChild(w);break;case"meta":if(R=iN("meta","content",y).get(h+(d.content||""))){for(O=0;O<R.length;O++)if(w=R[O],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){R.splice(O,1);break t}}w=y.createElement(h),Qn(w,h,d),y.head.appendChild(w);break;default:throw Error(o(468,h))}w[sn]=s,Un(w),h=w}s.stateNode=h}else sN(y,s.type,s.stateNode);else s.stateNode=oN(y,h,s.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?sN(y,s.type,s.stateNode):oN(y,h,s.memoizedProps)):h===null&&s.stateNode!==null&&hb(s,s.memoizedProps,d.memoizedProps)}break;case 27:Lr(a,s),Fr(s),h&512&&(ln||d===null||ai(d,d.return)),d!==null&&h&4&&hb(s,s.memoizedProps,d.memoizedProps);break;case 5:if(Lr(a,s),Fr(s),h&512&&(ln||d===null||ai(d,d.return)),s.flags&32){y=s.stateNode;try{Rl(y,"")}catch(te){$t(s,s.return,te)}}h&4&&s.stateNode!=null&&(y=s.memoizedProps,hb(s,y,d!==null?d.memoizedProps:y)),h&1024&&(vb=!0);break;case 6:if(Lr(a,s),Fr(s),h&4){if(s.stateNode===null)throw Error(o(162));h=s.memoizedProps,d=s.stateNode;try{d.nodeValue=h}catch(te){$t(s,s.return,te)}}break;case 3:if(fh=null,y=Do,Do=uh(a.containerInfo),Lr(a,s),Do=y,Fr(s),h&4&&d!==null&&d.memoizedState.isDehydrated)try{bd(a.containerInfo)}catch(te){$t(s,s.return,te)}vb&&(vb=!1,fj(s));break;case 4:h=Do,Do=uh(s.stateNode.containerInfo),Lr(a,s),Fr(s),Do=h;break;case 12:Lr(a,s),Fr(s);break;case 13:Lr(a,s),Fr(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Cb=Mt()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,yb(s,h)));break;case 22:y=s.memoizedState!==null;var D=d!==null&&d.memoizedState!==null,Q=Vi,de=ln;if(Vi=Q||y,ln=de||D,Lr(a,s),ln=de,Vi=Q,Fr(s),h&8192)e:for(a=s.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(d===null||D||Vi||ln||Ca(s)),d=null,a=s;;){if(a.tag===5||a.tag===26){if(d===null){D=d=a;try{if(w=D.stateNode,y)R=w.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{O=D.stateNode;var he=D.memoizedProps.style,ee=he!=null&&he.hasOwnProperty("display")?he.display:null;O.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(te){$t(D,D.return,te)}}}else if(a.tag===6){if(d===null){D=a;try{D.stateNode.nodeValue=y?"":D.memoizedProps}catch(te){$t(D,D.return,te)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;d===a&&(d=null),a=a.return}d===a&&(d=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=s.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,yb(s,d))));break;case 19:Lr(a,s),Fr(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,yb(s,h)));break;case 30:break;case 21:break;default:Lr(a,s),Fr(s)}}function Fr(s){var a=s.flags;if(a&2){try{for(var d,h=s.return;h!==null;){if(oj(h)){d=h;break}h=h.return}if(d==null)throw Error(o(160));switch(d.tag){case 27:var y=d.stateNode,w=pb(s);Wm(s,w,y);break;case 5:var R=d.stateNode;d.flags&32&&(Rl(R,""),d.flags&=-33);var O=pb(s);Wm(s,O,R);break;case 3:case 4:var D=d.stateNode.containerInfo,Q=pb(s);gb(s,Q,D);break;default:throw Error(o(161))}}catch(de){$t(s,s.return,de)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function fj(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;fj(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),s=s.sibling}}function xs(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)aj(s,a.alternate,a),a=a.sibling}function Ca(s){for(s=s.child;s!==null;){var a=s;switch(a.tag){case 0:case 11:case 14:case 15:bs(4,a,a.return),Ca(a);break;case 1:ai(a,a.return);var d=a.stateNode;typeof d.componentWillUnmount=="function"&&nj(a,a.return,d),Ca(a);break;case 27:dd(a.stateNode);case 26:case 5:ai(a,a.return),Ca(a);break;case 22:a.memoizedState===null&&Ca(a);break;case 30:Ca(a);break;default:Ca(a)}s=s.sibling}}function _s(s,a,d){for(d=d&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,y=s,w=a,R=w.flags;switch(w.tag){case 0:case 11:case 15:_s(y,w,d),td(4,w);break;case 1:if(_s(y,w,d),h=w,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(Q){$t(h,h.return,Q)}if(h=w,y=h.updateQueue,y!==null){var O=h.stateNode;try{var D=y.shared.hiddenCallbacks;if(D!==null)for(y.shared.hiddenCallbacks=null,y=0;y<D.length;y++)FR(D[y],O)}catch(Q){$t(h,h.return,Q)}}d&&R&64&&tj(w),nd(w,w.return);break;case 27:ij(w);case 26:case 5:_s(y,w,d),d&&h===null&&R&4&&rj(w),nd(w,w.return);break;case 12:_s(y,w,d);break;case 13:_s(y,w,d),d&&R&4&&uj(y,w);break;case 22:w.memoizedState===null&&_s(y,w,d),nd(w,w.return);break;case 30:break;default:_s(y,w,d)}a=a.sibling}}function bb(s,a){var d=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==d&&(s!=null&&s.refCount++,d!=null&&Fu(d))}function xb(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Fu(s))}function li(s,a,d,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)mj(s,a,d,h),a=a.sibling}function mj(s,a,d,h){var y=a.flags;switch(a.tag){case 0:case 11:case 15:li(s,a,d,h),y&2048&&td(9,a);break;case 1:li(s,a,d,h);break;case 3:li(s,a,d,h),y&2048&&(s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Fu(s)));break;case 12:if(y&2048){li(s,a,d,h),s=a.stateNode;try{var w=a.memoizedProps,R=w.id,O=w.onPostCommit;typeof O=="function"&&O(R,a.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(D){$t(a,a.return,D)}}else li(s,a,d,h);break;case 13:li(s,a,d,h);break;case 23:break;case 22:w=a.stateNode,R=a.alternate,a.memoizedState!==null?w._visibility&2?li(s,a,d,h):rd(s,a):w._visibility&2?li(s,a,d,h):(w._visibility|=2,Gl(s,a,d,h,(a.subtreeFlags&10256)!==0)),y&2048&&bb(R,a);break;case 24:li(s,a,d,h),y&2048&&xb(a.alternate,a);break;default:li(s,a,d,h)}}function Gl(s,a,d,h,y){for(y=y&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var w=s,R=a,O=d,D=h,Q=R.flags;switch(R.tag){case 0:case 11:case 15:Gl(w,R,O,D,y),td(8,R);break;case 23:break;case 22:var de=R.stateNode;R.memoizedState!==null?de._visibility&2?Gl(w,R,O,D,y):rd(w,R):(de._visibility|=2,Gl(w,R,O,D,y)),y&&Q&2048&&bb(R.alternate,R);break;case 24:Gl(w,R,O,D,y),y&&Q&2048&&xb(R.alternate,R);break;default:Gl(w,R,O,D,y)}a=a.sibling}}function rd(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var d=s,h=a,y=h.flags;switch(h.tag){case 22:rd(d,h),y&2048&&bb(h.alternate,h);break;case 24:rd(d,h),y&2048&&xb(h.alternate,h);break;default:rd(d,h)}a=a.sibling}}var od=8192;function ql(s){if(s.subtreeFlags&od)for(s=s.child;s!==null;)hj(s),s=s.sibling}function hj(s){switch(s.tag){case 26:ql(s),s.flags&od&&s.memoizedState!==null&&L3(Do,s.memoizedState,s.memoizedProps);break;case 5:ql(s);break;case 3:case 4:var a=Do;Do=uh(s.stateNode.containerInfo),ql(s),Do=a;break;case 22:s.memoizedState===null&&(a=s.alternate,a!==null&&a.memoizedState!==null?(a=od,od=16777216,ql(s),od=a):ql(s));break;default:ql(s)}}function pj(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function id(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var d=0;d<a.length;d++){var h=a[d];Fn=h,vj(h,s)}pj(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)gj(s),s=s.sibling}function gj(s){switch(s.tag){case 0:case 11:case 15:id(s),s.flags&2048&&bs(9,s,s.return);break;case 3:id(s);break;case 12:id(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,Qm(s)):id(s);break;default:id(s)}}function Qm(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var d=0;d<a.length;d++){var h=a[d];Fn=h,vj(h,s)}pj(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:bs(8,a,a.return),Qm(a);break;case 22:d=a.stateNode,d._visibility&2&&(d._visibility&=-3,Qm(a));break;default:Qm(a)}s=s.sibling}}function vj(s,a){for(;Fn!==null;){var d=Fn;switch(d.tag){case 0:case 11:case 15:bs(8,d,a);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Fu(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,Fn=h;else e:for(d=s;Fn!==null;){h=Fn;var y=h.sibling,w=h.return;if(lj(h),h===d){Fn=null;break e}if(y!==null){y.return=w,Fn=y;break e}Fn=w}}}var n3={getCacheForType:function(s){var a=nr(kn),d=a.data.get(s);return d===void 0&&(d=s(),a.data.set(s,d)),d}},r3=typeof WeakMap=="function"?WeakMap:Map,jt=0,zt=null,pt=null,bt=0,Nt=0,Vr=null,ws=!1,Kl=!1,_b=!1,Hi=0,Wt=0,Ss=0,Ea=0,wb=0,vo=0,Zl=0,sd=null,Nr=null,Sb=!1,Cb=0,Jm=1/0,eh=null,Cs=null,Wn=0,Es=null,Yl=null,Xl=0,Eb=0,Rb=null,yj=null,ad=0,jb=null;function Br(){if((jt&2)!==0&&bt!==0)return bt&-bt;if(M.T!==null){var s=Dl;return s!==0?s:$b()}return ca()}function bj(){vo===0&&(vo=(bt&536870912)===0||St?Mo():536870912);var s=go.current;return s!==null&&(s.flags|=32),vo}function Hr(s,a,d){(s===zt&&(Nt===2||Nt===9)||s.cancelPendingCommit!==null)&&(Wl(s,0),Rs(s,bt,vo,!1)),us(s,d),((jt&2)===0||s!==zt)&&(s===zt&&((jt&2)===0&&(Ea|=d),Wt===4&&Rs(s,bt,vo,!1)),ci(s))}function xj(s,a,d){if((jt&6)!==0)throw Error(o(327));var h=!d&&(a&124)===0&&(a&s.expiredLanes)===0||Ti(s,a),y=h?s3(s,a):kb(s,a,!0),w=h;do{if(y===0){Kl&&!h&&Rs(s,a,0,!1);break}else{if(d=s.current.alternate,w&&!o3(d)){y=kb(s,a,!1),w=!1;continue}if(y===2){if(w=a,s.errorRecoveryDisabledLanes&w)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){a=R;e:{var O=s;y=sd;var D=O.current.memoizedState.isDehydrated;if(D&&(Wl(O,R).flags|=256),R=kb(O,R,!1),R!==2){if(_b&&!D){O.errorRecoveryDisabledLanes|=w,Ea|=w,y=4;break e}w=Nr,Nr=y,w!==null&&(Nr===null?Nr=w:Nr.push.apply(Nr,w))}y=R}if(w=!1,y!==2)continue}}if(y===1){Wl(s,0),Rs(s,a,0,!0);break}e:{switch(h=s,w=y,w){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:Rs(h,a,vo,!ws);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(y=Cb+300-Mt(),10<y)){if(Rs(h,a,vo,!ws),oi(h,0,!0)!==0)break e;h.timeoutHandle=Yj(_j.bind(null,h,d,Nr,eh,Sb,a,vo,Ea,Zl,ws,w,2,-0,0),y);break e}_j(h,d,Nr,eh,Sb,a,vo,Ea,Zl,ws,w,0,-0,0)}}break}while(!0);ci(s)}function _j(s,a,d,h,y,w,R,O,D,Q,de,he,ee,te){if(s.timeoutHandle=-1,he=a.subtreeFlags,(he&8192||(he&16785408)===16785408)&&(hd={stylesheets:null,count:0,unsuspend:U3},hj(a),he=F3(),he!==null)){s.cancelPendingCommit=he(Nj.bind(null,s,a,w,d,h,y,R,O,D,de,1,ee,te)),Rs(s,w,R,!Q);return}Nj(s,a,w,d,h,y,R,O,D)}function o3(s){for(var a=s;;){var d=a.tag;if((d===0||d===11||d===15)&&a.flags&16384&&(d=a.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var h=0;h<d.length;h++){var y=d[h],w=y.getSnapshot;y=y.value;try{if(!zr(w(),y))return!1}catch{return!1}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Rs(s,a,d,h){a&=~wb,a&=~Ea,s.suspendedLanes|=a,s.pingedLanes&=~a,h&&(s.warmLanes|=a),h=s.expirationTimes;for(var y=a;0<y;){var w=31-Rt(y),R=1<<w;h[w]=-1,y&=~R}d!==0&&Qe(s,d,a)}function th(){return(jt&6)===0?(ld(0),!1):!0}function Nb(){if(pt!==null){if(Nt===0)var s=pt.return;else s=pt,Pi=ba=null,Gy(s),Bl=null,Qu=0,s=pt;for(;s!==null;)ej(s.alternate,s),s=s.return;pt=null}}function Wl(s,a){var d=s.timeoutHandle;d!==-1&&(s.timeoutHandle=-1,w3(d)),d=s.cancelPendingCommit,d!==null&&(s.cancelPendingCommit=null,d()),Nb(),zt=s,pt=d=Ii(s.current,null),bt=a,Nt=0,Vr=null,ws=!1,Kl=Ti(s,a),_b=!1,Zl=vo=wb=Ea=Ss=Wt=0,Nr=sd=null,Sb=!1,(a&8)!==0&&(a|=a&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=a;0<h;){var y=31-Rt(h),w=1<<y;a|=s[y],h&=~w}return Hi=a,Sm(),d}function wj(s,a){ct=null,M.H=Vm,a===Bu||a===Am?(a=UR(),Nt=3):a===PR?(a=UR(),Nt=4):Nt=a===L1?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Vr=a,pt===null&&(Wt=1,Km(s,fo(a,s.current)))}function Sj(){var s=M.H;return M.H=Vm,s===null?Vm:s}function Cj(){var s=M.A;return M.A=n3,s}function Tb(){Wt=4,ws||(bt&4194048)!==bt&&go.current!==null||(Kl=!0),(Ss&134217727)===0&&(Ea&134217727)===0||zt===null||Rs(zt,bt,vo,!1)}function kb(s,a,d){var h=jt;jt|=2;var y=Sj(),w=Cj();(zt!==s||bt!==a)&&(eh=null,Wl(s,a)),a=!1;var R=Wt;e:do try{if(Nt!==0&&pt!==null){var O=pt,D=Vr;switch(Nt){case 8:Nb(),R=6;break e;case 3:case 2:case 9:case 6:go.current===null&&(a=!0);var Q=Nt;if(Nt=0,Vr=null,Ql(s,O,D,Q),d&&Kl){R=0;break e}break;default:Q=Nt,Nt=0,Vr=null,Ql(s,O,D,Q)}}i3(),R=Wt;break}catch(de){wj(s,de)}while(!0);return a&&s.shellSuspendCounter++,Pi=ba=null,jt=h,M.H=y,M.A=w,pt===null&&(zt=null,bt=0,Sm()),R}function i3(){for(;pt!==null;)Ej(pt)}function s3(s,a){var d=jt;jt|=2;var h=Sj(),y=Cj();zt!==s||bt!==a?(eh=null,Jm=Mt()+500,Wl(s,a)):Kl=Ti(s,a);e:do try{if(Nt!==0&&pt!==null){a=pt;var w=Vr;t:switch(Nt){case 1:Nt=0,Vr=null,Ql(s,a,w,1);break;case 2:case 9:if(DR(w)){Nt=0,Vr=null,Rj(a);break}a=function(){Nt!==2&&Nt!==9||zt!==s||(Nt=7),ci(s)},w.then(a,a);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:DR(w)?(Nt=0,Vr=null,Rj(a)):(Nt=0,Vr=null,Ql(s,a,w,7));break;case 5:var R=null;switch(pt.tag){case 26:R=pt.memoizedState;case 5:case 27:var O=pt;if(!R||aN(R)){Nt=0,Vr=null;var D=O.sibling;if(D!==null)pt=D;else{var Q=O.return;Q!==null?(pt=Q,nh(Q)):pt=null}break t}}Nt=0,Vr=null,Ql(s,a,w,5);break;case 6:Nt=0,Vr=null,Ql(s,a,w,6);break;case 8:Nb(),Wt=6;break e;default:throw Error(o(462))}}a3();break}catch(de){wj(s,de)}while(!0);return Pi=ba=null,M.H=h,M.A=y,jt=d,pt!==null?0:(zt=null,bt=0,Sm(),Wt)}function a3(){for(;pt!==null&&!Zn();)Ej(pt)}function Ej(s){var a=Q1(s.alternate,s,Hi);s.memoizedProps=s.pendingProps,a===null?nh(s):pt=a}function Rj(s){var a=s,d=a.alternate;switch(a.tag){case 15:case 0:a=q1(d,a,a.pendingProps,a.type,void 0,bt);break;case 11:a=q1(d,a,a.pendingProps,a.type.render,a.ref,bt);break;case 5:Gy(a);default:ej(d,a),a=pt=jR(a,Hi),a=Q1(d,a,Hi)}s.memoizedProps=s.pendingProps,a===null?nh(s):pt=a}function Ql(s,a,d,h){Pi=ba=null,Gy(a),Bl=null,Qu=0;var y=a.return;try{if(XV(s,y,a,d,bt)){Wt=1,Km(s,fo(d,s.current)),pt=null;return}}catch(w){if(y!==null)throw pt=y,w;Wt=1,Km(s,fo(d,s.current)),pt=null;return}a.flags&32768?(St||h===1?s=!0:Kl||(bt&536870912)!==0?s=!1:(ws=s=!0,(h===2||h===9||h===3||h===6)&&(h=go.current,h!==null&&h.tag===13&&(h.flags|=16384))),jj(a,s)):nh(a)}function nh(s){var a=s;do{if((a.flags&32768)!==0){jj(a,ws);return}s=a.return;var d=QV(a.alternate,a,Hi);if(d!==null){pt=d;return}if(a=a.sibling,a!==null){pt=a;return}pt=a=s}while(a!==null);Wt===0&&(Wt=5)}function jj(s,a){do{var d=JV(s.alternate,s);if(d!==null){d.flags&=32767,pt=d;return}if(d=s.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!a&&(s=s.sibling,s!==null)){pt=s;return}pt=s=d}while(s!==null);Wt=6,pt=null}function Nj(s,a,d,h,y,w,R,O,D){s.cancelPendingCommit=null;do rh();while(Wn!==0);if((jt&6)!==0)throw Error(o(327));if(a!==null){if(a===s.current)throw Error(o(177));if(w=a.lanes|a.childLanes,w|=xy,dm(s,d,w,R,O,D),s===zt&&(pt=zt=null,bt=0),Yl=a,Es=s,Xl=d,Eb=w,Rb=y,yj=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,d3(X,function(){return Ij(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=M.T,M.T=null,y=K.p,K.p=2,R=jt,jt|=4;try{e3(s,a,d)}finally{jt=R,K.p=y,M.T=h}}Wn=1,Tj(),kj(),Oj()}}function Tj(){if(Wn===1){Wn=0;var s=Es,a=Yl,d=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var h=K.p;K.p=2;var y=jt;jt|=4;try{dj(a,s);var w=Vb,R=vR(s.containerInfo),O=w.focusedElem,D=w.selectionRange;if(R!==O&&O&&O.ownerDocument&&gR(O.ownerDocument.documentElement,O)){if(D!==null&&py(O)){var Q=D.start,de=D.end;if(de===void 0&&(de=Q),"selectionStart"in O)O.selectionStart=Q,O.selectionEnd=Math.min(de,O.value.length);else{var he=O.ownerDocument||document,ee=he&&he.defaultView||window;if(ee.getSelection){var te=ee.getSelection(),Ke=O.textContent.length,Fe=Math.min(D.start,Ke),It=D.end===void 0?Fe:Math.min(D.end,Ke);!te.extend&&Fe>It&&(R=It,It=Fe,Fe=R);var G=pR(O,Fe),F=pR(O,It);if(G&&F&&(te.rangeCount!==1||te.anchorNode!==G.node||te.anchorOffset!==G.offset||te.focusNode!==F.node||te.focusOffset!==F.offset)){var Y=he.createRange();Y.setStart(G.node,G.offset),te.removeAllRanges(),Fe>It?(te.addRange(Y),te.extend(F.node,F.offset)):(Y.setEnd(F.node,F.offset),te.addRange(Y))}}}}for(he=[],te=O;te=te.parentNode;)te.nodeType===1&&he.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<he.length;O++){var me=he[O];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}ph=!!Fb,Vb=Fb=null}finally{jt=y,K.p=h,M.T=d}}s.current=a,Wn=2}}function kj(){if(Wn===2){Wn=0;var s=Es,a=Yl,d=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var h=K.p;K.p=2;var y=jt;jt|=4;try{aj(s,a.alternate,a)}finally{jt=y,K.p=h,M.T=d}}Wn=3}}function Oj(){if(Wn===4||Wn===3){Wn=0,fr();var s=Es,a=Yl,d=Xl,h=yj;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Wn=5:(Wn=0,Yl=Es=null,Aj(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Cs=null),Yn(d),a=a.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(Re,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=M.T,y=K.p,K.p=2,M.T=null;try{for(var w=s.onRecoverableError,R=0;R<h.length;R++){var O=h[R];w(O.value,{componentStack:O.stack})}}finally{M.T=a,K.p=y}}(Xl&3)!==0&&rh(),ci(s),y=s.pendingLanes,(d&4194090)!==0&&(y&42)!==0?s===jb?ad++:(ad=0,jb=s):ad=0,ld(0)}}function Aj(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,Fu(a)))}function rh(s){return Tj(),kj(),Oj(),Ij()}function Ij(){if(Wn!==5)return!1;var s=Es,a=Eb;Eb=0;var d=Yn(Xl),h=M.T,y=K.p;try{K.p=32>d?32:d,M.T=null,d=Rb,Rb=null;var w=Es,R=Xl;if(Wn=0,Yl=Es=null,Xl=0,(jt&6)!==0)throw Error(o(331));var O=jt;if(jt|=4,gj(w.current),mj(w,w.current,R,d),jt=O,ld(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(Re,w)}catch{}return!0}finally{K.p=y,M.T=h,Aj(s,a)}}function $j(s,a,d){a=fo(d,a),a=ib(s.stateNode,a,2),s=ps(s,a,2),s!==null&&(us(s,2),ci(s))}function $t(s,a,d){if(s.tag===3)$j(s,s,d);else for(;a!==null;){if(a.tag===3){$j(a,s,d);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Cs===null||!Cs.has(h))){s=fo(d,s),d=z1(2),h=ps(a,d,2),h!==null&&(U1(d,h,a,s),us(h,2),ci(h));break}}a=a.return}}function Ob(s,a,d){var h=s.pingCache;if(h===null){h=s.pingCache=new r3;var y=new Set;h.set(a,y)}else y=h.get(a),y===void 0&&(y=new Set,h.set(a,y));y.has(d)||(_b=!0,y.add(d),s=l3.bind(null,s,a,d),a.then(s,s))}function l3(s,a,d){var h=s.pingCache;h!==null&&h.delete(a),s.pingedLanes|=s.suspendedLanes&d,s.warmLanes&=~d,zt===s&&(bt&d)===d&&(Wt===4||Wt===3&&(bt&62914560)===bt&&300>Mt()-Cb?(jt&2)===0&&Wl(s,0):wb|=d,Zl===bt&&(Zl=0)),ci(s)}function Mj(s,a){a===0&&(a=um()),s=Il(s,a),s!==null&&(us(s,a),ci(s))}function c3(s){var a=s.memoizedState,d=0;a!==null&&(d=a.retryLane),Mj(s,d)}function u3(s,a){var d=0;switch(s.tag){case 13:var h=s.stateNode,y=s.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(o(314))}h!==null&&h.delete(a),Mj(s,d)}function d3(s,a){return Gt(s,a)}var oh=null,Jl=null,Ab=!1,ih=!1,Ib=!1,Ra=0;function ci(s){s!==Jl&&s.next===null&&(Jl===null?oh=Jl=s:Jl=Jl.next=s),ih=!0,Ab||(Ab=!0,m3())}function ld(s,a){if(!Ib&&ih){Ib=!0;do for(var d=!1,h=oh;h!==null;){if(s!==0){var y=h.pendingLanes;if(y===0)var w=0;else{var R=h.suspendedLanes,O=h.pingedLanes;w=(1<<31-Rt(42|s)+1)-1,w&=y&~(R&~O),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,Uj(h,w))}else w=bt,w=oi(h,h===zt?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||Ti(h,w)||(d=!0,Uj(h,w));h=h.next}while(d);Ib=!1}}function f3(){Pj()}function Pj(){ih=Ab=!1;var s=0;Ra!==0&&(_3()&&(s=Ra),Ra=0);for(var a=Mt(),d=null,h=oh;h!==null;){var y=h.next,w=Dj(h,a);w===0?(h.next=null,d===null?oh=y:d.next=y,y===null&&(Jl=d)):(d=h,(s!==0||(w&3)!==0)&&(ih=!0)),h=y}ld(s)}function Dj(s,a){for(var d=s.suspendedLanes,h=s.pingedLanes,y=s.expirationTimes,w=s.pendingLanes&-62914561;0<w;){var R=31-Rt(w),O=1<<R,D=y[R];D===-1?((O&d)===0||(O&h)!==0)&&(y[R]=cs(O,a)):D<=a&&(s.expiredLanes|=O),w&=~O}if(a=zt,d=bt,d=oi(s,s===a?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,d===0||s===a&&(Nt===2||Nt===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Yt(h),s.callbackNode=null,s.callbackPriority=0;if((d&3)===0||Ti(s,d)){if(a=d&-d,a===s.callbackPriority)return a;switch(h!==null&&Yt(h),Yn(d)){case 2:case 8:d=z;break;case 32:d=X;break;case 268435456:d=ve;break;default:d=X}return h=zj.bind(null,s),d=Gt(d,h),s.callbackPriority=a,s.callbackNode=d,a}return h!==null&&h!==null&&Yt(h),s.callbackPriority=2,s.callbackNode=null,2}function zj(s,a){if(Wn!==0&&Wn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var d=s.callbackNode;if(rh()&&s.callbackNode!==d)return null;var h=bt;return h=oi(s,s===zt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(xj(s,h,a),Dj(s,Mt()),s.callbackNode!=null&&s.callbackNode===d?zj.bind(null,s):null)}function Uj(s,a){if(rh())return null;xj(s,a,!0)}function m3(){S3(function(){(jt&6)!==0?Gt(Pt,f3):Pj()})}function $b(){return Ra===0&&(Ra=Mo()),Ra}function Lj(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:gm(""+s)}function Fj(s,a){var d=a.ownerDocument.createElement("input");return d.name=a.name,d.value=a.value,s.id&&d.setAttribute("form",s.id),a.parentNode.insertBefore(d,a),s=new FormData(s),d.parentNode.removeChild(d),s}function h3(s,a,d,h,y){if(a==="submit"&&d&&d.stateNode===y){var w=Lj((y[Dt]||null).action),R=h.submitter;R&&(a=(a=R[Dt]||null)?Lj(a.formAction):R.getAttribute("formAction"),a!==null&&(w=a,R=null));var O=new xm("action","action",null,h,y);s.push({event:O,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Ra!==0){var D=R?Fj(y,R):new FormData(y);eb(d,{pending:!0,data:D,method:y.method,action:w},null,D)}}else typeof w=="function"&&(O.preventDefault(),D=R?Fj(y,R):new FormData(y),eb(d,{pending:!0,data:D,method:y.method,action:w},w,D))},currentTarget:y}]})}}for(var Mb=0;Mb<by.length;Mb++){var Pb=by[Mb],p3=Pb.toLowerCase(),g3=Pb[0].toUpperCase()+Pb.slice(1);Po(p3,"on"+g3)}Po(xR,"onAnimationEnd"),Po(_R,"onAnimationIteration"),Po(wR,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(IV,"onTransitionRun"),Po($V,"onTransitionStart"),Po(MV,"onTransitionCancel"),Po(SR,"onTransitionEnd"),Sl("onMouseEnter",["mouseout","mouseover"]),Sl("onMouseLeave",["mouseout","mouseover"]),Sl("onPointerEnter",["pointerout","pointerover"]),Sl("onPointerLeave",["pointerout","pointerover"]),ua("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ua("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ua("onBeforeInput",["compositionend","keypress","textInput","paste"]),ua("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),v3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cd));function Vj(s,a){a=(a&4)!==0;for(var d=0;d<s.length;d++){var h=s[d],y=h.event;h=h.listeners;e:{var w=void 0;if(a)for(var R=h.length-1;0<=R;R--){var O=h[R],D=O.instance,Q=O.currentTarget;if(O=O.listener,D!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=Q;try{w(y)}catch(de){qm(de)}y.currentTarget=null,w=D}else for(R=0;R<h.length;R++){if(O=h[R],D=O.instance,Q=O.currentTarget,O=O.listener,D!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=Q;try{w(y)}catch(de){qm(de)}y.currentTarget=null,w=D}}}}function gt(s,a){var d=a[bl];d===void 0&&(d=a[bl]=new Set);var h=s+"__bubble";d.has(h)||(Bj(a,s,2,!1),d.add(h))}function Db(s,a,d){var h=0;a&&(h|=4),Bj(d,s,h,a)}var sh="_reactListening"+Math.random().toString(36).slice(2);function zb(s){if(!s[sh]){s[sh]=!0,PE.forEach(function(d){d!=="selectionchange"&&(v3.has(d)||Db(d,!1,s),Db(d,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[sh]||(a[sh]=!0,Db("selectionchange",!1,a))}}function Bj(s,a,d,h){switch(mN(a)){case 2:var y=H3;break;case 8:y=G3;break;default:y=Qb}d=y.bind(null,a,d,s),y=void 0,!sy||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),h?y!==void 0?s.addEventListener(a,d,{capture:!0,passive:y}):s.addEventListener(a,d,!0):y!==void 0?s.addEventListener(a,d,{passive:y}):s.addEventListener(a,d,!1)}function Ub(s,a,d,h,y){var w=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var O=h.stateNode.containerInfo;if(O===y)break;if(R===4)for(R=h.return;R!==null;){var D=R.tag;if((D===3||D===4)&&R.stateNode.containerInfo===y)return;R=R.return}for(;O!==null;){if(R=xl(O),R===null)return;if(D=R.tag,D===5||D===6||D===26||D===27){h=w=R;continue e}O=O.parentNode}}h=h.return}XE(function(){var Q=w,de=oy(d),he=[];e:{var ee=CR.get(s);if(ee!==void 0){var te=xm,Ke=s;switch(s){case"keypress":if(ym(d)===0)break e;case"keydown":case"keyup":te=dV;break;case"focusin":Ke="focus",te=uy;break;case"focusout":Ke="blur",te=uy;break;case"beforeblur":case"afterblur":te=uy;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=JE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=J6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=hV;break;case xR:case _R:case wR:te=nV;break;case SR:te=gV;break;case"scroll":case"scrollend":te=W6;break;case"wheel":te=yV;break;case"copy":case"cut":case"paste":te=oV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=tR;break;case"toggle":case"beforetoggle":te=xV}var Fe=(a&4)!==0,It=!Fe&&(s==="scroll"||s==="scrollend"),G=Fe?ee!==null?ee+"Capture":null:ee;Fe=[];for(var F=Q,Y;F!==null;){var me=F;if(Y=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||Y===null||G===null||(me=Nu(F,G),me!=null&&Fe.push(ud(F,me,Y))),It)break;F=F.return}0<Fe.length&&(ee=new te(ee,Ke,null,d,de),he.push({event:ee,listeners:Fe}))}}if((a&7)===0){e:{if(ee=s==="mouseover"||s==="pointerover",te=s==="mouseout"||s==="pointerout",ee&&d!==ry&&(Ke=d.relatedTarget||d.fromElement)&&(xl(Ke)||Ke[zn]))break e;if((te||ee)&&(ee=de.window===de?de:(ee=de.ownerDocument)?ee.defaultView||ee.parentWindow:window,te?(Ke=d.relatedTarget||d.toElement,te=Q,Ke=Ke?xl(Ke):null,Ke!==null&&(It=i(Ke),Fe=Ke.tag,Ke!==It||Fe!==5&&Fe!==27&&Fe!==6)&&(Ke=null)):(te=null,Ke=Q),te!==Ke)){if(Fe=JE,me="onMouseLeave",G="onMouseEnter",F="mouse",(s==="pointerout"||s==="pointerover")&&(Fe=tR,me="onPointerLeave",G="onPointerEnter",F="pointer"),It=te==null?ee:ju(te),Y=Ke==null?ee:ju(Ke),ee=new Fe(me,F+"leave",te,d,de),ee.target=It,ee.relatedTarget=Y,me=null,xl(de)===Q&&(Fe=new Fe(G,F+"enter",Ke,d,de),Fe.target=Y,Fe.relatedTarget=It,me=Fe),It=me,te&&Ke)t:{for(Fe=te,G=Ke,F=0,Y=Fe;Y;Y=ec(Y))F++;for(Y=0,me=G;me;me=ec(me))Y++;for(;0<F-Y;)Fe=ec(Fe),F--;for(;0<Y-F;)G=ec(G),Y--;for(;F--;){if(Fe===G||G!==null&&Fe===G.alternate)break t;Fe=ec(Fe),G=ec(G)}Fe=null}else Fe=null;te!==null&&Hj(he,ee,te,Fe,!1),Ke!==null&&It!==null&&Hj(he,It,Ke,Fe,!0)}}e:{if(ee=Q?ju(Q):window,te=ee.nodeName&&ee.nodeName.toLowerCase(),te==="select"||te==="input"&&ee.type==="file")var je=cR;else if(aR(ee))if(uR)je=kV;else{je=NV;var mt=jV}else te=ee.nodeName,!te||te.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?Q&&ny(Q.elementType)&&(je=cR):je=TV;if(je&&(je=je(s,Q))){lR(he,je,d,de);break e}mt&&mt(s,ee,Q),s==="focusout"&&Q&&ee.type==="number"&&Q.memoizedProps.value!=null&&ty(ee,"number",ee.value)}switch(mt=Q?ju(Q):window,s){case"focusin":(aR(mt)||mt.contentEditable==="true")&&(kl=mt,gy=Q,Pu=null);break;case"focusout":Pu=gy=kl=null;break;case"mousedown":vy=!0;break;case"contextmenu":case"mouseup":case"dragend":vy=!1,yR(he,d,de);break;case"selectionchange":if(AV)break;case"keydown":case"keyup":yR(he,d,de)}var Pe;if(fy)e:{switch(s){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Tl?iR(s,d)&&(Be="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(Be="onCompositionStart");Be&&(nR&&d.locale!=="ko"&&(Tl||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Tl&&(Pe=WE()):(ds=de,ay="value"in ds?ds.value:ds.textContent,Tl=!0)),mt=ah(Q,Be),0<mt.length&&(Be=new eR(Be,s,null,d,de),he.push({event:Be,listeners:mt}),Pe?Be.data=Pe:(Pe=sR(d),Pe!==null&&(Be.data=Pe)))),(Pe=wV?SV(s,d):CV(s,d))&&(Be=ah(Q,"onBeforeInput"),0<Be.length&&(mt=new eR("onBeforeInput","beforeinput",null,d,de),he.push({event:mt,listeners:Be}),mt.data=Pe)),h3(he,s,Q,d,de)}Vj(he,a)})}function ud(s,a,d){return{instance:s,listener:a,currentTarget:d}}function ah(s,a){for(var d=a+"Capture",h=[];s!==null;){var y=s,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Nu(s,d),y!=null&&h.unshift(ud(s,y,w)),y=Nu(s,a),y!=null&&h.push(ud(s,y,w))),s.tag===3)return h;s=s.return}return[]}function ec(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Hj(s,a,d,h,y){for(var w=a._reactName,R=[];d!==null&&d!==h;){var O=d,D=O.alternate,Q=O.stateNode;if(O=O.tag,D!==null&&D===h)break;O!==5&&O!==26&&O!==27||Q===null||(D=Q,y?(Q=Nu(d,w),Q!=null&&R.unshift(ud(d,Q,D))):y||(Q=Nu(d,w),Q!=null&&R.push(ud(d,Q,D)))),d=d.return}R.length!==0&&s.push({event:a,listeners:R})}var y3=/\r\n?/g,b3=/\u0000|\uFFFD/g;function Gj(s){return(typeof s=="string"?s:""+s).replace(y3,`
439
+ `).replace(b3,"")}function qj(s,a){return a=Gj(a),Gj(s)===a}function lh(){}function At(s,a,d,h,y,w){switch(d){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||Rl(s,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&Rl(s,""+h);break;case"className":mm(s,"class",h);break;case"tabIndex":mm(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":mm(s,d,h);break;case"style":ZE(s,h,w);break;case"data":if(a!=="object"){mm(s,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||d!=="href")){s.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(d);break}h=gm(""+h),s.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(a!=="input"&&At(s,a,"name",y.name,y,null),At(s,a,"formEncType",y.formEncType,y,null),At(s,a,"formMethod",y.formMethod,y,null),At(s,a,"formTarget",y.formTarget,y,null)):(At(s,a,"encType",y.encType,y,null),At(s,a,"method",y.method,y,null),At(s,a,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(d);break}h=gm(""+h),s.setAttribute(d,h);break;case"onClick":h!=null&&(s.onclick=lh);break;case"onScroll":h!=null&&gt("scroll",s);break;case"onScrollEnd":h!=null&&gt("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(d=h.__html,d!=null){if(y.children!=null)throw Error(o(60));s.innerHTML=d}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}d=gm(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(d,""+h):s.removeAttribute(d);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":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(d,""):s.removeAttribute(d);break;case"capture":case"download":h===!0?s.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(d,h):s.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(d,h):s.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(d):s.setAttribute(d,h);break;case"popover":gt("beforetoggle",s),gt("toggle",s),fm(s,"popover",h);break;case"xlinkActuate":Oi(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Oi(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Oi(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Oi(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Oi(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Oi(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Oi(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Oi(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Oi(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":fm(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=Y6.get(d)||d,fm(s,d,h))}}function Lb(s,a,d,h,y,w){switch(d){case"style":ZE(s,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(d=h.__html,d!=null){if(y.children!=null)throw Error(o(60));s.innerHTML=d}}break;case"children":typeof h=="string"?Rl(s,h):(typeof h=="number"||typeof h=="bigint")&&Rl(s,""+h);break;case"onScroll":h!=null&&gt("scroll",s);break;case"onScrollEnd":h!=null&&gt("scrollend",s);break;case"onClick":h!=null&&(s.onclick=lh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!DE.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(y=d.endsWith("Capture"),a=d.slice(2,y?d.length-7:void 0),w=s[Dt]||null,w=w!=null?w[d]:null,typeof w=="function"&&s.removeEventListener(a,w,y),typeof h=="function")){typeof w!="function"&&w!==null&&(d in s?s[d]=null:s.hasAttribute(d)&&s.removeAttribute(d)),s.addEventListener(a,h,y);break e}d in s?s[d]=h:h===!0?s.setAttribute(d,""):fm(s,d,h)}}}function Qn(s,a,d){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",s),gt("load",s);var h=!1,y=!1,w;for(w in d)if(d.hasOwnProperty(w)){var R=d[w];if(R!=null)switch(w){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:At(s,a,w,R,d,null)}}y&&At(s,a,"srcSet",d.srcSet,d,null),h&&At(s,a,"src",d.src,d,null);return;case"input":gt("invalid",s);var O=w=R=y=null,D=null,Q=null;for(h in d)if(d.hasOwnProperty(h)){var de=d[h];if(de!=null)switch(h){case"name":y=de;break;case"type":R=de;break;case"checked":D=de;break;case"defaultChecked":Q=de;break;case"value":w=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(o(137,a));break;default:At(s,a,h,de,d,null)}}HE(s,w,O,D,Q,R,y,!1),hm(s);return;case"select":gt("invalid",s),h=R=w=null;for(y in d)if(d.hasOwnProperty(y)&&(O=d[y],O!=null))switch(y){case"value":w=O;break;case"defaultValue":R=O;break;case"multiple":h=O;default:At(s,a,y,O,d,null)}a=w,d=R,s.multiple=!!h,a!=null?El(s,!!h,a,!1):d!=null&&El(s,!!h,d,!0);return;case"textarea":gt("invalid",s),w=y=h=null;for(R in d)if(d.hasOwnProperty(R)&&(O=d[R],O!=null))switch(R){case"value":h=O;break;case"defaultValue":y=O;break;case"children":w=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(91));break;default:At(s,a,R,O,d,null)}qE(s,h,y,w),hm(s);return;case"option":for(D in d)if(d.hasOwnProperty(D)&&(h=d[D],h!=null))switch(D){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:At(s,a,D,h,d,null)}return;case"dialog":gt("beforetoggle",s),gt("toggle",s),gt("cancel",s),gt("close",s);break;case"iframe":case"object":gt("load",s);break;case"video":case"audio":for(h=0;h<cd.length;h++)gt(cd[h],s);break;case"image":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"embed":case"source":case"link":gt("error",s),gt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in d)if(d.hasOwnProperty(Q)&&(h=d[Q],h!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:At(s,a,Q,h,d,null)}return;default:if(ny(a)){for(de in d)d.hasOwnProperty(de)&&(h=d[de],h!==void 0&&Lb(s,a,de,h,d,void 0));return}}for(O in d)d.hasOwnProperty(O)&&(h=d[O],h!=null&&At(s,a,O,h,d,null))}function x3(s,a,d,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,R=null,O=null,D=null,Q=null,de=null;for(te in d){var he=d[te];if(d.hasOwnProperty(te)&&he!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":D=he;default:h.hasOwnProperty(te)||At(s,a,te,null,h,he)}}for(var ee in h){var te=h[ee];if(he=d[ee],h.hasOwnProperty(ee)&&(te!=null||he!=null))switch(ee){case"type":w=te;break;case"name":y=te;break;case"checked":Q=te;break;case"defaultChecked":de=te;break;case"value":R=te;break;case"defaultValue":O=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(o(137,a));break;default:te!==he&&At(s,a,ee,te,h,he)}}ey(s,R,O,D,Q,de,w,y);return;case"select":te=R=O=ee=null;for(w in d)if(D=d[w],d.hasOwnProperty(w)&&D!=null)switch(w){case"value":break;case"multiple":te=D;default:h.hasOwnProperty(w)||At(s,a,w,null,h,D)}for(y in h)if(w=h[y],D=d[y],h.hasOwnProperty(y)&&(w!=null||D!=null))switch(y){case"value":ee=w;break;case"defaultValue":O=w;break;case"multiple":R=w;default:w!==D&&At(s,a,y,w,h,D)}a=O,d=R,h=te,ee!=null?El(s,!!d,ee,!1):!!h!=!!d&&(a!=null?El(s,!!d,a,!0):El(s,!!d,d?[]:"",!1));return;case"textarea":te=ee=null;for(O in d)if(y=d[O],d.hasOwnProperty(O)&&y!=null&&!h.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:At(s,a,O,null,h,y)}for(R in h)if(y=h[R],w=d[R],h.hasOwnProperty(R)&&(y!=null||w!=null))switch(R){case"value":ee=y;break;case"defaultValue":te=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(o(91));break;default:y!==w&&At(s,a,R,y,h,w)}GE(s,ee,te);return;case"option":for(var Ke in d)if(ee=d[Ke],d.hasOwnProperty(Ke)&&ee!=null&&!h.hasOwnProperty(Ke))switch(Ke){case"selected":s.selected=!1;break;default:At(s,a,Ke,null,h,ee)}for(D in h)if(ee=h[D],te=d[D],h.hasOwnProperty(D)&&ee!==te&&(ee!=null||te!=null))switch(D){case"selected":s.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:At(s,a,D,ee,h,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Fe in d)ee=d[Fe],d.hasOwnProperty(Fe)&&ee!=null&&!h.hasOwnProperty(Fe)&&At(s,a,Fe,null,h,ee);for(Q in h)if(ee=h[Q],te=d[Q],h.hasOwnProperty(Q)&&ee!==te&&(ee!=null||te!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,a));break;default:At(s,a,Q,ee,h,te)}return;default:if(ny(a)){for(var It in d)ee=d[It],d.hasOwnProperty(It)&&ee!==void 0&&!h.hasOwnProperty(It)&&Lb(s,a,It,void 0,h,ee);for(de in h)ee=h[de],te=d[de],!h.hasOwnProperty(de)||ee===te||ee===void 0&&te===void 0||Lb(s,a,de,ee,h,te);return}}for(var G in d)ee=d[G],d.hasOwnProperty(G)&&ee!=null&&!h.hasOwnProperty(G)&&At(s,a,G,null,h,ee);for(he in h)ee=h[he],te=d[he],!h.hasOwnProperty(he)||ee===te||ee==null&&te==null||At(s,a,he,ee,h,te)}var Fb=null,Vb=null;function ch(s){return s.nodeType===9?s:s.ownerDocument}function Kj(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zj(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function Bb(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Hb=null;function _3(){var s=window.event;return s&&s.type==="popstate"?s===Hb?!1:(Hb=s,!0):(Hb=null,!1)}var Yj=typeof setTimeout=="function"?setTimeout:void 0,w3=typeof clearTimeout=="function"?clearTimeout:void 0,Xj=typeof Promise=="function"?Promise:void 0,S3=typeof queueMicrotask=="function"?queueMicrotask:typeof Xj<"u"?function(s){return Xj.resolve(null).then(s).catch(C3)}:Yj;function C3(s){setTimeout(function(){throw s})}function js(s){return s==="head"}function Wj(s,a){var d=a,h=0,y=0;do{var w=d.nextSibling;if(s.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<h&&8>h){d=h;var R=s.ownerDocument;if(d&1&&dd(R.documentElement),d&2&&dd(R.body),d&4)for(d=R.head,dd(d),R=d.firstChild;R;){var O=R.nextSibling,D=R.nodeName;R[Ru]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&R.rel.toLowerCase()==="stylesheet"||d.removeChild(R),R=O}}if(y===0){s.removeChild(w),bd(a);return}y--}else d==="$"||d==="$?"||d==="$!"?y++:h=d.charCodeAt(0)-48;else h=0;d=w}while(d);bd(a)}function Gb(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var d=a;switch(a=a.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Gb(d),Xv(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}s.removeChild(d)}}function E3(s,a,d,h){for(;s.nodeType===1;){var y=d;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Ru])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(w=s.getAttribute("rel"),w==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(w!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(w=s.getAttribute("src"),(w!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===w)return s}else return s;if(s=zo(s.nextSibling),s===null)break}return null}function R3(s,a,d){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!d||(s=zo(s.nextSibling),s===null))return null;return s}function qb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState==="complete"}function j3(s,a){var d=s.ownerDocument;if(s.data!=="$?"||d.readyState==="complete")a();else{var h=function(){a(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function zo(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return s}var Kb=null;function Qj(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"){if(a===0)return s;a--}else d==="/$"&&a++}s=s.previousSibling}return null}function Jj(s,a,d){switch(a=ch(d),s){case"html":if(s=a.documentElement,!s)throw Error(o(452));return s;case"head":if(s=a.head,!s)throw Error(o(453));return s;case"body":if(s=a.body,!s)throw Error(o(454));return s;default:throw Error(o(451))}}function dd(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);Xv(s)}var yo=new Map,eN=new Set;function uh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Gi=K.d;K.d={f:N3,r:T3,D:k3,C:O3,L:A3,m:I3,X:M3,S:$3,M:P3};function N3(){var s=Gi.f(),a=th();return s||a}function T3(s){var a=_l(s);a!==null&&a.tag===5&&a.type==="form"?x1(a):Gi.r(s)}var tc=typeof document>"u"?null:document;function tN(s,a,d){var h=tc;if(h&&typeof a=="string"&&a){var y=uo(a);y='link[rel="'+s+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),eN.has(y)||(eN.add(y),s={rel:s,crossOrigin:d,href:a},h.querySelector(y)===null&&(a=h.createElement("link"),Qn(a,"link",s),Un(a),h.head.appendChild(a)))}}function k3(s){Gi.D(s),tN("dns-prefetch",s,null)}function O3(s,a){Gi.C(s,a),tN("preconnect",s,a)}function A3(s,a,d){Gi.L(s,a,d);var h=tc;if(h&&s&&a){var y='link[rel="preload"][as="'+uo(a)+'"]';a==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+uo(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+uo(d.imageSizes)+'"]')):y+='[href="'+uo(s)+'"]';var w=y;switch(a){case"style":w=nc(s);break;case"script":w=rc(s)}yo.has(w)||(s=p({rel:"preload",href:a==="image"&&d&&d.imageSrcSet?void 0:s,as:a},d),yo.set(w,s),h.querySelector(y)!==null||a==="style"&&h.querySelector(fd(w))||a==="script"&&h.querySelector(md(w))||(a=h.createElement("link"),Qn(a,"link",s),Un(a),h.head.appendChild(a)))}}function I3(s,a){Gi.m(s,a);var d=tc;if(d&&s){var h=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+uo(h)+'"][href="'+uo(s)+'"]',w=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=rc(s)}if(!yo.has(w)&&(s=p({rel:"modulepreload",href:s},a),yo.set(w,s),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(md(w)))return}h=d.createElement("link"),Qn(h,"link",s),Un(h),d.head.appendChild(h)}}}function $3(s,a,d){Gi.S(s,a,d);var h=tc;if(h&&s){var y=wl(h).hoistableStyles,w=nc(s);a=a||"default";var R=y.get(w);if(!R){var O={loading:0,preload:null};if(R=h.querySelector(fd(w)))O.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":a},d),(d=yo.get(w))&&Zb(s,d);var D=R=h.createElement("link");Un(D),Qn(D,"link",s),D._p=new Promise(function(Q,de){D.onload=Q,D.onerror=de}),D.addEventListener("load",function(){O.loading|=1}),D.addEventListener("error",function(){O.loading|=2}),O.loading|=4,dh(R,a,h)}R={type:"stylesheet",instance:R,count:1,state:O},y.set(w,R)}}}function M3(s,a){Gi.X(s,a);var d=tc;if(d&&s){var h=wl(d).hoistableScripts,y=rc(s),w=h.get(y);w||(w=d.querySelector(md(y)),w||(s=p({src:s,async:!0},a),(a=yo.get(y))&&Yb(s,a),w=d.createElement("script"),Un(w),Qn(w,"link",s),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(y,w))}}function P3(s,a){Gi.M(s,a);var d=tc;if(d&&s){var h=wl(d).hoistableScripts,y=rc(s),w=h.get(y);w||(w=d.querySelector(md(y)),w||(s=p({src:s,async:!0,type:"module"},a),(a=yo.get(y))&&Yb(s,a),w=d.createElement("script"),Un(w),Qn(w,"link",s),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(y,w))}}function nN(s,a,d,h){var y=(y=ye.current)?uh(y):null;if(!y)throw Error(o(446));switch(s){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(a=nc(d.href),d=wl(y).hoistableStyles,h=d.get(a),h||(h={type:"style",instance:null,count:0,state:null},d.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){s=nc(d.href);var w=wl(y).hoistableStyles,R=w.get(s);if(R||(y=y.ownerDocument||y,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(s,R),(w=y.querySelector(fd(s)))&&!w._p&&(R.instance=w,R.state.loading=5),yo.has(s)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},yo.set(s,d),w||D3(y,s,d,R.state))),a&&h===null)throw Error(o(528,""));return R}if(a&&h!==null)throw Error(o(529,""));return null;case"script":return a=d.async,d=d.src,typeof d=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=rc(d),d=wl(y).hoistableScripts,h=d.get(a),h||(h={type:"script",instance:null,count:0,state:null},d.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,s))}}function nc(s){return'href="'+uo(s)+'"'}function fd(s){return'link[rel="stylesheet"]['+s+"]"}function rN(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function D3(s,a,d,h){s.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=s.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),Qn(a,"link",d),Un(a),s.head.appendChild(a))}function rc(s){return'[src="'+uo(s)+'"]'}function md(s){return"script[async]"+s}function oN(s,a,d){if(a.count++,a.instance===null)switch(a.type){case"style":var h=s.querySelector('style[data-href~="'+uo(d.href)+'"]');if(h)return a.instance=h,Un(h),h;var y=p({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Un(h),Qn(h,"style",y),dh(h,d.precedence,s),a.instance=h;case"stylesheet":y=nc(d.href);var w=s.querySelector(fd(y));if(w)return a.state.loading|=4,a.instance=w,Un(w),w;h=rN(d),(y=yo.get(y))&&Zb(h,y),w=(s.ownerDocument||s).createElement("link"),Un(w);var R=w;return R._p=new Promise(function(O,D){R.onload=O,R.onerror=D}),Qn(w,"link",h),a.state.loading|=4,dh(w,d.precedence,s),a.instance=w;case"script":return w=rc(d.src),(y=s.querySelector(md(w)))?(a.instance=y,Un(y),y):(h=d,(y=yo.get(w))&&(h=p({},d),Yb(h,y)),s=s.ownerDocument||s,y=s.createElement("script"),Un(y),Qn(y,"link",h),s.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,dh(h,d.precedence,s));return a.instance}function dh(s,a,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,w=y,R=0;R<h.length;R++){var O=h[R];if(O.dataset.precedence===a)w=O;else if(w!==y)break}w?w.parentNode.insertBefore(s,w.nextSibling):(a=d.nodeType===9?d.head:d,a.insertBefore(s,a.firstChild))}function Zb(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function Yb(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var fh=null;function iN(s,a,d){if(fh===null){var h=new Map,y=fh=new Map;y.set(d,h)}else y=fh,h=y.get(d),h||(h=new Map,y.set(d,h));if(h.has(s))return h;for(h.set(s,null),d=d.getElementsByTagName(s),y=0;y<d.length;y++){var w=d[y];if(!(w[Ru]||w[sn]||s==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var R=w.getAttribute(a)||"";R=s+R;var O=h.get(R);O?O.push(w):h.set(R,[w])}}return h}function sN(s,a,d){s=s.ownerDocument||s,s.head.insertBefore(d,a==="title"?s.querySelector("head > title"):null)}function z3(s,a,d){if(d===1||a.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return s=a.disabled,typeof a.precedence=="string"&&s==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function aN(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}var hd=null;function U3(){}function L3(s,a,d){if(hd===null)throw Error(o(475));var h=hd;if(a.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=nc(d.href),w=s.querySelector(fd(y));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(h.count++,h=mh.bind(h),s.then(h,h)),a.state.loading|=4,a.instance=w,Un(w);return}w=s.ownerDocument||s,d=rN(d),(y=yo.get(y))&&Zb(d,y),w=w.createElement("link"),Un(w);var R=w;R._p=new Promise(function(O,D){R.onload=O,R.onerror=D}),Qn(w,"link",d),a.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(h.count++,a=mh.bind(h),s.addEventListener("load",a),s.addEventListener("error",a))}}function F3(){if(hd===null)throw Error(o(475));var s=hd;return s.stylesheets&&s.count===0&&Xb(s,s.stylesheets),0<s.count?function(a){var d=setTimeout(function(){if(s.stylesheets&&Xb(s,s.stylesheets),s.unsuspend){var h=s.unsuspend;s.unsuspend=null,h()}},6e4);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(d)}}:null}function mh(){if(this.count--,this.count===0){if(this.stylesheets)Xb(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var hh=null;function Xb(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,hh=new Map,a.forEach(V3,s),hh=null,mh.call(s))}function V3(s,a){if(!(a.state.loading&4)){var d=hh.get(s);if(d)var h=d.get(null);else{d=new Map,hh.set(s,d);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var R=y[w];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(d.set(R.dataset.precedence,R),h=R)}h&&d.set(null,h)}y=a.instance,R=y.getAttribute("data-precedence"),w=d.get(R)||h,w===h&&d.set(null,y),d.set(R,y),this.count++,h=mh.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),w?w.parentNode.insertBefore(y,w.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),a.state.loading|=4}}var pd={$$typeof:N,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function B3(s,a,d,h,y,w,R,O){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Eu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eu(0),this.hiddenUpdates=Eu(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function lN(s,a,d,h,y,w,R,O,D,Q,de,he){return s=new B3(s,a,d,R,O,D,Q,he),a=1,w===!0&&(a|=24),w=Ur(3,null,null,a),s.current=w,w.stateNode=s,a=Oy(),a.refCount++,s.pooledCache=a,a.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:a},My(w),s}function cN(s){return s?(s=$l,s):$l}function uN(s,a,d,h,y,w){y=cN(y),h.context===null?h.context=y:h.pendingContext=y,h=hs(a),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=ps(s,h,a),d!==null&&(Hr(d,s,a),Gu(d,s,a))}function dN(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<a?d:a}}function Wb(s,a){dN(s,a),(s=s.alternate)&&dN(s,a)}function fN(s){if(s.tag===13){var a=Il(s,67108864);a!==null&&Hr(a,s,67108864),Wb(s,67108864)}}var ph=!0;function H3(s,a,d,h){var y=M.T;M.T=null;var w=K.p;try{K.p=2,Qb(s,a,d,h)}finally{K.p=w,M.T=y}}function G3(s,a,d,h){var y=M.T;M.T=null;var w=K.p;try{K.p=8,Qb(s,a,d,h)}finally{K.p=w,M.T=y}}function Qb(s,a,d,h){if(ph){var y=Jb(h);if(y===null)Ub(s,a,h,gh,d),hN(s,h);else if(K3(y,s,a,d,h))h.stopPropagation();else if(hN(s,h),a&4&&-1<q3.indexOf(s)){for(;y!==null;){var w=_l(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var R=lo(w.pendingLanes);if(R!==0){var O=w;for(O.pendingLanes|=2,O.entangledLanes|=2;R;){var D=1<<31-Rt(R);O.entanglements[1]|=D,R&=~D}ci(w),(jt&6)===0&&(Jm=Mt()+500,ld(0))}}break;case 13:O=Il(w,2),O!==null&&Hr(O,w,2),th(),Wb(w,2)}if(w=Jb(h),w===null&&Ub(s,a,h,gh,d),w===y)break;y=w}y!==null&&h.stopPropagation()}else Ub(s,a,h,null,d)}}function Jb(s){return s=oy(s),ex(s)}var gh=null;function ex(s){if(gh=null,s=xl(s),s!==null){var a=i(s);if(a===null)s=null;else{var d=a.tag;if(d===13){if(s=l(a),s!==null)return s;s=null}else if(d===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return gh=s,null}function mN(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nn()){case Pt:return 2;case z:return 8;case X:case oe:return 32;case ve:return 268435456;default:return 32}default:return 32}}var tx=!1,Ns=null,Ts=null,ks=null,gd=new Map,vd=new Map,Os=[],q3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hN(s,a){switch(s){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":ks=null;break;case"pointerover":case"pointerout":gd.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":vd.delete(a.pointerId)}}function yd(s,a,d,h,y,w){return s===null||s.nativeEvent!==w?(s={blockedOn:a,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[y]},a!==null&&(a=_l(a),a!==null&&fN(a)),s):(s.eventSystemFlags|=h,a=s.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),s)}function K3(s,a,d,h,y){switch(a){case"focusin":return Ns=yd(Ns,s,a,d,h,y),!0;case"dragenter":return Ts=yd(Ts,s,a,d,h,y),!0;case"mouseover":return ks=yd(ks,s,a,d,h,y),!0;case"pointerover":var w=y.pointerId;return gd.set(w,yd(gd.get(w)||null,s,a,d,h,y)),!0;case"gotpointercapture":return w=y.pointerId,vd.set(w,yd(vd.get(w)||null,s,a,d,h,y)),!0}return!1}function pN(s){var a=xl(s.target);if(a!==null){var d=i(a);if(d!==null){if(a=d.tag,a===13){if(a=l(d),a!==null){s.blockedOn=a,Tn(s.priority,function(){if(d.tag===13){var h=Br();h=bn(h);var y=Il(d,h);y!==null&&Hr(y,d,h),Wb(d,h)}});return}}else if(a===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function vh(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var d=Jb(s.nativeEvent);if(d===null){d=s.nativeEvent;var h=new d.constructor(d.type,d);ry=h,d.target.dispatchEvent(h),ry=null}else return a=_l(d),a!==null&&fN(a),s.blockedOn=d,!1;a.shift()}return!0}function gN(s,a,d){vh(s)&&d.delete(a)}function Z3(){tx=!1,Ns!==null&&vh(Ns)&&(Ns=null),Ts!==null&&vh(Ts)&&(Ts=null),ks!==null&&vh(ks)&&(ks=null),gd.forEach(gN),vd.forEach(gN)}function yh(s,a){s.blockedOn===a&&(s.blockedOn=null,tx||(tx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Z3)))}var bh=null;function vN(s){bh!==s&&(bh=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bh===s&&(bh=null);for(var a=0;a<s.length;a+=3){var d=s[a],h=s[a+1],y=s[a+2];if(typeof h!="function"){if(ex(h||d)===null)continue;break}var w=_l(d);w!==null&&(s.splice(a,3),a-=3,eb(w,{pending:!0,data:y,method:d.method,action:h},h,y))}}))}function bd(s){function a(D){return yh(D,s)}Ns!==null&&yh(Ns,s),Ts!==null&&yh(Ts,s),ks!==null&&yh(ks,s),gd.forEach(a),vd.forEach(a);for(var d=0;d<Os.length;d++){var h=Os[d];h.blockedOn===s&&(h.blockedOn=null)}for(;0<Os.length&&(d=Os[0],d.blockedOn===null);)pN(d),d.blockedOn===null&&Os.shift();if(d=(s.ownerDocument||s).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var y=d[h],w=d[h+1],R=y[Dt]||null;if(typeof w=="function")R||vN(d);else if(R){var O=null;if(w&&w.hasAttribute("formAction")){if(y=w,R=w[Dt]||null)O=R.formAction;else if(ex(y)!==null)continue}else O=R.action;typeof O=="function"?d[h+1]=O:(d.splice(h,3),h-=3),vN(d)}}}function nx(s){this._internalRoot=s}xh.prototype.render=nx.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(o(409));var d=a.current,h=Br();uN(d,h,s,a,null,null)},xh.prototype.unmount=nx.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;uN(s.current,2,null,s,null,null),th(),a[zn]=null}};function xh(s){this._internalRoot=s}xh.prototype.unstable_scheduleHydration=function(s){if(s){var a=ca();s={blockedOn:null,target:s,priority:a};for(var d=0;d<Os.length&&a!==0&&a<Os[d].priority;d++);Os.splice(d,0,s),d===0&&pN(s)}};var yN=t.version;if(yN!=="19.1.1")throw Error(o(527,yN,"19.1.1"));K.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=f(a),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var Y3={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_h.isDisabled&&_h.supportsFiber)try{Re=_h.inject(Y3),We=_h}catch{}}return Dd.createRoot=function(s,a){if(!r(s))throw Error(o(299));var d=!1,h="",y=$1,w=M1,R=P1,O=null;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(O=a.unstable_transitionCallbacks)),a=lN(s,1,!1,null,null,d,h,y,w,R,O,null),s[zn]=a.current,zb(s),new nx(a)},Dd.hydrateRoot=function(s,a,d){if(!r(s))throw Error(o(299));var h=!1,y="",w=$1,R=M1,O=P1,D=null,Q=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(y=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(R=d.onCaughtError),d.onRecoverableError!==void 0&&(O=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(D=d.unstable_transitionCallbacks),d.formState!==void 0&&(Q=d.formState)),a=lN(s,1,!0,a,d??null,h,y,w,R,O,D,Q),a.context=cN(null),d=a.current,h=Br(),h=bn(h),y=hs(h),y.callback=null,ps(d,y,h),d=h,a.current.lanes=d,us(a,d),ci(a),s[zn]=a.current,zb(s),new xh(a)},Dd.version="19.1.1",Dd}var nA;function Yye(){if(nA)return N_.exports;nA=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),N_.exports=Zye(),N_.exports}var Xye=Yye();Xye.createRoot(document.getElementById("root"),{onUncaughtError:(e,t)=>{hp(),console.error("Uncaught error:",e,t)},onCaughtError:(e,t)=>{hp(),console.error("Caught error:",e,t)},onRecoverableError:(e,t)=>{hp(),console.warn("Recoverable error:",e,t)}}).render(c.jsx(_.StrictMode,{children:c.jsx(Gye,{})}));export{it as $,gbe as A,_e as B,zx as C,wbe as D,oX as E,vn as F,iM as G,xbe as H,Le as I,ybe as J,bbe as K,Hn as L,Jt as M,Et as N,nM as O,eX as P,zg as Q,Ks as R,as as S,ra as T,oM as U,Qt as V,Sbe as W,PW as X,DW as Y,Tt as Z,xi as _,kt as a,IS as a0,vbe as a1,xZ as a2,_Y as a3,tt as a4,PS as a5,l$ as a6,Rbe as a7,Cbe as a8,Ebe as a9,jbe as aa,J7 as ab,Co as ac,ar as ad,cr as ae,es as af,ES as ag,$f as ah,v$ as ai,Hc as aj,DK as ak,Aq as al,dl as am,wt as an,qn as ao,Wo as ap,Fc as aq,ht as ar,PI as as,Pg as at,Rn as b,pn as c,Nf as d,gn as e,yn as f,ZH as g,$e as h,ke as i,c as j,Oe as k,Cee as l,Ie as m,Ae as n,Pn as o,sM as p,TS as q,_ as r,vt as s,Ee as t,at as u,ZY as v,YY as w,hX as x,_be as y,DY as z};