@techlabi/kycrazy-ui-kit 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -7592,9 +7592,10 @@ const eu = ({
|
|
|
7592
7592
|
onBack: n,
|
|
7593
7593
|
renderProgress: o
|
|
7594
7594
|
}) => {
|
|
7595
|
+
console.log("photo", e);
|
|
7595
7596
|
const s = P.useMemo(() => URL.createObjectURL(e), [e]);
|
|
7596
|
-
return P.useEffect(() => () => {
|
|
7597
|
-
|
|
7597
|
+
return console.log("photoUrl", s), P.useEffect(() => () => {
|
|
7598
|
+
console.log("REVOKEEEEEE", s);
|
|
7598
7599
|
}, [s]), /* @__PURE__ */ h(ze, { className: "w-full max-w-md mx-auto", children: /* @__PURE__ */ j(Be, { className: "p-6", children: [
|
|
7599
7600
|
/* @__PURE__ */ h(
|
|
7600
7601
|
Dn,
|
package/dist/index.umd.js
CHANGED
|
@@ -59,4 +59,4 @@
|
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
61
|
*/const ea=We("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qr="-",ta=e=>{const t=na(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(Qr);return a[0]===""&&a.length!==1&&a.shift(),ho(a,t)||ra(i)},getConflictingClassGroupIds:(i,a)=>{const u=r[i]||[];return a&&n[i]?[...u,...n[i]]:u}}},ho=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ho(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Qr);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},po=/^\[(.+)\]$/,ra=e=>{if(po.test(e)){const t=po.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},na=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return sa(Object.entries(e.classGroups),r).forEach(([s,i])=>{Gr(i,n,s,t)}),n},Gr=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:mo(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(oa(o)){Gr(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{Gr(i,mo(t,s),r,n)})})},mo=(e,t)=>{let r=e;return t.split(Qr).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},oa=e=>e.isThemeGetter,sa=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[r,o]}):e,ia=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},go="!",aa=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let l=0,f=0,h;for(let g=0;g<a.length;g++){let C=a[g];if(l===0){if(C===o&&(n||a.slice(g,g+s)===t)){u.push(a.slice(f,g)),f=g+s;continue}if(C==="/"){h=g;continue}}C==="["?l++:C==="]"&&l--}const y=u.length===0?a:a.substring(f),d=y.startsWith(go),b=d?y.substring(1):y,m=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:d,baseClassName:b,maybePostfixModifierPosition:m}};return r?a=>r({className:a,parseClassName:i}):i},la=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},ca=e=>({cache:ia(e.cacheSize),parseClassName:aa(e),...ta(e)}),da=/\s+/,ua=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(da);let a="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{modifiers:f,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:d}=r(l);let b=!!d,m=n(b?y.substring(0,d):y);if(!m){if(!b){a=l+(a.length>0?" "+a:a);continue}if(m=n(y),!m){a=l+(a.length>0?" "+a:a);continue}b=!1}const g=la(f).join(":"),C=h?g+go:g,E=C+m;if(s.includes(E))continue;s.push(E);const T=o(m,b);for(let w=0;w<T.length;++w){const P=T[w];s.push(C+P)}a=l+(a.length>0?" "+a:a)}return a};function fa(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=yo(t))&&(n&&(n+=" "),n+=r);return n}const yo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=yo(e[n]))&&(r&&(r+=" "),r+=t);return r};function ha(e,...t){let r,n,o,s=i;function i(u){const l=t.reduce((f,h)=>h(f),e());return r=ca(l),n=r.cache.get,o=r.cache.set,s=a,a(u)}function a(u){const l=n(u);if(l)return l;const f=ua(u,r);return o(u,f),f}return function(){return s(fa.apply(null,arguments))}}const Y=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},vo=/^\[(?:([a-z-]+):)?(.+)\]$/i,pa=/^\d+\/\d+$/,ma=new Set(["px","full","screen"]),ga=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ya=/\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$/,va=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>xt(e)||ma.has(e)||pa.test(e),qe=e=>Ct(e,"length",Aa),xt=e=>!!e&&!Number.isNaN(Number(e)),Yr=e=>Ct(e,"number",xt),Kt=e=>!!e&&Number.isInteger(Number(e)),xa=e=>e.endsWith("%")&&xt(e.slice(0,-1)),$=e=>vo.test(e),Ke=e=>ga.test(e),Ca=new Set(["length","size","percentage"]),Ea=e=>Ct(e,Ca,bo),Ta=e=>Ct(e,"position",bo),Pa=new Set(["image","url"]),Sa=e=>Ct(e,Pa,Oa),Na=e=>Ct(e,"",ka),Qt=()=>!0,Ct=(e,t,r)=>{const n=vo.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Aa=e=>ya.test(e)&&!va.test(e),bo=()=>!1,ka=e=>ba.test(e),Oa=e=>wa.test(e),Ma=ha(()=>{const e=Y("colors"),t=Y("spacing"),r=Y("blur"),n=Y("brightness"),o=Y("borderColor"),s=Y("borderRadius"),i=Y("borderSpacing"),a=Y("borderWidth"),u=Y("contrast"),l=Y("grayscale"),f=Y("hueRotate"),h=Y("invert"),y=Y("gap"),d=Y("gradientColorStops"),b=Y("gradientColorStopPositions"),m=Y("inset"),g=Y("margin"),C=Y("opacity"),E=Y("padding"),T=Y("saturate"),w=Y("scale"),P=Y("sepia"),S=Y("skew"),N=Y("space"),L=Y("translate"),M=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",$,t],O=()=>[$,t],W=()=>["",Ie,qe],A=()=>["auto",xt,$],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",$],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[xt,$];return{cacheSize:500,separator:":",theme:{colors:[Qt],spacing:[Ie,qe],blur:["none","",Ke,$],brightness:ee(),borderColor:[e],borderRadius:["none","","full",Ke,$],borderSpacing:O(),borderWidth:W(),contrast:ee(),grayscale:k(),hueRotate:ee(),invert:k(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[xa,qe],inset:H(),margin:H(),opacity:ee(),padding:O(),saturate:ee(),scale:ee(),sepia:k(),skew:ee(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Ke]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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"],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:[...V(),$]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,$]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Kt,$]}],"grid-cols":[{"grid-cols":[Qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,$]},$]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Qt]}],"row-start-end":[{row:["auto",{span:[Kt,$]},$]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Ke]},Ke]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ke,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yr]}],"font-family":[{font:[Qt]}],"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:["tighter","tight","normal","wide","wider","widest",$]}],"line-clamp":[{"line-clamp":["none",xt,Yr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ie,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ie,qe]}],"underline-offset":[{"underline-offset":["auto",Ie,$]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Ta]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ea]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sa]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[Ie,$]}],"outline-w":[{outline:[Ie,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Ie,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ke,Na]}],"shadow-color":[{shadow:[Qt]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ke,$]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[T]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:ee()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:ee()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Kt,$]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ie,qe,Yr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}});function se(...e){return Ma(io(e))}const Da=qi,wo=p.forwardRef(({className:e,...t},r)=>c.jsx(Zn,{ref:r,className:se("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));wo.displayName=Zn.displayName;const Ia=Kr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),xo=p.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(eo,{ref:n,className:se(Ia({variant:t}),e),...r}));xo.displayName=eo.displayName;const La=p.forwardRef(({className:e,...t},r)=>c.jsx(no,{ref:r,className:se("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));La.displayName=no.displayName;const Co=p.forwardRef(({className:e,...t},r)=>c.jsx(oo,{ref:r,className:se("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(ea,{className:"h-4 w-4"})}));Co.displayName=oo.displayName;const Eo=p.forwardRef(({className:e,...t},r)=>c.jsx(to,{ref:r,className:se("text-sm font-semibold",e),...t}));Eo.displayName=to.displayName;const To=p.forwardRef(({className:e,...t},r)=>c.jsx(ro,{ref:r,className:se("text-sm opacity-90",e),...t}));To.displayName=ro.displayName;function Fa(){const{toasts:e}=Fr();return c.jsxs(Da,{children:[e.map(function({id:t,title:r,description:n,action:o,...s}){return c.jsxs(xo,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(Eo,{children:r}),n&&c.jsx(To,{children:n})]}),o,c.jsx(Co,{})]},t)}),c.jsx(wo,{})]})}var Po=["light","dark"],_a="(prefers-color-scheme: dark)",$a=p.createContext(void 0),ja={setTheme:e=>{},themes:[]},za=()=>{var e;return(e=p.useContext($a))!=null?e:ja};p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:o,defaultTheme:s,value:i,attrs:a,nonce:u})=>{let l=s==="system",f=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=o?Po.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(b,m=!1,g=!0)=>{let C=i?i[b]:b,E=m?b+"|| ''":`'${C}'`,T="";return o&&g&&!m&&Po.includes(b)&&(T+=`d.style.colorScheme = '${b}';`),r==="class"?m||C?T+=`c.add(${E})`:T+="null":C&&(T+=`d[s](n,${E})`),T},d=e?`!function(){${f}${y(e)}}()`:n?`!function(){try{${f}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${_a}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}${l?"":"else{"+y(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${y(i?"x[e]":"e",!0)}}else{${y(s,!1,!1)};}${h}}catch(t){}}();`;return p.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:d}})});var Ba=e=>{switch(e){case"success":return Ua;case"info":return qa;case"warning":return Wa;case"error":return Ka;default:return null}},Ha=Array(12).fill(0),Va=({visible:e,className:t})=>x.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},x.createElement("div",{className:"sonner-spinner"},Ha.map((r,n)=>x.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Ua=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Wa=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},x.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"})),qa=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Ka=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.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"})),Qa=x.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"},x.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ga=()=>{let[e,t]=x.useState(document.hidden);return x.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Rr=1,Ya=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Rr++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:r}),{...a,...e,id:o,dismissible:i,title:r}):a):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),o=r!==void 0,s,i=n.then(async u=>{if(s=["resolve",u],x.isValidElement(u))o=!1,this.create({id:r,type:"default",message:u});else if(Xa(u)&&!u.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:r,type:"error",message:l,description:f})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(u):t.success,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"success",message:l,description:f})}}).catch(async u=>{if(s=["reject",u],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"error",message:l,description:f})}}).finally(()=>{var u;o&&(this.dismiss(r),r=void 0),(u=t.finally)==null||u.call(t)}),a=()=>new Promise((u,l)=>i.then(()=>s[0]==="reject"?l(s[1]):u(s[1])).catch(l));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Rr++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ce=new Ya,Ra=(e,t)=>{let r=(t==null?void 0:t.id)||Rr++;return ce.addToast({title:e,...t,id:r}),r},Xa=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Ja=Ra,Za=()=>ce.toasts,el=()=>ce.getActiveToasts();Object.assign(Ja,{success:ce.success,info:ce.info,warning:ce.warning,error:ce.error,custom:ce.custom,message:ce.message,promise:ce.promise,dismiss:ce.dismiss,loading:ce.loading},{getHistory:Za,getToasts:el});function tl(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}tl(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)}
|
|
62
|
-
`);function ur(e){return e.label!==void 0}var rl=3,nl="32px",ol="16px",So=4e3,sl=356,il=14,al=20,ll=200;function ve(...e){return e.filter(Boolean).join(" ")}function cl(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var dl=e=>{var t,r,n,o,s,i,a,u,l,f,h;let{invert:y,toast:d,unstyled:b,interacting:m,setHeights:g,visibleToasts:C,heights:E,index:T,toasts:w,expanded:P,removeToast:S,defaultRichColors:N,closeButton:L,style:M,cancelButtonStyle:_,actionButtonStyle:H,className:O="",descriptionClassName:W="",duration:A,position:V,gap:j,loadingIcon:z,expandByDefault:D,classNames:k,icons:K,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:U}=e,[q,Q]=x.useState(null),[ie,rt]=x.useState(null),[R,jt]=x.useState(!1),[nt,vt]=x.useState(!1),[ot,zt]=x.useState(!1),[st,Nr]=x.useState(!1),[Cn,Ar]=x.useState(!1),[En,tr]=x.useState(0),[Bt,Hs]=x.useState(0),rr=x.useRef(d.duration||A||So),Vs=x.useRef(null),bt=x.useRef(null),Ud=T===0,Wd=T+1<=C,ge=d.type,Ht=d.dismissible!==!1,qd=d.className||"",Kd=d.descriptionClassName||"",kr=x.useMemo(()=>E.findIndex(F=>F.toastId===d.id)||0,[E,d.id]),Qd=x.useMemo(()=>{var F;return(F=d.closeButton)!=null?F:L},[d.closeButton,L]),Us=x.useMemo(()=>d.duration||A||So,[d.duration,A]),Tn=x.useRef(0),Vt=x.useRef(0),Ws=x.useRef(0),Ut=x.useRef(null),[Gd,Yd]=V.split("-"),qs=x.useMemo(()=>E.reduce((F,G,X)=>X>=kr?F:F+G.height,0),[E,kr]),Ks=Ga(),Rd=d.invert||y,Pn=ge==="loading";Vt.current=x.useMemo(()=>kr*j+qs,[kr,qs]),x.useEffect(()=>{rr.current=Us},[Us]),x.useEffect(()=>{jt(!0)},[]),x.useEffect(()=>{let F=bt.current;if(F){let G=F.getBoundingClientRect().height;return Hs(G),g(X=>[{toastId:d.id,height:G,position:d.position},...X]),()=>g(X=>X.filter(Ee=>Ee.toastId!==d.id))}},[g,d.id]),x.useLayoutEffect(()=>{if(!R)return;let F=bt.current,G=F.style.height;F.style.height="auto";let X=F.getBoundingClientRect().height;F.style.height=G,Hs(X),g(Ee=>Ee.find(Te=>Te.toastId===d.id)?Ee.map(Te=>Te.toastId===d.id?{...Te,height:X}:Te):[{toastId:d.id,height:X,position:d.position},...Ee])},[R,d.title,d.description,g,d.id]);let it=x.useCallback(()=>{vt(!0),tr(Vt.current),g(F=>F.filter(G=>G.toastId!==d.id)),setTimeout(()=>{S(d)},ll)},[d,S,g,Vt]);x.useEffect(()=>{if(d.promise&&ge==="loading"||d.duration===1/0||d.type==="loading")return;let F;return P||m||U&&Ks?(()=>{if(Ws.current<Tn.current){let G=new Date().getTime()-Tn.current;rr.current=rr.current-G}Ws.current=new Date().getTime()})():rr.current!==1/0&&(Tn.current=new Date().getTime(),F=setTimeout(()=>{var G;(G=d.onAutoClose)==null||G.call(d,d),it()},rr.current)),()=>clearTimeout(F)},[P,m,d,ge,U,Ks,it]),x.useEffect(()=>{d.delete&&it()},[it,d.delete]);function Xd(){var F,G,X;return K!=null&&K.loading?x.createElement("div",{className:ve(k==null?void 0:k.loader,(F=d==null?void 0:d.classNames)==null?void 0:F.loader,"sonner-loader"),"data-visible":ge==="loading"},K.loading):z?x.createElement("div",{className:ve(k==null?void 0:k.loader,(G=d==null?void 0:d.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":ge==="loading"},z):x.createElement(Va,{className:ve(k==null?void 0:k.loader,(X=d==null?void 0:d.classNames)==null?void 0:X.loader),visible:ge==="loading"})}return x.createElement("li",{tabIndex:0,ref:bt,className:ve(O,qd,k==null?void 0:k.toast,(t=d==null?void 0:d.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[ge],(r=d==null?void 0:d.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:N,"data-styled":!(d.jsx||d.unstyled||b),"data-mounted":R,"data-promise":!!d.promise,"data-swiped":Cn,"data-removed":nt,"data-visible":Wd,"data-y-position":Gd,"data-x-position":Yd,"data-index":T,"data-front":Ud,"data-swiping":ot,"data-dismissible":Ht,"data-type":ge,"data-invert":Rd,"data-swipe-out":st,"data-swipe-direction":ie,"data-expanded":!!(P||D&&R),style:{"--index":T,"--toasts-before":T,"--z-index":w.length-T,"--offset":`${nt?En:Vt.current}px`,"--initial-height":D?"auto":`${Bt}px`,...M,...d.style},onDragEnd:()=>{zt(!1),Q(null),Ut.current=null},onPointerDown:F=>{Pn||!Ht||(Vs.current=new Date,tr(Vt.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(zt(!0),Ut.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,G,X,Ee;if(st||!Ht)return;Ut.current=null;let Te=Number(((F=bt.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),at=Number(((G=bt.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((X=Vs.current)==null?void 0:X.getTime()),Pe=q==="x"?Te:at,lt=Math.abs(Pe)/wt;if(Math.abs(Pe)>=al||lt>.11){tr(Vt.current),(Ee=d.onDismiss)==null||Ee.call(d,d),rt(q==="x"?Te>0?"right":"left":at>0?"down":"up"),it(),Nr(!0),Ar(!1);return}zt(!1),Q(null)},onPointerMove:F=>{var G,X,Ee,Te;if(!Ut.current||!Ht||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;let at=F.clientY-Ut.current.y,wt=F.clientX-Ut.current.x,Pe=(X=e.swipeDirections)!=null?X:cl(V);!q&&(Math.abs(wt)>1||Math.abs(at)>1)&&Q(Math.abs(wt)>Math.abs(at)?"x":"y");let lt={x:0,y:0};q==="y"?(Pe.includes("top")||Pe.includes("bottom"))&&(Pe.includes("top")&&at<0||Pe.includes("bottom")&&at>0)&&(lt.y=at):q==="x"&&(Pe.includes("left")||Pe.includes("right"))&&(Pe.includes("left")&&wt<0||Pe.includes("right")&&wt>0)&&(lt.x=wt),(Math.abs(lt.x)>0||Math.abs(lt.y)>0)&&Ar(!0),(Ee=bt.current)==null||Ee.style.setProperty("--swipe-amount-x",`${lt.x}px`),(Te=bt.current)==null||Te.style.setProperty("--swipe-amount-y",`${lt.y}px`)}},Qd&&!d.jsx?x.createElement("button",{"aria-label":ee,"data-disabled":Pn,"data-close-button":!0,onClick:Pn||!Ht?()=>{}:()=>{var F;it(),(F=d.onDismiss)==null||F.call(d,d)},className:ve(k==null?void 0:k.closeButton,(o=d==null?void 0:d.classNames)==null?void 0:o.closeButton)},(s=K==null?void 0:K.close)!=null?s:Qa):null,d.jsx||x.isValidElement(d.title)?d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title:x.createElement(x.Fragment,null,ge||d.icon||d.promise?x.createElement("div",{"data-icon":"",className:ve(k==null?void 0:k.icon,(i=d==null?void 0:d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Xd():null,d.type!=="loading"?d.icon||(K==null?void 0:K[ge])||Ba(ge):null):null,x.createElement("div",{"data-content":"",className:ve(k==null?void 0:k.content,(a=d==null?void 0:d.classNames)==null?void 0:a.content)},x.createElement("div",{"data-title":"",className:ve(k==null?void 0:k.title,(u=d==null?void 0:d.classNames)==null?void 0:u.title)},typeof d.title=="function"?d.title():d.title),d.description?x.createElement("div",{"data-description":"",className:ve(W,Kd,k==null?void 0:k.description,(l=d==null?void 0:d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),x.isValidElement(d.cancel)?d.cancel:d.cancel&&ur(d.cancel)?x.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||_,onClick:F=>{var G,X;ur(d.cancel)&&Ht&&((X=(G=d.cancel).onClick)==null||X.call(G,F),it())},className:ve(k==null?void 0:k.cancelButton,(f=d==null?void 0:d.classNames)==null?void 0:f.cancelButton)},d.cancel.label):null,x.isValidElement(d.action)?d.action:d.action&&ur(d.action)?x.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||H,onClick:F=>{var G,X;ur(d.action)&&((X=(G=d.action).onClick)==null||X.call(G,F),!F.defaultPrevented&&it())},className:ve(k==null?void 0:k.actionButton,(h=d==null?void 0:d.classNames)==null?void 0:h.actionButton)},d.action.label):null))};function No(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ul(e,t){let r={};return[e,t].forEach((n,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?ol:nl;function u(l){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(l=>{n[l]===void 0?r[`${i}-${l}`]=a:r[`${i}-${l}`]=typeof n[l]=="number"?`${n[l]}px`:n[l]}):u(a)}),r}var fl=x.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:u,mobileOffset:l,theme:f="light",richColors:h,duration:y,style:d,visibleToasts:b=rl,toastOptions:m,dir:g=No(),gap:C=il,loadingIcon:E,icons:T,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:P}=e,[S,N]=x.useState([]),L=x.useMemo(()=>Array.from(new Set([n].concat(S.filter(U=>U.position).map(U=>U.position)))),[S,n]),[M,_]=x.useState([]),[H,O]=x.useState(!1),[W,A]=x.useState(!1),[V,j]=x.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=x.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=x.useRef(null),K=x.useRef(!1),ee=x.useCallback(U=>{N(q=>{var Q;return(Q=q.find(ie=>ie.id===U.id))!=null&&Q.delete||ce.dismiss(U.id),q.filter(({id:ie})=>ie!==U.id)})},[]);return x.useEffect(()=>ce.subscribe(U=>{if(U.dismiss){N(q=>q.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{re.flushSync(()=>{N(q=>{let Q=q.findIndex(ie=>ie.id===U.id);return Q!==-1?[...q.slice(0,Q),{...q[Q],...U},...q.slice(Q+1)]:[U,...q]})})})}),[]),x.useEffect(()=>{if(f!=="system"){j(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:q})=>{j(q?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{j(Q?"dark":"light")}catch(ie){console.error(ie)}})}},[f]),x.useEffect(()=>{S.length<=1&&O(!1)},[S]),x.useEffect(()=>{let U=q=>{var Q,ie;o.every(rt=>q[rt]||q.code===rt)&&(O(!0),(Q=z.current)==null||Q.focus()),q.code==="Escape"&&(document.activeElement===z.current||(ie=z.current)!=null&&ie.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),x.useEffect(()=>{if(z.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,K.current=!1)}},[z.current]),x.createElement("section",{ref:t,"aria-label":`${w} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((U,q)=>{var Q;let[ie,rt]=U.split("-");return S.length?x.createElement("ol",{key:U,dir:g==="auto"?No():g,tabIndex:-1,ref:z,className:a,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":ie,"data-lifted":H&&S.length>1&&!s,"data-x-position":rt,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${sl}px`,"--gap":`${C}px`,...d,...ul(u,l)},onBlur:R=>{K.current&&!R.currentTarget.contains(R.relatedTarget)&&(K.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||K.current||(K.current=!0,k.current=R.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{W||O(!1)},onDragEnd:()=>O(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},S.filter(R=>!R.position&&q===0||R.position===U).map((R,jt)=>{var nt,vt;return x.createElement(dl,{key:R.id,icons:T,index:jt,toast:R,defaultRichColors:h,duration:(nt=m==null?void 0:m.duration)!=null?nt:y,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:b,closeButton:(vt=m==null?void 0:m.closeButton)!=null?vt:i,interacting:W,position:U,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ee,toasts:S.filter(ot=>ot.position==R.position),heights:M.filter(ot=>ot.position==R.position),setHeights:_,expandByDefault:s,gap:C,loadingIcon:E,expanded:H,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const hl=({...e})=>{const{theme:t="system"}=za();return c.jsx(fl,{theme:t,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",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},pl=["top","right","bottom","left"],Qe=Math.min,ue=Math.max,fr=Math.round,hr=Math.floor,Se=e=>({x:e,y:e}),ml={left:"right",right:"left",bottom:"top",top:"bottom"},gl={start:"end",end:"start"};function Xr(e,t,r){return ue(e,Qe(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function Jr(e){return e==="x"?"y":"x"}function Zr(e){return e==="y"?"height":"width"}const yl=new Set(["top","bottom"]);function Ne(e){return yl.has(Fe(e))?"y":"x"}function en(e){return Jr(Ne(e))}function vl(e,t,r){r===void 0&&(r=!1);const n=Et(e),o=en(e),s=Zr(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=pr(i)),[i,pr(i)]}function bl(e){const t=pr(e);return[tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>gl[t])}const Ao=["left","right"],ko=["right","left"],wl=["top","bottom"],xl=["bottom","top"];function Cl(e,t,r){switch(e){case"top":case"bottom":return r?t?ko:Ao:t?Ao:ko;case"left":case"right":return t?wl:xl;default:return[]}}function El(e,t,r,n){const o=Et(e);let s=Cl(Fe(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(tn)))),s}function pr(e){return e.replace(/left|right|bottom|top/g,t=>ml[t])}function Tl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oo(e){return typeof e!="number"?Tl(e):{top:e,right:e,bottom:e,left:e}}function mr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Mo(e,t,r){let{reference:n,floating:o}=e;const s=Ne(t),i=en(t),a=Zr(i),u=Fe(t),l=s==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,y=n[a]/2-o[a]/2;let d;switch(u){case"top":d={x:f,y:n.y-o.height};break;case"bottom":d={x:f,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:h};break;case"left":d={x:n.x-o.width,y:h};break;default:d={x:n.x,y:n.y}}switch(Et(t)){case"start":d[i]-=y*(r&&l?-1:1);break;case"end":d[i]+=y*(r&&l?-1:1);break}return d}const Pl=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Mo(l,n,u),y=n,d={},b=0;for(let m=0;m<a.length;m++){const{name:g,fn:C}=a[m],{x:E,y:T,data:w,reset:P}=await C({x:f,y:h,initialPlacement:n,placement:y,strategy:o,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});f=E??f,h=T??h,d={...d,[g]:{...d[g],...w}},P&&b<=50&&(b++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(l=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:h}=Mo(l,y,u)),m=-1)}return{x:f,y:h,placement:y,strategy:o,middlewareData:d}};async function Gt(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:y=!1,padding:d=0}=Le(t,e),b=Oo(d),g=a[y?h==="floating"?"reference":"floating":h],C=mr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:u})),E=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},P=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:u}):E);return{top:(C.top-P.top+b.top)/w.y,bottom:(P.bottom-C.bottom+b.bottom)/w.y,left:(C.left-P.left+b.left)/w.x,right:(P.right-C.right+b.right)/w.x}}const Sl=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:l,padding:f=0}=Le(e,t)||{};if(l==null)return{};const h=Oo(f),y={x:r,y:n},d=en(o),b=Zr(d),m=await i.getDimensions(l),g=d==="y",C=g?"top":"left",E=g?"bottom":"right",T=g?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[d]-y[d]-s.floating[b],P=y[d]-s.reference[d],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let N=S?S[T]:0;(!N||!await(i.isElement==null?void 0:i.isElement(S)))&&(N=a.floating[T]||s.floating[b]);const L=w/2-P/2,M=N/2-m[b]/2-1,_=Qe(h[C],M),H=Qe(h[E],M),O=_,W=N-m[b]-H,A=N/2-m[b]/2+L,V=Xr(O,A,W),j=!u.arrow&&Et(o)!=null&&A!==V&&s.reference[b]/2-(A<O?_:H)-m[b]/2<0,z=j?A<O?A-O:A-W:0;return{[d]:y[d]+z,data:{[d]:V,centerOffset:A-V-z,...j&&{alignmentOffset:z}},reset:j}}}),Nl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...g}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const C=Fe(o),E=Ne(a),T=Fe(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(l.floating)),P=y||(T||!m?[pr(a)]:bl(a)),S=b!=="none";!y&&S&&P.push(...El(a,m,b,w));const N=[a,...P],L=await Gt(t,g),M=[];let _=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&M.push(L[C]),h){const A=vl(o,i,w);M.push(L[A[0]],L[A[1]])}if(_=[..._,{placement:o,overflows:M}],!M.every(A=>A<=0)){var H,O;const A=(((H=s.flip)==null?void 0:H.index)||0)+1,V=N[A];if(V&&(!(h==="alignment"?E!==Ne(V):!1)||_.every(D=>D.overflows[0]>0&&Ne(D.placement)===E)))return{data:{index:A,overflows:_},reset:{placement:V}};let j=(O=_.filter(z=>z.overflows[0]<=0).sort((z,D)=>z.overflows[1]-D.overflows[1])[0])==null?void 0:O.placement;if(!j)switch(d){case"bestFit":{var W;const z=(W=_.filter(D=>{if(S){const k=Ne(D.placement);return k===E||k==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((D,k)=>D[1]-k[1])[0])==null?void 0:W[0];z&&(j=z);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Do(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Io(e){return pl.some(t=>e[t]>=0)}const Al=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Le(e,t);switch(n){case"referenceHidden":{const s=await Gt(t,{...o,elementContext:"reference"}),i=Do(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Io(i)}}}case"escaped":{const s=await Gt(t,{...o,altBoundary:!0}),i=Do(s,r.floating);return{data:{escapedOffsets:i,escaped:Io(i)}}}default:return{}}}}},Lo=new Set(["left","top"]);async function kl(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Fe(r),a=Et(r),u=Ne(r)==="y",l=Lo.has(i)?-1:1,f=s&&u?-1:1,h=Le(t,e);let{mainAxis:y,crossAxis:d,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(d=a==="end"?b*-1:b),u?{x:d*f,y:y*l}:{x:y*l,y:d*f}}const Ol=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await kl(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Ml=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:C,y:E}=g;return{x:C,y:E}}},...u}=Le(e,t),l={x:r,y:n},f=await Gt(t,u),h=Ne(Fe(o)),y=Jr(h);let d=l[y],b=l[h];if(s){const g=y==="y"?"top":"left",C=y==="y"?"bottom":"right",E=d+f[g],T=d-f[C];d=Xr(E,d,T)}if(i){const g=h==="y"?"top":"left",C=h==="y"?"bottom":"right",E=b+f[g],T=b-f[C];b=Xr(E,b,T)}const m=a.fn({...t,[y]:d,[h]:b});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[y]:s,[h]:i}}}}}},Dl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=Le(e,t),f={x:r,y:n},h=Ne(o),y=Jr(h);let d=f[y],b=f[h];const m=Le(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const T=y==="y"?"height":"width",w=s.reference[y]-s.floating[T]+g.mainAxis,P=s.reference[y]+s.reference[T]-g.mainAxis;d<w?d=w:d>P&&(d=P)}if(l){var C,E;const T=y==="y"?"width":"height",w=Lo.has(Fe(o)),P=s.reference[h]-s.floating[T]+(w&&((C=i.offset)==null?void 0:C[h])||0)+(w?0:g.crossAxis),S=s.reference[h]+s.reference[T]+(w?0:((E=i.offset)==null?void 0:E[h])||0)-(w?g.crossAxis:0);b<P?b=P:b>S&&(b=S)}return{[y]:d,[h]:b}}}},Il=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...l}=Le(e,t),f=await Gt(t,l),h=Fe(o),y=Et(o),d=Ne(o)==="y",{width:b,height:m}=s.floating;let g,C;h==="top"||h==="bottom"?(g=h,C=y===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(C=h,g=y==="end"?"top":"bottom");const E=m-f.top-f.bottom,T=b-f.left-f.right,w=Qe(m-f[g],E),P=Qe(b-f[C],T),S=!t.middlewareData.shift;let N=w,L=P;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=T),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=E),S&&!y){const _=ue(f.left,0),H=ue(f.right,0),O=ue(f.top,0),W=ue(f.bottom,0);d?L=b-2*(_!==0||H!==0?_+H:ue(f.left,f.right)):N=m-2*(O!==0||W!==0?O+W:ue(f.top,f.bottom))}await u({...t,availableWidth:L,availableHeight:N});const M=await i.getDimensions(a.floating);return b!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function gr(){return typeof window<"u"}function Tt(e){return Fo(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(Fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fo(e){return gr()?e instanceof Node||e instanceof fe(e).Node:!1}function be(e){return gr()?e instanceof Element||e instanceof fe(e).Element:!1}function ke(e){return gr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function _o(e){return!gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Ll=new Set(["inline","contents"]);function Yt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ll.has(o)}const Fl=new Set(["table","td","th"]);function _l(e){return Fl.has(Tt(e))}const $l=[":popover-open",":modal"];function yr(e){return $l.some(t=>{try{return e.matches(t)}catch{return!1}})}const jl=["transform","translate","scale","rotate","perspective"],zl=["transform","translate","scale","rotate","perspective","filter"],Bl=["paint","layout","strict","content"];function rn(e){const t=nn(),r=be(e)?we(e):e;return jl.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||zl.some(n=>(r.willChange||"").includes(n))||Bl.some(n=>(r.contain||"").includes(n))}function Hl(e){let t=Ge(e);for(;ke(t)&&!Pt(t);){if(rn(t))return t;if(yr(t))return null;t=Ge(t)}return null}function nn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vl=new Set(["html","body","#document"]);function Pt(e){return Vl.has(Tt(e))}function we(e){return fe(e).getComputedStyle(e)}function vr(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_o(e)&&e.host||Ae(e);return _o(t)?t.host:t}function $o(e){const t=Ge(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Yt(t)?t:$o(t)}function Rt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=$o(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=fe(o);if(s){const a=on(i);return t.concat(i,i.visualViewport||[],Yt(o)?o:[],a&&r?Rt(a):[])}return t.concat(o,Rt(o,[],r))}function on(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jo(e){const t=we(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ke(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=fr(r)!==s||fr(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function sn(e){return be(e)?e:e.contextElement}function St(e){const t=sn(e);if(!ke(t))return Se(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=jo(t);let i=(s?fr(r.width):r.width)/n,a=(s?fr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ul=Se(0);function zo(e){const t=fe(e);return!nn()||!t.visualViewport?Ul:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function ut(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=sn(e);let i=Se(1);t&&(n?be(n)&&(i=St(n)):i=St(e));const a=Wl(s,r,n)?zo(s):Se(0);let u=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const y=fe(s),d=n&&be(n)?fe(n):n;let b=y,m=on(b);for(;m&&n&&d!==b;){const g=St(m),C=m.getBoundingClientRect(),E=we(m),T=C.left+(m.clientLeft+parseFloat(E.paddingLeft))*g.x,w=C.top+(m.clientTop+parseFloat(E.paddingTop))*g.y;u*=g.x,l*=g.y,f*=g.x,h*=g.y,u+=T,l+=w,b=fe(m),m=on(b)}}return mr({width:f,height:h,x:u,y:l})}function an(e,t){const r=vr(e).scrollLeft;return t?t.left+r:ut(Ae(e)).left+r}function Bo(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:an(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function ql(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),a=t?yr(t.floating):!1;if(n===i||a&&s)return r;let u={scrollLeft:0,scrollTop:0},l=Se(1);const f=Se(0),h=ke(n);if((h||!h&&!s)&&((Tt(n)!=="body"||Yt(i))&&(u=vr(n)),ke(n))){const d=ut(n);l=St(n),f.x=d.x+n.clientLeft,f.y=d.y+n.clientTop}const y=i&&!h&&!s?Bo(i,u,!0):Se(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+f.x+y.x,y:r.y*l.y-u.scrollTop*l.y+f.y+y.y}}function Kl(e){return Array.from(e.getClientRects())}function Ql(e){const t=Ae(e),r=vr(e),n=e.ownerDocument.body,o=ue(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ue(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+an(e);const a=-r.scrollTop;return we(n).direction==="rtl"&&(i+=ue(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Gl(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const l=nn();(!l||l&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}const Yl=new Set(["absolute","fixed"]);function Rl(e,t){const r=ut(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ke(e)?St(e):Se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,l=n*s.y;return{width:i,height:a,x:u,y:l}}function Ho(e,t,r){let n;if(t==="viewport")n=Gl(e,r);else if(t==="document")n=Ql(Ae(e));else if(be(t))n=Rl(t,r);else{const o=zo(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(n)}function Vo(e,t){const r=Ge(e);return r===t||!be(r)||Pt(r)?!1:we(r).position==="fixed"||Vo(r,t)}function Xl(e,t){const r=t.get(e);if(r)return r;let n=Rt(e,[],!1).filter(a=>be(a)&&Tt(a)!=="body"),o=null;const s=we(e).position==="fixed";let i=s?Ge(e):e;for(;be(i)&&!Pt(i);){const a=we(i),u=rn(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&Yl.has(o.position)||Yt(i)&&!u&&Vo(e,i))?n=n.filter(f=>f!==i):o=a,i=Ge(i)}return t.set(e,n),n}function Jl(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?yr(t)?[]:Xl(t,this._c):[].concat(r),n],a=i[0],u=i.reduce((l,f)=>{const h=Ho(t,f,o);return l.top=ue(h.top,l.top),l.right=Qe(h.right,l.right),l.bottom=Qe(h.bottom,l.bottom),l.left=ue(h.left,l.left),l},Ho(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Zl(e){const{width:t,height:r}=jo(e);return{width:t,height:r}}function ec(e,t,r){const n=ke(t),o=Ae(t),s=r==="fixed",i=ut(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Se(0);function l(){u.x=an(o)}if(n||!n&&!s)if((Tt(t)!=="body"||Yt(o))&&(a=vr(t)),n){const d=ut(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else o&&l();s&&!n&&o&&l();const f=o&&!n&&!s?Bo(o,a):Se(0),h=i.left+a.scrollLeft-u.x-f.x,y=i.top+a.scrollTop-u.y-f.y;return{x:h,y,width:i.width,height:i.height}}function ln(e){return we(e).position==="static"}function Uo(e,t){if(!ke(e)||we(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Wo(e,t){const r=fe(e);if(yr(e))return r;if(!ke(e)){let o=Ge(e);for(;o&&!Pt(o);){if(be(o)&&!ln(o))return o;o=Ge(o)}return r}let n=Uo(e,t);for(;n&&_l(n)&&ln(n);)n=Uo(n,t);return n&&Pt(n)&&ln(n)&&!rn(n)?r:n||Hl(e)||r}const tc=async function(e){const t=this.getOffsetParent||Wo,r=this.getDimensions,n=await r(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rc(e){return we(e).direction==="rtl"}const nc={convertOffsetParentRelativeRectToViewportRelativeRect:ql,getDocumentElement:Ae,getClippingRect:Jl,getOffsetParent:Wo,getElementRects:tc,getClientRects:Kl,getDimensions:Zl,getScale:St,isElement:be,isRTL:rc};function qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oc(e,t){let r=null,n;const o=Ae(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:h,width:y,height:d}=l;if(a||t(),!y||!d)return;const b=hr(h),m=hr(o.clientWidth-(f+y)),g=hr(o.clientHeight-(h+d)),C=hr(f),T={rootMargin:-b+"px "+-m+"px "+-g+"px "+-C+"px",threshold:ue(0,Qe(1,u))||1};let w=!0;function P(S){const N=S[0].intersectionRatio;if(N!==u){if(!w)return i();N?i(!1,N):n=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!qo(l,e.getBoundingClientRect())&&i(),w=!1}try{r=new IntersectionObserver(P,{...T,root:o.ownerDocument})}catch{r=new IntersectionObserver(P,T)}r.observe(e)}return i(!0),s}function sc(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,l=sn(e),f=o||s?[...l?Rt(l):[],...Rt(t)]:[];f.forEach(C=>{o&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const h=l&&a?oc(l,r):null;let y=-1,d=null;i&&(d=new ResizeObserver(C=>{let[E]=C;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=d)==null||T.observe(t)})),r()}),l&&!u&&d.observe(l),d.observe(t));let b,m=u?ut(e):null;u&&g();function g(){const C=ut(e);m&&!qo(m,C)&&r(),m=C,b=requestAnimationFrame(g)}return r(),()=>{var C;f.forEach(E=>{o&&E.removeEventListener("scroll",r),s&&E.removeEventListener("resize",r)}),h==null||h(),(C=d)==null||C.disconnect(),d=null,u&&cancelAnimationFrame(b)}}const ic=Ol,ac=Ml,lc=Nl,cc=Il,dc=Al,Ko=Sl,uc=Dl,fc=(e,t,r)=>{const n=new Map,o={platform:nc,...r},s={...o.platform,_c:n};return Pl(e,t,{...o,platform:s})};var hc=typeof document<"u",pc=function(){},br=hc?x.useLayoutEffect:pc;function wr(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!wr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!wr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Qo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Go(e,t){const r=Qo(e);return Math.round(t*r)/r}function cn(e){const t=p.useRef(e);return br(()=>{t.current=e}),t}function mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[f,h]=p.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,d]=p.useState(n);wr(y,n)||d(n);const[b,m]=p.useState(null),[g,C]=p.useState(null),E=p.useCallback(D=>{D!==S.current&&(S.current=D,m(D))},[]),T=p.useCallback(D=>{D!==N.current&&(N.current=D,C(D))},[]),w=s||b,P=i||g,S=p.useRef(null),N=p.useRef(null),L=p.useRef(f),M=u!=null,_=cn(u),H=cn(o),O=cn(l),W=p.useCallback(()=>{if(!S.current||!N.current)return;const D={placement:t,strategy:r,middleware:y};H.current&&(D.platform=H.current),fc(S.current,N.current,D).then(k=>{const K={...k,isPositioned:O.current!==!1};A.current&&!wr(L.current,K)&&(L.current=K,Dr.flushSync(()=>{h(K)}))})},[y,t,r,H,O]);br(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[l]);const A=p.useRef(!1);br(()=>(A.current=!0,()=>{A.current=!1}),[]),br(()=>{if(w&&(S.current=w),P&&(N.current=P),w&&P){if(_.current)return _.current(w,P,W);W()}},[w,P,W,_,M]);const V=p.useMemo(()=>({reference:S,floating:N,setReference:E,setFloating:T}),[E,T]),j=p.useMemo(()=>({reference:w,floating:P}),[w,P]),z=p.useMemo(()=>{const D={position:r,left:0,top:0};if(!j.floating)return D;const k=Go(j.floating,f.x),K=Go(j.floating,f.y);return a?{...D,transform:"translate("+k+"px, "+K+"px)",...Qo(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:K}},[r,a,j.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:W,refs:V,elements:j,floatingStyles:z}),[f,W,V,j,z])}const gc=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ko({element:n.current,padding:o}).fn(r):{}:n?Ko({element:n,padding:o}).fn(r):{}}}},yc=(e,t)=>({...ic(e),options:[e,t]}),vc=(e,t)=>({...ac(e),options:[e,t]}),bc=(e,t)=>({...uc(e),options:[e,t]}),wc=(e,t)=>({...lc(e),options:[e,t]}),xc=(e,t)=>({...cc(e),options:[e,t]}),Cc=(e,t)=>({...dc(e),options:[e,t]}),Ec=(e,t)=>({...gc(e),options:[e,t]});var Tc="Arrow",Yo=p.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(ae.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yo.displayName=Tc;var Pc=Yo;function Sc(e){const[t,r]=p.useState(void 0);return Ue(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ro="Popper",[Xo,Jo]=sr(Ro),[eu,Zo]=Xo(Ro),es="PopperAnchor",ts=p.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Zo(es,r),i=p.useRef(null),a=ye(t,i);return p.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:c.jsx(ae.div,{...o,ref:a})});ts.displayName=es;var dn="PopperContent",[Nc,Ac]=Xo(dn),rs=p.forwardRef((e,t)=>{var R,jt,nt,vt,ot,zt;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:y=!1,updatePositionStrategy:d="optimized",onPlaced:b,...m}=e,g=Zo(dn,r),[C,E]=p.useState(null),T=ye(t,st=>E(st)),[w,P]=p.useState(null),S=Sc(w),N=(S==null?void 0:S.width)??0,L=(S==null?void 0:S.height)??0,M=n+(s!=="center"?"-"+s:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},H=Array.isArray(l)?l:[l],O=H.length>0,W={padding:_,boundary:H.filter(Oc),altBoundary:O},{refs:A,floatingStyles:V,placement:j,isPositioned:z,middlewareData:D}=mc({strategy:"fixed",placement:M,whileElementsMounted:(...st)=>sc(...st,{animationFrame:d==="always"}),elements:{reference:g.anchor},middleware:[yc({mainAxis:o+L,alignmentAxis:i}),u&&vc({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?bc():void 0,...W}),u&&wc({...W}),xc({...W,apply:({elements:st,rects:Nr,availableWidth:Cn,availableHeight:Ar})=>{const{width:En,height:tr}=Nr.reference,Bt=st.floating.style;Bt.setProperty("--radix-popper-available-width",`${Cn}px`),Bt.setProperty("--radix-popper-available-height",`${Ar}px`),Bt.setProperty("--radix-popper-anchor-width",`${En}px`),Bt.setProperty("--radix-popper-anchor-height",`${tr}px`)}}),w&&Ec({element:w,padding:a}),Mc({arrowWidth:N,arrowHeight:L}),y&&Cc({strategy:"referenceHidden",...W})]}),[k,K]=ss(j),ee=Ve(b);Ue(()=>{z&&(ee==null||ee())},[z,ee]);const U=(R=D.arrow)==null?void 0:R.x,q=(jt=D.arrow)==null?void 0:jt.y,Q=((nt=D.arrow)==null?void 0:nt.centerOffset)!==0,[ie,rt]=p.useState();return Ue(()=>{C&&rt(window.getComputedStyle(C).zIndex)},[C]),c.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:z?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(vt=D.transformOrigin)==null?void 0:vt.x,(ot=D.transformOrigin)==null?void 0:ot.y].join(" "),...((zt=D.hide)==null?void 0:zt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Nc,{scope:r,placedSide:k,onArrowChange:P,arrowX:U,arrowY:q,shouldHideArrow:Q,children:c.jsx(ae.div,{"data-side":k,"data-align":K,...m,ref:T,style:{...m.style,animation:z?void 0:"none"}})})})});rs.displayName=dn;var ns="PopperArrow",kc={top:"bottom",right:"left",bottom:"top",left:"right"},os=p.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Ac(ns,n),i=kc[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Pc,{...o,ref:r,style:{...o.style,display:"block"}})})});os.displayName=ns;function Oc(e){return e!==null}var Mc=e=>({name:"transformOrigin",options:e,fn(t){var g,C,E;const{placement:r,rects:n,middlewareData:o}=t,i=((g=o.arrow)==null?void 0:g.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[l,f]=ss(r),h={start:"0%",center:"50%",end:"100%"}[f],y=(((C=o.arrow)==null?void 0:C.x)??0)+a/2,d=(((E=o.arrow)==null?void 0:E.y)??0)+u/2;let b="",m="";return l==="bottom"?(b=i?h:`${y}px`,m=`${-u}px`):l==="top"?(b=i?h:`${y}px`,m=`${n.floating.height+u}px`):l==="right"?(b=`${-u}px`,m=i?h:`${d}px`):l==="left"&&(b=`${n.floating.width+u}px`,m=i?h:`${d}px`),{data:{x:b,y:m}}}});function ss(e){const[t,r="center"]=e.split("-");return[t,r]}var Dc=ts,Ic=rs,Lc=os,[xr,tu]=sr("Tooltip",[Jo]),un=Jo(),is="TooltipProvider",Fc=700,as="tooltip.open",[_c,ls]=xr(is),cs=e=>{const{__scopeTooltip:t,delayDuration:r=Fc,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const l=u.current;return()=>window.clearTimeout(l)},[]),c.jsx(_c,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};cs.displayName=is;var ds="Tooltip",[ru,Cr]=xr(ds),fn="TooltipTrigger",$c=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Cr(fn,r),s=ls(fn,r),i=un(r),a=p.useRef(null),u=ye(t,a,o.onTriggerChange),l=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>l.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(Dc,{asChild:!0,...i,children:c.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:te(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});$c.displayName=fn;var jc="TooltipPortal",[nu,zc]=xr(jc,{forceMount:void 0}),Nt="TooltipContent",us=p.forwardRef((e,t)=>{const r=zc(Nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=Cr(Nt,e.__scopeTooltip);return c.jsx(jr,{present:n||i.open,children:i.disableHoverableContent?c.jsx(fs,{side:o,...s,ref:t}):c.jsx(Bc,{side:o,...s,ref:t})})}),Bc=p.forwardRef((e,t)=>{const r=Cr(Nt,e.__scopeTooltip),n=ls(Nt,e.__scopeTooltip),o=p.useRef(null),s=ye(t,o),[i,a]=p.useState(null),{trigger:u,onClose:l}=r,f=o.current,{onPointerInTransitChange:h}=n,y=p.useCallback(()=>{a(null),h(!1)},[h]),d=p.useCallback((b,m)=>{const g=b.currentTarget,C={x:b.clientX,y:b.clientY},E=qc(C,g.getBoundingClientRect()),T=Kc(C,E),w=Qc(m.getBoundingClientRect()),P=Yc([...T,...w]);a(P),h(!0)},[h]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(u&&f){const b=g=>d(g,f),m=g=>d(g,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",m)}}},[u,f,d,y]),p.useEffect(()=>{if(i){const b=m=>{const g=m.target,C={x:m.clientX,y:m.clientY},E=(u==null?void 0:u.contains(g))||(f==null?void 0:f.contains(g)),T=!Gc(C,i);E?y():T&&(y(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,i,l,y]),c.jsx(fs,{...e,ref:s})}),[Hc,Vc]=xr(ds,{isInside:!1}),Uc=ri("TooltipContent"),fs=p.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Cr(Nt,r),l=un(r),{onClose:f}=u;return p.useEffect(()=>(document.addEventListener(as,f),()=>document.removeEventListener(as,f)),[f]),p.useEffect(()=>{if(u.trigger){const h=y=>{const d=y.target;d!=null&&d.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),c.jsx($r,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(Ic,{"data-state":u.stateAttribute,...l,...a,ref:t,style:{...a.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(Uc,{children:n}),c.jsx(Hc,{scope:r,isInside:!0,children:c.jsx(Ni,{id:u.contentId,role:"tooltip",children:o||n})})]})})});us.displayName=Nt;var hs="TooltipArrow",Wc=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=un(r);return Vc(hs,r).isInside?null:c.jsx(Lc,{...o,...n,ref:t})});Wc.displayName=hs;function qc(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Kc(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Qc(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Gc(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],u=t[i],l=a.x,f=a.y,h=u.x,y=u.y;f>n!=y>n&&r<(h-l)*(n-f)/(y-f)+l&&(o=!o)}return o}function Yc(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Rc(t)}function Rc(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Xc=cs,ps=us;const Jc=Xc,Zc=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(ps,{ref:n,sideOffset:t,className:se("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...r}));Zc.displayName=ps.displayName;var Xt=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(){}},Er=typeof window>"u"||"Deno"in globalThis;function he(){}function ed(e,t){return typeof e=="function"?e(t):e}function td(e){return typeof e=="number"&&e>=0&&e!==1/0}function rd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hn(e,t){return typeof e=="function"?e(t):e}function nd(e,t){return typeof e=="function"?e(t):e}function ms(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==pn(i,t.options))return!1}else if(!Jt(t.queryKey,i))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function gs(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(ft(t.options.mutationKey)!==ft(s))return!1}else if(!Jt(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function pn(e,t){return((t==null?void 0:t.queryKeyHashFn)||ft)(e)}function ft(e){return JSON.stringify(e,(t,r)=>gn(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Jt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Jt(e[r],t[r])):!1}function mn(e,t){if(e===t)return e;const r=ys(e)&&ys(t);if(r||gn(e)&&gn(t)){const n=r?e:Object.keys(e),o=n.length,s=r?t:Object.keys(t),i=s.length,a=r?[]:{},u=new Set(n);let l=0;for(let f=0;f<i;f++){const h=r?f:s[f];(!r&&u.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(a[h]=void 0,l++):(a[h]=mn(e[h],t[h]),a[h]===e[h]&&e[h]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function od(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ys(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gn(e){if(!vs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!vs(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vs(e){return Object.prototype.toString.call(e)==="[object Object]"}function sd(e){return new Promise(t=>{setTimeout(t,e)})}function id(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return mn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return mn(e,t)}return t}function ad(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function ld(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tr=Symbol();function bs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Tr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cd(e,t){return typeof e=="function"?e(...t):!!e}var dd=(Ds=class extends Xt{constructor(){super();B(this,ht);B(this,Ye);B(this,kt);I(this,kt,t=>{if(!Er&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){v(this,Ye)||this.setEventListener(v(this,kt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Ye))==null||t.call(this),I(this,Ye,void 0))}setEventListener(t){var r;I(this,kt,t),(r=v(this,Ye))==null||r.call(this),I(this,Ye,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){v(this,ht)!==t&&(I(this,ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof v(this,ht)=="boolean"?v(this,ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ht=new WeakMap,Ye=new WeakMap,kt=new WeakMap,Ds),ws=new dd,ud=(Is=class extends Xt{constructor(){super();B(this,Ot,!0);B(this,Re);B(this,Mt);I(this,Mt,t=>{if(!Er&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){v(this,Re)||this.setEventListener(v(this,Mt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Re))==null||t.call(this),I(this,Re,void 0))}setEventListener(t){var r;I(this,Mt,t),(r=v(this,Re))==null||r.call(this),I(this,Re,t(this.setOnline.bind(this)))}setOnline(t){v(this,Ot)!==t&&(I(this,Ot,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return v(this,Ot)}},Ot=new WeakMap,Re=new WeakMap,Mt=new WeakMap,Is),Pr=new ud;function fd(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}function hd(e){return Math.min(1e3*2**e,3e4)}function xs(e){return(e??"online")==="online"?Pr.isOnline():!0}var Cs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Es(e){let t=!1,r=0,n;const o=fd(),s=()=>o.status!=="pending",i=m=>{var g;s()||(y(new Cs(m)),(g=e.abort)==null||g.call(e))},a=()=>{t=!0},u=()=>{t=!1},l=()=>ws.isFocused()&&(e.networkMode==="always"||Pr.isOnline())&&e.canRun(),f=()=>xs(e.networkMode)&&e.canRun(),h=m=>{s()||(n==null||n(),o.resolve(m))},y=m=>{s()||(n==null||n(),o.reject(m))},d=()=>new Promise(m=>{var g;n=C=>{(s()||l())&&m(C)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;n=void 0,s()||(m=e.onContinue)==null||m.call(e)}),b=()=>{if(s())return;let m;const g=r===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(C){m=Promise.reject(C)}Promise.resolve(m).then(h).catch(C=>{var S;if(s())return;const E=e.retry??(Er?0:3),T=e.retryDelay??hd,w=typeof T=="function"?T(r,C):T,P=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,C);if(t||!P){y(C);return}r++,(S=e.onFail)==null||S.call(e,r,C),sd(w).then(()=>l()?void 0:d()).then(()=>{t?y(C):b()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:a,continueRetry:u,canStart:f,start:()=>(f()?b():d().then(b),o)}}var pd=e=>setTimeout(e,0);function md(){let e=[],t=0,r=a=>{a()},n=a=>{a()},o=pd;const s=a=>{t?e.push(a):o(()=>{r(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{n(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||i()}return u},batchCalls:a=>(...u)=>{s(()=>{a(...u)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{o=a}}}var oe=md(),Ts=(Ls=class{constructor(){B(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),td(this.gcTime)&&I(this,pt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Er?1/0:5*60*1e3))}clearGcTimeout(){v(this,pt)&&(clearTimeout(v(this,pt)),I(this,pt,void 0))}},pt=new WeakMap,Ls),gd=(Fs=class extends Ts{constructor(t){super();B(this,xe);B(this,Dt);B(this,It);B(this,me);B(this,mt);B(this,ne);B(this,Zt);B(this,gt);I(this,gt,!1),I(this,Zt,t.defaultOptions),this.setOptions(t.options),this.observers=[],I(this,mt,t.client),I(this,me,v(this,mt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,I(this,Dt,vd(this.options)),this.state=t.state??v(this,Dt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=v(this,ne))==null?void 0:t.promise}setOptions(t){this.options={...v(this,Zt),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&v(this,me).remove(this)}setData(t,r){const n=id(this.state.data,t,this.options);return Z(this,xe,He).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Z(this,xe,He).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,o;const r=(n=v(this,ne))==null?void 0:n.promise;return(o=v(this,ne))==null||o.cancel(t),r?r.then(he).catch(he):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(v(this,Dt))}isActive(){return this.observers.some(t=>nd(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>hn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=v(this,ne))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=v(this,ne))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),v(this,me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(v(this,ne)&&(v(this,gt)?v(this,ne).cancel({revert:!0}):v(this,ne).cancelRetry()),this.scheduleGc()),v(this,me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,xe,He).call(this,{type:"invalidate"})}async fetch(t,r){var u,l,f,h,y,d,b,m,g,C,E,T;if(this.state.fetchStatus!=="idle"&&((u=v(this,ne))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(v(this,ne))return v(this,ne).continueRetry(),v(this,ne).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(P=>P.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(I(this,gt,!0),n.signal)})},s=()=>{const w=bs(this.options,r),S=(()=>{const N={client:v(this,mt),queryKey:this.queryKey,meta:this.meta};return o(N),N})();return I(this,gt,!1),this.options.persister?this.options.persister(w,S,this):w(S)},a=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:v(this,mt),state:this.state,fetchFn:s};return o(w),w})();(l=this.options.behavior)==null||l.onFetch(a,this),I(this,It,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Z(this,xe,He).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),I(this,ne,Es({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onFail:(w,P)=>{Z(this,xe,He).call(this,{type:"failed",failureCount:w,error:P})},onPause:()=>{Z(this,xe,He).call(this,{type:"pause"})},onContinue:()=>{Z(this,xe,He).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await v(this,ne).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(d=(y=v(this,me).config).onSuccess)==null||d.call(y,w,this),(m=(b=v(this,me).config).onSettled)==null||m.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Cs){if(w.silent)return v(this,ne).promise;if(w.revert){if(this.setState({...v(this,It),fetchStatus:"idle"}),this.state.data===void 0)throw w;return this.state.data}}throw Z(this,xe,He).call(this,{type:"error",error:w}),(C=(g=v(this,me).config).onError)==null||C.call(g,w,this),(T=(E=v(this,me).config).onSettled)==null||T.call(E,this.state.data,w,this),w}finally{this.scheduleGc()}}},Dt=new WeakMap,It=new WeakMap,me=new WeakMap,mt=new WeakMap,ne=new WeakMap,Zt=new WeakMap,gt=new WeakMap,xe=new WeakSet,He=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...yd(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return I(this,It,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),oe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),v(this,me).notify({query:this,type:"updated",action:t})})},Fs);function yd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vd(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var bd=(_s=class extends Xt{constructor(t={}){super();B(this,Oe);this.config=t,I(this,Oe,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??pn(o,r);let i=this.get(s);return i||(i=new gd({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){v(this,Oe).has(t.queryHash)||(v(this,Oe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=v(this,Oe).get(t.queryHash);r&&(t.destroy(),r===t&&v(this,Oe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){oe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return v(this,Oe).get(t)}getAll(){return[...v(this,Oe).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ms(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ms(t,n)):r}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){oe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){oe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Oe=new WeakMap,_s),wd=($s=class extends Ts{constructor(t){super();B(this,De);B(this,Me);B(this,le);B(this,yt);this.mutationId=t.mutationId,I(this,le,t.mutationCache),I(this,Me,[]),this.state=t.state||Ps(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){v(this,Me).includes(t)||(v(this,Me).push(t),this.clearGcTimeout(),v(this,le).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){I(this,Me,v(this,Me).filter(r=>r!==t)),this.scheduleGc(),v(this,le).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){v(this,Me).length||(this.state.status==="pending"?this.scheduleGc():v(this,le).remove(this))}continue(){var t;return((t=v(this,yt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,u,l,f,h,y,d,b,m,g,C,E,T,w,P,S,N,L;const r=()=>{Z(this,De,ct).call(this,{type:"continue"})};I(this,yt,Es({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,_)=>{Z(this,De,ct).call(this,{type:"failed",failureCount:M,error:_})},onPause:()=>{Z(this,De,ct).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>v(this,le).canRun(this)}));const n=this.state.status==="pending",o=!v(this,yt).canStart();try{if(n)r();else{Z(this,De,ct).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=v(this,le).config).onMutate)==null?void 0:i.call(s,t,this));const _=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t));_!==this.state.context&&Z(this,De,ct).call(this,{type:"pending",context:_,variables:t,isPaused:o})}const M=await v(this,yt).start();return await((f=(l=v(this,le).config).onSuccess)==null?void 0:f.call(l,M,t,this.state.context,this)),await((y=(h=this.options).onSuccess)==null?void 0:y.call(h,M,t,this.state.context)),await((b=(d=v(this,le).config).onSettled)==null?void 0:b.call(d,M,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,M,null,t,this.state.context)),Z(this,De,ct).call(this,{type:"success",data:M}),M}catch(M){try{throw await((E=(C=v(this,le).config).onError)==null?void 0:E.call(C,M,t,this.state.context,this)),await((w=(T=this.options).onError)==null?void 0:w.call(T,M,t,this.state.context)),await((S=(P=v(this,le).config).onSettled)==null?void 0:S.call(P,void 0,M,this.state.variables,this.state.context,this)),await((L=(N=this.options).onSettled)==null?void 0:L.call(N,void 0,M,t,this.state.context)),M}finally{Z(this,De,ct).call(this,{type:"error",error:M})}}finally{v(this,le).runNext(this)}}},Me=new WeakMap,le=new WeakMap,yt=new WeakMap,De=new WeakSet,ct=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),oe.batch(()=>{v(this,Me).forEach(n=>{n.onMutationUpdate(t)}),v(this,le).notify({mutation:this,type:"updated",action:t})})},$s);function Ps(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xd=(js=class extends Xt{constructor(t={}){super();B(this,je);B(this,Ce);B(this,er);this.config=t,I(this,je,new Set),I(this,Ce,new Map),I(this,er,0)}build(t,r,n){const o=new wd({mutationCache:this,mutationId:++Or(this,er)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){v(this,je).add(t);const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);n?n.push(t):v(this,Ce).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(v(this,je).delete(t)){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&v(this,Ce).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Sr(t);if(typeof r=="string"){const o=(n=v(this,Ce).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){oe.batch(()=>{v(this,je).forEach(t=>{this.notify({type:"removed",mutation:t})}),v(this,je).clear(),v(this,Ce).clear()})}getAll(){return Array.from(v(this,je))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>gs(r,n))}findAll(t={}){return this.getAll().filter(r=>gs(t,r))}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return oe.batch(()=>Promise.all(t.map(r=>r.continue().catch(he))))}},je=new WeakMap,Ce=new WeakMap,er=new WeakMap,js);function Sr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ss(e){return{onFetch:(t,r)=>{var f,h,y,d,b;const n=t.options,o=(y=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,s=((d=t.state.data)==null?void 0:d.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const l=async()=>{let m=!1;const g=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},C=bs(t.options,t.fetchOptions),E=async(T,w,P)=>{if(m)return Promise.reject();if(w==null&&T.pages.length)return Promise.resolve(T);const N=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:w,direction:P?"backward":"forward",meta:t.options.meta};return g(H),H})(),L=await C(N),{maxPages:M}=t.options,_=P?ld:ad;return{pages:_(T.pages,L,M),pageParams:_(T.pageParams,w,M)}};if(o&&s.length){const T=o==="backward",w=T?Cd:Ns,P={pages:s,pageParams:i},S=w(n,P);a=await E(P,S,T)}else{const T=e??s.length;do{const w=u===0?i[0]??n.initialPageParam:Ns(n,a);if(u>0&&w==null)break;a=await E(a,w),u++}while(u<T)}return a};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Ns(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Cd(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ed=(zs=class{constructor(e={}){B(this,J);B(this,Xe);B(this,Je);B(this,Lt);B(this,Ft);B(this,Ze);B(this,_t);B(this,$t);I(this,J,e.queryCache||new bd),I(this,Xe,e.mutationCache||new xd),I(this,Je,e.defaultOptions||{}),I(this,Lt,new Map),I(this,Ft,new Map),I(this,Ze,0)}mount(){Or(this,Ze)._++,v(this,Ze)===1&&(I(this,_t,ws.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onFocus())})),I(this,$t,Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onOnline())})))}unmount(){var e,t;Or(this,Ze)._--,v(this,Ze)===0&&((e=v(this,_t))==null||e.call(this),I(this,_t,void 0),(t=v(this,$t))==null||t.call(this),I(this,$t,void 0))}isFetching(e){return v(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return v(this,Xe).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=v(this,J).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(hn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return v(this,J).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=v(this,J).get(n.queryHash),s=o==null?void 0:o.state.data,i=ed(t,s);if(i!==void 0)return v(this,J).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return oe.batch(()=>v(this,J).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=v(this,J);oe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=v(this,J);return oe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=oe.batch(()=>v(this,J).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(he).catch(he)}invalidateQueries(e,t={}){return oe.batch(()=>(v(this,J).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=oe.batch(()=>v(this,J).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(he)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(he)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=v(this,J).build(this,t);return r.isStaleByTime(hn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(he).catch(he)}fetchInfiniteQuery(e){return e.behavior=Ss(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(he).catch(he)}ensureInfiniteQueryData(e){return e.behavior=Ss(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pr.isOnline()?v(this,Xe).resumePausedMutations():Promise.resolve()}getQueryCache(){return v(this,J)}getMutationCache(){return v(this,Xe)}getDefaultOptions(){return v(this,Je)}setDefaultOptions(e){I(this,Je,e)}setQueryDefaults(e,t){v(this,Lt).set(ft(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...v(this,Lt).values()],r={};return t.forEach(n=>{Jt(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){v(this,Ft).set(ft(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...v(this,Ft).values()],r={};return t.forEach(n=>{Jt(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...v(this,Je).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pn(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===Tr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...v(this,Je).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){v(this,J).clear(),v(this,Xe).clear()}},J=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Ze=new WeakMap,_t=new WeakMap,$t=new WeakMap,zs),Td=(Bs=class extends Xt{constructor(t,r){super();B(this,Be);B(this,et);B(this,tt);B(this,de);B(this,ze);I(this,et,t),this.setOptions(r),this.bindMethods(),Z(this,Be,Mr).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=v(this,et).defaultMutationOptions(t),od(this.options,r)||v(this,et).getMutationCache().notify({type:"observerOptionsUpdated",mutation:v(this,de),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ft(r.mutationKey)!==ft(this.options.mutationKey)?this.reset():((n=v(this,de))==null?void 0:n.state.status)==="pending"&&v(this,de).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=v(this,de))==null||t.removeObserver(this)}onMutationUpdate(t){Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this,t)}getCurrentResult(){return v(this,tt)}reset(){var t;(t=v(this,de))==null||t.removeObserver(this),I(this,de,void 0),Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this)}mutate(t,r){var n;return I(this,ze,r),(n=v(this,de))==null||n.removeObserver(this),I(this,de,v(this,et).getMutationCache().build(v(this,et),this.options)),v(this,de).addObserver(this),v(this,de).execute(t)}},et=new WeakMap,tt=new WeakMap,de=new WeakMap,ze=new WeakMap,Be=new WeakSet,Mr=function(){var r;const t=((r=v(this,de))==null?void 0:r.state)??Ps();I(this,tt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Nn=function(t){oe.batch(()=>{var r,n,o,s,i,a,u,l;if(v(this,ze)&&this.hasListeners()){const f=v(this,tt).variables,h=v(this,tt).context;(t==null?void 0:t.type)==="success"?((n=(r=v(this,ze)).onSuccess)==null||n.call(r,t.data,f,h),(s=(o=v(this,ze)).onSettled)==null||s.call(o,t.data,null,f,h)):(t==null?void 0:t.type)==="error"&&((a=(i=v(this,ze)).onError)==null||a.call(i,t.error,f,h),(l=(u=v(this,ze)).onSettled)==null||l.call(u,void 0,t.error,f,h))}this.listeners.forEach(f=>{f(v(this,tt))})})},Bs),As=p.createContext(void 0),Pd=e=>{const t=p.useContext(As);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sd=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(As.Provider,{value:e,children:t}));function Nd(e,t){const r=Pd(),[n]=p.useState(()=>new Td(r,e));p.useEffect(()=>{n.setOptions(e)},[n,e]);const o=p.useSyncExternalStore(p.useCallback(i=>n.subscribe(oe.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=p.useCallback((i,a)=>{n.mutate(i,a).catch(he)},[n]);if(o.error&&cd(n.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ad=Kr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pe=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?ei:"button";return c.jsx(i,{className:se(Ad({variant:t,size:r,className:e})),ref:s,...o})});pe.displayName="Button";const _e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_e.displayName="Card";const yn=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex flex-col space-y-1.5 p-6",e),...t}));yn.displayName="CardHeader";const vn=p.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));vn.displayName="CardTitle";const kd=p.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:se("text-sm text-muted-foreground",e),...t}));kd.displayName="CardDescription";const $e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("p-6 pt-0",e),...t}));$e.displayName="CardContent";const Od=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex items-center p-6 pt-0",e),...t}));Od.displayName="CardFooter";const Md=({onContinue:e})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"pt-8 text-center",children:[c.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:c.jsx("div",{className:"relative mb-8",children:c.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:c.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),c.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),c.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),c.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:c.jsx(fo,{className:"w-6 h-6 text-white"})})]})})}),c.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:"Verify your identity"}),c.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:"We need some information to help us confirm your identity."}),c.jsx(pe,{className:"w-full h-14 text-lg font-semibold",onClick:e,children:"Start"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),ks=p.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ks.displayName="Input";var Dd="Label",Os=p.forwardRef((e,t)=>c.jsx(ae.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Os.displayName=Dd;var Ms=Os;const Id=Kr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),At=p.forwardRef(({className:e,...t},r)=>c.jsx(Ms,{ref:r,className:se(Id(),e),...t}));At.displayName=Ms.displayName;const Ld=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(Ji,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),c.jsx(vn,{children:"Personal Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),c.jsxs($e,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{htmlFor:"fullName",children:"Full Name"}),c.jsx(ks,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:o=>t(o.target.value)})]}),c.jsx(pe,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),c.jsx("div",{className:"mt-6",children:n()})]})]}),bn=({title:e,subTitle:t,onBack:r})=>c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center mb-6",children:[c.jsx(pe,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:c.jsx(uo,{className:"w-6 h-6"})}),c.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),c.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Fd=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:o})=>{const s=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Xi},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ri},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Yi},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Zi}];return c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),c.jsx("div",{className:"space-y-3",children:s.map(i=>{const a=i.icon;return c.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===i.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(i.id),children:c.jsxs("div",{className:"flex items-center space-x-4",children:[c.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:c.jsx(a,{className:"w-6 h-6 text-white"})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h3",{className:"font-semibold text-foreground",children:i.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:i.description})]})]})},i.id)})}),c.jsx(pe,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),c.jsx("div",{className:"mt-6",children:o()})]})})},_d=e=>{switch(e){case"selfie":return{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular"};case"id-front":return{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};case"id-back":return{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};default:return{title:"Take Photo",description:"Position your document inside the frame and take a picture.",frameType:"rectangular"}}},wn=({acceptedFile:e,currentStep:t,setCurrentStep:r,setSelfiePhoto:n,setIdCardFront:o,setIdCardBack:s})=>{const[i,a]=x.useState(null),u=x.useRef(null),l=x.useRef(null),f=!!i,{toast:h}=Fr();x.useEffect(()=>{i&&u.current&&(u.current.srcObject=i)},[i]);const y=x.useCallback(async()=>{try{const w=await navigator.mediaDevices.getUserMedia({video:{facingMode:t==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});a(w)}catch{h({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[t,h]);x.useEffect(()=>{!i&&!e&&y()},[t,y,i,e]);const d=x.useCallback(()=>{i&&(i.getTracks().forEach(w=>w.stop()),a(null))},[i]),b=x.useCallback(()=>{if(!u.current||!l.current)return;const w=u.current,P=l.current,S=P.getContext("2d");S&&(P.width=w.videoWidth,P.height=w.videoHeight,S.drawImage(w,0,0),P.toBlob(N=>{if(N){const L=new File([N],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(L),d(),r("selfie-confirm");break;case"id-front":o(L),d(),r("id-front-confirm");break;case"id-back":s(L),d(),r("id-back-confirm");break}h({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[t,d,h]);x.useEffect(()=>()=>{d()},[d]);const m=_d(t),{title:g,description:C,frameType:E}=m,T=()=>{switch(d(),t){case"selfie":r("pre-selfie");break;case"id-front":r("document-selection");break;case"id-back":r("document-selection");break}};return c.jsx(_e,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:c.jsxs($e,{className:" text-white flex flex-col",children:[c.jsxs("div",{className:"flex items-center p-6",children:[c.jsx(pe,{variant:"ghost",size:"sm",onClick:T,className:"text-white hover:bg-gray-800",children:c.jsx(uo,{className:"h-6 w-6"})}),c.jsx("h1",{className:"text-xl font-semibold ml-4",children:g})]}),c.jsx("div",{className:"px-6 mb-8",children:c.jsx("p",{className:"text-gray-300 text-center",children:C})}),c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[c.jsx("div",{className:"relative mb-16",children:f?c.jsxs(c.Fragment,{children:[c.jsx("video",{ref:u,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),c.jsx("canvas",{ref:l,className:"hidden"})]}):c.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:c.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),c.jsx(pe,{onClick:f?b:y,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!f,children:c.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},$d=({onContinue:e,onBack:t})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),c.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:c.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:c.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),c.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),c.jsx("div",{className:"mt-8",children:c.jsx(pe,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),xn=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:o})=>{const s=x.useMemo(()=>URL.createObjectURL(e),[e]);return x.useEffect(()=>()=>{URL.revokeObjectURL(s)},[s]),c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:n}),c.jsx("div",{className:"mb-8",children:c.jsx("div",{className:"relative",children:c.jsx("img",{src:s,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(pe,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),c.jsx(pe,{onClick:r,className:"flex-1 text-md",children:"Looks good"})]})]})})},jd=({fullName:e,onComplete:t,onStartOver:r})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(fo,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),c.jsx(vn,{children:"Review Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{children:"Full Name"}),c.jsx("p",{className:"font-medium",children:e})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"Selfie"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Front"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Back"}),c.jsx("div",{className:"text-green-500",children:"✓"})]})]}),c.jsx(pe,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),c.jsx(pe,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),zd=({onComplete:e})=>(x.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),c.jsx(_e,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:c.jsxs($e,{className:"text-center space-y-8",children:[c.jsx("div",{children:c.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Bd=({apiEndpoint:e,hideNameStep:t,hideDocumentSelectionStep:r})=>{const[n,o]=x.useState("landing"),[s,i]=x.useState(""),[a,u]=x.useState(""),[l,f]=x.useState(null),[h,y]=x.useState(null),[d,b]=x.useState(null),m=Nd({mutationFn:Hd}),{toast:g}=Fr(),C=x.useMemo(()=>[...t?[]:["name"],...r?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[t,r]),E=()=>t?r?"id-front":"document-selection":"name",T=()=>{(t||!!s)&&l&&h&&d&&(m.mutate({endpoint:e,data:{fullName:s,selfiePhoto:l,idCardFront:h,idCardBack:d}}),g({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),f(null),y(null),b(null),o("landing"))},w=()=>c.jsx(c.Fragment,{children:n!=="landing"&&c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"flex space-x-2",children:C.map((S,N)=>c.jsx("div",{className:`w-3 h-3 rounded-full ${C.indexOf(n)>=N?"bg-primary":"bg-muted"}`},S))})})}),P=()=>{switch(n){case"landing":return c.jsx(Md,{onContinue:()=>o(E())});case"name":return c.jsx(Ld,{fullName:s,onNameChange:i,onContinue:()=>o(r?"id-front":"document-selection"),renderProgress:w});case"document-selection":return c.jsx(Fd,{selectedDocumentType:a,onDocumentTypeChange:u,onContinue:()=>o("id-front"),onBack:()=>o(t?"landing":"name"),renderProgress:w});case"id-front":return c.jsx(wn,{acceptedFile:h,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"id-back":return c.jsx(wn,{acceptedFile:d,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"pre-selfie":return c.jsx($d,{onContinue:()=>o("selfie"),onBack:()=>o("name")});case"selfie":return c.jsx(wn,{acceptedFile:l,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"selfie-confirm":return l?c.jsx(xn,{photo:l,onRetake:()=>{f(null),o("selfie")},onConfirm:()=>o("verify"),onBack:()=>o("selfie"),renderProgress:w}):null;case"id-front-confirm":return h?c.jsx(xn,{photo:h,onRetake:()=>{y(null),o("id-front")},onConfirm:()=>o("id-back"),onBack:()=>o("id-front"),renderProgress:w}):null;case"id-back-confirm":return d?c.jsx(xn,{photo:d,onRetake:()=>{b(null),o("id-back")},onConfirm:()=>o("pre-selfie"),onBack:()=>o("id-back"),renderProgress:w}):null;case"verify":return c.jsx(jd,{fullName:s,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return c.jsx(zd,{onComplete:T});default:return null}};return c.jsx("div",{className:"w-[430px]",children:P()})};async function Hd({endpoint:e,data:t}){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error("Network response was not ok");return r.json()}const Vd=new Ed;return()=>c.jsx(Sd,{client:Vd,children:c.jsxs(Jc,{children:[c.jsx(Fa,{}),c.jsx(hl,{}),c.jsx(Bd,{})]})})});
|
|
62
|
+
`);function ur(e){return e.label!==void 0}var rl=3,nl="32px",ol="16px",So=4e3,sl=356,il=14,al=20,ll=200;function ve(...e){return e.filter(Boolean).join(" ")}function cl(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var dl=e=>{var t,r,n,o,s,i,a,u,l,f,h;let{invert:y,toast:d,unstyled:b,interacting:m,setHeights:g,visibleToasts:C,heights:E,index:T,toasts:w,expanded:P,removeToast:S,defaultRichColors:N,closeButton:L,style:M,cancelButtonStyle:_,actionButtonStyle:H,className:O="",descriptionClassName:W="",duration:A,position:V,gap:j,loadingIcon:z,expandByDefault:D,classNames:k,icons:K,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:U}=e,[q,Q]=x.useState(null),[ie,rt]=x.useState(null),[R,jt]=x.useState(!1),[nt,vt]=x.useState(!1),[ot,zt]=x.useState(!1),[st,Nr]=x.useState(!1),[Cn,Ar]=x.useState(!1),[En,tr]=x.useState(0),[Bt,Hs]=x.useState(0),rr=x.useRef(d.duration||A||So),Vs=x.useRef(null),bt=x.useRef(null),Ud=T===0,Wd=T+1<=C,ge=d.type,Ht=d.dismissible!==!1,qd=d.className||"",Kd=d.descriptionClassName||"",kr=x.useMemo(()=>E.findIndex(F=>F.toastId===d.id)||0,[E,d.id]),Qd=x.useMemo(()=>{var F;return(F=d.closeButton)!=null?F:L},[d.closeButton,L]),Us=x.useMemo(()=>d.duration||A||So,[d.duration,A]),Tn=x.useRef(0),Vt=x.useRef(0),Ws=x.useRef(0),Ut=x.useRef(null),[Gd,Yd]=V.split("-"),qs=x.useMemo(()=>E.reduce((F,G,X)=>X>=kr?F:F+G.height,0),[E,kr]),Ks=Ga(),Rd=d.invert||y,Pn=ge==="loading";Vt.current=x.useMemo(()=>kr*j+qs,[kr,qs]),x.useEffect(()=>{rr.current=Us},[Us]),x.useEffect(()=>{jt(!0)},[]),x.useEffect(()=>{let F=bt.current;if(F){let G=F.getBoundingClientRect().height;return Hs(G),g(X=>[{toastId:d.id,height:G,position:d.position},...X]),()=>g(X=>X.filter(Ee=>Ee.toastId!==d.id))}},[g,d.id]),x.useLayoutEffect(()=>{if(!R)return;let F=bt.current,G=F.style.height;F.style.height="auto";let X=F.getBoundingClientRect().height;F.style.height=G,Hs(X),g(Ee=>Ee.find(Te=>Te.toastId===d.id)?Ee.map(Te=>Te.toastId===d.id?{...Te,height:X}:Te):[{toastId:d.id,height:X,position:d.position},...Ee])},[R,d.title,d.description,g,d.id]);let it=x.useCallback(()=>{vt(!0),tr(Vt.current),g(F=>F.filter(G=>G.toastId!==d.id)),setTimeout(()=>{S(d)},ll)},[d,S,g,Vt]);x.useEffect(()=>{if(d.promise&&ge==="loading"||d.duration===1/0||d.type==="loading")return;let F;return P||m||U&&Ks?(()=>{if(Ws.current<Tn.current){let G=new Date().getTime()-Tn.current;rr.current=rr.current-G}Ws.current=new Date().getTime()})():rr.current!==1/0&&(Tn.current=new Date().getTime(),F=setTimeout(()=>{var G;(G=d.onAutoClose)==null||G.call(d,d),it()},rr.current)),()=>clearTimeout(F)},[P,m,d,ge,U,Ks,it]),x.useEffect(()=>{d.delete&&it()},[it,d.delete]);function Xd(){var F,G,X;return K!=null&&K.loading?x.createElement("div",{className:ve(k==null?void 0:k.loader,(F=d==null?void 0:d.classNames)==null?void 0:F.loader,"sonner-loader"),"data-visible":ge==="loading"},K.loading):z?x.createElement("div",{className:ve(k==null?void 0:k.loader,(G=d==null?void 0:d.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":ge==="loading"},z):x.createElement(Va,{className:ve(k==null?void 0:k.loader,(X=d==null?void 0:d.classNames)==null?void 0:X.loader),visible:ge==="loading"})}return x.createElement("li",{tabIndex:0,ref:bt,className:ve(O,qd,k==null?void 0:k.toast,(t=d==null?void 0:d.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[ge],(r=d==null?void 0:d.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:N,"data-styled":!(d.jsx||d.unstyled||b),"data-mounted":R,"data-promise":!!d.promise,"data-swiped":Cn,"data-removed":nt,"data-visible":Wd,"data-y-position":Gd,"data-x-position":Yd,"data-index":T,"data-front":Ud,"data-swiping":ot,"data-dismissible":Ht,"data-type":ge,"data-invert":Rd,"data-swipe-out":st,"data-swipe-direction":ie,"data-expanded":!!(P||D&&R),style:{"--index":T,"--toasts-before":T,"--z-index":w.length-T,"--offset":`${nt?En:Vt.current}px`,"--initial-height":D?"auto":`${Bt}px`,...M,...d.style},onDragEnd:()=>{zt(!1),Q(null),Ut.current=null},onPointerDown:F=>{Pn||!Ht||(Vs.current=new Date,tr(Vt.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(zt(!0),Ut.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,G,X,Ee;if(st||!Ht)return;Ut.current=null;let Te=Number(((F=bt.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),at=Number(((G=bt.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((X=Vs.current)==null?void 0:X.getTime()),Pe=q==="x"?Te:at,lt=Math.abs(Pe)/wt;if(Math.abs(Pe)>=al||lt>.11){tr(Vt.current),(Ee=d.onDismiss)==null||Ee.call(d,d),rt(q==="x"?Te>0?"right":"left":at>0?"down":"up"),it(),Nr(!0),Ar(!1);return}zt(!1),Q(null)},onPointerMove:F=>{var G,X,Ee,Te;if(!Ut.current||!Ht||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;let at=F.clientY-Ut.current.y,wt=F.clientX-Ut.current.x,Pe=(X=e.swipeDirections)!=null?X:cl(V);!q&&(Math.abs(wt)>1||Math.abs(at)>1)&&Q(Math.abs(wt)>Math.abs(at)?"x":"y");let lt={x:0,y:0};q==="y"?(Pe.includes("top")||Pe.includes("bottom"))&&(Pe.includes("top")&&at<0||Pe.includes("bottom")&&at>0)&&(lt.y=at):q==="x"&&(Pe.includes("left")||Pe.includes("right"))&&(Pe.includes("left")&&wt<0||Pe.includes("right")&&wt>0)&&(lt.x=wt),(Math.abs(lt.x)>0||Math.abs(lt.y)>0)&&Ar(!0),(Ee=bt.current)==null||Ee.style.setProperty("--swipe-amount-x",`${lt.x}px`),(Te=bt.current)==null||Te.style.setProperty("--swipe-amount-y",`${lt.y}px`)}},Qd&&!d.jsx?x.createElement("button",{"aria-label":ee,"data-disabled":Pn,"data-close-button":!0,onClick:Pn||!Ht?()=>{}:()=>{var F;it(),(F=d.onDismiss)==null||F.call(d,d)},className:ve(k==null?void 0:k.closeButton,(o=d==null?void 0:d.classNames)==null?void 0:o.closeButton)},(s=K==null?void 0:K.close)!=null?s:Qa):null,d.jsx||x.isValidElement(d.title)?d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title:x.createElement(x.Fragment,null,ge||d.icon||d.promise?x.createElement("div",{"data-icon":"",className:ve(k==null?void 0:k.icon,(i=d==null?void 0:d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Xd():null,d.type!=="loading"?d.icon||(K==null?void 0:K[ge])||Ba(ge):null):null,x.createElement("div",{"data-content":"",className:ve(k==null?void 0:k.content,(a=d==null?void 0:d.classNames)==null?void 0:a.content)},x.createElement("div",{"data-title":"",className:ve(k==null?void 0:k.title,(u=d==null?void 0:d.classNames)==null?void 0:u.title)},typeof d.title=="function"?d.title():d.title),d.description?x.createElement("div",{"data-description":"",className:ve(W,Kd,k==null?void 0:k.description,(l=d==null?void 0:d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),x.isValidElement(d.cancel)?d.cancel:d.cancel&&ur(d.cancel)?x.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||_,onClick:F=>{var G,X;ur(d.cancel)&&Ht&&((X=(G=d.cancel).onClick)==null||X.call(G,F),it())},className:ve(k==null?void 0:k.cancelButton,(f=d==null?void 0:d.classNames)==null?void 0:f.cancelButton)},d.cancel.label):null,x.isValidElement(d.action)?d.action:d.action&&ur(d.action)?x.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||H,onClick:F=>{var G,X;ur(d.action)&&((X=(G=d.action).onClick)==null||X.call(G,F),!F.defaultPrevented&&it())},className:ve(k==null?void 0:k.actionButton,(h=d==null?void 0:d.classNames)==null?void 0:h.actionButton)},d.action.label):null))};function No(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ul(e,t){let r={};return[e,t].forEach((n,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?ol:nl;function u(l){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(l=>{n[l]===void 0?r[`${i}-${l}`]=a:r[`${i}-${l}`]=typeof n[l]=="number"?`${n[l]}px`:n[l]}):u(a)}),r}var fl=x.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:u,mobileOffset:l,theme:f="light",richColors:h,duration:y,style:d,visibleToasts:b=rl,toastOptions:m,dir:g=No(),gap:C=il,loadingIcon:E,icons:T,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:P}=e,[S,N]=x.useState([]),L=x.useMemo(()=>Array.from(new Set([n].concat(S.filter(U=>U.position).map(U=>U.position)))),[S,n]),[M,_]=x.useState([]),[H,O]=x.useState(!1),[W,A]=x.useState(!1),[V,j]=x.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=x.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=x.useRef(null),K=x.useRef(!1),ee=x.useCallback(U=>{N(q=>{var Q;return(Q=q.find(ie=>ie.id===U.id))!=null&&Q.delete||ce.dismiss(U.id),q.filter(({id:ie})=>ie!==U.id)})},[]);return x.useEffect(()=>ce.subscribe(U=>{if(U.dismiss){N(q=>q.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{re.flushSync(()=>{N(q=>{let Q=q.findIndex(ie=>ie.id===U.id);return Q!==-1?[...q.slice(0,Q),{...q[Q],...U},...q.slice(Q+1)]:[U,...q]})})})}),[]),x.useEffect(()=>{if(f!=="system"){j(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:q})=>{j(q?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{j(Q?"dark":"light")}catch(ie){console.error(ie)}})}},[f]),x.useEffect(()=>{S.length<=1&&O(!1)},[S]),x.useEffect(()=>{let U=q=>{var Q,ie;o.every(rt=>q[rt]||q.code===rt)&&(O(!0),(Q=z.current)==null||Q.focus()),q.code==="Escape"&&(document.activeElement===z.current||(ie=z.current)!=null&&ie.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),x.useEffect(()=>{if(z.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,K.current=!1)}},[z.current]),x.createElement("section",{ref:t,"aria-label":`${w} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((U,q)=>{var Q;let[ie,rt]=U.split("-");return S.length?x.createElement("ol",{key:U,dir:g==="auto"?No():g,tabIndex:-1,ref:z,className:a,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":ie,"data-lifted":H&&S.length>1&&!s,"data-x-position":rt,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${sl}px`,"--gap":`${C}px`,...d,...ul(u,l)},onBlur:R=>{K.current&&!R.currentTarget.contains(R.relatedTarget)&&(K.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||K.current||(K.current=!0,k.current=R.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{W||O(!1)},onDragEnd:()=>O(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},S.filter(R=>!R.position&&q===0||R.position===U).map((R,jt)=>{var nt,vt;return x.createElement(dl,{key:R.id,icons:T,index:jt,toast:R,defaultRichColors:h,duration:(nt=m==null?void 0:m.duration)!=null?nt:y,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:b,closeButton:(vt=m==null?void 0:m.closeButton)!=null?vt:i,interacting:W,position:U,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ee,toasts:S.filter(ot=>ot.position==R.position),heights:M.filter(ot=>ot.position==R.position),setHeights:_,expandByDefault:s,gap:C,loadingIcon:E,expanded:H,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const hl=({...e})=>{const{theme:t="system"}=za();return c.jsx(fl,{theme:t,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",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},pl=["top","right","bottom","left"],Qe=Math.min,ue=Math.max,fr=Math.round,hr=Math.floor,Se=e=>({x:e,y:e}),ml={left:"right",right:"left",bottom:"top",top:"bottom"},gl={start:"end",end:"start"};function Xr(e,t,r){return ue(e,Qe(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function Jr(e){return e==="x"?"y":"x"}function Zr(e){return e==="y"?"height":"width"}const yl=new Set(["top","bottom"]);function Ne(e){return yl.has(Fe(e))?"y":"x"}function en(e){return Jr(Ne(e))}function vl(e,t,r){r===void 0&&(r=!1);const n=Et(e),o=en(e),s=Zr(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=pr(i)),[i,pr(i)]}function bl(e){const t=pr(e);return[tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>gl[t])}const Ao=["left","right"],ko=["right","left"],wl=["top","bottom"],xl=["bottom","top"];function Cl(e,t,r){switch(e){case"top":case"bottom":return r?t?ko:Ao:t?Ao:ko;case"left":case"right":return t?wl:xl;default:return[]}}function El(e,t,r,n){const o=Et(e);let s=Cl(Fe(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(tn)))),s}function pr(e){return e.replace(/left|right|bottom|top/g,t=>ml[t])}function Tl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oo(e){return typeof e!="number"?Tl(e):{top:e,right:e,bottom:e,left:e}}function mr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Mo(e,t,r){let{reference:n,floating:o}=e;const s=Ne(t),i=en(t),a=Zr(i),u=Fe(t),l=s==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,y=n[a]/2-o[a]/2;let d;switch(u){case"top":d={x:f,y:n.y-o.height};break;case"bottom":d={x:f,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:h};break;case"left":d={x:n.x-o.width,y:h};break;default:d={x:n.x,y:n.y}}switch(Et(t)){case"start":d[i]-=y*(r&&l?-1:1);break;case"end":d[i]+=y*(r&&l?-1:1);break}return d}const Pl=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Mo(l,n,u),y=n,d={},b=0;for(let m=0;m<a.length;m++){const{name:g,fn:C}=a[m],{x:E,y:T,data:w,reset:P}=await C({x:f,y:h,initialPlacement:n,placement:y,strategy:o,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});f=E??f,h=T??h,d={...d,[g]:{...d[g],...w}},P&&b<=50&&(b++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(l=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:h}=Mo(l,y,u)),m=-1)}return{x:f,y:h,placement:y,strategy:o,middlewareData:d}};async function Gt(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:y=!1,padding:d=0}=Le(t,e),b=Oo(d),g=a[y?h==="floating"?"reference":"floating":h],C=mr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:u})),E=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},P=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:u}):E);return{top:(C.top-P.top+b.top)/w.y,bottom:(P.bottom-C.bottom+b.bottom)/w.y,left:(C.left-P.left+b.left)/w.x,right:(P.right-C.right+b.right)/w.x}}const Sl=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:l,padding:f=0}=Le(e,t)||{};if(l==null)return{};const h=Oo(f),y={x:r,y:n},d=en(o),b=Zr(d),m=await i.getDimensions(l),g=d==="y",C=g?"top":"left",E=g?"bottom":"right",T=g?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[d]-y[d]-s.floating[b],P=y[d]-s.reference[d],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let N=S?S[T]:0;(!N||!await(i.isElement==null?void 0:i.isElement(S)))&&(N=a.floating[T]||s.floating[b]);const L=w/2-P/2,M=N/2-m[b]/2-1,_=Qe(h[C],M),H=Qe(h[E],M),O=_,W=N-m[b]-H,A=N/2-m[b]/2+L,V=Xr(O,A,W),j=!u.arrow&&Et(o)!=null&&A!==V&&s.reference[b]/2-(A<O?_:H)-m[b]/2<0,z=j?A<O?A-O:A-W:0;return{[d]:y[d]+z,data:{[d]:V,centerOffset:A-V-z,...j&&{alignmentOffset:z}},reset:j}}}),Nl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...g}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const C=Fe(o),E=Ne(a),T=Fe(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(l.floating)),P=y||(T||!m?[pr(a)]:bl(a)),S=b!=="none";!y&&S&&P.push(...El(a,m,b,w));const N=[a,...P],L=await Gt(t,g),M=[];let _=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&M.push(L[C]),h){const A=vl(o,i,w);M.push(L[A[0]],L[A[1]])}if(_=[..._,{placement:o,overflows:M}],!M.every(A=>A<=0)){var H,O;const A=(((H=s.flip)==null?void 0:H.index)||0)+1,V=N[A];if(V&&(!(h==="alignment"?E!==Ne(V):!1)||_.every(D=>D.overflows[0]>0&&Ne(D.placement)===E)))return{data:{index:A,overflows:_},reset:{placement:V}};let j=(O=_.filter(z=>z.overflows[0]<=0).sort((z,D)=>z.overflows[1]-D.overflows[1])[0])==null?void 0:O.placement;if(!j)switch(d){case"bestFit":{var W;const z=(W=_.filter(D=>{if(S){const k=Ne(D.placement);return k===E||k==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((D,k)=>D[1]-k[1])[0])==null?void 0:W[0];z&&(j=z);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Do(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Io(e){return pl.some(t=>e[t]>=0)}const Al=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Le(e,t);switch(n){case"referenceHidden":{const s=await Gt(t,{...o,elementContext:"reference"}),i=Do(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Io(i)}}}case"escaped":{const s=await Gt(t,{...o,altBoundary:!0}),i=Do(s,r.floating);return{data:{escapedOffsets:i,escaped:Io(i)}}}default:return{}}}}},Lo=new Set(["left","top"]);async function kl(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Fe(r),a=Et(r),u=Ne(r)==="y",l=Lo.has(i)?-1:1,f=s&&u?-1:1,h=Le(t,e);let{mainAxis:y,crossAxis:d,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(d=a==="end"?b*-1:b),u?{x:d*f,y:y*l}:{x:y*l,y:d*f}}const Ol=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await kl(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Ml=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:C,y:E}=g;return{x:C,y:E}}},...u}=Le(e,t),l={x:r,y:n},f=await Gt(t,u),h=Ne(Fe(o)),y=Jr(h);let d=l[y],b=l[h];if(s){const g=y==="y"?"top":"left",C=y==="y"?"bottom":"right",E=d+f[g],T=d-f[C];d=Xr(E,d,T)}if(i){const g=h==="y"?"top":"left",C=h==="y"?"bottom":"right",E=b+f[g],T=b-f[C];b=Xr(E,b,T)}const m=a.fn({...t,[y]:d,[h]:b});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[y]:s,[h]:i}}}}}},Dl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=Le(e,t),f={x:r,y:n},h=Ne(o),y=Jr(h);let d=f[y],b=f[h];const m=Le(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const T=y==="y"?"height":"width",w=s.reference[y]-s.floating[T]+g.mainAxis,P=s.reference[y]+s.reference[T]-g.mainAxis;d<w?d=w:d>P&&(d=P)}if(l){var C,E;const T=y==="y"?"width":"height",w=Lo.has(Fe(o)),P=s.reference[h]-s.floating[T]+(w&&((C=i.offset)==null?void 0:C[h])||0)+(w?0:g.crossAxis),S=s.reference[h]+s.reference[T]+(w?0:((E=i.offset)==null?void 0:E[h])||0)-(w?g.crossAxis:0);b<P?b=P:b>S&&(b=S)}return{[y]:d,[h]:b}}}},Il=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...l}=Le(e,t),f=await Gt(t,l),h=Fe(o),y=Et(o),d=Ne(o)==="y",{width:b,height:m}=s.floating;let g,C;h==="top"||h==="bottom"?(g=h,C=y===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(C=h,g=y==="end"?"top":"bottom");const E=m-f.top-f.bottom,T=b-f.left-f.right,w=Qe(m-f[g],E),P=Qe(b-f[C],T),S=!t.middlewareData.shift;let N=w,L=P;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=T),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=E),S&&!y){const _=ue(f.left,0),H=ue(f.right,0),O=ue(f.top,0),W=ue(f.bottom,0);d?L=b-2*(_!==0||H!==0?_+H:ue(f.left,f.right)):N=m-2*(O!==0||W!==0?O+W:ue(f.top,f.bottom))}await u({...t,availableWidth:L,availableHeight:N});const M=await i.getDimensions(a.floating);return b!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function gr(){return typeof window<"u"}function Tt(e){return Fo(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(Fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fo(e){return gr()?e instanceof Node||e instanceof fe(e).Node:!1}function be(e){return gr()?e instanceof Element||e instanceof fe(e).Element:!1}function ke(e){return gr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function _o(e){return!gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Ll=new Set(["inline","contents"]);function Yt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ll.has(o)}const Fl=new Set(["table","td","th"]);function _l(e){return Fl.has(Tt(e))}const $l=[":popover-open",":modal"];function yr(e){return $l.some(t=>{try{return e.matches(t)}catch{return!1}})}const jl=["transform","translate","scale","rotate","perspective"],zl=["transform","translate","scale","rotate","perspective","filter"],Bl=["paint","layout","strict","content"];function rn(e){const t=nn(),r=be(e)?we(e):e;return jl.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||zl.some(n=>(r.willChange||"").includes(n))||Bl.some(n=>(r.contain||"").includes(n))}function Hl(e){let t=Ge(e);for(;ke(t)&&!Pt(t);){if(rn(t))return t;if(yr(t))return null;t=Ge(t)}return null}function nn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vl=new Set(["html","body","#document"]);function Pt(e){return Vl.has(Tt(e))}function we(e){return fe(e).getComputedStyle(e)}function vr(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_o(e)&&e.host||Ae(e);return _o(t)?t.host:t}function $o(e){const t=Ge(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Yt(t)?t:$o(t)}function Rt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=$o(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=fe(o);if(s){const a=on(i);return t.concat(i,i.visualViewport||[],Yt(o)?o:[],a&&r?Rt(a):[])}return t.concat(o,Rt(o,[],r))}function on(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jo(e){const t=we(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ke(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=fr(r)!==s||fr(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function sn(e){return be(e)?e:e.contextElement}function St(e){const t=sn(e);if(!ke(t))return Se(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=jo(t);let i=(s?fr(r.width):r.width)/n,a=(s?fr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ul=Se(0);function zo(e){const t=fe(e);return!nn()||!t.visualViewport?Ul:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function ut(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=sn(e);let i=Se(1);t&&(n?be(n)&&(i=St(n)):i=St(e));const a=Wl(s,r,n)?zo(s):Se(0);let u=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const y=fe(s),d=n&&be(n)?fe(n):n;let b=y,m=on(b);for(;m&&n&&d!==b;){const g=St(m),C=m.getBoundingClientRect(),E=we(m),T=C.left+(m.clientLeft+parseFloat(E.paddingLeft))*g.x,w=C.top+(m.clientTop+parseFloat(E.paddingTop))*g.y;u*=g.x,l*=g.y,f*=g.x,h*=g.y,u+=T,l+=w,b=fe(m),m=on(b)}}return mr({width:f,height:h,x:u,y:l})}function an(e,t){const r=vr(e).scrollLeft;return t?t.left+r:ut(Ae(e)).left+r}function Bo(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:an(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function ql(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),a=t?yr(t.floating):!1;if(n===i||a&&s)return r;let u={scrollLeft:0,scrollTop:0},l=Se(1);const f=Se(0),h=ke(n);if((h||!h&&!s)&&((Tt(n)!=="body"||Yt(i))&&(u=vr(n)),ke(n))){const d=ut(n);l=St(n),f.x=d.x+n.clientLeft,f.y=d.y+n.clientTop}const y=i&&!h&&!s?Bo(i,u,!0):Se(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+f.x+y.x,y:r.y*l.y-u.scrollTop*l.y+f.y+y.y}}function Kl(e){return Array.from(e.getClientRects())}function Ql(e){const t=Ae(e),r=vr(e),n=e.ownerDocument.body,o=ue(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ue(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+an(e);const a=-r.scrollTop;return we(n).direction==="rtl"&&(i+=ue(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Gl(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const l=nn();(!l||l&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}const Yl=new Set(["absolute","fixed"]);function Rl(e,t){const r=ut(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ke(e)?St(e):Se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,l=n*s.y;return{width:i,height:a,x:u,y:l}}function Ho(e,t,r){let n;if(t==="viewport")n=Gl(e,r);else if(t==="document")n=Ql(Ae(e));else if(be(t))n=Rl(t,r);else{const o=zo(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(n)}function Vo(e,t){const r=Ge(e);return r===t||!be(r)||Pt(r)?!1:we(r).position==="fixed"||Vo(r,t)}function Xl(e,t){const r=t.get(e);if(r)return r;let n=Rt(e,[],!1).filter(a=>be(a)&&Tt(a)!=="body"),o=null;const s=we(e).position==="fixed";let i=s?Ge(e):e;for(;be(i)&&!Pt(i);){const a=we(i),u=rn(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&Yl.has(o.position)||Yt(i)&&!u&&Vo(e,i))?n=n.filter(f=>f!==i):o=a,i=Ge(i)}return t.set(e,n),n}function Jl(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?yr(t)?[]:Xl(t,this._c):[].concat(r),n],a=i[0],u=i.reduce((l,f)=>{const h=Ho(t,f,o);return l.top=ue(h.top,l.top),l.right=Qe(h.right,l.right),l.bottom=Qe(h.bottom,l.bottom),l.left=ue(h.left,l.left),l},Ho(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Zl(e){const{width:t,height:r}=jo(e);return{width:t,height:r}}function ec(e,t,r){const n=ke(t),o=Ae(t),s=r==="fixed",i=ut(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Se(0);function l(){u.x=an(o)}if(n||!n&&!s)if((Tt(t)!=="body"||Yt(o))&&(a=vr(t)),n){const d=ut(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else o&&l();s&&!n&&o&&l();const f=o&&!n&&!s?Bo(o,a):Se(0),h=i.left+a.scrollLeft-u.x-f.x,y=i.top+a.scrollTop-u.y-f.y;return{x:h,y,width:i.width,height:i.height}}function ln(e){return we(e).position==="static"}function Uo(e,t){if(!ke(e)||we(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Wo(e,t){const r=fe(e);if(yr(e))return r;if(!ke(e)){let o=Ge(e);for(;o&&!Pt(o);){if(be(o)&&!ln(o))return o;o=Ge(o)}return r}let n=Uo(e,t);for(;n&&_l(n)&&ln(n);)n=Uo(n,t);return n&&Pt(n)&&ln(n)&&!rn(n)?r:n||Hl(e)||r}const tc=async function(e){const t=this.getOffsetParent||Wo,r=this.getDimensions,n=await r(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rc(e){return we(e).direction==="rtl"}const nc={convertOffsetParentRelativeRectToViewportRelativeRect:ql,getDocumentElement:Ae,getClippingRect:Jl,getOffsetParent:Wo,getElementRects:tc,getClientRects:Kl,getDimensions:Zl,getScale:St,isElement:be,isRTL:rc};function qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oc(e,t){let r=null,n;const o=Ae(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:h,width:y,height:d}=l;if(a||t(),!y||!d)return;const b=hr(h),m=hr(o.clientWidth-(f+y)),g=hr(o.clientHeight-(h+d)),C=hr(f),T={rootMargin:-b+"px "+-m+"px "+-g+"px "+-C+"px",threshold:ue(0,Qe(1,u))||1};let w=!0;function P(S){const N=S[0].intersectionRatio;if(N!==u){if(!w)return i();N?i(!1,N):n=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!qo(l,e.getBoundingClientRect())&&i(),w=!1}try{r=new IntersectionObserver(P,{...T,root:o.ownerDocument})}catch{r=new IntersectionObserver(P,T)}r.observe(e)}return i(!0),s}function sc(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,l=sn(e),f=o||s?[...l?Rt(l):[],...Rt(t)]:[];f.forEach(C=>{o&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const h=l&&a?oc(l,r):null;let y=-1,d=null;i&&(d=new ResizeObserver(C=>{let[E]=C;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=d)==null||T.observe(t)})),r()}),l&&!u&&d.observe(l),d.observe(t));let b,m=u?ut(e):null;u&&g();function g(){const C=ut(e);m&&!qo(m,C)&&r(),m=C,b=requestAnimationFrame(g)}return r(),()=>{var C;f.forEach(E=>{o&&E.removeEventListener("scroll",r),s&&E.removeEventListener("resize",r)}),h==null||h(),(C=d)==null||C.disconnect(),d=null,u&&cancelAnimationFrame(b)}}const ic=Ol,ac=Ml,lc=Nl,cc=Il,dc=Al,Ko=Sl,uc=Dl,fc=(e,t,r)=>{const n=new Map,o={platform:nc,...r},s={...o.platform,_c:n};return Pl(e,t,{...o,platform:s})};var hc=typeof document<"u",pc=function(){},br=hc?x.useLayoutEffect:pc;function wr(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!wr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!wr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Qo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Go(e,t){const r=Qo(e);return Math.round(t*r)/r}function cn(e){const t=p.useRef(e);return br(()=>{t.current=e}),t}function mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[f,h]=p.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,d]=p.useState(n);wr(y,n)||d(n);const[b,m]=p.useState(null),[g,C]=p.useState(null),E=p.useCallback(D=>{D!==S.current&&(S.current=D,m(D))},[]),T=p.useCallback(D=>{D!==N.current&&(N.current=D,C(D))},[]),w=s||b,P=i||g,S=p.useRef(null),N=p.useRef(null),L=p.useRef(f),M=u!=null,_=cn(u),H=cn(o),O=cn(l),W=p.useCallback(()=>{if(!S.current||!N.current)return;const D={placement:t,strategy:r,middleware:y};H.current&&(D.platform=H.current),fc(S.current,N.current,D).then(k=>{const K={...k,isPositioned:O.current!==!1};A.current&&!wr(L.current,K)&&(L.current=K,Dr.flushSync(()=>{h(K)}))})},[y,t,r,H,O]);br(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[l]);const A=p.useRef(!1);br(()=>(A.current=!0,()=>{A.current=!1}),[]),br(()=>{if(w&&(S.current=w),P&&(N.current=P),w&&P){if(_.current)return _.current(w,P,W);W()}},[w,P,W,_,M]);const V=p.useMemo(()=>({reference:S,floating:N,setReference:E,setFloating:T}),[E,T]),j=p.useMemo(()=>({reference:w,floating:P}),[w,P]),z=p.useMemo(()=>{const D={position:r,left:0,top:0};if(!j.floating)return D;const k=Go(j.floating,f.x),K=Go(j.floating,f.y);return a?{...D,transform:"translate("+k+"px, "+K+"px)",...Qo(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:K}},[r,a,j.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:W,refs:V,elements:j,floatingStyles:z}),[f,W,V,j,z])}const gc=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ko({element:n.current,padding:o}).fn(r):{}:n?Ko({element:n,padding:o}).fn(r):{}}}},yc=(e,t)=>({...ic(e),options:[e,t]}),vc=(e,t)=>({...ac(e),options:[e,t]}),bc=(e,t)=>({...uc(e),options:[e,t]}),wc=(e,t)=>({...lc(e),options:[e,t]}),xc=(e,t)=>({...cc(e),options:[e,t]}),Cc=(e,t)=>({...dc(e),options:[e,t]}),Ec=(e,t)=>({...gc(e),options:[e,t]});var Tc="Arrow",Yo=p.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(ae.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yo.displayName=Tc;var Pc=Yo;function Sc(e){const[t,r]=p.useState(void 0);return Ue(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ro="Popper",[Xo,Jo]=sr(Ro),[eu,Zo]=Xo(Ro),es="PopperAnchor",ts=p.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Zo(es,r),i=p.useRef(null),a=ye(t,i);return p.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:c.jsx(ae.div,{...o,ref:a})});ts.displayName=es;var dn="PopperContent",[Nc,Ac]=Xo(dn),rs=p.forwardRef((e,t)=>{var R,jt,nt,vt,ot,zt;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:y=!1,updatePositionStrategy:d="optimized",onPlaced:b,...m}=e,g=Zo(dn,r),[C,E]=p.useState(null),T=ye(t,st=>E(st)),[w,P]=p.useState(null),S=Sc(w),N=(S==null?void 0:S.width)??0,L=(S==null?void 0:S.height)??0,M=n+(s!=="center"?"-"+s:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},H=Array.isArray(l)?l:[l],O=H.length>0,W={padding:_,boundary:H.filter(Oc),altBoundary:O},{refs:A,floatingStyles:V,placement:j,isPositioned:z,middlewareData:D}=mc({strategy:"fixed",placement:M,whileElementsMounted:(...st)=>sc(...st,{animationFrame:d==="always"}),elements:{reference:g.anchor},middleware:[yc({mainAxis:o+L,alignmentAxis:i}),u&&vc({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?bc():void 0,...W}),u&&wc({...W}),xc({...W,apply:({elements:st,rects:Nr,availableWidth:Cn,availableHeight:Ar})=>{const{width:En,height:tr}=Nr.reference,Bt=st.floating.style;Bt.setProperty("--radix-popper-available-width",`${Cn}px`),Bt.setProperty("--radix-popper-available-height",`${Ar}px`),Bt.setProperty("--radix-popper-anchor-width",`${En}px`),Bt.setProperty("--radix-popper-anchor-height",`${tr}px`)}}),w&&Ec({element:w,padding:a}),Mc({arrowWidth:N,arrowHeight:L}),y&&Cc({strategy:"referenceHidden",...W})]}),[k,K]=ss(j),ee=Ve(b);Ue(()=>{z&&(ee==null||ee())},[z,ee]);const U=(R=D.arrow)==null?void 0:R.x,q=(jt=D.arrow)==null?void 0:jt.y,Q=((nt=D.arrow)==null?void 0:nt.centerOffset)!==0,[ie,rt]=p.useState();return Ue(()=>{C&&rt(window.getComputedStyle(C).zIndex)},[C]),c.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:z?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(vt=D.transformOrigin)==null?void 0:vt.x,(ot=D.transformOrigin)==null?void 0:ot.y].join(" "),...((zt=D.hide)==null?void 0:zt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Nc,{scope:r,placedSide:k,onArrowChange:P,arrowX:U,arrowY:q,shouldHideArrow:Q,children:c.jsx(ae.div,{"data-side":k,"data-align":K,...m,ref:T,style:{...m.style,animation:z?void 0:"none"}})})})});rs.displayName=dn;var ns="PopperArrow",kc={top:"bottom",right:"left",bottom:"top",left:"right"},os=p.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Ac(ns,n),i=kc[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Pc,{...o,ref:r,style:{...o.style,display:"block"}})})});os.displayName=ns;function Oc(e){return e!==null}var Mc=e=>({name:"transformOrigin",options:e,fn(t){var g,C,E;const{placement:r,rects:n,middlewareData:o}=t,i=((g=o.arrow)==null?void 0:g.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[l,f]=ss(r),h={start:"0%",center:"50%",end:"100%"}[f],y=(((C=o.arrow)==null?void 0:C.x)??0)+a/2,d=(((E=o.arrow)==null?void 0:E.y)??0)+u/2;let b="",m="";return l==="bottom"?(b=i?h:`${y}px`,m=`${-u}px`):l==="top"?(b=i?h:`${y}px`,m=`${n.floating.height+u}px`):l==="right"?(b=`${-u}px`,m=i?h:`${d}px`):l==="left"&&(b=`${n.floating.width+u}px`,m=i?h:`${d}px`),{data:{x:b,y:m}}}});function ss(e){const[t,r="center"]=e.split("-");return[t,r]}var Dc=ts,Ic=rs,Lc=os,[xr,tu]=sr("Tooltip",[Jo]),un=Jo(),is="TooltipProvider",Fc=700,as="tooltip.open",[_c,ls]=xr(is),cs=e=>{const{__scopeTooltip:t,delayDuration:r=Fc,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const l=u.current;return()=>window.clearTimeout(l)},[]),c.jsx(_c,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};cs.displayName=is;var ds="Tooltip",[ru,Cr]=xr(ds),fn="TooltipTrigger",$c=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Cr(fn,r),s=ls(fn,r),i=un(r),a=p.useRef(null),u=ye(t,a,o.onTriggerChange),l=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>l.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(Dc,{asChild:!0,...i,children:c.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:te(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});$c.displayName=fn;var jc="TooltipPortal",[nu,zc]=xr(jc,{forceMount:void 0}),Nt="TooltipContent",us=p.forwardRef((e,t)=>{const r=zc(Nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=Cr(Nt,e.__scopeTooltip);return c.jsx(jr,{present:n||i.open,children:i.disableHoverableContent?c.jsx(fs,{side:o,...s,ref:t}):c.jsx(Bc,{side:o,...s,ref:t})})}),Bc=p.forwardRef((e,t)=>{const r=Cr(Nt,e.__scopeTooltip),n=ls(Nt,e.__scopeTooltip),o=p.useRef(null),s=ye(t,o),[i,a]=p.useState(null),{trigger:u,onClose:l}=r,f=o.current,{onPointerInTransitChange:h}=n,y=p.useCallback(()=>{a(null),h(!1)},[h]),d=p.useCallback((b,m)=>{const g=b.currentTarget,C={x:b.clientX,y:b.clientY},E=qc(C,g.getBoundingClientRect()),T=Kc(C,E),w=Qc(m.getBoundingClientRect()),P=Yc([...T,...w]);a(P),h(!0)},[h]);return p.useEffect(()=>()=>y(),[y]),p.useEffect(()=>{if(u&&f){const b=g=>d(g,f),m=g=>d(g,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",m)}}},[u,f,d,y]),p.useEffect(()=>{if(i){const b=m=>{const g=m.target,C={x:m.clientX,y:m.clientY},E=(u==null?void 0:u.contains(g))||(f==null?void 0:f.contains(g)),T=!Gc(C,i);E?y():T&&(y(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,i,l,y]),c.jsx(fs,{...e,ref:s})}),[Hc,Vc]=xr(ds,{isInside:!1}),Uc=ri("TooltipContent"),fs=p.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Cr(Nt,r),l=un(r),{onClose:f}=u;return p.useEffect(()=>(document.addEventListener(as,f),()=>document.removeEventListener(as,f)),[f]),p.useEffect(()=>{if(u.trigger){const h=y=>{const d=y.target;d!=null&&d.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),c.jsx($r,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(Ic,{"data-state":u.stateAttribute,...l,...a,ref:t,style:{...a.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(Uc,{children:n}),c.jsx(Hc,{scope:r,isInside:!0,children:c.jsx(Ni,{id:u.contentId,role:"tooltip",children:o||n})})]})})});us.displayName=Nt;var hs="TooltipArrow",Wc=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=un(r);return Vc(hs,r).isInside?null:c.jsx(Lc,{...o,...n,ref:t})});Wc.displayName=hs;function qc(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Kc(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Qc(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Gc(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],u=t[i],l=a.x,f=a.y,h=u.x,y=u.y;f>n!=y>n&&r<(h-l)*(n-f)/(y-f)+l&&(o=!o)}return o}function Yc(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Rc(t)}function Rc(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Xc=cs,ps=us;const Jc=Xc,Zc=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(ps,{ref:n,sideOffset:t,className:se("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...r}));Zc.displayName=ps.displayName;var Xt=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(){}},Er=typeof window>"u"||"Deno"in globalThis;function he(){}function ed(e,t){return typeof e=="function"?e(t):e}function td(e){return typeof e=="number"&&e>=0&&e!==1/0}function rd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hn(e,t){return typeof e=="function"?e(t):e}function nd(e,t){return typeof e=="function"?e(t):e}function ms(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==pn(i,t.options))return!1}else if(!Jt(t.queryKey,i))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function gs(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(ft(t.options.mutationKey)!==ft(s))return!1}else if(!Jt(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function pn(e,t){return((t==null?void 0:t.queryKeyHashFn)||ft)(e)}function ft(e){return JSON.stringify(e,(t,r)=>gn(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Jt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Jt(e[r],t[r])):!1}function mn(e,t){if(e===t)return e;const r=ys(e)&&ys(t);if(r||gn(e)&&gn(t)){const n=r?e:Object.keys(e),o=n.length,s=r?t:Object.keys(t),i=s.length,a=r?[]:{},u=new Set(n);let l=0;for(let f=0;f<i;f++){const h=r?f:s[f];(!r&&u.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(a[h]=void 0,l++):(a[h]=mn(e[h],t[h]),a[h]===e[h]&&e[h]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function od(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ys(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gn(e){if(!vs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!vs(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vs(e){return Object.prototype.toString.call(e)==="[object Object]"}function sd(e){return new Promise(t=>{setTimeout(t,e)})}function id(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return mn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return mn(e,t)}return t}function ad(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function ld(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tr=Symbol();function bs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Tr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function cd(e,t){return typeof e=="function"?e(...t):!!e}var dd=(Ds=class extends Xt{constructor(){super();B(this,ht);B(this,Ye);B(this,kt);I(this,kt,t=>{if(!Er&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){v(this,Ye)||this.setEventListener(v(this,kt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Ye))==null||t.call(this),I(this,Ye,void 0))}setEventListener(t){var r;I(this,kt,t),(r=v(this,Ye))==null||r.call(this),I(this,Ye,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){v(this,ht)!==t&&(I(this,ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof v(this,ht)=="boolean"?v(this,ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ht=new WeakMap,Ye=new WeakMap,kt=new WeakMap,Ds),ws=new dd,ud=(Is=class extends Xt{constructor(){super();B(this,Ot,!0);B(this,Re);B(this,Mt);I(this,Mt,t=>{if(!Er&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){v(this,Re)||this.setEventListener(v(this,Mt))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,Re))==null||t.call(this),I(this,Re,void 0))}setEventListener(t){var r;I(this,Mt,t),(r=v(this,Re))==null||r.call(this),I(this,Re,t(this.setOnline.bind(this)))}setOnline(t){v(this,Ot)!==t&&(I(this,Ot,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return v(this,Ot)}},Ot=new WeakMap,Re=new WeakMap,Mt=new WeakMap,Is),Pr=new ud;function fd(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}function hd(e){return Math.min(1e3*2**e,3e4)}function xs(e){return(e??"online")==="online"?Pr.isOnline():!0}var Cs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Es(e){let t=!1,r=0,n;const o=fd(),s=()=>o.status!=="pending",i=m=>{var g;s()||(y(new Cs(m)),(g=e.abort)==null||g.call(e))},a=()=>{t=!0},u=()=>{t=!1},l=()=>ws.isFocused()&&(e.networkMode==="always"||Pr.isOnline())&&e.canRun(),f=()=>xs(e.networkMode)&&e.canRun(),h=m=>{s()||(n==null||n(),o.resolve(m))},y=m=>{s()||(n==null||n(),o.reject(m))},d=()=>new Promise(m=>{var g;n=C=>{(s()||l())&&m(C)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;n=void 0,s()||(m=e.onContinue)==null||m.call(e)}),b=()=>{if(s())return;let m;const g=r===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(C){m=Promise.reject(C)}Promise.resolve(m).then(h).catch(C=>{var S;if(s())return;const E=e.retry??(Er?0:3),T=e.retryDelay??hd,w=typeof T=="function"?T(r,C):T,P=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,C);if(t||!P){y(C);return}r++,(S=e.onFail)==null||S.call(e,r,C),sd(w).then(()=>l()?void 0:d()).then(()=>{t?y(C):b()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:a,continueRetry:u,canStart:f,start:()=>(f()?b():d().then(b),o)}}var pd=e=>setTimeout(e,0);function md(){let e=[],t=0,r=a=>{a()},n=a=>{a()},o=pd;const s=a=>{t?e.push(a):o(()=>{r(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{n(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||i()}return u},batchCalls:a=>(...u)=>{s(()=>{a(...u)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{o=a}}}var oe=md(),Ts=(Ls=class{constructor(){B(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),td(this.gcTime)&&I(this,pt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Er?1/0:5*60*1e3))}clearGcTimeout(){v(this,pt)&&(clearTimeout(v(this,pt)),I(this,pt,void 0))}},pt=new WeakMap,Ls),gd=(Fs=class extends Ts{constructor(t){super();B(this,xe);B(this,Dt);B(this,It);B(this,me);B(this,mt);B(this,ne);B(this,Zt);B(this,gt);I(this,gt,!1),I(this,Zt,t.defaultOptions),this.setOptions(t.options),this.observers=[],I(this,mt,t.client),I(this,me,v(this,mt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,I(this,Dt,vd(this.options)),this.state=t.state??v(this,Dt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=v(this,ne))==null?void 0:t.promise}setOptions(t){this.options={...v(this,Zt),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&v(this,me).remove(this)}setData(t,r){const n=id(this.state.data,t,this.options);return Z(this,xe,He).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Z(this,xe,He).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,o;const r=(n=v(this,ne))==null?void 0:n.promise;return(o=v(this,ne))==null||o.cancel(t),r?r.then(he).catch(he):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(v(this,Dt))}isActive(){return this.observers.some(t=>nd(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>hn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!rd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=v(this,ne))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=v(this,ne))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),v(this,me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(v(this,ne)&&(v(this,gt)?v(this,ne).cancel({revert:!0}):v(this,ne).cancelRetry()),this.scheduleGc()),v(this,me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,xe,He).call(this,{type:"invalidate"})}async fetch(t,r){var u,l,f,h,y,d,b,m,g,C,E,T;if(this.state.fetchStatus!=="idle"&&((u=v(this,ne))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(v(this,ne))return v(this,ne).continueRetry(),v(this,ne).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(P=>P.options.queryFn);w&&this.setOptions(w.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(I(this,gt,!0),n.signal)})},s=()=>{const w=bs(this.options,r),S=(()=>{const N={client:v(this,mt),queryKey:this.queryKey,meta:this.meta};return o(N),N})();return I(this,gt,!1),this.options.persister?this.options.persister(w,S,this):w(S)},a=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:v(this,mt),state:this.state,fetchFn:s};return o(w),w})();(l=this.options.behavior)==null||l.onFetch(a,this),I(this,It,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Z(this,xe,He).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),I(this,ne,Es({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onFail:(w,P)=>{Z(this,xe,He).call(this,{type:"failed",failureCount:w,error:P})},onPause:()=>{Z(this,xe,He).call(this,{type:"pause"})},onContinue:()=>{Z(this,xe,He).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await v(this,ne).start();if(w===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(w),(d=(y=v(this,me).config).onSuccess)==null||d.call(y,w,this),(m=(b=v(this,me).config).onSettled)==null||m.call(b,w,this.state.error,this),w}catch(w){if(w instanceof Cs){if(w.silent)return v(this,ne).promise;if(w.revert){if(this.setState({...v(this,It),fetchStatus:"idle"}),this.state.data===void 0)throw w;return this.state.data}}throw Z(this,xe,He).call(this,{type:"error",error:w}),(C=(g=v(this,me).config).onError)==null||C.call(g,w,this),(T=(E=v(this,me).config).onSettled)==null||T.call(E,this.state.data,w,this),w}finally{this.scheduleGc()}}},Dt=new WeakMap,It=new WeakMap,me=new WeakMap,mt=new WeakMap,ne=new WeakMap,Zt=new WeakMap,gt=new WeakMap,xe=new WeakSet,He=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...yd(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return I(this,It,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),oe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),v(this,me).notify({query:this,type:"updated",action:t})})},Fs);function yd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vd(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var bd=(_s=class extends Xt{constructor(t={}){super();B(this,Oe);this.config=t,I(this,Oe,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??pn(o,r);let i=this.get(s);return i||(i=new gd({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){v(this,Oe).has(t.queryHash)||(v(this,Oe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=v(this,Oe).get(t.queryHash);r&&(t.destroy(),r===t&&v(this,Oe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){oe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return v(this,Oe).get(t)}getAll(){return[...v(this,Oe).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ms(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ms(t,n)):r}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){oe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){oe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Oe=new WeakMap,_s),wd=($s=class extends Ts{constructor(t){super();B(this,De);B(this,Me);B(this,le);B(this,yt);this.mutationId=t.mutationId,I(this,le,t.mutationCache),I(this,Me,[]),this.state=t.state||Ps(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){v(this,Me).includes(t)||(v(this,Me).push(t),this.clearGcTimeout(),v(this,le).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){I(this,Me,v(this,Me).filter(r=>r!==t)),this.scheduleGc(),v(this,le).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){v(this,Me).length||(this.state.status==="pending"?this.scheduleGc():v(this,le).remove(this))}continue(){var t;return((t=v(this,yt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,u,l,f,h,y,d,b,m,g,C,E,T,w,P,S,N,L;const r=()=>{Z(this,De,ct).call(this,{type:"continue"})};I(this,yt,Es({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,_)=>{Z(this,De,ct).call(this,{type:"failed",failureCount:M,error:_})},onPause:()=>{Z(this,De,ct).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>v(this,le).canRun(this)}));const n=this.state.status==="pending",o=!v(this,yt).canStart();try{if(n)r();else{Z(this,De,ct).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=v(this,le).config).onMutate)==null?void 0:i.call(s,t,this));const _=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t));_!==this.state.context&&Z(this,De,ct).call(this,{type:"pending",context:_,variables:t,isPaused:o})}const M=await v(this,yt).start();return await((f=(l=v(this,le).config).onSuccess)==null?void 0:f.call(l,M,t,this.state.context,this)),await((y=(h=this.options).onSuccess)==null?void 0:y.call(h,M,t,this.state.context)),await((b=(d=v(this,le).config).onSettled)==null?void 0:b.call(d,M,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,M,null,t,this.state.context)),Z(this,De,ct).call(this,{type:"success",data:M}),M}catch(M){try{throw await((E=(C=v(this,le).config).onError)==null?void 0:E.call(C,M,t,this.state.context,this)),await((w=(T=this.options).onError)==null?void 0:w.call(T,M,t,this.state.context)),await((S=(P=v(this,le).config).onSettled)==null?void 0:S.call(P,void 0,M,this.state.variables,this.state.context,this)),await((L=(N=this.options).onSettled)==null?void 0:L.call(N,void 0,M,t,this.state.context)),M}finally{Z(this,De,ct).call(this,{type:"error",error:M})}}finally{v(this,le).runNext(this)}}},Me=new WeakMap,le=new WeakMap,yt=new WeakMap,De=new WeakSet,ct=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),oe.batch(()=>{v(this,Me).forEach(n=>{n.onMutationUpdate(t)}),v(this,le).notify({mutation:this,type:"updated",action:t})})},$s);function Ps(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xd=(js=class extends Xt{constructor(t={}){super();B(this,je);B(this,Ce);B(this,er);this.config=t,I(this,je,new Set),I(this,Ce,new Map),I(this,er,0)}build(t,r,n){const o=new wd({mutationCache:this,mutationId:++Or(this,er)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){v(this,je).add(t);const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);n?n.push(t):v(this,Ce).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(v(this,je).delete(t)){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&v(this,Ce).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Sr(t);if(typeof r=="string"){const n=v(this,Ce).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Sr(t);if(typeof r=="string"){const o=(n=v(this,Ce).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){oe.batch(()=>{v(this,je).forEach(t=>{this.notify({type:"removed",mutation:t})}),v(this,je).clear(),v(this,Ce).clear()})}getAll(){return Array.from(v(this,je))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>gs(r,n))}findAll(t={}){return this.getAll().filter(r=>gs(t,r))}notify(t){oe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return oe.batch(()=>Promise.all(t.map(r=>r.continue().catch(he))))}},je=new WeakMap,Ce=new WeakMap,er=new WeakMap,js);function Sr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ss(e){return{onFetch:(t,r)=>{var f,h,y,d,b;const n=t.options,o=(y=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,s=((d=t.state.data)==null?void 0:d.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const l=async()=>{let m=!1;const g=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},C=bs(t.options,t.fetchOptions),E=async(T,w,P)=>{if(m)return Promise.reject();if(w==null&&T.pages.length)return Promise.resolve(T);const N=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:w,direction:P?"backward":"forward",meta:t.options.meta};return g(H),H})(),L=await C(N),{maxPages:M}=t.options,_=P?ld:ad;return{pages:_(T.pages,L,M),pageParams:_(T.pageParams,w,M)}};if(o&&s.length){const T=o==="backward",w=T?Cd:Ns,P={pages:s,pageParams:i},S=w(n,P);a=await E(P,S,T)}else{const T=e??s.length;do{const w=u===0?i[0]??n.initialPageParam:Ns(n,a);if(u>0&&w==null)break;a=await E(a,w),u++}while(u<T)}return a};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Ns(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Cd(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ed=(zs=class{constructor(e={}){B(this,J);B(this,Xe);B(this,Je);B(this,Lt);B(this,Ft);B(this,Ze);B(this,_t);B(this,$t);I(this,J,e.queryCache||new bd),I(this,Xe,e.mutationCache||new xd),I(this,Je,e.defaultOptions||{}),I(this,Lt,new Map),I(this,Ft,new Map),I(this,Ze,0)}mount(){Or(this,Ze)._++,v(this,Ze)===1&&(I(this,_t,ws.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onFocus())})),I(this,$t,Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,J).onOnline())})))}unmount(){var e,t;Or(this,Ze)._--,v(this,Ze)===0&&((e=v(this,_t))==null||e.call(this),I(this,_t,void 0),(t=v(this,$t))==null||t.call(this),I(this,$t,void 0))}isFetching(e){return v(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return v(this,Xe).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=v(this,J).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(hn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return v(this,J).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=v(this,J).get(n.queryHash),s=o==null?void 0:o.state.data,i=ed(t,s);if(i!==void 0)return v(this,J).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return oe.batch(()=>v(this,J).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=v(this,J).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=v(this,J);oe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=v(this,J);return oe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=oe.batch(()=>v(this,J).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(he).catch(he)}invalidateQueries(e,t={}){return oe.batch(()=>(v(this,J).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=oe.batch(()=>v(this,J).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(he)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(he)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=v(this,J).build(this,t);return r.isStaleByTime(hn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(he).catch(he)}fetchInfiniteQuery(e){return e.behavior=Ss(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(he).catch(he)}ensureInfiniteQueryData(e){return e.behavior=Ss(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pr.isOnline()?v(this,Xe).resumePausedMutations():Promise.resolve()}getQueryCache(){return v(this,J)}getMutationCache(){return v(this,Xe)}getDefaultOptions(){return v(this,Je)}setDefaultOptions(e){I(this,Je,e)}setQueryDefaults(e,t){v(this,Lt).set(ft(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...v(this,Lt).values()],r={};return t.forEach(n=>{Jt(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){v(this,Ft).set(ft(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...v(this,Ft).values()],r={};return t.forEach(n=>{Jt(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...v(this,Je).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pn(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===Tr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...v(this,Je).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){v(this,J).clear(),v(this,Xe).clear()}},J=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Ze=new WeakMap,_t=new WeakMap,$t=new WeakMap,zs),Td=(Bs=class extends Xt{constructor(t,r){super();B(this,Be);B(this,et);B(this,tt);B(this,de);B(this,ze);I(this,et,t),this.setOptions(r),this.bindMethods(),Z(this,Be,Mr).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=v(this,et).defaultMutationOptions(t),od(this.options,r)||v(this,et).getMutationCache().notify({type:"observerOptionsUpdated",mutation:v(this,de),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ft(r.mutationKey)!==ft(this.options.mutationKey)?this.reset():((n=v(this,de))==null?void 0:n.state.status)==="pending"&&v(this,de).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=v(this,de))==null||t.removeObserver(this)}onMutationUpdate(t){Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this,t)}getCurrentResult(){return v(this,tt)}reset(){var t;(t=v(this,de))==null||t.removeObserver(this),I(this,de,void 0),Z(this,Be,Mr).call(this),Z(this,Be,Nn).call(this)}mutate(t,r){var n;return I(this,ze,r),(n=v(this,de))==null||n.removeObserver(this),I(this,de,v(this,et).getMutationCache().build(v(this,et),this.options)),v(this,de).addObserver(this),v(this,de).execute(t)}},et=new WeakMap,tt=new WeakMap,de=new WeakMap,ze=new WeakMap,Be=new WeakSet,Mr=function(){var r;const t=((r=v(this,de))==null?void 0:r.state)??Ps();I(this,tt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Nn=function(t){oe.batch(()=>{var r,n,o,s,i,a,u,l;if(v(this,ze)&&this.hasListeners()){const f=v(this,tt).variables,h=v(this,tt).context;(t==null?void 0:t.type)==="success"?((n=(r=v(this,ze)).onSuccess)==null||n.call(r,t.data,f,h),(s=(o=v(this,ze)).onSettled)==null||s.call(o,t.data,null,f,h)):(t==null?void 0:t.type)==="error"&&((a=(i=v(this,ze)).onError)==null||a.call(i,t.error,f,h),(l=(u=v(this,ze)).onSettled)==null||l.call(u,void 0,t.error,f,h))}this.listeners.forEach(f=>{f(v(this,tt))})})},Bs),As=p.createContext(void 0),Pd=e=>{const t=p.useContext(As);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sd=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(As.Provider,{value:e,children:t}));function Nd(e,t){const r=Pd(),[n]=p.useState(()=>new Td(r,e));p.useEffect(()=>{n.setOptions(e)},[n,e]);const o=p.useSyncExternalStore(p.useCallback(i=>n.subscribe(oe.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=p.useCallback((i,a)=>{n.mutate(i,a).catch(he)},[n]);if(o.error&&cd(n.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ad=Kr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pe=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?ei:"button";return c.jsx(i,{className:se(Ad({variant:t,size:r,className:e})),ref:s,...o})});pe.displayName="Button";const _e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_e.displayName="Card";const yn=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex flex-col space-y-1.5 p-6",e),...t}));yn.displayName="CardHeader";const vn=p.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));vn.displayName="CardTitle";const kd=p.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:se("text-sm text-muted-foreground",e),...t}));kd.displayName="CardDescription";const $e=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("p-6 pt-0",e),...t}));$e.displayName="CardContent";const Od=p.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:se("flex items-center p-6 pt-0",e),...t}));Od.displayName="CardFooter";const Md=({onContinue:e})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"pt-8 text-center",children:[c.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:c.jsx("div",{className:"relative mb-8",children:c.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:c.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),c.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),c.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),c.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:c.jsx(fo,{className:"w-6 h-6 text-white"})})]})})}),c.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:"Verify your identity"}),c.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:"We need some information to help us confirm your identity."}),c.jsx(pe,{className:"w-full h-14 text-lg font-semibold",onClick:e,children:"Start"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),ks=p.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ks.displayName="Input";var Dd="Label",Os=p.forwardRef((e,t)=>c.jsx(ae.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Os.displayName=Dd;var Ms=Os;const Id=Kr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),At=p.forwardRef(({className:e,...t},r)=>c.jsx(Ms,{ref:r,className:se(Id(),e),...t}));At.displayName=Ms.displayName;const Ld=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(Ji,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),c.jsx(vn,{children:"Personal Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),c.jsxs($e,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{htmlFor:"fullName",children:"Full Name"}),c.jsx(ks,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:o=>t(o.target.value)})]}),c.jsx(pe,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),c.jsx("div",{className:"mt-6",children:n()})]})]}),bn=({title:e,subTitle:t,onBack:r})=>c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center mb-6",children:[c.jsx(pe,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:c.jsx(uo,{className:"w-6 h-6"})}),c.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),c.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Fd=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:o})=>{const s=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Xi},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ri},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Yi},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Zi}];return c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),c.jsx("div",{className:"space-y-3",children:s.map(i=>{const a=i.icon;return c.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===i.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(i.id),children:c.jsxs("div",{className:"flex items-center space-x-4",children:[c.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:c.jsx(a,{className:"w-6 h-6 text-white"})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h3",{className:"font-semibold text-foreground",children:i.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:i.description})]})]})},i.id)})}),c.jsx(pe,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),c.jsx("div",{className:"mt-6",children:o()})]})})},_d=e=>{switch(e){case"selfie":return{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular"};case"id-front":return{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};case"id-back":return{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular"};default:return{title:"Take Photo",description:"Position your document inside the frame and take a picture.",frameType:"rectangular"}}},wn=({acceptedFile:e,currentStep:t,setCurrentStep:r,setSelfiePhoto:n,setIdCardFront:o,setIdCardBack:s})=>{const[i,a]=x.useState(null),u=x.useRef(null),l=x.useRef(null),f=!!i,{toast:h}=Fr();x.useEffect(()=>{i&&u.current&&(u.current.srcObject=i)},[i]);const y=x.useCallback(async()=>{try{const w=await navigator.mediaDevices.getUserMedia({video:{facingMode:t==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});a(w)}catch{h({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[t,h]);x.useEffect(()=>{!i&&!e&&y()},[t,y,i,e]);const d=x.useCallback(()=>{i&&(i.getTracks().forEach(w=>w.stop()),a(null))},[i]),b=x.useCallback(()=>{if(!u.current||!l.current)return;const w=u.current,P=l.current,S=P.getContext("2d");S&&(P.width=w.videoWidth,P.height=w.videoHeight,S.drawImage(w,0,0),P.toBlob(N=>{if(N){const L=new File([N],`${t}-${Date.now()}.jpg`,{type:"image/jpeg"});switch(t){case"selfie":n(L),d(),r("selfie-confirm");break;case"id-front":o(L),d(),r("id-front-confirm");break;case"id-back":s(L),d(),r("id-back-confirm");break}h({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[t,d,h]);x.useEffect(()=>()=>{d()},[d]);const m=_d(t),{title:g,description:C,frameType:E}=m,T=()=>{switch(d(),t){case"selfie":r("pre-selfie");break;case"id-front":r("document-selection");break;case"id-back":r("document-selection");break}};return c.jsx(_e,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:c.jsxs($e,{className:" text-white flex flex-col",children:[c.jsxs("div",{className:"flex items-center p-6",children:[c.jsx(pe,{variant:"ghost",size:"sm",onClick:T,className:"text-white hover:bg-gray-800",children:c.jsx(uo,{className:"h-6 w-6"})}),c.jsx("h1",{className:"text-xl font-semibold ml-4",children:g})]}),c.jsx("div",{className:"px-6 mb-8",children:c.jsx("p",{className:"text-gray-300 text-center",children:C})}),c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[c.jsx("div",{className:"relative mb-16",children:f?c.jsxs(c.Fragment,{children:[c.jsx("video",{ref:u,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),c.jsx("canvas",{ref:l,className:"hidden"})]}):c.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${E==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:c.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),c.jsx(pe,{onClick:f?b:y,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!f,children:c.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},$d=({onContinue:e,onBack:t})=>c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),c.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:c.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:c.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),c.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),c.jsx("div",{className:"mt-8",children:c.jsx(pe,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),xn=({photo:e,onRetake:t,onConfirm:r,onBack:n,renderProgress:o})=>{console.log("photo",e);const s=x.useMemo(()=>URL.createObjectURL(e),[e]);return console.log("photoUrl",s),x.useEffect(()=>()=>{console.log("REVOKEEEEEE",s)},[s]),c.jsx(_e,{className:"w-full max-w-md mx-auto",children:c.jsxs($e,{className:"p-6",children:[c.jsx(bn,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:n}),c.jsx("div",{className:"mb-8",children:c.jsx("div",{className:"relative",children:c.jsx("img",{src:s,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(pe,{variant:"outline",onClick:t,className:"flex-1 text-md",children:"Take again"}),c.jsx(pe,{onClick:r,className:"flex-1 text-md",children:"Looks good"})]})]})})},jd=({fullName:e,onComplete:t,onStartOver:r})=>c.jsxs(_e,{className:"w-full max-w-md mx-auto",children:[c.jsxs(yn,{className:"text-center",children:[c.jsx(fo,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),c.jsx(vn,{children:"Review Information"}),c.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(At,{children:"Full Name"}),c.jsx("p",{className:"font-medium",children:e})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"Selfie"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Front"}),c.jsx("div",{className:"text-green-500",children:"✓"})]}),c.jsxs("div",{children:[c.jsx(At,{className:"text-xs",children:"ID Back"}),c.jsx("div",{className:"text-green-500",children:"✓"})]})]}),c.jsx(pe,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),c.jsx(pe,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),zd=({onComplete:e})=>(x.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),c.jsx(_e,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:c.jsxs($e,{className:"text-center space-y-8",children:[c.jsx("div",{children:c.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Bd=({apiEndpoint:e,hideNameStep:t,hideDocumentSelectionStep:r})=>{const[n,o]=x.useState("landing"),[s,i]=x.useState(""),[a,u]=x.useState(""),[l,f]=x.useState(null),[h,y]=x.useState(null),[d,b]=x.useState(null),m=Nd({mutationFn:Hd}),{toast:g}=Fr(),C=x.useMemo(()=>[...t?[]:["name"],...r?[]:["document-selection"],"selfie","selfie-confirm","pre-selfie","id-front","id-front-confirm","id-back","id-back-confirm","verify"],[t,r]),E=()=>t?r?"id-front":"document-selection":"name",T=()=>{(t||!!s)&&l&&h&&d&&(m.mutate({endpoint:e,data:{fullName:s,selfiePhoto:l,idCardFront:h,idCardBack:d}}),g({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),f(null),y(null),b(null),o("landing"))},w=()=>c.jsx(c.Fragment,{children:n!=="landing"&&c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"flex space-x-2",children:C.map((S,N)=>c.jsx("div",{className:`w-3 h-3 rounded-full ${C.indexOf(n)>=N?"bg-primary":"bg-muted"}`},S))})})}),P=()=>{switch(n){case"landing":return c.jsx(Md,{onContinue:()=>o(E())});case"name":return c.jsx(Ld,{fullName:s,onNameChange:i,onContinue:()=>o(r?"id-front":"document-selection"),renderProgress:w});case"document-selection":return c.jsx(Fd,{selectedDocumentType:a,onDocumentTypeChange:u,onContinue:()=>o("id-front"),onBack:()=>o(t?"landing":"name"),renderProgress:w});case"id-front":return c.jsx(wn,{acceptedFile:h,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"id-back":return c.jsx(wn,{acceptedFile:d,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"pre-selfie":return c.jsx($d,{onContinue:()=>o("selfie"),onBack:()=>o("name")});case"selfie":return c.jsx(wn,{acceptedFile:l,currentStep:n,setCurrentStep:o,setSelfiePhoto:f,setIdCardFront:y,setIdCardBack:b});case"selfie-confirm":return l?c.jsx(xn,{photo:l,onRetake:()=>{f(null),o("selfie")},onConfirm:()=>o("verify"),onBack:()=>o("selfie"),renderProgress:w}):null;case"id-front-confirm":return h?c.jsx(xn,{photo:h,onRetake:()=>{y(null),o("id-front")},onConfirm:()=>o("id-back"),onBack:()=>o("id-front"),renderProgress:w}):null;case"id-back-confirm":return d?c.jsx(xn,{photo:d,onRetake:()=>{b(null),o("id-back")},onConfirm:()=>o("pre-selfie"),onBack:()=>o("id-back"),renderProgress:w}):null;case"verify":return c.jsx(jd,{fullName:s,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return c.jsx(zd,{onComplete:T});default:return null}};return c.jsx("div",{className:"w-[430px]",children:P()})};async function Hd({endpoint:e,data:t}){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error("Network response was not ok");return r.json()}const Vd=new Ed;return()=>c.jsx(Sd,{client:Vd,children:c.jsxs(Jc,{children:[c.jsx(Fa,{}),c.jsx(hl,{}),c.jsx(Bd,{})]})})});
|