@coristen/widget 0.1.6 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -6
- package/dist/api.d.ts +13 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/website-chat.d.ts +4 -2
- package/dist/widget-composer.d.ts +5 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var Ih=Object.create;var{getPrototypeOf:bh,defineProperty:hl,getOwnPropertyNames:Ch}=Object;var Um=Object.prototype.hasOwnProperty;function Sh(e){return this[e]}var wh,xh,_m=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?wh??=new WeakMap:xh??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?Ih(bh(e)):{};let s=t||!e||!e.__esModule||!Um.call(e,"default")?hl(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of Ch(e))if(!Um.call(s,i))hl(s,i,{get:Sh.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var yh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Rh=(e)=>e;function vh(e,t){this[e]=Rh.bind(null,t)}var fs=(e,t)=>{for(var o in t)hl(e,o,{get:t[o],enumerable:!0,configurable:!0,set:vh.bind(t,o)})};import*as qo from"react";var Fi=yh(function(N2){function E2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var P2=typeof Object.is==="function"?Object.is:E2,A2=qo.useState,M2=qo.useEffect,k2=qo.useLayoutEffect,L2=qo.useDebugValue;function D2(e,t){var o=t(),r=A2({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return k2(function(){n.value=o,n.getSnapshot=t,gu(n)&&a({inst:n})},[e,o,t]),M2(function(){return gu(n)&&a({inst:n}),e(function(){gu(n)&&a({inst:n})})},[e]),L2(o),o}function gu(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!P2(e,o)}catch(r){return!0}}function F2(e,t){return t()}var O2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?F2:D2;N2.useSyncExternalStore=qo.useSyncExternalStore!==void 0?qo.useSyncExternalStore:O2});var dr={};fs(dr,{android:()=>Qf,apple:()=>Bl,ios:()=>Nl,linux:()=>$I,mac:()=>ep,windows:()=>jI});var gr={};fs(gr,{blink:()=>KI,gecko:()=>YI,webkit:()=>Hl});var Vl={};fs(Vl,{voiceOver:()=>JI});var Sa={};fs(Sa,{jsdom:()=>QI});import{Component as tw,useCallback as ow,useEffect as Sn,useMemo as rw,useRef as rs,useState as lr}from"react";import{ConvexProvider as nw,ConvexReactClient as aw}from"convex/react";import{useEffect as os,useRef as PS,useState as zr}from"react";import{useMutation as Yn,useQuery as Nc}from"convex/react";import{jsx as Oh}from"react/jsx-runtime";var Uo=34,Qr=200,Th=6,Eh=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function Ph(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return Math.abs(t)}function Gm(e,t){let o=[];for(let r=0;r<t;r++)o.push(Ph(e+":"+r));return o}function Wm(e,t,o){t/=100,o/=100;let r=(i)=>(i+e/30)%12,n=t*Math.min(o,1-o),a=(i)=>o-n*Math.max(-1,Math.min(r(i)-3,Math.min(9-r(i),1))),s=(i)=>Math.round(i*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}function Ah(e){let[t]=Gm(e,1),o=t%360;return{fill:Wm(o,85,30),stroke:Wm(o,90,65)}}function Mh(e){let[t,o]=Gm(e,2),r=t%360*(Math.PI/180),n=o%100/100*0.4-0.2,a=Math.cos(r),s=Math.sin(r),i=[];for(let c=0;c<Uo;c++){let u=[];for(let l=0;l<Uo;l++){let m=l/(Uo-1)*2-1,f=c/(Uo-1)*2-1,p=(m*a+f*s+1+n)/2;u.push(Math.max(0,Math.min(1,p)))}i.push(u)}return i}function kh(e){let t=[];for(let o=0;o<Uo;o++){let r=[];for(let n=0;n<Uo;n++){let a=Eh[o%4][n%4]/16;r.push(e[o][n]>=a?1:0)}t.push(r)}return t}function Lh(e){let t=[];for(let o=0;o<Uo;o++){let r=e[o],n=[],a=0;while(a<Uo)if(r[a]===1){let c=a;while(a<Uo&&r[a]===1)a++;n.push({start:c,len:a-c})}else a++;if(n.length===0)continue;let s=`M${n[0].start} ${o}`,i=n[0].start;s+=`h${n[0].len}`,i+=n[0].len;for(let c=1;c<n.length;c++){let u=n[c].start-i;s+=`m${u} 0h${n[c].len}`,i=n[c].start+n[c].len}t.push(s)}return t.join("")}function Dh(e){let{fill:t,stroke:o}=Ah(e),r=Mh(e),n=kh(r),a=Lh(n),i=Qr/Uo*(Th/6),c=Uo/2,u=`translate(${Qr/2},${Qr/2})scale(${i})translate(-${c},-${c})`;return[`<svg width="${Qr}" height="${Qr}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,`<rect width="${Qr}" height="${Qr}" fill="${t}"/>`,`<path fill="none" stroke="${o}" transform="${u}" d="${a}"/>`,"</svg>"].join("")}function Fh(e){let t=Dh(e);return`data:image/svg+xml,${encodeURIComponent(t)}`}function vn({seed:e,size:t=40,className:o,style:r}){let n=Fh(e);return Oh("img",{src:n,alt:"",width:t,height:t,className:o,style:{borderRadius:"50%",...r}})}import*as ps from"react";import*as en from"react";import{createContext as Nh}from"react";var zm=Nh({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Oe=en.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:f="regular",mirrored:g=!1,...p}=en.useContext(zm);return en.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||g?"scale(-1, 1)":void 0,...p,...u},!!o&&en.createElement("title",null,o),i,c.get(a!=null?a:f))});Oe.displayName="IconBase";import*as ft from"react";var Zm=new Map([["bold",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),ft.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",ft.createElement(ft.Fragment,null,ft.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var ds=ps.forwardRef((e,t)=>ps.createElement(Oe,{ref:t,...e,weights:Zm}));ds.displayName="ArrowUpIcon";import*as gs from"react";import*as pt from"react";var qm=new Map([["bold",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M216.49,56.48,177,96h19a12,12,0,0,1,0,24H148a12,12,0,0,1-12-12V60a12,12,0,0,1,24,0V79l39.51-39.52a12,12,0,0,1,17,17ZM108,136H60a12,12,0,0,0,0,24H79L39.51,199.51a12,12,0,0,0,17,17L96,177v19a12,12,0,0,0,24,0V148A12,12,0,0,0,108,136Z"}))],["duotone",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),pt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["fill",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M120,144v48a8,8,0,0,1-13.66,5.66L88,179.31,53.66,213.66a8,8,0,0,1-11.32-11.32L76.69,168,58.34,149.66A8,8,0,0,1,64,136h48A8,8,0,0,1,120,144ZM213.66,42.34a8,8,0,0,0-11.32,0L168,76.69,149.66,58.34A8,8,0,0,0,136,64v48a8,8,0,0,0,8,8h48a8,8,0,0,0,5.66-13.66L179.31,88l34.35-34.34A8,8,0,0,0,213.66,42.34Z"}))],["light",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M212.24,52.24,158.48,106H192a6,6,0,0,1,0,12H144a6,6,0,0,1-6-6V64a6,6,0,0,1,12,0V97.52l53.76-53.76a6,6,0,0,1,8.48,8.48ZM112,138H64a6,6,0,0,0,0,12H97.52L43.76,203.76a6,6,0,1,0,8.48,8.48L106,158.48V192a6,6,0,0,0,12,0V144A6,6,0,0,0,112,138Z"}))],["regular",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["thin",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M210.83,50.83,153.66,108H192a4,4,0,0,1,0,8H144a4,4,0,0,1-4-4V64a4,4,0,0,1,8,0v38.34l57.17-57.17a4,4,0,1,1,5.66,5.66ZM112,140H64a4,4,0,0,0,0,8h38.34L45.17,205.17a4,4,0,0,0,5.66,5.66L108,153.66V192a4,4,0,0,0,8,0V144A4,4,0,0,0,112,140Z"}))]]);var hs=gs.forwardRef((e,t)=>gs.createElement(Oe,{ref:t,...e,weights:qm}));hs.displayName="ArrowsInSimpleIcon";import*as Is from"react";import*as dt from"react";var Xm=new Map([["bold",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),dt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]);var bs=Is.forwardRef((e,t)=>Is.createElement(Oe,{ref:t,...e,weights:Xm}));bs.displayName="ArrowsOutSimpleIcon";import*as Cs from"react";import*as gt from"react";var jm=new Map([["bold",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),gt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var Ss=Cs.forwardRef((e,t)=>Cs.createElement(Oe,{ref:t,...e,weights:jm}));Ss.displayName="BinocularsIcon";import*as ws from"react";import*as ht from"react";var $m=new Map([["bold",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),ht.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var xs=ws.forwardRef((e,t)=>ws.createElement(Oe,{ref:t,...e,weights:$m}));xs.displayName="CaretLeftIcon";import*as ys from"react";import*as It from"react";var Ym=new Map([["bold",It.createElement(It.Fragment,null,It.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",It.createElement(It.Fragment,null,It.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),It.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",It.createElement(It.Fragment,null,It.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",It.createElement(It.Fragment,null,It.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",It.createElement(It.Fragment,null,It.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",It.createElement(It.Fragment,null,It.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var Rs=ys.forwardRef((e,t)=>ys.createElement(Oe,{ref:t,...e,weights:Ym}));Rs.displayName="CaretRightIcon";import*as vs from"react";import*as bt from"react";var Km=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),bt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var Ts=vs.forwardRef((e,t)=>vs.createElement(Oe,{ref:t,...e,weights:Km}));Ts.displayName="ClockCounterClockwiseIcon";import*as Es from"react";import*as Ct from"react";var Jm=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),Ct.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var tn=Es.forwardRef((e,t)=>Es.createElement(Oe,{ref:t,...e,weights:Jm}));tn.displayName="FileTextIcon";import*as Ps from"react";import*as St from"react";var Qm=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),St.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var As=Ps.forwardRef((e,t)=>Ps.createElement(Oe,{ref:t,...e,weights:Qm}));As.displayName="GlobeIcon";import*as Ms from"react";import*as wt from"react";var ef=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),wt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var ks=Ms.forwardRef((e,t)=>Ms.createElement(Oe,{ref:t,...e,weights:ef}));ks.displayName="ImageIcon";import*as Ls from"react";import*as xt from"react";var tf=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),xt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var Ds=Ls.forwardRef((e,t)=>Ls.createElement(Oe,{ref:t,...e,weights:tf}));Ds.displayName="PaperclipIcon";import*as Fs from"react";import*as yt from"react";var of=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),yt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var Tn=Fs.forwardRef((e,t)=>Fs.createElement(Oe,{ref:t,...e,weights:of}));Tn.displayName="PlusIcon";import*as Os from"react";import*as Rt from"react";var rf=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Rt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Po=Os.forwardRef((e,t)=>Os.createElement(Oe,{ref:t,...e,weights:rf}));Po.displayName="XIcon";import{makeFunctionReference as er}from"convex/server";var _o={workspace:er("conversations:workspace"),visitorProfile:er("conversations:visitorProfile"),openWebsite:er("conversations:openWebsite"),visitorConversations:er("conversations:visitorConversations"),customerMessages:er("conversations:customerMessages"),startCustomer:er("conversations:startCustomer"),sendCustomer:er("conversations:sendCustomer"),retryAgentResponse:er("conversations:retryAgentResponse"),generateAttachmentUploadUrl:er("conversations:generateAttachmentUploadUrl"),markCustomerRead:er("conversations:markCustomerRead")};import{useEffect as RC,useRef as vC,useState as qn}from"react";function oa(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var nf={};function _t(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Ns(t);let a=Ns(e);if(t)a=ra(a,t);if(o)a=ra(a,o);if(r)a=ra(a,r);if(n)a=ra(a,n);return a}function af(e){if(e.length===0)return nf;if(e.length===1)return Ns(e[0]);let t=Ns(e[0]);for(let o=1;o<e.length;o+=1)t=ra(t,e[o]);return t}function Ns(e){if(cf(e))return{...e(nf)};return Bh(e)}function ra(e,t){if(cf(t))return t(e);return Hh(e,t)}function Bh(e){let t={...e};for(let o in t){let r=t[o];if(sf(o,r))t[o]=lf(r)}return t}function Hh(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=oa(e.style,r);break}case"className":{e[o]=Il(e.className,r);break}default:if(sf(o,r))e[o]=Vh(e[o],r);else e[o]=r}}return e}function sf(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function cf(e){return typeof e==="function"}function Vh(e,t){if(!t)return e;if(!e)return lf(t);return(...o)=>{let r=o[0];if(uf(r)){let a=r;na(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function lf(e){if(!e)return e;return(...t)=>{let o=t[0];if(uf(o))na(o);return e(...t)}}function na(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Il(e,t){if(t){if(e)return t+" "+e;return t}return e}function uf(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as Ar from"react";import*as ff from"react";var mf={};function qe(e,t){let o=ff.useRef(mf);if(o.current===mf)o.current=e(t);return o}function Ao(e,t,o,r){let n=qe(df).current;if(Uh(n,e,t,o,r))gf(n,[e,t,o,r]);return n.callback}function pf(e){let t=qe(df).current;if(_h(t,e))gf(t,e);return t.callback}function df(){return{callback:null,cleanup:null,refs:[]}}function Uh(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function _h(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function gf(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as If from"react";import*as hf from"react";var Wh=parseInt(hf.version,10);function En(e){return Wh>=e}function bl(e){if(!If.isValidElement(e))return null;let t=e,o=t.props;return(En(19)?o?.ref:t.ref)??null}function Ye(){}var pr=Object.freeze([]),_e=Object.freeze({});function bf(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function Cf(e,t){return typeof e==="function"?e(t):e}function Sf(e,t){return typeof e==="function"?e(t):e}import{createElement as wf}from"react";function ke(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=aa(r);let n=Gh(t,o,r);if(o.enabled===!1)return null;let a=o.state??_e;return qh(e,r,n,a)}function Gh(e,t,o){let{className:r,style:n}=e,{state:a=_e,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Cf(r,a):void 0,m=u?Sf(n,a):void 0,f=u?bf(a,c):_e,g=u&&i?zh(i):void 0,p=u?oa(f,g)??{}:_e;if(typeof document<"u")if(!u)Ao(null,null);else if(Array.isArray(s))p.ref=pf([p.ref,bl(o),...s]);else p.ref=Ao(p.ref,bl(o),s);if(!u)return _e;if(l!==void 0)p.className=Il(p.className,l);if(m!==void 0)p.style=oa(p.style,m);return p}function zh(e){if(Array.isArray(e))return af(e);return _t(void 0,e)}var Zh=Symbol.for("react.lazy");function aa(e){if(e?.$$typeof!==Zh)return e;let t=Ar.Children.toArray(e)[0];return Ar.isValidElement(t)?t:e}function qh(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=_t(o,t.props);return n.ref=o.ref,Ar.cloneElement(t,n)}return Xh(e,o)}function Xh(e,t){if(e==="button")return wf("button",{type:"button",...t,key:t.key});if(e==="img")return wf("img",{alt:"",...t,key:t.key});return Ar.createElement(e,t)}function Pn(e){return ke(e.defaultTagName??"div",e,e)}function xf(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=xf(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function yf(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=xf(e))&&(r&&(r+=" "),r+=t);return r}var Rf=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,vf=yf,Xt=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return vf(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let f=Rf(l)||Rf(m);return n[u][f]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,f]=l;if(f===void 0)return u;return u[m]=f,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:f,...g}=l;return Object.entries(g).every((p)=>{let[w,I]=p;return Array.isArray(I)?I.includes({...a,...i}[w]):{...a,...i}[w]===I})?[...u,m,f]:u},[]);return vf(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var tr=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Bs=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},Mr=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var jh=[],on=Bs(tr("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),$h=Bs(tr(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var Yh=(()=>{let e=on.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=on[n];i<on[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(on[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=on[n];s<on[n+1];s++)o[r++]=a,a+=t[a]}return o})(),Kh=tr("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),Jh=Bs(tr("123333359346463635126536711576")),Qh=tr("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),eI=tr("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),tI=Mr("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),oI=(()=>{let e=new Int32Array(319).fill(-1),t=Mr("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Mr("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),rI="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),Tf=Mr("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),nI=Mr("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),aI=Mr("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),Ef=new Int32Array(995),Pf=new Int32Array(995),Af=new Int32Array(995),Cl="",Sl=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<Tf.length;r++)for(let n of rI[aI[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),Sl[a*2]=Cl.length,Sl[a*2+1]=n.length,Cl+=n;Ef[o]=Tf[r],Pf[o]=nI[r],Af[o]=a,o++}}var sI=Mr("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),iI=Bs(tr("1::24444432:442:44:44>222222:44:4421322511111311111114")),cI=Mr("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),lI=tr("ij"),uI=tr(""),mI=tr("1"),fI="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Mf={GROUP_COUNT:384,customValidatorNames:jh,edgeStart:on,labelStart:$h,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:Yh,nodeGroup:Kh,nodeVlist:oI,vlistPat:Jh,vlistOps:Qh,vlistRef:eI,vlistGroup:tI,litAnchor:Ef,litGroup:Pf,litPool:Af,poolOffsets:Sl,poolText:Cl,adjGid:sI,adjStart:iI,adjTgt:cI,patGid:lI,patTgt:uI,postfixLookupGroups:mI,orderSensitiveModifiers:fI};var pI="line"in Error();var wl=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},Hs=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},kf=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:f,vlistGroup:g,litAnchor:p,litGroup:w,litPool:I,poolOffsets:d,poolText:C,adjGid:b,adjStart:h,adjTgt:S,patGid:y,patTgt:x,postfixLookupGroups:v,customValidatorNames:T,orderSensitiveModifiers:M}=e,B=new Int32Array(r).fill(-1);for(let D=0;D<b.length;D++)B[b[D]]=D;let E=0;for(let D=0;D+1<h.length;D++){let Z=h[D+1]-h[D];if(Z>E)E=Z}let F=32;while(F<2*(1+E+y.length))F<<=1;let A=new Int32Array(f.length+1);for(let D=0;D<f.length;D++)A[D+1]=A[D]+l[f[D]+1]-l[f[D]];let R=new Uint8Array(r);for(let D=0;D<v.length;D++)R[v[D]]=1;let O=n.length-1,X=new Uint8Array(O),P=0,N=!0;for(let D=0;D<p.length;D++){X[p[D]]=1;let Z=d[I[D]*2+1];if(Z>P)P=Z;let te=C.charCodeAt(d[I[D]*2]);if(te===91||te===40)N=!1}let W=1;while(W<p.length*2)W<<=1;let J=new Int32Array(W).fill(-1);for(let D=0;D<p.length;D++){let Z=d[I[D]*2],te=(wl(C,Z,Z+d[I[D]*2+1])^Math.imul(p[D],2654435761)|0)&W-1;while(J[te]!==-1)te=te+1&W-1;J[te]=D}let k=(D,Z,te,xe)=>{let Be=(wl(Z,te,xe)^Math.imul(D,2654435761)|0)&W-1,Le=xe-te;for(;;){let Xe=J[Be];if(Xe===-1)return-1;if(p[Xe]===D&&d[I[Xe]*2+1]===Le){let mt=d[I[Xe]*2],Ke=!0;for(let Pe=0;Pe<Le;Pe++)if(C.charCodeAt(mt+Pe)!==Z.charCodeAt(te+Pe)){Ke=!1;break}if(Ke)return w[Xe]}Be=Be+1&W-1}},ne=o.cacheSize??8192,H=o.prefix??e.prefix??"",Y=H===""?"":H+":",z=Y.length,ae=(T??[]).map((D)=>{let Z=t&&t[D];if(!Z)throw Error("cn: missing validator "+D);return Z}),we=/\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$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=0,U=-1,G=-1,ie=-1,pe=-1,Ee=(D)=>D>=97&&D<=122||D>=65&&D<=90||D>=48&&D<=57||D===95,Fe=(D)=>/\s/.test(String.fromCharCode(D)),le=(D,Z,te)=>{if(K=0,U=-1,te-Z<3)return;let xe=D.charCodeAt(Z),Be=D.charCodeAt(te-1);if(xe===91&&Be===93)K=1;else if(xe===40&&Be===41)K=2;else return;ie=Z+1,pe=te-1;let Le=Z+1;if(Ee(D.charCodeAt(Le))){Le++;while(Le<te-1){let Xe=D.charCodeAt(Le);if(!Ee(Xe)&&Xe!==45)break;Le++}if(Le<te-2&&D.charCodeAt(Le)===58)U=Z+1,G=Le,ie=Le+1}},Ie=(D,Z,te,xe)=>{if(te-Z!==xe.length)return!1;for(let Be=0;Be<xe.length;Be++)if(D.charCodeAt(Z+Be)!==xe.charCodeAt(Be))return!1;return!0},se=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ue=(D)=>!!D&&!Number.isNaN(Number(D)),Se=(D,Z,te)=>{if(te-Z<11||!Ie(D,Z,Z+10,"@container"))return!1;if(D.charCodeAt(Z+10)===47)return te-Z>=12;let xe=D.charCodeAt(Z+11);return xe===115&&te-Z>=17&&Ie(D,Z+10,Z+16,"-size/")||xe===110&&te-Z>=19&&Ie(D,Z+10,Z+18,"-normal/")},L=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],V="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((D)=>D.split(" ")),be=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],j=(D,Z,te,xe)=>{if(D>=10){if(D>=25)return ae[D-25](Z.slice(te,xe));let Be=D-10;if(K!==L[Be])return!1;if(U>=0){for(let Le of V[Be])if(Ie(Z,U,G,Le))return!0;return!1}switch(be[Be]){case 0:return!1;case 1:return!0;case 2:{let Le=Z.slice(ie,pe);return we.test(Le)&&!ee.test(Le)}case 3:return ue(Z.slice(ie,pe));case 4:return _.test(Z.slice(ie,pe));default:return ce.test(Z.slice(ie,pe))}}switch(D){case 0:return!0;case 1:return K===0;case 2:return K===1;case 3:return K===2;case 4:return se.test(Z.slice(te,xe));case 5:return ue(Z.slice(te,xe));case 6:{let Be=Z.slice(te,xe);return!!Be&&Number.isInteger(Number(Be))}case 7:return xe>te&&Z.charCodeAt(xe-1)===37&&ue(Z.slice(te,xe-1));case 8:return Ne.test(Z.slice(te,xe));default:return Se(Z,te,xe)}},oe=new Set(typeof M==="string"?M.split(" "):M),de=(D,Z,te,xe,Be,Le)=>{let Xe=wl(Z,te,xe)^(Be?2654435769:0)|0,mt=D.get(Xe);if(mt!==void 0)e:for(let Ue=0;Ue<mt.length;Ue++){let $e=mt[Ue];if($e.imp!==Be||$e.k.length!==xe-te)continue;for(let Ut=0;Ut<$e.k.length;Ut++)if($e.k.charCodeAt(Ut)!==Z.charCodeAt(te+Ut))continue e;return $e.id}else D.set(Xe,mt=[]);let Ke=Z.slice(te,xe),Pe=Le(Ke);return mt.push({k:Ke,imp:Be,id:Pe}),Pe},ge=new Map,he=new Map,Ae=2,je=4096,ct=(D,Z)=>{let te=[],xe=0,Be=0,Le=0;for(let Pe=0;Pe<D.length;Pe++){let Ue=D.charCodeAt(Pe);if(xe===0&&Be===0&&Ue===58)te.push(D.slice(Le,Pe)),Le=Pe+1;else if(Ue===91)xe++;else if(Ue===93)xe--;else if(Ue===40)Be++;else if(Ue===41)Be--}te.push(D.slice(Le));let Xe=te[0];if(te.length>1){let Pe=[],Ue=[];for(let $e of te)if($e.charCodeAt(0)===91||oe.has($e)){if(Ue.length)Pe.push(...Ue.sort()),Ue=[];Pe.push($e)}else Ue.push($e);if(Ue.length)Pe.push(...Ue.sort());Xe=Pe.join(":")}let mt=Z?Xe+" !":Xe,Ke=he.get(mt);if(Ke===void 0)he.set(mt,Ke=Ae++);return Ke},so=new Map,io=r,No=r+4096,qt=()=>io++,Wt=2097152,po=8192,Io=new Int32Array(po),Jt=Array(po).fill(null),Xr=new Int32Array(po),jr=new Int32Array(po),We=new Uint8Array(po),Nt=0,Ce=(D,Z,te,xe,Be,Le,Xe,mt)=>{let Ke=D;if(Jt[D]!==null)if(Jt[D|1]===null)Ke=D|1;else if((Nt++&3)===0)Ke=D|Nt>>2&1;else return;Jt[Ke]=Z.slice(te,xe),Io[Ke]=Be,Xr[Ke]=Le,jr[Ke]=Xe,We[Ke]=mt},ve=()=>Jt.fill(null),Ve=256,Bt=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Gt,co,Vt,bo]=Bt,Bo=new Uint8Array(Ve),Ro=new Uint8Array(Ve),wn=()=>{Ve*=2,Bt=Bt.map((Z)=>{let te=new Int32Array(Ve);return te.set(Z),te}),[Gt,co,Vt,bo]=Bt;let D=new Uint8Array(Ve);D.set(Bo),Bo=D,Ro=new Uint8Array(Ve)},Yo=64,$r=new Int32Array(Yo),Yr=new Int32Array(Yo),tl=new Int32Array(r),Rr=2048,Fm=21,ol=new Float64Array(Rr),ns=new Int32Array(Rr),vr=0,rl=(D,Z)=>{if(D===0&&Z<r){if(tl[Z]===vr)return 1;return tl[Z]=vr,0}let te=D*2097152+Z+1,xe=Math.imul(te,2654435761)>>>Fm;for(;;){if(ns[xe]!==vr)break;if(ol[xe]===te)return 1;xe=xe+1&Rr-1}return ol[xe]=te,ns[xe]=vr,0},as=(D,Z,te,xe,Be)=>{if(te-Z>=2&&D.charCodeAt(Z)===91&&D.charCodeAt(te-1)===93){let Le=-1;for(let Xe=Z+1;Xe<te-1;Xe++)if(D.charCodeAt(Xe)===58){Le=Xe;break}if(Le===-1||Le===Z+1)return-1;return de(so,D,Z+1,Le,0,qt)}if(xe>=0&&c[xe]>=0)return c[xe];for(let Le=Be-1;Le>=0;Le--){let Xe=Yr[Le];if(Xe>te)continue;let mt=$r[Le],Ke=te-Xe;if(X[mt]===1&&Ke>0&&Ke<=P){let zt=D.charCodeAt(Xe);if(N===!1||zt!==91&&zt!==40){let Er=k(mt,D,Xe,te);if(Er>=0)return Er}}let Pe=u[mt];if(Pe<0)continue;let Ue=f[Pe],$e=l[Ue],Ut=l[Ue+1];if($e===Ut)continue;le(D,Xe,te);let Qt=A[Pe]-$e;for(let zt=$e;zt<Ut;zt++)if(j(m[zt],D,Xe,te))return g[Qt+zt]}return-1},ss=(D)=>{let Z=D.length,te=0,xe=0,Be=!1;if(Ae>je||ge.size>je)ge=new Map,he=new Map,Ae=2,ve();if(io>No)so=new Map,io=r,ve();let Le=0;while(Le<Z){let Pe=D.charCodeAt(Le);if(Pe===32||Pe>=9&&Pe<=13||Pe>=160&&Fe(Pe)){if(Pe!==32)Be=!0;Le++;continue}let Ue=Le,$e=0;while(Le<Z){if(Pe=D.charCodeAt(Le),Pe<=32){if(Pe===32)break;if(Pe>=9&&Pe<=13){Be=!0;break}}else if(Pe>=160&&Fe(Pe)){Be=!0;break}$e=Math.imul($e^Pe,16777619),Le++}let Ut=Le,Qt=Ut-Ue;if(te===Ve)wn();let zt=te++;Gt[zt]=Ue,co[zt]=Ut,xe+=Qt,$e^=Math.imul(Qt,2654435761);let Er=$e^$e>>>15|0,Ko=Er&8190;{let ot=-1;if(Io[Ko]===Er&&Jt[Ko]!==null&&Jt[Ko].length===Qt)ot=Ko;else if(Io[Ko|1]===Er&&Jt[Ko|1]!==null&&Jt[Ko|1].length===Qt)ot=Ko|1;if(ot>=0){let Vo=Jt[ot],mr=!0;for(let fr=0;fr<Qt;fr++)if(Vo.charCodeAt(fr)!==D.charCodeAt(Ue+fr)){mr=!1;break}if(mr){Vt[zt]=Xr[ot],bo[zt]=jr[ot],Bo[zt]=We[ot];continue}}}let yn=Ue;if(z!==0){if(Ut-Ue<=z||!D.startsWith(Y,Ue)){Vt[zt]=-1,Ce(Ko,D,Ue,Ut,Er,-1,0,0);continue}yn=Ue+z}let al=0,sl=0,ea=-1,il=-1;for(let ot=yn;ot<Ut;ot++){let Vo=D.charCodeAt(ot);if(al===0&&sl===0){if(Vo===58){ea=ot;continue}if(Vo===47){il=ot;continue}}if(Vo===91)al++;else if(Vo===93)al--;else if(Vo===40)sl++;else if(Vo===41)sl--}let Bm=ea>=yn?ea+1:yn,vo=Bm,To=Ut,ta=!1,Hm=0;if(To>vo&&D.charCodeAt(To-1)===33)ta=!0,To--;else if(To>vo&&D.charCodeAt(vo)===33)ta=!0,vo++,Hm=1;let Kr=-1;if(il>Bm){if(Kr=il+Hm,Kr>=To)Kr=-1}let cl=vo;if(To-vo>1&&D.charCodeAt(vo)===45)cl=vo+1;let Jo=0,Pr=0,Rn=0,Vm=-1,Qo=0;if(u[0]>=0||X[0]===1)$r[0]=0,Yr[0]=cl,Qo=1;let ll=-1,ul=0;for(let ot=cl;ot<To;ot++){if(ot===Kr)ll=Pr<Rn?-1:Jo,ul=Qo;if(Jo!==-1){let Vo=D.charCodeAt(ot),mr=-1;if(Pr<Rn)if(s.charCodeAt(Pr)===Vo){if(Pr++,Pr===Rn)mr=Jo=Vm}else Jo=-1;else{let fr=n[Jo],ms=n[Jo+1],dl=-1;for(let Jr=fr;Jr<ms;Jr++){let gl=a[Jr];if(s.charCodeAt(gl)===Vo){if(a[Jr+1]-gl===1)mr=dl=i[Jr];else Pr=gl+1,Rn=a[Jr+1],Vm=i[Jr],dl=Jo;break}}Jo=dl}if(mr>=0&&(u[mr]>=0||X[mr]===1)&&ot+1<To&&D.charCodeAt(ot+1)===45){if(Qo===Yo){Yo*=2;let fr=new Int32Array(Yo);fr.set($r),$r=fr;let ms=new Int32Array(Yo);ms.set(Yr),Yr=ms}$r[Qo]=mr,Yr[Qo]=ot+2,Qo++}}}if(Kr===To)ll=Pr<Rn?-1:Jo,ul=Qo;let ml=Pr<Rn?-1:Jo,Eo,us=!1;if(Kr>=0){if(us=!0,Eo=as(D,vo,Kr,ll,ul),Eo!==-1&&Eo<r&&R[Eo]){let ot=as(D,vo,To,ml,Qo);if(ot!==-1&&ot!==Eo)Eo=ot,us=!1}else if(Eo===-1)Eo=as(D,vo,To,ml,Qo),us=!1}else Eo=as(D,vo,To,ml,Qo);let fl=0,pl=0;if(Eo===-1)Vt[zt]=-1;else pl=us?1:0,fl=yn>=ea?ta?1:0:de(ge,D,yn,ea,ta?1:0,(ot)=>ct(ot,ta)),Vt[zt]=Eo,Bo[zt]=pl,bo[zt]=fl;Ce(Ko,D,Ue,Ut,Er,Eo,fl,pl)}if(te===0)return"";if(te===1)return Gt[0]===0&&co[0]===Z?D:D.slice(Gt[0],co[0]);if(te*F>Rr){while(te*F>Rr)Rr<<=1,Fm--;ol=new Float64Array(Rr),ns=new Int32Array(Rr)}if(Ae>=Wt||io>=Wt)throw Error("cn: too many distinct classes in one merge");if(vr=vr+1|0,vr===0)tl.fill(0),ns.fill(0),vr=1;let Xe=!1;for(let Pe=te-1;Pe>=0;Pe--){let Ue=Vt[Pe];if(Ue===-1){Ro[Pe]=1;continue}let $e=bo[Pe];if(rl($e,Ue)===1){Ro[Pe]=0,Xe=!0;continue}if(Ro[Pe]=1,Ue<r){let Ut=B[Ue];if(Ut>=0)for(let Qt=h[Ut];Qt<h[Ut+1];Qt++)rl($e,S[Qt]);if(Bo[Pe]&1){for(let Qt=0;Qt<y.length;Qt++)if(y[Qt]===Ue)rl($e,x[Qt])}}}if(!Xe&&!Be&&Z===xe+te-1)return D;let mt="",Ke=0;while(Ke<te){if(!Ro[Ke]){Ke++;continue}let Pe=Gt[Ke],Ue=co[Ke],$e=Ke+1;while($e<te&&Ro[$e]&&Gt[$e]===Ue+1&&D.charCodeAt(Ue)===32)Ue=co[$e],$e++;if(mt.length>0)mt+=" ";mt+=D.slice(Pe,Ue),Ke=$e}return mt},Tr=16384,ur=new Int32Array(Tr*2),is=0,Ho=1,Jn=Object.create(null),Om=Object.create(null),xn=new Map,Nm=new Map,cs=0,ls=0,Qn=()=>{is^=Tr,Ho=Ho+1|0,ls=0},dh=(D)=>{let Z=Jn[D];if(Z!==void 0)return Z;let te=Hs(D,0,D.length),xe=(te&16383)+is,Be=ur[xe]===(te^Ho)||ur[xe^Tr]===(te^Ho-1);if(Be){if(Z=Om[D],Z!==void 0)return Jn[D]=Z,Z}if(Z=ss(D),Be){if(Jn[D]=Z,++cs>ne)cs=0,Om=Jn,Jn=Object.create(null),Qn()}else if(ur[xe]=te^Ho,++ls>Tr)Qn();return Z},gh=(D)=>{let Z=xn.get(D);if(Z!==void 0)return Z;let te=Hs(D,0,D.length),xe=(te&16383)+is,Be=ur[xe]===(te^Ho)||ur[xe^Tr]===(te^Ho-1);if(Be){if(Z=Nm.get(D),Z!==void 0)return xn.set(D,Z),Z}if(Z=ss(D),Be){if(xn.set(D,Z),++cs>ne)cs=0,Nm=xn,xn=new Map,Qn()}else if(ur[xe]=te^Ho,++ls>Tr)Qn();return Z},hh=(D)=>{let Z=Hs(D,0,D.length),te=(Z&16383)+is;if(ur[te]===(Z^Ho)||ur[te^Tr]===(Z^Ho-1))return!0;if(ur[te]=Z^Ho,++ls>Tr)Qn();return!1},nl=ne===0?ss:pI?(D)=>{let Z=xn.get(D);return Z!==void 0?Z:gh(D)}:dh;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?nl(arguments[0]):nl(Lf.apply(null,arguments))},mergeString:nl,seenBefore:ne===0?()=>!1:hh,mergeUncached:ss}},Vs=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Vs(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},dI=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Vs(n,t);if(a){if(o)o+=" ";o+=a}}return o},Lf=function(){return dI(arguments,!1)};var Df=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,f=(d,C,b)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let h=Hs(d,0,d.length)&4094;if(c[h]===d&&u[h]===C)return l[h];if(c[h|1]===d&&u[h|1]===C)return l[h|1];let S=e(b?C+" "+d:d),y=c[h]===""?h:h|(c[h|1]===""?1:m++&1);return c[y]=d,u[y]=C,l[y]=S,S},g=(d,C,b,h)=>{let S=0;if(C){if(C!==d.a0)return!1;S=1}if(b){if(b!==(S===0?d.a0:d.a1))return!1;S++}if(h){if(h!==(S===0?d.a0:S===1?d.a1:d.a2))return!1;S++}return S===d.t},p=(d,C)=>{let b=d.a,h=0;for(let S=0;S<C.length;S++){let y=C[S];if(!y)continue;if(y!==b[h])return!1;h++}return h===d.t},w=(d,C)=>{let b=d.length,h=i===null?null:i.n;if(!C){if(h!==null&&p(h,d))return i=h,h.r;if(i!==null&&i!==h&&p(i,d))return i.r}let S="",y=-1,x=0,v=!1;for(let B=0;B<b;B++){let E=d[B];if(!E)continue;if(typeof E!=="string"){if(E=d[B]=Vs(E,!0),!E)continue;v=!0}if(y<0)S=E,y=B;x++}if(x===0)return"";if(x===1)return e(S);if(v){if(h!==null&&p(h,d))return i=h,h.r;if(i!==null&&i!==h&&p(i,d))return i.r}let T=n.get(S);if(T===void 0){if(T=a.get(S),T!==void 0)n.set(S,T)}let M=null;if(T!==void 0){if(T.skip>0){T.skip--,i=null;let E=S;for(let F=y+1;F<b;F++){let A=d[F];if(A)E+=" "+A}return f(E,"",!1)}let B=T.e;e:for(let E=0;E<B.length;E++){let F=B[E];if(F.t!==x)continue;let A=F.a,R=1;for(let O=y+1;O<b;O++){let X=d[O];if(X&&X!==A[R++])continue e}M=F;break}if(M!==null)T.miss=0}if(M===null){let B=S,E=[S];for(let A=y+1;A<b;A++){let R=d[A];if(!R)continue;B+=" "+R,E.push(R)}if(!o(B))return r(B);if(M={r:e(B),t:E.length,a0:E[0],a1:E[1],a2:E[2]??"",a:E,n:null},T===void 0)n.set(S,T={e:[],miss:0,skip:0,at:0});else if(++T.miss>16)T.miss=16,T.skip=1024,T.e.length=0,T.at=0;let F=T.e;if(F.length<256)F.push(M);else F[T.at]=M,T.at=T.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==M)i.n=M;return i=M,M.r},I=(d)=>Array.isArray(d)?w(d.slice(),!1):e(Vs(d,!0));return function(d,C,b){let h=arguments.length;if((h|1)===3){let x=i;if(x!==null){let v=x.n;if(v!==null&&g(v,d,C,b))return i=v,v.r;if(x!==v&&g(x,d,C,b))return x.r}if(h===2&&typeof C==="string"&&C!==""){let v=n.get(d);if(v!==void 0&&v.skip>0)return v.skip--,i=null,f(C,d,!0)}return w([d,C,b],!0)}if(h===1)return typeof d==="string"?e(d):I(d);let S=i;if(S!==null){let x=S.n;if(x!==null){let v=x.a,T=0,M=!0;for(let B=0;B<h;B++){let E=arguments[B];if(!E)continue;if(E!==v[T]){M=!1;break}T++}if(M&&T===x.t)return i=x,x.r}if(S!==x){let v=S.a,T=0,M=!0;for(let B=0;B<h;B++){let E=arguments[B];if(!E)continue;if(E!==v[T]){M=!1;break}T++}if(M&&T===S.t)return S.r}}let y=[];for(let x=0;x<h;x++)y.push(arguments[x]);return w(y,!0)}};var xl=kf(Mf),me=Df(xl.mergeString,xl),cHe=xl.merge;import*as Uf from"react";import*as kn from"react";function Us(){return typeof window<"u"}function vt(e){if(_s(e))return(e.nodeName||"").toLowerCase();return"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function or(e){var t;return(t=(_s(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _s(e){if(!Us())return!1;return e instanceof Node||e instanceof ze(e).Node}function He(e){if(!Us())return!1;return e instanceof Element||e instanceof ze(e).Element}function Ge(e){if(!Us())return!1;return e instanceof HTMLElement||e instanceof ze(e).HTMLElement}function Wo(e){if(!Us()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function nn(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=jt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Ff(e){return/^(table|td|th)$/.test(vt(e))}function sa(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var gI=/transform|translate|scale|rotate|perspective|filter/,hI=/paint|layout|strict|content/,rn=(e)=>!!e&&e!=="none",yl;function Ws(e){let t=He(e)?jt(e):e;return rn(t.transform)||rn(t.translate)||rn(t.scale)||rn(t.rotate)||rn(t.perspective)||!Gs()&&(rn(t.backdropFilter)||rn(t.filter))||gI.test(t.willChange||"")||hI.test(t.contain||"")}function Of(e){let t=Mo(e);while(Ge(t)&&!ko(t)){if(Ws(t))return t;else if(sa(t))return null;t=Mo(t)}return null}function Gs(){if(yl==null)yl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return yl}function ko(e){return/^(html|body|#document)$/.test(vt(e))}function jt(e){return ze(e).getComputedStyle(e)}function ia(e){if(He(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mo(e){if(vt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||or(e);return Wo(t)?t.host:t}function Nf(e){let t=Mo(e);if(ko(t))return(e.ownerDocument||e).body;if(Ge(t)&&nn(t))return t;return Nf(t)}function kr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=Nf(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=ze(n);if(a){let i=zs(s);return t.concat(s,s.visualViewport||[],nn(n)?n:[],i&&o?kr(i):[])}else return t.concat(n,kr(n,[],o))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as II from"react";var ca={...II};var Rl=ca.useInsertionEffect,bI=Rl&&Rl!==ca.useLayoutEffect?Rl:(e)=>e();function re(e){let t=qe(CI).current;return t.next=e,bI(t.effect),t.trampoline}function CI(){let e={next:void 0,callback:SI,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function SI(){}import*as Bf from"react";var wI=()=>{},q=typeof document<"u"?Bf.useLayoutEffect:wI;function xI(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var yI=xI("https://base-ui.com/production-error","Base UI"),Je=yI;import*as Zs from"react";var RI=Zs.createContext(void 0);function An(e=!1){let t=Zs.useContext(RI);if(t===void 0&&!e)throw Error(Je(16));return t}import*as Hf from"react";function Vf(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:Hf.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function ye(e){return e?.ownerDocument||document}function Mn(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(ze(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function lo(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=kn.useRef(null),i=An(!0),c=a??i!==void 0,{props:u}=Vf({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=kn.useCallback(()=>{let g=s.current;if(!vl(g))return;if(c&&t&&u.disabled===void 0&&g.disabled)g.disabled=!1},[t,u.disabled,c]);q(l,[l]);let m=kn.useCallback((g={})=>{let{onClick:p,onMouseDown:w,onKeyUp:I,onKeyDown:d,onPointerDown:C,...b}=g;return _t({onClick(h){if(t){h.preventDefault();return}p?.(h)},onMouseDown(h){if(!t)w?.(h)},onKeyDown(h){if(t)return;if(na(h),d?.(h),h.baseUIHandlerPrevented)return;let S=h.target===h.currentTarget,y=h.currentTarget,x=vl(y),v=!n&&vI(y),T=S&&(n?x:!v),M=h.key==="Enter",B=h.key===" ",E=y.getAttribute("role"),F=E?.startsWith("menuitem")||E==="option"||E==="gridcell";if(S&&c&&B){if(h.defaultPrevented&&F)return;if(h.preventDefault(),!n||x)h.preventBaseUIHandler(),Mn(y,h);return}if(!T||n||!B&&!M){if(S&&v&&B)h.preventDefault();return}if(h.defaultPrevented)return;if(h.preventDefault(),M)h.preventBaseUIHandler(),Mn(y,h)},onKeyUp(h){if(t)return;if(na(h),I?.(h),h.target===h.currentTarget&&n&&c&&vl(h.currentTarget)&&h.key===" "){h.preventDefault();return}if(h.baseUIHandlerPrevented)return;if(h.target===h.currentTarget&&!n&&!c&&!h.defaultPrevented&&h.key===" ")h.preventBaseUIHandler(),Mn(h.currentTarget,h)},onPointerDown(h){if(t){h.preventDefault();return}C?.(h)}},n?{type:"button"}:{role:"button"},u,b)},[t,u,c,n]),f=re((g)=>{s.current=g,l()});return{getButtonProps:m,buttonRef:f}}function vl(e){return Ge(e)&&e.tagName==="BUTTON"}function vI(e){return Ge(e)&&e.tagName==="A"&&Boolean(e.href)}var Tl=Uf.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=lo({disabled:a,focusableWhenDisabled:s,native:i});return ke("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as EI}from"react/jsx-runtime";var TI=Xt("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Tt({className:e,variant:t="default",size:o="default",...r}){return EI(Tl,{"data-slot":"button",className:me(TI({variant:t,size:o,className:e})),...r})}import{jsx as Lr}from"react/jsx-runtime";var PI=Xt("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function Ln({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return Lr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:me(PI({size:o,orientation:r}),e),...n})}var AI=Xt("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function la({className:e,variant:t="icon",...o}){return Lr("div",{"data-slot":"attachment-media","data-variant":t,className:me(AI({variant:t}),e),...o})}function ua({className:e,...t}){return Lr("div",{"data-slot":"attachment-content",className:me("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function ma({className:e,...t}){return Lr("span",{"data-slot":"attachment-title",className:me("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function fa({className:e,...t}){return Lr("span",{"data-slot":"attachment-description",className:me("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function qs({className:e,...t}){return Lr("div",{"data-slot":"attachment-actions",className:me("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function _f({className:e,variant:t,size:o="icon-xs",...r}){return Lr(Tt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:me(e),...r})}function Xs({className:e,...t}){return Lr("div",{"data-slot":"attachment-group",className:me("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as js from"react";var El=js.createContext(void 0);function Wf(e){let t=js.useContext(El);if(t===void 0&&!e)throw Error(Je(33));return t}import*as $s from"react";var pa=$s.createContext(void 0);function go(e){let t=$s.useContext(pa);if(t===void 0&&!e)throw Error(Je(36));return t}var an="data-starting-style",da="data-ending-style";var MI={[an]:""},kI={[da]:""},Dn={transitionStatus(e){if(e==="starting")return MI;if(e==="ending")return kI;return null}};var Pl="data-open",Al="data-closed",LI=an,DI=da,Gf="data-anchor-hidden";var Ks="data-popup-open",Zf="data-pressed";var FI={[Ks]:""},OI={[Ks]:"",[Zf]:""},NI={[Pl]:""},BI={[Al]:""},HI={[Gf]:""},Xf={open(e){if(e)return FI;return null}},Ml={open(e){if(e)return OI;return null}},ga={open(e){if(e)return NI;return BI},anchorHidden(e){if(e)return HI;return null}},Js={...ga,...Dn};import*as Qs from"react";var VI=Qs.createContext(void 0);function Fn(e=!0){let t=Qs.useContext(VI);if(t===void 0&&!e)throw Error(Je(25));return t}var ha="none",ei="trigger-press",uo="trigger-hover",Ia="trigger-focus",kl="outside-press",Ll="item-press",UI="close-press";var On="focus-out",Dl="escape-key";var ti="list-navigation",jf="keyboard",_I="pointer";var WI="cancel-open",ba="sibling-open";var $f="imperative-action";import*as Ca from"react";var Fl=Ca.createContext(null);function Ol(e="root"){let t=Ca.useContext(Fl),o=Ca.useContext(pa);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var GI={visible:!0,ref:null};function zI(){return GI}function Yf(e,t,o="root"){let r=Ol(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??zI)({label:e.label,children:e.children,render:e.render}),s=Ao(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as Nn from"react";import*as tp from"react";function ZI(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qI,platform:XI,maxTouchPoints:Kf}=ZI(),sn=qI.toLowerCase(),cn=XI.toLowerCase();var Nl=/^i(os$|p)/.test(cn)||cn==="macintel"&&Kf>1,Jf="android",Qf=cn===Jf||sn.includes(Jf),ep=!Nl&&cn.startsWith("mac"),jI=cn.startsWith("win"),$I=!Qf&&/^(linux|chrome os)/.test(cn),Bl=ep||Nl;var Hl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),YI=!Hl&&sn.includes("firefox"),KI=!Hl&&sn.includes("chrom");var JI=Bl;var QI=/jsdom|happydom/.test(sn);function e2(e){e.preventDefault()}function op(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=go(),l=Fn(!0),m=c.type==="submenu-trigger",f=m?u.parentVirtualFocus:u.virtualFocus,p=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:w}=a.useState("floatingTreeRoot"),I=a.useState("open"),d=l!==void 0,C=!f&&I&&o?0:-1;return tp.useMemo(()=>({id:r,role:"menuitem",tabIndex:C,"aria-selected":p,onMouseDown:f?e2:void 0,onKeyDown(b){if(b.key===" "&&s?.current)b.preventDefault()},onMouseMove(b){if(!n)return;w.emit("itemhover",{nodeId:n,target:b.currentTarget})},onClick(b){if(t)w.emit("close",{domEvent:b.nativeEvent,reason:Ll})},onMouseUp(b){if(l){let h=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,d&&h&&Math.abs(b.clientX-h.x)<=1&&Math.abs(b.clientY-h.y)<=1)return;if(d&&!dr.mac&&b.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!d||b.button===2)){if(c.type==="regular-item")Mn(i.current,b,{detail:1,pointerType:"mouse"})}}}),[t,C,r,w,n,a.context.allowMouseUpTriggerRef,s,i,l,d,c.type,p,f])}var rp={type:"regular-item"};function np(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=Nn.useRef(null),{getButtonProps:m,buttonRef:f}=lo({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),g=op({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),p=Nn.useCallback((I)=>_t(g,{onMouseEnter(d){if(c.type!=="submenu-trigger")return;c.setActive(d.nativeEvent)}},I,m),[g,m,c]),w=Ao(l,f);return Nn.useMemo(()=>({getItemProps:p,itemRef:w}),[p,w])}import*as ln from"react";import*as oi from"react";var Ul=oi.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ap(){return oi.useContext(Ul)}function ri(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=ap(),l=ln.useRef(-1),[m,f]=ln.useState(a==null&&t?()=>{if(l.current===-1){let I=u.current;u.current+=1,l.current=I}return l.current}:-1),g=a??m,p=ln.useRef(null),w=ln.useCallback((I)=>{let d=p.current;if(d)i(d);if(p.current=I,I)s(I,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return q(()=>{if(a!=null)return;return c((I)=>{let d=p.current?I.get(p.current)?.index:null;if(d!=null)f(d)})},[a,c]),{ref:w,index:g}}import*as si from"react";import*as ni from"react";function ai(){let[,e]=ni.useState({});return ni.useCallback(()=>{e({})},[])}var sp=0;function t2(e,t="mui"){let o=si.useRef(void 0),r=ai(),n=e??o.current;return si.useEffect(()=>{if(o.current==null){if(sp+=1,o.current=`${t}-${sp}`,e==null)r()}},[e,t,r]),n}var ip=ca.useId;function rr(e,t){if(ip!==void 0){let o=ip();return e??(t?`${t}-${o}`:o)}return t2(e,t)}function mo(e){return rr(e,"base-ui")}function Me(e,t,o,r){let n=!1,a=!1,s=r??_e;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function cp(e,t,o){let r=o??_e;return{reason:e,event:t??new Event("base-ui"),...r}}import*as _l from"react";import*as lp from"react";function Dr(e){lp.useEffect(e,pr)}var ii=null,G9e=globalThis.requestAnimationFrame;class up{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var ci=new up;class Lo{static create(){return new Lo}static request(e){return ci.request(e)}static cancel(e){return ci.cancel(e)}currentId=ii;request(e){this.cancel(),this.currentId=ci.request(()=>{this.currentId=ii,e()})}cancel=()=>{if(this.currentId!==ii)ci.cancel(this.currentId),this.currentId=ii};disposeEffect=()=>this.cancel}function hr(){let e=qe(Lo.create).current;return Dr(e.disposeEffect),e}function mp(e,t=!1,o=!1,r=!1){let[n,a]=_l.useState(e&&t?"idle":void 0),[s,i]=_l.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return q(()=>{if(!e&&s&&n!=="ending"&&o){let c=Lo.request(()=>{a("ending")});return()=>{Lo.cancel(c)}}return},[e,s,n,o]),q(()=>{if(!e||t||n===void 0)return;let c=Lo.request(()=>{a(void 0)});return()=>{Lo.cancel(c)}},[t,e,n]),q(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=Lo.request(()=>{a("idle")});return()=>{Lo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as fp from"react";import*as Gl from"react-dom";function Go(e){if(e==null)return e;return"current"in e?e.current:e}function Wl(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var li=null;function o2(e){if(!li){let t=[];li=t,queueMicrotask(()=>{li=null,Gl.flushSync(()=>{for(let o of t)o()})})}li.push(e)}function Bn(e,t=!1,o=!1){let r=hr();return re((n,a=null)=>{r.cancel();let s=Go(e);if(s==null)return;let i=s,c=()=>{if(!o){Gl.flushSync(n);return}o2(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(Wl(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(Wl(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=an;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function Fr(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=re(a),i=Bn(r,o,n);fp.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as zl from"react";import{jsx as r2}from"react/jsx-runtime";var n2=zl.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:f}=go(),g=ri({guess:!0,label:s}),p=mo(a),w=f.useState("disabled"),I=f.useState("isActive",g.index),d=f.useState("floatingNodeId"),C=f.useState("itemProps"),b=c||w,{getItemProps:h,itemRef:S}=np({closeOnClick:u,disabled:b,highlighted:I,id:p,store:f,nativeButton:i,nodeId:d,itemMetadata:rp});return ke("div",t,{state:{disabled:b,highlighted:I},props:[C,m,h],ref:[S,o,g.ref]})}),pp=zl.forwardRef(function(t,o){let r=Yf(t,o);if(!r.visible)return null;return r2(n2,{...t,ref:r.ref})});import*as hn from"react";import*as $t from"react";function Te(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function lt(e){let t=qe(a2,e).current;return t.next=e,q(t.effect),t}function a2(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var wa=0;class eo{static create(){return new eo}currentId=wa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wa,t()},e)}isStarted(){return this.currentId!==wa}clear=()=>{if(this.currentId!==wa)clearTimeout(this.currentId),this.currentId=wa};disposeEffect=()=>this.clear}function rt(){let e=qe(eo.create).current;return Dr(e.disposeEffect),e}import*as mi from"react";var dp={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ui={...dp,position:"fixed",margin:0,top:0,left:0},w7e={...dp,position:"absolute"};import{jsx as s2}from"react/jsx-runtime";var zo=mi.forwardRef(function(t,o){let[r,n]=mi.useState();return q(()=>{if(Vl.voiceOver&&gr.webkit)n("button")},[]),s2("span",{...t,ref:o,style:ui,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});function nt(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function fe(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Wo(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e,t){let o=e;while(o){if(He(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(Wo(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var xa="data-base-ui-focusable";var Zl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ya="ArrowLeft",Ra="ArrowRight",ql="ArrowUp",fi="ArrowDown";var L7e=Ks,Xl="data-trigger-disabled";function Or(e,t){if(!He(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(Xl);for(let[,r]of t.entries())if(fe(r,o))return!r.hasAttribute(Xl);return!1}function pi(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function gp(e){return e.matches("html,body")}function br(e){return Ge(e)&&e.matches(Zl)}function jl(e){return Ir(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Zl}`)!=null}function va(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&br(e)}function Nr(e){if(!e||Sa.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function Ta(e){if(!e)return null;return e.hasAttribute(xa)?e:e.querySelector(`[${xa}]`)||e}function So(e){e.preventDefault(),e.stopPropagation()}function hp(e){return"nativeEvent"in e}function Br(e){if(e.pointerType===""&&e.isTrusted)return!0;if(dr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function Hn(e){if(Sa.jsdom)return!1;return!dr.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(dr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Cr(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Ip(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var{min:Hr,max:Zo,round:Pa,floor:Aa}=Math,nr=(e)=>({x:e,y:e}),c2={left:"right",right:"left",bottom:"top",top:"bottom"};function gi(e,t,o){return Zo(e,Hr(t,o))}function ar(e,t){return typeof e==="function"?e(t):e}function fo(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function hi(e){return e==="x"?"y":"x"}function Ma(e){return e==="y"?"height":"width"}function ho(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ka(e){return hi(ho(e))}function Sp(e,t,o){if(o===void 0)o=!1;let r=wo(e),n=ka(e),a=Ma(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=Ea(s);return[s,Ea(s)]}function wp(e){let t=Ea(e);return[di(e),t,di(t)]}function di(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var bp=["left","right"],Cp=["right","left"],l2=["top","bottom"],u2=["bottom","top"];function m2(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Cp:bp;return t?bp:Cp;case"left":case"right":return t?l2:u2;default:return[]}}function xp(e,t,o,r){let n=wo(e),a=m2(fo(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(di))}return a}function Ea(e){let t=fo(e);return c2[t]+e.slice(t.length)}function f2(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function Ii(e){return typeof e!=="number"?f2(e):{top:e,right:e,bottom:e,left:e}}function un(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function bi(e,t){return t<0||t>=e.length}function Ci(e,t){return Yl(e.current,{disabledIndices:t})}function $l(e,t){return Yl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function yp(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>Yl(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let f=r?-1:e.length;if(a&&t!==f)l=-1;else l=r?c:i,m=!0}else l=u();return{index:bi(e,l)?-1:l,wrapped:m}}function Yl(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&Kl(e,a,r));return a}function Kl(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!mn(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function p2(e){return e.visibility==="hidden"||e.visibility==="collapse"}function mn(e,t=e?jt(e):null){if(!e||!e.isConnected||!t||p2(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var d2='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function g2(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return Wo(o)?o.host:null}function Ql(e){for(let t of Array.from(e.children))if(vt(t)==="summary")return t;return null}function h2(e,t){let o=Ql(t);return!!o&&(e===o||fe(o,e))}function Rp(e){let t=e?vt(e):"";return e!=null&&e.matches(d2)&&(t!=="summary"||e.parentElement!=null&&vt(e.parentElement)==="details"&&Ql(e.parentElement)===e)&&(t!=="details"||Ql(e)==null)&&(t!=="input"||e.type!=="hidden")}function eu(e){if(!Rp(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=g2(t)){let o=t!==e,r=vt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&vt(t)==="details"&&!t.open&&!h2(e,t)||t.hasAttribute("hidden")||!r&&!I2(t,o))return!1}return!0}function I2(e,t){let o=jt(e);if(!t)return mn(e,o);return o.display!=="none"}function vp(e){let t=e.tabIndex;if(t<0){let o=vt(e);if(o==="details"||o==="audio"||o==="video"||Ge(e)&&e.isContentEditable)return 0}return t}function Jl(e){if(vt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function Tp(e,t){let o=Jl(e);if(!o)return!0;let r=t.find((n)=>{let a=Jl(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=Jl(n);return a?.name===o.name&&a.form===o.form})===o}function Ep(e){if(Ge(e)&&vt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(Ge(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function tu(e,t){Ep(e).forEach((o)=>{if(Rp(o))t.push(o);tu(o,t)})}function Pp(e,t,o){Ep(e).forEach((r)=>{if(Ge(r)&&r.matches(t))o.push(r);Pp(r,t,o)})}function La(e){return eu(e)&&vp(e)>=0}function ou(e){let t=[];return tu(e,t),t.filter(eu)}function Da(e){let t=ou(e);return t.filter((o)=>vp(o)>=0&&Tp(o,t))}function Ap(e,t){let o=Da(e),r=o.length;if(r===0)return;let n=nt(ye(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function Si(e){return Ap(ye(e).body,1)||e}function wi(e){return Ap(ye(e).body,-1)||e}function Mp(e,t,o){if(!e)return null;let r=[];tu(ye(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(eu);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!fe(o,i)&&La(i)&&Tp(i,a))return i}return r[n]}function Sr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!fe(o,r)}function kp(e){Da(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function ru(e){let t=[];Pp(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function Do(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...Do(e,n.id,o)])}function nu(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function sr(e){return`data-base-ui-${e}`}var xi=0;function Vn(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(xi);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return xi=s,()=>{if(xi===s)cancelAnimationFrame(s),xi=0}}var Lp="data-base-ui-inert",Fa=new WeakMap,yi=new WeakSet,Oa=new WeakMap,au=0;function Np(e){if(!e)return null;return Wo(e)?e.host:Np(e.parentNode)}var Dp=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=Np(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),Fp=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},Op=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(vt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function b2(e,t,o,{mark:r=!0}){let n=Dp(t,e),a=r?Op(t,Fp(n),new Set(n)):[],s=[],i=[];if(o){let c=Dp(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);Op(t,Fp(u),new Set(u)).forEach((m)=>{let f=m.getAttribute("aria-hidden"),g=f!==null&&f!=="false",p=(Fa.get(m)||0)+1;if(Fa.set(m,p),s.push(m),p===1&&g)yi.add(m);if(!g)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Oa.get(c)||0)+1;if(Oa.set(c,u),i.push(c),u===1)c.setAttribute(Lp,"")});return au+=1,()=>{if(s.forEach((c)=>{let u=(Fa.get(c)||0)-1;if(Fa.set(c,u),!u){if(!yi.has(c))c.removeAttribute("aria-hidden");yi.delete(c)}}),r)i.forEach((c)=>{let u=(Oa.get(c)||0)-1;if(Oa.set(c,u),!u)c.removeAttribute(Lp)});if(au-=1,!au)Fa=new WeakMap,yi=new WeakSet,Oa=new WeakMap}}function su(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=ye(e[0]).body;return b2(e,n,o,{mark:r})}import*as it from"react";import*as cu from"react-dom";var Bp=500,Hp=500,Vp={style:{transition:"none"}},Ri="data-base-ui-click-trigger";var Up="[data-base-ui-swipe-ignore]",_p="[data-swipe-ignore]",Wp={fallbackAxisSide:"none"},Gp={fallbackAxisSide:"end"},zp={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as iu,jsxs as Zp}from"react/jsx-runtime";var qp=it.createContext(null),lu=()=>it.useContext(qp),C2=sr("portal");function vi(e={}){let{ref:t,container:o,componentProps:r=_e,elementProps:n}=e,a=rr(),i=lu()?.portalNode,[c,u]=it.useState(null),[l,m]=it.useState(null),f=re((I)=>{if(I!==null)m(I)}),g=it.useRef(null);q(()=>{if(o===null){if(g.current)g.current=null,m(null),u(null);return}let I=(o&&(_s(o)?o:o.current))??i??document.body;if(I==null){if(g.current)g.current=null,m(null),u(null);return}if(g.current!==I)g.current=I,m(null),u(I)},[o,i]);let p=ke("div",r,{ref:[t,f],props:[{id:a,[C2]:""},n]}),w=c&&p?cu.createPortal(p,c):null;return{node:l,nodeId:it.isValidElement(p)?p.props.id:void 0,subtree:w}}var Na=it.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:f}=vi({container:i,ref:o,componentProps:t,elementProps:u}),g=it.useRef(null),p=it.useRef(null),w=it.useRef(null),I=it.useRef(null),[d,C]=it.useState(null),b=it.useRef(!1),h=d?.modal,S=d?.open,y=!!d&&!d.modal&&d.open&&!!l;it.useEffect(()=>{if(!l||h)return;function v(T){if(l&&T.relatedTarget&&Sr(T))if(T.type==="focusin"){if(b.current)ru(l),b.current=!1}else kp(l),b.current=!0}return Zt(Te(l,"focusin",v,!0),Te(l,"focusout",v,!0))},[l,h]),q(()=>{if(!l||S!==!0||!b.current)return;ru(l),b.current=!1},[S,l]);let x=it.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:p,beforeInsideRef:w,afterInsideRef:I,portalNode:l,setFocusManagerState:C}),[l]);return Zp(it.Fragment,{children:[f,Zp(qp.Provider,{value:x,children:[y&&l&&iu(zo,{"data-type":"outside",ref:g,onFocus:(v)=>{if(Sr(v,l))w.current?.focus();else{let T=d?d.domReference:null;wi(T)?.focus()}}}),y&&l&&iu("span",{role:c,"aria-owns":m,style:zp}),l&&cu.createPortal(s,l),y&&l&&iu(zo,{"data-type":"outside",ref:p,onFocus:(v)=>{if(Sr(v,l))I.current?.focus();else{let T=d?d.domReference:null;if(Si(T)?.focus(),d?.closeOnFocusOut)d?.onOpenChange(!1,Me(On,v.nativeEvent))}}})]})]})});import*as Vr from"react";function Ti(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class fn{nodesRef={current:[]};events=Ti();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as Xp}from"react/jsx-runtime";var jp=Vr.createContext(null),$p=Vr.createContext(null),xo=()=>Vr.useContext(jp)?.id||null,to=(e)=>{let t=Vr.useContext($p);return e??t};function Ba(e){let t=rr(),o=to(e),r=xo();return q(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function uu(e){let{children:t,id:o}=e,r=xo();return Xp(jp.Provider,{value:Vr.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function mu(e){let{children:t,externalTree:o}=e,r=qe(()=>o??new fn).current;return Xp($p.Provider,{value:r,children:t})}import{jsx as Yp,jsxs as S2}from"react/jsx-runtime";function w2(e,t){let o=ze(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Br(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var Kp=20,Ur=[];function fu(){Ur=Ur.filter((e)=>e.deref()?.isConnected)}function Jp(e){if(fu(),e&&vt(e)!=="body"){if(Ur.push(new WeakRef(e)),Ur.length>Kp)Ur=Ur.slice(-Kp)}}function Qp(){return fu(),Ur[Ur.length-1]?.deref()}function x2(e){if(!e)return null;if(La(e))return e;return Da(e)[0]||e}function ed(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=ou(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return La(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function Ha(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:f,beforeContentFocusGuardRef:g,externalTree:p,getInsideElements:w}=e,I=t.useState("open"),d=t.useState("domReferenceElement"),C=t.useState("floatingElement"),{events:b,dataRef:h}=t.context,S=re(()=>h.current.floatingContext?.nodeId),y=n===!1,x=va(d)&&y,v=lt(n),T=lt(a),M=lt(s),B=lt(l),E=lt(I),F=to(p),A=lu(),R=$t.useRef(!1),O=$t.useRef(!1),X=$t.useRef(!1),P=$t.useRef(null),N=$t.useRef(""),W=$t.useRef(""),J=$t.useRef(null),k=$t.useRef(null),ne=Ao(J,g,A?.beforeInsideRef),H=Ao(k,A?.afterInsideRef),Y=rt(),z=rt(),ae=hr(),we=A!=null,ee=Ta(C),ce=re((G=ee)=>G?Da(G):[]),_=re(()=>w?.().filter((G)=>G!=null)??[]);$t.useEffect(()=>{if(r||!c)return;function G(pe){if(pe.key==="Tab"){if(fe(ee,nt(ye(ee)))&&ce().length===0&&!x)So(pe)}}let ie=ye(ee);return Te(ie,"keydown",G)},[r,ee,c,x,ce]),$t.useEffect(()=>{if(r||!I)return;let G=ye(ee);function ie(){X.current=!1}function pe(Fe){let le=Ze(Fe),Ie=_(),se=fe(C,le)||fe(d,le)||fe(A?.portalNode,le)||Ie.some((Ne)=>Ne===le||fe(Ne,le));if(X.current=!se,W.current=Fe.pointerType||"keyboard",Ir(le,`[${Ri}]`))O.current=!0,z.start(0,()=>{O.current=!1})}function Ee(){W.current="keyboard"}return Zt(Te(G,"pointerdown",pe,!0),Te(G,"pointerup",ie,!0),Te(G,"pointercancel",ie,!0),Te(G,"keydown",Ee,!0),ie)},[r,C,d,ee,I,A,z,_]),$t.useEffect(()=>{if(r||!u)return;let G=ye(ee);function ie(){O.current=!0,z.start(0,()=>{O.current=!1})}function pe(Ie){let se=Ze(Ie);if(La(se))P.current=se}function Ee(Ie){let{relatedTarget:se,currentTarget:Ne}=Ie,ue=Ze(Ie);if(c&&se==null&&ue!=null&&fe(C,ue))Jp(ue);queueMicrotask(()=>{let Se=S(),L=t.context.triggerElements,V=_(),be=se?.hasAttribute(sr("focus-guard"))&&[J.current,k.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Go(f),Go(m)].includes(se),j=!(fe(d,se)||fe(C,se)||fe(se,C)||fe(A?.portalNode,se)||V.some((oe)=>oe===se||fe(oe,se))||L.hasMatchingElement((oe)=>fe(oe,se))||be||F&&(Do(F.nodesRef.current,Se).find((oe)=>fe(oe.context?.elements.floating,se)||fe(oe.context?.elements.domReference,se))||nu(F.nodesRef.current,Se).find((oe)=>[oe.context?.elements.floating,Ta(oe.context?.elements.floating)].includes(se)||oe.context?.elements.domReference===se)));if(Ne===d&&ee)ed(ee);if(i&&Ne!==d&&!mn(ue)&&nt(G)===G.body){if(Ge(ee)){if(ee.focus(),i==="popup"){ae.request(()=>{ee.focus()});return}}let oe=ce(),de=P.current,ge=(de&&oe.includes(de)?de:null)||oe[oe.length-1]||ee;if(Ge(ge))ge.focus()}if(h.current.insideReactTree){h.current.insideReactTree=!1;return}if((x?!0:!c)&&se&&j&&!O.current&&(x||se!==Qp()))R.current=!0,t.setOpen(!1,Me(On,Ie))})}function Fe(){if(X.current)return;h.current.insideReactTree=!0,Y.start(0,()=>{h.current.insideReactTree=!1})}let le=Ge(d)?d:null;if(!C&&!le)return;return Zt(le&&Te(le,"focusout",Ee),le&&Te(le,"pointerdown",ie),C&&Te(C,"focusin",pe),C&&Te(C,"focusout",Ee),C&&A&&Te(C,"focusout",Fe,!0))},[r,d,C,ee,c,F,A,t,u,i,ce,x,S,h,Y,z,ae,m,f,_]),$t.useEffect(()=>{if(r||!C||!I)return;let G=Array.from(A?.portalNode?.querySelectorAll(`[${sr("portal")}]`)||[]),pe=(F?nu(F.nodesRef.current,S()):[]).find((Ne)=>va(Ne.context?.elements.domReference||null))?.context?.elements.domReference,Fe=[...[C,...G,J.current,k.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,..._()],pe,Go(f),Go(m),x?d:null].filter((Ne)=>Ne!=null),le=su(Fe,{ariaHidden:c||x,mark:!1}),Ie=[C,...G].filter((Ne)=>Ne!=null),se=su(Ie);return()=>{se(),le()}},[I,r,d,C,c,A,x,F,S,m,f,_]),q(()=>{if(!I||r||!Ge(ee))return;N.current="",W.current="";let G=ye(ee),ie=nt(G);queueMicrotask(()=>{let pe=v.current,Ee=typeof pe==="function"?pe(B.current||""):pe;if(Ee===void 0||Ee===!1)return;if(fe(ee,ie))return;let le=null,Ie=()=>{if(le==null)le=ce(ee);return le[0]||ee},se;if(Ee===!0||Ee===null)se=Ie();else se=Go(Ee);se=se||Ie();let Ne=fe(ee,nt(G)),ue=h.current.openEvent,Se=ue?.type==="mousedown"&&Br(ue);Vn(se,{sync:Se,preventScroll:se===ee,shouldFocus(){if(!E.current)return!1;if(Ne)return!0;let L=nt(G);return!(L!==se&&fe(ee,L))}})})},[r,I,ee,ce,v,B,E,h]);let K=$t.useRef(null);q(()=>{if(r||!ee){K.current=null;return}if(K.current)K.current.cancelled=!0,K.current=null;let G=ye(ee),ie=nt(G),pe=B.current==null;Jp(ie);function Ee(le){if(!le.open)N.current=w2(le.nativeEvent,W.current);if(le.reason===On&&le.triggerElement?.hasAttribute(sr("focus-guard"))||le.reason===uo&&le.nativeEvent.type==="mouseleave")R.current=!0;if(le.reason!==kl)return;if(le.nested)R.current=!1;else if(Br(le.nativeEvent)||Hn(le.nativeEvent))R.current=!1;else{let Ie=!1;if(ye(ee).createElement("div").focus({get preventScroll(){return Ie=!0,!1}}),Ie)R.current=!1;else R.current=!0}}b.on("openchange",Ee);function Fe(le){let Ie=T.current,se=typeof Ie==="function"?Ie(le):Ie;if(se===void 0||se===!1)return null;if(se===null)se=!0;let Ne=d?.isConnected?d:null,ue=ie?.isConnected&&vt(ie)!=="body"?ie:null,Se=pe?ue||Ne:Ne||ue;if(!Se)Se=Qp()||null;if(typeof se==="boolean")return Se;return Go(se)||Se||null}return()=>{b.off("openchange",Ee);let le=nt(G),Ie=_(),se=fe(C,le)||Ie.some((V)=>V===le||fe(V,le))||F&&Do(F.nodesRef.current,S(),!1).some((V)=>fe(V.context?.elements.floating,le)),Ne=T.current,ue=N.current,Se=Fe(ue),L={cancelled:!1};K.current=L,queueMicrotask(()=>{if(K.current===L)K.current=null;let V=x2(Se),be=M.current??typeof Ne!=="boolean";if(!L.cancelled&&Ne&&!R.current&&Ge(V)&&(!be&&V!==le&&le!==G.body?se:!0)){let j={preventScroll:!0};if(ue==="keyboard")j.focusVisible=!0;V.focus(j)}R.current=!1})}},[r,C,ee,T,M,B,b,F,d,S,_]),q(()=>{if(!gr.webkit||I||!C)return;let G=nt(ye(C));if(!Ge(G)||!br(G))return;if(fe(C,G))G.blur()},[I,C]),q(()=>{if(r||!A)return;return A.setFocusManagerState({modal:c,closeOnFocusOut:u,open:I,onOpenChange:t.setOpen,domReference:d}),()=>{A.setFocusManagerState(null)}},[r,A,c,I,t,u,d]),q(()=>{if(r||!ee)return;return ed(ee),()=>{queueMicrotask(fu)}},[r,ee]);let U=!r&&(c?!x:!0)&&(we||c);return S2($t.Fragment,{children:[U&&Yp(zo,{"data-type":"inside",ref:ne,onFocus:(G)=>{if(c){let ie=ce();Vn(ie[ie.length-1])}else if(A?.portalNode)if(R.current=!1,Sr(G,A.portalNode))Si(d)?.focus();else Go(f??A.beforeOutsideRef)?.focus()}}),o,U&&Yp(zo,{"data-type":"inside",ref:H,onFocus:(G)=>{if(c)Vn(ce()[0]);else if(A?.portalNode){if(u)R.current=!0;if(Sr(G,A.portalNode))wi(d)?.focus();else Go(m??A.afterOutsideRef)?.focus()}}})]})}import*as Va from"react";function Ua(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=ei}=t,u=e.context.dataRef,l=Va.useRef(void 0),m=hr(),f=rt(),g=Va.useMemo(()=>{function p(I,d,C,b){let h=Me(c,d,C);if(I&&b==="touch"&&i>0)f.start(i,()=>{e.setOpen(!0,h)});else e.setOpen(I,h)}function w(I,d,C){let b=u.current.openEvent,h=e.select("domReferenceElement")!==d;if(I&&h)return!0;if(!I)return!0;if(!n)return!0;if(b&&(typeof s==="function"?s():s))return!C(b.type);return!1}return{onPointerDown(I){l.current=Cr(I.pointerType,!0)&&Hn(I.nativeEvent)?"virtual":I.pointerType},onMouseDown(I){let d=l.current,C=I.nativeEvent,b=e.select("open");if(I.button!==0||r==="click"||Cr(d,!0)&&a)return;let h=w(b,I.currentTarget,(v)=>v==="click"||v==="mousedown"),S=Ze(C),y=br(S);if(y||d==="virtual"){p(h,C,y?S:I.currentTarget,d);return}let x=I.currentTarget;m.request(()=>{p(h,C,x,d)})},onClick(I){if(r==="mousedown-only")return;let d=l.current;if(r==="mousedown"&&d){l.current=void 0;return}if(Cr(d,!0)&&a)return;let C=e.select("open"),b=w(C,I.currentTarget,(h)=>h==="click"||h==="mousedown"||h==="keydown"||h==="keyup");p(b,I.nativeEvent,I.currentTarget,d)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,f,i]);return Va.useMemo(()=>o?{reference:g}:_e,[o,g])}import*as oo from"react";function y2(){return!1}function R2(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function _a(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=y2,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:f}=e.context,g=to(c),p=re(typeof n==="function"?n:()=>!1),w=typeof n==="function"?p:n,I=w!==!1,d=re(()=>a),{escapeKey:C,outsidePress:b}=R2(i),h=oo.useRef(!1),S=oo.useRef(!1),y=oo.useRef(!1),x=oo.useRef(!1),v=oo.useRef(!1),T=oo.useRef(""),M=oo.useRef(null),B=rt(),E=rt(),F=rt(),A=re(()=>{E.clear(),m.current.insideReactTree=!1}),R=re((H)=>{let Y=m.current.floatingContext?.nodeId;return(g?Do(g.nodesRef.current,Y):[]).some((ae)=>ae.context?.open&&!ae.context.dataRef.current[H])}),O=re((H)=>pi(H,e.select("floatingElement"))||pi(H,e.select("domReferenceElement"))),X=re((H)=>{if(!s())return;e.setOpen(!1,Me(ei,H.nativeEvent))}),P=re((H)=>{if(!u||!o||!r||H.key!=="Escape")return;let Y=hp(H)?H.nativeEvent:H;if(v.current||Y.isComposing)return;if(!C&&R("__escapeKeyBubbles"))return;let z=Me(Dl,Y);if(e.setOpen(!1,z),!z.isCanceled)H.preventDefault();if(!C&&!z.isPropagationAllowed)H.stopPropagation()}),N=re(()=>{m.current.insideReactTree=!0,E.start(0,A)}),W=re((H)=>{if(!u||!o||H.button!==0)return;let Y=Ze(H.nativeEvent);if(!fe(e.select("floatingElement"),Y))return;if(!h.current)h.current=!0,S.current=!1}),J=re((H)=>{if(!u||!o)return;if(!(H.defaultPrevented||H.nativeEvent.defaultPrevented))return;if(h.current)S.current=!0});oo.useEffect(()=>{function H(Y){if(!Y.open)x.current=!1}return f.on("openchange",H),()=>{f.off("openchange",H)}},[f]),oo.useEffect(()=>A,[A]),oo.useEffect(()=>{if(!u||!o){if(!u)x.current=!1,v.current=!1,T.current="",M.current=null;return A}m.current.__escapeKeyBubbles=C,m.current.__outsidePressBubbles=b;let H=new eo,Y=ye(l);function z(){F.clear(),v.current=!0}function ae(){v.current=!0,F.start(gr.webkit?5:0,()=>{v.current=!1})}function we(){y.current=!0,H.start(0,()=>{y.current=!1})}function ee(){h.current=!1,S.current=!1}function ce(){let L=T.current,V=L==="pen"||!L?"mouse":L,be=d(),j=typeof be==="function"?be():be;if(typeof j==="string")return j;return j[V]}function _(L){let V=ce();return V==="intentional"&&L.type!=="click"||V==="sloppy"&&L.type==="click"}function K(L){let V=m.current.floatingContext?.nodeId,be=g&&Do(g.nodesRef.current,V).some((j)=>pi(L,j.context?.elements.floating));return O(L)||be}function U(L){if(_(L)){if(L.type!=="click"&&!O(L))H.clear(),y.current=!1;A();return}if(m.current.insideReactTree){A();return}let V=Ze(L),be=`[${sr("inert")}]`,j=He(V)?V.getRootNode():null,oe=Array.from((Wo(j)?j:ye(e.select("floatingElement"))).querySelectorAll(be)),de=e.context.triggerElements;if(V&&(de.hasElement(V)||de.hasMatchingElement((he)=>fe(he,V))))return;let ge=He(V)?V:null;while(ge&&!ko(ge)){let he=Mo(ge);if(ko(he)||!He(he))break;ge=he}if(oe.length&&He(V)&&!gp(V)&&!fe(V,e.select("floatingElement"))&&oe.every((he)=>!fe(ge,he)))return;if(Ge(V)&&!("touches"in L)){let he=ko(V),Ae=jt(V),je=/auto|scroll/,ct=he||je.test(Ae.overflowX),so=he||je.test(Ae.overflowY),io=ct&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,No=so&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,qt=Ae.direction==="rtl",Wt=No&&(qt?L.offsetX<=V.offsetWidth-V.clientWidth:L.offsetX>V.clientWidth),po=io&&L.offsetY>V.clientHeight;if(Wt||po)return}if(K(L))return;if(ce()==="intentional"){if(L.detail!==0&&!Br(L)&&!x.current)return;if(y.current){H.clear(),y.current=!1;return}}if(typeof w==="function"&&!w(L))return;if(R("__outsidePressBubbles"))return;e.setOpen(!1,Me(kl,L)),A()}function G(L){if(ce()!=="sloppy"||L.pointerType==="touch"||!e.select("open")||!o||O(L))return;U(L)}function ie(L){if(ce()!=="sloppy"||!e.select("open")||!o||O(L))return;let V=L.touches[0];if(V)M.current={startTime:Date.now(),startX:V.clientX,startY:V.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1000,()=>{if(M.current)M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1})}function pe(L,V){let be=Ze(L);if(!be)return;let j=Te(be,L.type,()=>{V(L),j()})}function Ee(L){T.current="touch",pe(L,ie)}function Fe(L){if(B.clear(),L.type==="pointerdown"){if(L.button===0)x.current=!0;T.current=L.pointerType}if(L.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)return;pe(L,(V)=>{if(V.type==="pointerdown")G(V);else U(V)})}function le(L){if(L.type==="pointercancel")x.current=!1;if(!h.current)return;let V=S.current;if(ee(),ce()!=="intentional")return;if(L.type==="pointercancel"){if(V)we();return}if(K(L))return;if(V){we();return}if(typeof w==="function"&&!w(L))return;H.clear(),y.current=!0,A()}function Ie(L){if(ce()!=="sloppy"||!M.current||O(L))return;let V=L.touches[0];if(!V)return;let be=Math.abs(V.clientX-M.current.startX),j=Math.abs(V.clientY-M.current.startY),oe=Math.sqrt(be*be+j*j);if(oe>5)M.current.dismissOnTouchEnd=!0;if(oe>10)U(L),B.clear(),M.current=null}function se(L){pe(L,Ie)}function Ne(L){if(ce()!=="sloppy"||!M.current||O(L))return;if(M.current.dismissOnTouchEnd)U(L);B.clear(),M.current=null}function ue(L){pe(L,Ne)}let Se=Zt(r&&Zt(Te(Y,"keydown",P),Te(Y,"compositionstart",z),Te(Y,"compositionend",ae)),I&&Zt(Te(Y,"click",Fe,!0),Te(Y,"pointerdown",Fe,!0),Te(Y,"pointerup",le,!0),Te(Y,"pointercancel",le,!0),Te(Y,"mousedown",Fe,!0),Te(Y,"mouseup",le,!0),Te(Y,"touchstart",Ee,{capture:!0,passive:!0}),Te(Y,"touchmove",se,{capture:!0,passive:!0}),Te(Y,"touchend",ue,{capture:!0,passive:!0})));return()=>{Se(),H.clear(),ee(),y.current=!1}},[m,l,r,I,w,u,o,C,b,P,A,d,R,O,g,e,B,F]);let k=oo.useMemo(()=>({onKeyDown:P,onPointerDown:X,onClick:X}),[P,X]),ne=oo.useMemo(()=>({onKeyDown:P,onPointerDown:J,onMouseDown:J,onClickCapture:N,onMouseDownCapture(H){N(),W(H)},onPointerDownCapture(H){N(),W(H)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[P,N,W,J]);return oo.useMemo(()=>o?{reference:k,floating:ne,trigger:k}:{},[o,k,ne])}import*as du from"react";import*as v2 from"react-dom";function Wa(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),q(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(He(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as pu from"react";function td(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=re(n),{mounted:c,setMounted:u,transitionStatus:l}=mp(t,!1,!1,s),m=t?!1:r;q(()=>{if(t)i(!1)},[t,i]);let f=pu.useRef(c),g=pu.useRef(!1),p=ai(),w=()=>{f.current=!1,u(!1),a()};q(()=>{if(f.current=c,g.current){if(g.current=!1,!t&&c)w()}});let I=re(()=>{if(!f.current)return;if(t){g.current=!0,p();return}w()});return Fr({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)I()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:I}}var Ei={tabIndex:-1,[xa]:""};function rd(e){return(t)=>t==="touch"?e.current:!0}function nd(e,t=!1){let o=rr(),r=xo()!=null,n=qe(()=>e(o,r)).current;return Wa({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function Pi({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function od(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function T2(e,t){let o=du.useRef(null);return re((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),od(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),od(t)})}function Ai(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function ad(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Mi(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=T2(e,o),s=re((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=re((c)=>{if(a(c),c)s(c)});return q(()=>(i(t.current),()=>i(null)),[i,t,o,e]),q(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function ki(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=du.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");q(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let f=e.context.triggerElements.getById(l);if(!f){for(let[g,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,f!==e.state.activeTriggerElement)u.activeTriggerElement=f}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let f=e.context.triggerElements.entries().next();if(!f.done){let[g,p]=f.value;u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let f=Me(ha);if(e.setOpen(!1,f),!f.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function Li(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=td({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return qe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function Di(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:_e,inactiveTriggerProps:_e,popupProps:_e})},[e])}function sd(e,t){q(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),q(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class Ga{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Cu=_m(Fi(),1);import*as ud from"react";import*as _r from"react";var H2=Fi();function V2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var U2=typeof Object.is==="function"?Object.is:V2,_2=H2.useSyncExternalStore,W2=_r.useRef,G2=_r.useEffect,z2=_r.useMemo,Z2=_r.useDebugValue;var hu=function(e,t,o,r,n){var a=W2(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=z2(function(){function c(g){if(!u){if(u=!0,l=g,g=r(g),n!==void 0&&s.hasValue){var p=s.value;if(n(p,g))return m=p}return m=g}if(p=m,U2(l,g))return p;var w=r(g);if(n!==void 0&&n(p,w))return l=g,p;return l=g,m=w}var u=!1,l,m,f=o===void 0?null:o;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,o,r,n]);var i=_2(e,a[0],a[1]);return G2(function(){s.hasValue=!0,s.value=i},[i]),Z2(i),i};import*as id from"react";var Iu=[],bu=void 0;function cd(){return bu}function ld(e){Iu.push(e)}function za(e){let t=(o,r)=>{let n=qe(q2).current,a;try{bu=n;for(let s of Iu)s.before(n);a=e(o,r);for(let s of Iu)s.after(n);n.didInitialize=!0}finally{bu=void 0}return a};return t.displayName=e.displayName||e.name,t}function Oi(e){return id.forwardRef(za(e))}function q2(){return{didInitialize:!1}}var X2=En(19),j2=X2?Y2:K2;function Ni(e,t,o,r,n){return j2(e,t,o,r,n)}function $2(e,t,o,r,n){let a=ud.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return Cu.useSyncExternalStore(e.subscribe,a,a)}ld({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};Cu.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function Y2(e,t,o,r,n){let a=cd();if(!a)return $2(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function K2(e,t,o,r,n){return hu(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class Su{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=(e)=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return Ni(this,e,t,o,r)}}import*as pn from"react";class wr extends Su{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){pn.useDebugValue(e);let o=this;q(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;q(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);q(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){pn.useDebugValue(e);let o=this,r=t!==void 0;q(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return pn.useDebugValue(e),Ni(this,this.selectors[e],t,o,r)}useContextCallback(e,t){pn.useDebugValue(e);let o=re(t??Ye);this.context[e]=o}useStateSetter(e){let t=pn.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var J2={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class wu extends wr{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ti(),nested:o,triggerElements:n},J2);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Ip(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Hi(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_e,inactiveTriggerProps:_e,popupProps:_e}}var Za=(e)=>e.triggerIdProp??e.activeTriggerId,Bi=(e)=>e.openProp??e.open,md=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function fd(e,t){return t!==void 0&&Bi(e)&&Za(e)===t}function Q2(e,t){if(fd(e,t))return!0;return t!==void 0&&Bi(e)&&Za(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Un={open:Bi,mounted:(e)=>e.mounted,transitionStatus:(e)=>Bi(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:Za,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:md,isTriggerActive:(e,t)=>t!==void 0&&Za(e)===t,isOpenedByTrigger:(e,t)=>fd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Za(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Q2(e,t)?md(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var pd=_m(Fi(),1);import*as xu from"react";function Vi(e){let t=xu.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=xu.useCallback(()=>e===void 0?void 0:e.store,[e]);return pd.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as ir from"react";var yu=dr.mac&&gr.webkit;function Ru(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=ir.useRef(!1),i=ir.useRef(null),c=ir.useRef(!0),u=rt();ir.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let f=ze(m);function g(){let I=e.select("domReferenceElement");if(!e.select("open")&&Ge(I)&&I===nt(ye(I)))s.current=!0,i.current=I}function p(){c.current=!0}function w(){c.current=!1}return Zt(Te(f,"blur",g),yu&&Te(f,"keydown",p,!0),yu&&Te(f,"pointerdown",w,!0))},[e,o]),ir.useEffect(()=>{if(!o)return;function m(f){if(f.reason===ei||f.reason===Dl){let g=e.select("domReferenceElement");if(He(g))i.current=g,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=ir.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(f){let g=f.currentTarget;if(s.current){if(i.current===g)return;m()}let p=Ze(f.nativeEvent);if(He(p)){if(yu&&!f.relatedTarget){if(!c.current&&!br(p))return}else if(!Nr(p))return}let w=Or(f.relatedTarget,e.context.triggerElements),{nativeEvent:I,currentTarget:d}=f;if(e.select("open")&&w||!r){e.setOpen(!0,Me(Ia,I,d));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Me(Ia,I,d))})},onBlur(f){m();let{relatedTarget:g,nativeEvent:p}=f,w=He(g)&&g.hasAttribute(sr("focus-guard"))&&g.getAttribute("data-type")==="outside";u.start(0,()=>{let I=e.select("domReferenceElement"),d=nt(ye(I));if(!g&&d===I)return;if(fe(a.current.floatingContext?.refs.floating.current,d)||fe(I,d)||w)return;if(Or(g??d,e.context.triggerElements))return;e.setOpen(!1,Me(Ia,p))})}}},[a,r,e,u]);return ir.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as Eu from"react";class vu{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new eo;restTimeout=new eo;handleCloseOptions=void 0;static create(){return new vu}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var Ui=new WeakMap;function _n(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Ui.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Ui.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function _i(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=Ui.get(o);if(a&&a!==e)_n(a);_n(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Ui.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function Wi(e){let t=e.context.dataRef.current,o=qe(()=>t.hoverInteractionState??vu.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return Dr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function eb(e,t){if(t!=null&&!Cr(t))return 0;if(typeof e==="function")return e();return e}function qa(e,t,o){let r=eb(e,o);if(typeof r==="number")return r;return r?.[t]}function Tu(e){if(typeof e==="function")return e();return e}function Gi(e,t){return t||e==="click"||e==="mousedown"}function dd(e){return e?.includes("mouse")&&e!=="mousedown"}function Pu(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=to(),l=xo(),m=Wi(e),f=rt(),g=re(()=>Gi(c.current.openEvent?.type,m.interactedInside)),p=re(()=>dd(c.current.openEvent?.type)),w=re(()=>{_n(m)});q(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w()},[a,m,w]),Eu.useEffect(()=>w,[w]),q(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&p()&&He(i)&&s){let I=i,d=s,C=ye(s),b=u?.nodesRef.current.find((x)=>x.id===l)?.context?.elements.floating;if(b)b.style.pointerEvents="";let h=m.pointerEventsScopeElement!==d?m.pointerEventsScopeElement:null,S=b!==d?b:null,y=m.handleCloseOptions?.getScope?.()??h??S??Ir(I,"[data-rootownerid]")??C.body;return _i(m,{scopeElement:y,referenceElement:I,floatingElement:d}),()=>{w()}}return},[o,a,i,s,m,p,u,l,w]),Eu.useEffect(()=>{if(!o)return;function I(){return!!(u&&l&&Do(u.nodesRef.current,l).length>0)}function d(x){let v=qa(r,"close",m.pointerType),T=()=>{e.setOpen(!1,Me(uo,x)),u?.events.emit("floating.closed",x)};if(v)m.openChangeTimeout.start(v,T);else m.openChangeTimeout.clear(),T()}function C(x){let v=Ze(x);if(!jl(v)){m.interactedInside=!1;return}m.interactedInside=Ir(v,"[aria-haspopup]")!=null}function b(){m.openChangeTimeout.clear(),f.clear(),u?.events.off("floating.closed",S),w()}function h(x){if(I()&&u){u.events.on("floating.closed",S);return}if(Or(x.relatedTarget,e.context.triggerElements))return;let v=c.current.floatingContext?.nodeId??n,T=x.relatedTarget;if(u&&v&&He(T)&&Do(u.nodesRef.current,v,!1).some((B)=>fe(B.context?.elements.floating,T)))return;if(m.handler){m.handler(x);return}if(w(),p()&&!g())d(x)}function S(x){if(!u||!l||I())return;f.start(0,()=>{u.events.off("floating.closed",S),e.setOpen(!1,Me(uo,x)),u.events.emit("floating.closed",x)})}let y=s;return Zt(y&&Te(y,"mouseenter",b),y&&Te(y,"mouseleave",h),y&&Te(y,"pointerdown",C,!0),()=>{u?.events.off("floating.closed",S)})},[o,s,e,c,r,n,p,g,w,m,u,l,f])}import*as Wr from"react";import*as gd from"react-dom";var tb={current:null};function Au(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=tb,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:f,shouldOpen:g,guardStaleOpen:p=!1}=t,{dataRef:w,events:I}=e.context,d=to(u),C=Wi(e),b=Wr.useRef(!1),h=lt(n),S=lt(r),y=lt(s),x=lt(o),v=lt(g),T=lt(f),M=re(()=>Gi(w.current.openEvent?.type,C.interactedInside)),B=re(()=>v.current?.()!==!1),E=re((R,O,X)=>{let P=e.context.triggerElements;if(P.hasElement(O))return!R||!fe(R,O);if(!He(X))return!1;let N=X;return P.hasMatchingElement((W)=>fe(W,N))&&(!R||!fe(R,N))}),F=re(()=>{if(!C.handler)return;ye(e.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),A=re(()=>{_n(C)});if(l)C.handleCloseOptions=n?.__options;return Wr.useEffect(()=>F,[F]),Wr.useEffect(()=>{if(!o)return;function R(O){if(!O.open)b.current=O.reason===uo,F(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1;else b.current=!1}return I.on("openchange",R),()=>{I.off("openchange",R)}},[o,I,C,F]),Wr.useEffect(()=>{if(!o)return;function R(J,k=!0){let ne=qa(S.current,"close",C.pointerType);if(ne)C.openChangeTimeout.start(ne,()=>{e.setOpen(!1,Me(uo,J)),d?.events.emit("floating.closed",J)});else if(k)C.openChangeTimeout.clear(),e.setOpen(!1,Me(uo,J)),d?.events.emit("floating.closed",J)}let O=c.current??(l?e.select("domReferenceElement"):null);if(!He(O))return;function X(J){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!Cr(C.pointerType))return;let k=Tu(y.current),ne=qa(S.current,"open",C.pointerType),H=Ze(J),Y=J.currentTarget??null,z=e.select("domReferenceElement"),ae=Y;if(He(H)&&!e.context.triggerElements.hasElement(H)){for(let pe of e.context.triggerElements.elements())if(fe(pe,H)){ae=pe;break}}if(He(Y)&&He(z)&&!e.context.triggerElements.hasElement(Y)&&fe(Y,z))ae=z;let we=ae==null?!1:E(z,ae,H),ee=e.select("open"),ce=T.current?.()??e.select("transitionStatus")==="ending",_=!ee&&ce&&b.current,K=!we&&He(ae)&&He(z)&&fe(z,ae)&&_,U=k>0&&!ne,G=we&&(ee||_)||K,ie=!ee||we;if(G){if(B())e.setOpen(!0,Me(uo,J,ae));return}if(U)return;if(ne)C.openChangeTimeout.start(ne,()=>{if(ie&&B())e.setOpen(!0,Me(uo,J,ae))});else if(ie){if(B())e.setOpen(!0,Me(uo,J,ae))}}function P(J){if(M()){A();return}F();let k=e.select("domReferenceElement"),ne=ye(k);C.restTimeout.clear(),C.restTimeoutPending=!1;let H=w.current.floatingContext??m?.();if(Or(J.relatedTarget,e.context.triggerElements))return;if(h.current&&H){if(!e.select("open"))C.openChangeTimeout.clear();let z=c.current;C.handler=h.current({...H,tree:d,x:J.clientX,y:J.clientY,onClose(){if(A(),F(),x.current&&!M()&&z===e.select("domReferenceElement"))R(J,!0)}}),ne.addEventListener("mousemove",C.handler),C.handler(J);return}if(C.pointerType==="touch"?!fe(e.select("floatingElement"),J.relatedTarget):!0)R(J)}function N(J){if(fe(O,J.relatedTarget))return;C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1}let W=p?Te(O,"mouseout",N):void 0;if(i)return Zt(Te(O,"mousemove",X,{once:!0}),Te(O,"mouseenter",X),Te(O,"mouseleave",P),W);return Zt(Te(O,"mouseenter",X),Te(O,"mouseleave",P),W)},[F,A,w,S,e,o,h,C,l,E,M,a,i,y,c,d,x,m,T,B,p]),Wr.useMemo(()=>{if(!o)return;function R(O){C.pointerType=O.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(O){let{nativeEvent:X}=O,P=O.currentTarget,N=e.select("domReferenceElement"),W=e.select("open"),J=E(N,P,O.target);if(a&&!Cr(C.pointerType))return;if(W&&J&&C.handleCloseOptions?.blockPointerEvents){let H=e.select("floatingElement");if(H){let Y=C.handleCloseOptions?.getScope?.()??P.ownerDocument.body;_i(C,{scopeElement:Y,referenceElement:P,floatingElement:H})}}let k=Tu(y.current);if(W&&!J||k===0)return;if(!J&&C.restTimeoutPending&&O.movementX**2+O.movementY**2<2)return;C.restTimeout.clear();function ne(){if(C.restTimeoutPending=!1,M())return;let H=e.select("open");if(!C.blockMouseMove&&(!H||J)&&B())e.setOpen(!0,Me(uo,X,P))}if(C.pointerType==="touch")gd.flushSync(()=>{ne()});else if(J&&W)ne();else C.restTimeoutPending=!0,C.restTimeout.start(k,ne)}}},[o,C,M,E,a,e,y,B])}import*as Yt from"react";function hd(e){return gr.webkit&&e.movementX===0&&e.movementY===0}function Zi(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function zi(e,t){return Zi(t,e===ql||e===fi,e===ya||e===Ra)}function Mu(e,t,o){return Zi(t,e===fi,o?e===ya:e===Ra)||e==="Enter"||e===" "||e===""}function ob(e,t,o){return Zi(t,o?e===ya:e===Ra,e===fi)}function rb(e,t,o,r){let n=o?e===Ra:e===ya,a=e===ql;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return Zi(t,n,a)}function ku(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:f="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:p=!0,disabledIndices:w=void 0,orientation:I="vertical",triggerOrientation:d=I,parentOrientation:C,id:b,resetOnPointerLeave:h=!0,externalTree:S,nestedReturnFocusRef:y,grid:x}=t,v=x!=null,T=e.useState("open"),M=e.useState("floatingElement"),B=e.useState("domReferenceElement"),E=e.context.dataRef,F=Ta(M),A=va(B),R=lt(F),O=xo(),X=to(S),P=Yt.useRef(f),N=Yt.useRef(s??-1),W=Yt.useRef(null),J=Yt.useRef(!0),k=re((L)=>{n(N.current===-1?null:N.current,L)}),ne=Yt.useRef(!!M),H=Yt.useRef(T),Y=Yt.useRef(!1),z=Yt.useRef(!1),ae=Yt.useRef(null),we=lt(w),ee=lt(T),ce=lt(s),_=lt(h),K=hr(),U=hr(),G=re(()=>{K.cancel();function L(oe){if(!m)ae.current=Vn(oe,{sync:Y.current,preventScroll:!0})}let V=o.current[N.current],be=z.current;if(V)L(V);(Y.current?(oe)=>oe():(oe)=>K.request(oe))(()=>{let oe=o.current[N.current]||V;if(!oe)return;if(!V)L(oe);if(Ie&&(be||!J.current))oe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{E.current.orientation=I},[E,I]),q(()=>{if(!T)W.current=null;if(!T||f!=="auto")P.current=f},[T,f]),q(()=>{if(!a)return;if(T&&M){if(N.current=s??-1,P.current&&s!=null)z.current=!0,k()}else if(ne.current)N.current=-1,k()},[a,T,M,s,k]),q(()=>{if(!a)return;if(!T){Y.current=!1;return}if(!M)return;if(r==null){if(Y.current=!1,ce.current!=null)return;if(ne.current)N.current=-1,G();if((!H.current||!ne.current)&&P.current&&(W.current!=null||P.current===!0&&W.current==null)){let L=0,V=()=>{if(o.current[0]==null){if(L<2)(L?(j)=>U.request(j):queueMicrotask)(V);L+=1}else N.current=W.current==null||Mu(W.current,d,l)||u?Ci(o):$l(o),W.current=null,k()};V()}}else if(!bi(o.current,r))N.current=r,G(),z.current=!1},[a,T,M,r,ce,u,o,d,l,k,G,U]),q(()=>{if(!a||M||!X||m||!ne.current)return;let L=X.nodesRef.current,V=L.find((oe)=>oe.id===O)?.context?.elements.floating,be=nt(ye(B??V??null)),j=L.some((oe)=>oe.context&&fe(oe.context.elements.floating,be));if(V&&!j&&J.current)V.focus({preventScroll:!0})},[a,M,B,X,O,m]),q(()=>{H.current=T,ne.current=!!M});let ie=r!=null,pe=re((L)=>{if(!ee.current)return;let V=o.current.indexOf(L.currentTarget);if(V!==-1&&(N.current!==V||r!==V))N.current=V,k(L)}),Ee=re(()=>C??X?.nodesRef.current.find((L)=>L.id===O)?.context?.dataRef?.current.orientation),Fe=re(()=>Ci(o,we.current)),le=re((L)=>{if(J.current=!1,Y.current=!0,L.which===229)return;if(!ee.current&&L.currentTarget===R.current)return;if(u&&rb(L.key,I,l,v)){if(!zi(L.key,Ee()))So(L);e.setOpen(!1,Me(ti,L.nativeEvent));let oe=y?.current??B;if(Ge(oe))oe.focus();return}if(r!=null&&r!==N.current&&!bi(o.current,r))N.current=r;let V=N.current,be=Ci(o,w),j=$l(o,w);if(!A){if(L.key==="Home")So(L),N.current=be,k(L);if(L.key==="End")So(L),N.current=j,k(L)}if(x!=null){let oe=x(L,N.current,o,I,c,l,w,be,j);if(oe!=null&&oe!==N.current)N.current=oe,k(L);if(I==="both")return}if(zi(L.key,I)){So(L);let oe=nt(L.currentTarget.ownerDocument);if(T&&!m&&fe(L.currentTarget,oe)&&!o.current.some((he)=>he!=null&&fe(he,oe))){if(N.current=Mu(L.key,I,l)?be:j,k(L),r===N.current)G();return}let{index:de,wrapped:ge}=yp(o.current,V,{decrement:!Mu(L.key,I,l),loopFocus:c,allowEscape:i,disabledIndices:w,minIndex:be,maxIndex:j});if(ge)Y.current=!1;N.current=de,k(L)}}),Ie=Yt.useMemo(()=>({onFocus(V){Y.current=!0,pe(V)},onClick({currentTarget:V}){if(!m)V.focus({preventScroll:!0})},onMouseMove(V){if(hd(V))return;if(Y.current=!0,z.current=!1,g)pe(V)},onPointerLeave(V){if(!ee.current||!J.current||V.pointerType==="touch")return;Y.current=!0;let be=V.relatedTarget;if(!g||o.current.includes(be))return;if(!_.current)return;if(ae.current?.(),ae.current=null,N.current=-1,k(V),!m){let j=R.current,oe=nt(ye(j));if(j&&fe(j,oe))j.focus({preventScroll:!0})}}}),[pe,ee,R,g,o,k,_,m]),se=Yt.useMemo(()=>m&&T&&ie&&{"aria-activedescendant":`${b}-${r}`},[m,T,ie,b,r]),Ne=Yt.useMemo(()=>({...!A?se:{},onKeyDown(L){if(L.key==="Tab"&&L.shiftKey&&T&&!m){let V=Ze(L.nativeEvent);if(V&&!fe(R.current,V))return;So(L);let be=Me(On,L.nativeEvent);e.setOpen(!1,be);let j=y?.current??B;if(!be.isCanceled&&Ge(j))j.focus();return}le(L)},onPointerMove(L){if(hd(L))return;J.current=!0}}),[se,le,R,A,e,T,m,B,y]),ue=Yt.useMemo(()=>{function L(j){e.setOpen(!0,Me(ti,j.nativeEvent,j.currentTarget))}function V(j){if(f==="auto"&&Br(j.nativeEvent))P.current=!m}function be(j){if(P.current=f,f==="auto"&&Hn(j.nativeEvent))P.current=!0}return{onKeyDown(j){let oe=e.select("open");J.current=!1;let de=j.key.startsWith("Arrow"),ge=ob(j.key,Ee(),l),he=zi(j.key,oe?I:d),Ae=(u?ge:he)||j.key==="Enter"||j.key.trim()==="";if(m&&oe&&(!u||br(j.currentTarget)))return le(j);if(!oe&&!p&&de)return;if(Ae){let je=zi(j.key,Ee());W.current=u&&je?null:j.key}if(u){if(ge)if(So(j),oe){if(N.current=Fe(),k(j),m)R.current?.focus()}else L(j);return}if(he){if(ce.current!=null)N.current=ce.current;if(So(j),!oe&&p)L(j);else le(j);if(oe)k(j)}return},onFocus(j){if(j.target!==j.currentTarget)return;if(e.select("open")&&!m)N.current=-1,k(j)},onPointerDown:be,onPointerEnter:be,onMouseDown:V,onClick:V}},[le,f,Fe,u,k,e,p,I,d,Ee,l,ce,m,R]),Se=Yt.useMemo(()=>({...se,...ue}),[se,ue]);return Yt.useMemo(()=>a?{reference:Se,floating:Ne,item:Ie,trigger:ue}:{},[a,Se,Ne,ue,Ie])}import*as dn from"react";function Lu(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=re(i),f=e.useState("open"),g=rt(),p=dn.useRef(""),w=dn.useRef(l??n??-1),I=dn.useRef(null),d=re((h)=>{function S(A){return r?.current[A]}function y(A){let R=S(A);if(R&&!mn(R)||R?.matches(":disabled"))return!1;return s==null||!Kl(pr,A,s)}function x(A,R,O=0){if(A.length===0)return-1;let X=(O%A.length+A.length)%A.length,P=R.toLowerCase();for(let N=0;N<A.length;N+=1){let W=(X+N)%A.length;if(!A[W]?.toLowerCase().startsWith(P)||!y(W))continue;return W}return-1}let v=o.current;if(p.current.length>0&&h.key===" ")So(h),m?.(!0);if(p.current.length>0&&p.current[0]!==" "){if(x(v,p.current)===-1&&h.key!==" ")m?.(!1)}if(v==null||h.key.length!==1||h.ctrlKey||h.metaKey||h.altKey)return;if(f&&h.key!==" ")So(h),m?.(!0);let T=p.current==="";if(T)w.current=l??n??-1;if(v.every((A,R)=>A&&y(R)?A[0]?.toLowerCase()!==A[1]?.toLowerCase():!0)&&p.current===h.key)p.current="",w.current=I.current;p.current+=h.key,g.start(u,()=>{p.current="",w.current=I.current,m?.(!1)});let E=((T?l??n??-1:w.current)??0)+1,F=x(v,p.current,E);if(F!==-1)a?.(F,h),I.current=F;else if(h.key!==" ")p.current="",m?.(!1)}),C=re((h)=>{let S=h.relatedTarget,y=e.select("domReferenceElement"),x=e.select("floatingElement");if(fe(y,S)||fe(x,S))return;g.clear(),p.current="",w.current=I.current,m?.(!1)});q(()=>{if(!f&&l!==null)return;if(g.clear(),I.current=null,p.current!=="")p.current="",m?.(!1)},[f,l,g,m]);let b=dn.useMemo(()=>({onKeyDown:d,onBlur:C}),[d,C]);return dn.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Id=0.1,nb=Id*Id,Qe=0.5;function qi(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function Xi(e,t,o,r,n,a,s,i,c,u){let l=!1;if(qi(e,t,o,r,n,a))l=!l;if(qi(e,t,n,a,s,i))l=!l;if(qi(e,t,s,i,c,u))l=!l;if(qi(e,t,c,u,o,r))l=!l;return l}function ab(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function ji(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function Du(e={}){let{blockPointerEvents:t=!1}=e,o=new eo,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],f=!1,g=null,p=null,w=typeof performance<"u"?performance.now():0;function I(C,b){let h=performance.now(),S=h-w;if(g===null||p===null||S===0)return g=C,p=b,w=h,!1;let y=C-g,x=b-p,v=y*y+x*x,T=S*S*nb;return g=C,p=b,w=h,v<T}function d(){o.clear(),c()}return function(b){o.clear();let{domReference:h,floating:S}=i;if(!h||!S||m==null||n==null||a==null)return;let{clientX:y,clientY:x}=b,v=Ze(b),T=b.type==="mouseleave",M=fe(S,v),B=fe(h,v);if(M){if(f=!0,!T)return}if(B){if(f=!1,!T){f=!0;return}}if(T&&He(b.relatedTarget)&&fe(S,b.relatedTarget))return;function E(){return Boolean(l&&Do(l.nodesRef.current,u).length>0)}function F(){if(!E())d()}if(E())return;let A=h.getBoundingClientRect(),R=S.getBoundingClientRect(),O=n>R.right-R.width/2,X=a>R.bottom-R.height/2,P=R.width>A.width,N=R.height>A.height,W=(P?A:R).left,J=(P?A:R).right,k=(N?A:R).top,ne=(N?A:R).bottom;if(m==="top"&&a>=A.bottom-1||m==="bottom"&&a<=A.top+1||m==="left"&&n>=A.right-1||m==="right"&&n<=A.left+1){F();return}let H=!1;switch(m){case"top":H=ji(y,x,W,A.top+1,J,R.bottom-1);break;case"bottom":H=ji(y,x,W,R.top+1,J,A.bottom-1);break;case"left":H=ji(y,x,R.right-1,ne,A.left+1,k);break;case"right":H=ji(y,x,A.right-1,ne,R.left+1,k);break;default:}if(H)return;if(f&&!ab(y,x,A)){F();return}if(!T&&I(y,x)){F();return}let Y=!1;switch(m){case"top":{let z=P?Qe/2:Qe*4,ae=P?n+z:O?n+z:n-z,we=P?n-z:O?n+z:n-z,ee=a+Qe+1,ce=O?R.bottom-Qe:P?R.bottom-Qe:R.top,_=O?P?R.bottom-Qe:R.top:R.bottom-Qe;Y=Xi(y,x,ae,ee,we,ee,R.left,ce,R.right,_);break}case"bottom":{let z=P?Qe/2:Qe*4,ae=P?n+z:O?n+z:n-z,we=P?n-z:O?n+z:n-z,ee=a-Qe,ce=O?R.top+Qe:P?R.top+Qe:R.bottom,_=O?P?R.top+Qe:R.bottom:R.top+Qe;Y=Xi(y,x,ae,ee,we,ee,R.left,ce,R.right,_);break}case"left":{let z=N?Qe/2:Qe*4,ae=N?a+z:X?a+z:a-z,we=N?a-z:X?a+z:a-z,ee=n+Qe+1,ce=X?R.right-Qe:N?R.right-Qe:R.left,_=X?N?R.right-Qe:R.left:R.right-Qe;Y=Xi(y,x,ce,R.top,_,R.bottom,ee,ae,ee,we);break}case"right":{let z=N?Qe/2:Qe*4,ae=N?a+z:X?a+z:a-z,we=N?a-z:X?a+z:a-z,ee=n-Qe,ce=X?R.left+Qe:N?R.left+Qe:R.right,_=X?N?R.left+Qe:R.right:R.left+Qe;Y=Xi(y,x,ee,ae,ee,we,ce,R.top,_,R.bottom);break}default:}if(!Y)F();else if(!f)o.start(40,F);return}};return r.__options={...e,blockPointerEvents:t},r}function bd(e,t,o){let{reference:r,floating:n}=e,a=ho(t),s=ka(t),i=Ma(s),c=fo(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,f=r[i]/2-n[i]/2,g;switch(c){case"top":g={x:l,y:r.y-n.height};break;case"bottom":g={x:l,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:m};break;case"left":g={x:r.x-n.width,y:m};break;default:g={x:r.x,y:r.y}}let p=wo(t);if(p)g[s]+=f*(p==="end"?1:-1)*(o&&u?-1:1);return g}async function Cd(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:f=!1,padding:g=0}=ar(t,e),p=Ii(g),I=i[f?m==="floating"?"reference":"floating":m],d=un(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(I)))!=null?o:!0)?I:I.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),C=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),h=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=un(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:b,strategy:c}):C);return{top:(d.top-S.top+p.top)/h.y,bottom:(S.bottom-d.bottom+p.bottom)/h.y,left:(d.left-S.left+p.left)/h.x,right:(S.right-d.right+p.right)/h.x}}var sb=50,Sd=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:Cd},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=bd(u,r,c),f=r,g=0,p={};for(let w=0;w<a.length;w++){let I=a[w];if(!I)continue;let{name:d,fn:C}=I,{x:b,y:h,data:S,reset:y}=await C({x:l,y:m,initialPlacement:r,placement:f,strategy:n,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=b!=null?b:l,m=h!=null?h:m,p[d]={...p[d],...S},y&&g<sb){if(g++,typeof y==="object"){if(y.placement)f=y.placement;if(y.rects)u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:l,y:m}=bd(u,f,c))}w=-1}}return{x:l,y:m,placement:f,strategy:n,middlewareData:p}};var wd=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...I}=ar(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let d=fo(n),C=ho(i),b=fo(i)===i,h=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=f||(b||!w?[Ea(i)]:wp(i)),y=p!=="none";if(!f&&y)S.push(...xp(i,w,p,h));let x=[i,...S],v=await c.detectOverflow(t,I),T=[],M=((r=a.flip)==null?void 0:r.overflows)||[];if(l)T.push(v[d]);if(m){let A=Sp(n,s,h);T.push(v[A[0]],v[A[1]])}if(M=[...M,{placement:n,overflows:T}],!T.every((A)=>A<=0)){var B,E;let A=(((B=a.flip)==null?void 0:B.index)||0)+1,R=x[A];if(R){if(!(m==="alignment"?C!==ho(R):!1)||M.every((P)=>ho(P.placement)===C?P.overflows[0]>0:!0))return{data:{index:A,overflows:M},reset:{placement:R}}}let O=(E=M.filter((X)=>X.overflows[0]<=0).sort((X,P)=>X.overflows[1]-P.overflows[1])[0])==null?void 0:E.placement;if(!O)switch(g){case"bestFit":{var F;let X=(F=M.filter((P)=>{if(y){let N=ho(P.placement);return N===C||N==="y"}return!0}).map((P)=>[P.placement,P.overflows.filter((N)=>N>0).reduce((N,W)=>N+W,0)]).sort((P,N)=>P[1]-N[1])[0])==null?void 0:F[0];if(X)O=X;break}case"initialPlacement":O=i;break}if(n!==O)return{reset:{placement:O}}}return{}}}};var xd=new Set(["left","top"]);async function ib(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=fo(o),i=wo(o),c=ho(o)==="y",u=xd.has(s)?-1:1,l=a&&c?-1:1,m=ar(t,e),{mainAxis:f,crossAxis:g,alignmentAxis:p}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof p==="number")g=i==="end"?p*-1:p;return c?{x:g*l,y:f*u}:{x:f*u,y:g*l}}var yd=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await ib(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},Rd=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(C)=>{let{x:b,y:h}=C;return{x:b,y:h}}},...u}=ar(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),f=ho(n),g=hi(f),p=l[g],w=l[f],I=(C,b)=>gi(b+m[C==="y"?"top":"left"],b,b-m[C==="y"?"bottom":"right"]);if(s)p=I(g,p);if(i)w=I(f,w);let d=c.fn({...t,[g]:p,[f]:w});return{...d,data:{x:d.x-o,y:d.y-r,enabled:{[g]:s,[f]:i}}}}}},vd=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=ar(e,t),f={x:n,y:a},g=ho(s),p=hi(g),w=f[p],I=f[g],d=ar(u,t),C=typeof d==="number"?{mainAxis:d,crossAxis:0}:{mainAxis:(o=d.mainAxis)!=null?o:0,crossAxis:(r=d.crossAxis)!=null?r:0};if(l){let S=p==="y"?"height":"width",y=i.reference[p]-i.floating[S]+C.mainAxis,x=i.reference[p]+i.reference[S]-C.mainAxis;if(w<y)w=y;else if(w>x)w=x}if(m){var b,h;let S=p==="y"?"width":"height",y=xd.has(fo(s)),x=i.reference[g]-i.floating[S]+(y?((b=c.offset)==null?void 0:b[g])||0:0)+(y?0:C.crossAxis),v=i.reference[g]+i.reference[S]+(y?0:((h=c.offset)==null?void 0:h[g])||0)-(y?C.crossAxis:0);if(I<x)I=x;else if(I>v)I=v}return{[p]:w,[g]:I}}}},Td=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=ar(e,t),c=await n.detectOverflow(t,i),u=fo(o),l=wo(o),m=ho(o)==="y",{width:f,height:g}=r.floating,p,w;if(u==="top"||u==="bottom")p=u,w=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else w=u,p=l==="end"?"top":"bottom";let I=g-c.top-c.bottom,d=f-c.left-c.right,C=Hr(g-c[p],I),b=Hr(f-c[w],d),h=t.middlewareData.shift,S=!h,y=C,x=b;if(h!=null&&h.enabled.x)x=d;if(h!=null&&h.enabled.y)y=I;if(S&&!l)if(m)x=f-2*Zo(c.left,c.right);else y=g-2*Zo(c.top,c.bottom);await s({...t,availableWidth:x,availableHeight:y});let v=await n.getDimensions(a.floating);if(f!==v.width||g!==v.height)return{reset:{rects:!0}};return{}}}};function Ad(e){let t=jt(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Ge(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=Pa(o)!==a||Pa(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Ou(e){return!He(e)?e.contextElement:e}function Wn(e){let t=Ou(e);if(!Ge(t))return nr(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=Ad(t),s=(a?Pa(o.width):o.width)/r,i=(a?Pa(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var cb=nr(0);function Md(e){let t=ze(e);if(!Gs()||!t.visualViewport)return cb;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lb(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===ze(e)}function gn(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Ou(e),s=nr(1);if(t)if(r){if(He(r))s=Wn(r)}else s=Wn(e);let i=lb(a,o,r)?Md(a):nr(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let f=ze(a),g=He(r)?ze(r):r,p=f,w=zs(p);while(w&&g!==p){let I=Wn(w),d=w.getBoundingClientRect(),C=jt(w),b=d.left+(w.clientLeft+parseFloat(C.paddingLeft))*I.x,h=d.top+(w.clientTop+parseFloat(C.paddingTop))*I.y;c*=I.x,u*=I.y,l*=I.x,m*=I.y,c+=b,u+=h,p=ze(w),w=zs(p)}}return un({width:l,height:m,x:c,y:u})}function $i(e,t){let o=ia(e).scrollLeft;if(!t)return gn(or(e)).left+o;return t.left+o}function kd(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-$i(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function ub(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=or(r),i=t?sa(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=nr(1),l=nr(0),m=Ge(r);if(m||!a){if(vt(r)!=="body"||nn(s))c=ia(r);if(m){let g=gn(r);u=Wn(r),l.x=g.x+r.clientLeft,l.y=g.y+r.clientTop}}let f=s&&!m&&!a?kd(s,c):nr(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+f.x,y:o.y*u.y-c.scrollTop*u.y+l.y+f.y}}function mb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fb(e){let t=ia(e),o=e.ownerDocument.body,r=Zo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=Zo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+$i(e),s=-t.scrollTop;if(jt(o).direction==="rtl")a+=Zo(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var pb=25;function db(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=ze(e),a=or(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let f=!Gs()||t==="fixed";if(r){if(!f)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,f)u=s.offsetLeft,l=s.offsetTop}if($i(a)<=0){let f=a.ownerDocument,g=f.body,p=getComputedStyle(g),w=f.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,I=Math.abs(a.clientWidth-g.clientWidth-w),d=getComputedStyle(a).scrollbarGutter==="stable both-edges"?I/2:I;if(d<=pb)i-=d}return{width:i,height:c,x:u,y:l}}function gb(e,t){let o=gn(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=Wn(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function Ed(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=db(e,o,t);else if(t==="document")r=fb(or(e));else if(He(t))r=gb(t,o);else{let n=Md(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return un(r)}function hb(e,t){let o=t.get(e);if(o)return o;let r=kr(e,[],!1).filter((i)=>He(i)&&vt(i)!=="body"),n=null,a=jt(e).position==="fixed",s=a?Mo(e):e;while(He(s)&&!ko(s)){let i=jt(s),c=Ws(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=Mo(s)}return t.set(e,r),r}function Ib(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?sa(t)?[]:hb(t,this._c):[].concat(o),r],i=Ed(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let f=1;f<s.length;f++){let g=Ed(t,s[f],n);c=Zo(g.top,c),u=Hr(g.right,u),l=Hr(g.bottom,l),m=Zo(g.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function bb(e){let{width:t,height:o}=Ad(e);return{width:t,height:o}}function Cb(e,t,o){let r=Ge(t),n=or(t),a=o==="fixed",s=gn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=nr(0);if(r||!a){if(vt(t)!=="body"||nn(n))i=ia(t);if(r){let f=gn(t,!0,a,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}}if(!r&&n)c.x=$i(n);let u=n&&!r&&!a?kd(n,i):nr(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function Fu(e){return jt(e).position==="static"}function Pd(e,t){if(!Ge(e)||jt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(or(e)===o)o=o.ownerDocument.body;return o}function Ld(e,t){let o=ze(e);if(sa(e))return o;if(!Ge(e)){let n=Mo(e);while(n&&!ko(n)){if(He(n)&&!Fu(n))return n;n=Mo(n)}return o}let r=Pd(e,t);while(r&&Ff(r)&&Fu(r))r=Pd(r,t);if(r&&ko(r)&&Fu(r)&&!Ws(r))return o;return r||Of(e)||o}var Sb=async function(e){let t=this.getOffsetParent||Ld,o=this.getDimensions,r=await o(e.floating);return{reference:Cb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wb(e){return jt(e).direction==="rtl"}var Nu={convertOffsetParentRelativeRectToViewportRelativeRect:ub,getDocumentElement:or,getClippingRect:Ib,getOffsetParent:Ld,getElementRects:Sb,getClientRects:mb,getDimensions:bb,getScale:Wn,isElement:He,isRTL:wb};function Dd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xb(e,t,o){let r=null,n,a=or(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let f=e.getBoundingClientRect(),{left:g,top:p,width:w,height:I}=f;if(!l)t();if(!w||!I)return;let d=Aa(p),C=Aa(a.clientWidth-(g+w)),b=Aa(a.clientHeight-(p+I)),h=Aa(g),y={rootMargin:-d+"px "+-C+"px "+-b+"px "+-h+"px",threshold:Zo(0,Hr(1,m))||1},x=!0;function v(T){let M=T[0].intersectionRatio;if(!Dd(f,e.getBoundingClientRect()))return i();if(M!==m){if(!x)return i();if(!M)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,M)}x=!1}try{r=new IntersectionObserver(v,{...y,root:a.ownerDocument})}catch(T){r=new IntersectionObserver(v,y)}r.observe(e)}let c=ze(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function Xa(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Ou(e),l=n||a?[...u?kr(u):[],...t?kr(t):[]]:[];l.forEach((d)=>{n&&d.addEventListener("scroll",o),a&&d.addEventListener("resize",o)});let m=u&&i?xb(u,o,a):null,f=-1,g=null;if(s){if(g=new ResizeObserver((d)=>{let[C]=d;if(C&&C.target===u&&g&&t)g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)});o()}),u&&!c)g.observe(u);if(t)g.observe(t)}let p,w=c?gn(e):null;if(c)I();function I(){let d=gn(e);if(w&&!Dd(w,d))o();w=d,p=requestAnimationFrame(I)}return o(),()=>{var d;if(l.forEach((C)=>{n&&C.removeEventListener("scroll",o),a&&C.removeEventListener("resize",o)}),m==null||m(),(d=g)==null||d.disconnect(),g=null,c)cancelAnimationFrame(p)}}var Fd=yd;var Od=Rd,Nd=wd,Bd=Td;var Hd=vd,Yi=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...Nu,...n.platform,_c:r};return Sd(e,t,{...n,platform:a})};import*as Ht from"react";import{useLayoutEffect as Rb}from"react";import*as Ud from"react-dom";var vb=typeof document<"u",Tb=function(){},Ki=vb?Rb:Tb;function Ji(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 o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!Ji(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!Ji(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function _d(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vd(e,t){let o=_d(e);return Math.round(t*o)/o}function Bu(e){let t=Ht.useRef(e);return Ki(()=>{t.current=e}),t}function Wd(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=Ht.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=Ht.useState(r);if(!Ji(f,r))g(r);let[p,w]=Ht.useState(null),[I,d]=Ht.useState(null),C=Ht.useCallback((P)=>{if(P!==y.current)y.current=P,w(P)},[]),b=Ht.useCallback((P)=>{if(P!==x.current)x.current=P,d(P)},[]),h=a||p,S=s||I,y=Ht.useRef(null),x=Ht.useRef(null),v=Ht.useRef(l),T=c!=null,M=Bu(c),B=Bu(n),E=Bu(u),F=Ht.useCallback(()=>{if(!y.current||!x.current)return;let P={placement:t,strategy:o,middleware:f};if(B.current)P.platform=B.current;Yi(y.current,x.current,P).then((N)=>{let W={...N,isPositioned:E.current!==!1};if(A.current&&!Ji(v.current,W))v.current=W,Ud.flushSync(()=>{m(W)})})},[f,t,o,B,E]);Ki(()=>{if(u===!1&&v.current.isPositioned)v.current.isPositioned=!1,m((P)=>({...P,isPositioned:!1}))},[u]);let A=Ht.useRef(!1);Ki(()=>(A.current=!0,()=>{A.current=!1}),[]),Ki(()=>{if(h)y.current=h;if(S)x.current=S;if(h&&S){if(M.current)return M.current(h,S,F);F()}},[h,S,F,M,T]);let R=Ht.useMemo(()=>({reference:y,floating:x,setReference:C,setFloating:b}),[C,b]),O=Ht.useMemo(()=>({reference:h,floating:S}),[h,S]),X=Ht.useMemo(()=>{let P={position:o,left:0,top:0};if(!O.floating)return P;let N=Vd(O.floating,l.x),W=Vd(O.floating,l.y);if(i)return{...P,transform:"translate("+N+"px, "+W+"px)",..._d(O.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:N,top:W}},[o,i,O.floating,l.x,l.y]);return Ht.useMemo(()=>({...l,update:F,refs:R,elements:O,floatingStyles:X}),[l,F,R,O,X])}var Hu=(e,t)=>{let o=Fd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Vu=(e,t)=>{let o=Od(e);return{name:o.name,fn:o.fn,options:[e,t]}},Uu=(e,t)=>({fn:Hd(e).fn,options:[e,t]}),_u=(e,t)=>{let o=Nd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Wu=(e,t)=>{let o=Bd(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as Qi from"react";var Eb=Qi.createContext(void 0);function Gd(e){let t=Qi.useContext(Eb);if(t===void 0&&!e)throw Error(Je(69));return t}var Pb="ArrowUp",Ab="ArrowDown",Mb="ArrowLeft",kb="ArrowRight",Lb="Home",Db="End";var ec=new Set([Pb,Ab,Mb,kb,Lb,Db]);function tc(e){return e==="starting"?Vp:_e}import*as oc from"react";var Fb=oc.createContext(void 0);function zd(){return oc.useContext(Fb)}import*as rc from"react";function Ob(e,t){let o=aa(e.render);if(rc.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function Zd(e,t,o){let r=Ob(e,t),n=r===t?void 0:r,a=rc.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as qd from"react";function Xd(e,t,o){let r=aa(e.render),n=qd.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as jd}from"react/jsx-runtime";var Nb=hn.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:f,virtualFocus:g,orientation:p}=go(),w=zd(),{side:I,align:d}=Wf(),C=Gd(!0)!=null,b=l.useState("open"),h=l.useState("transitionStatus"),S=l.useState("popupProps"),y=l.useState("mounted"),x=l.useState("instantType"),v=l.useState("activeTriggerElement"),T=l.useState("parent"),M=l.useState("lastOpenChangeReason"),B=l.useState("rootId"),E=l.useState("floatingRootContext"),F=l.useState("floatingTreeRoot"),A=l.useState("closeDelay"),R=l.useState("hoverEnabled"),O=l.useState("disabled"),X=l.useState("openMethod"),P=l.useState("activeTriggerId"),N=l.useState("listElement"),[W,J]=Zd(t,m,f),k=Xd(t,v,P),ne=T.type==="menu"?w:void 0,H=T.type==="context-menu",Y=c??T.type!=="menu";if(c===void 0&&N&&T.type!=="menu")Y=()=>{if(l.state.activeIndex!==null)return!1;return N};Fr({open:b,ref:l.context.popupRef,onComplete(){if(b)l.context.onOpenChangeComplete?.(!0)}}),hn.useEffect(()=>{function G(ie){l.setOpen(!1,Me(ie.reason,ie.domEvent))}return F.events.on("close",G),()=>{F.events.off("close",G)}},[F.events,l]),Pu(E,{enabled:R&&!O&&!H&&T.type!=="menubar",closeDelay:A});let z=l.useStateSetter("popupElement"),ae=hn.useContext(Fl)?.useParentHandoff??Hb,{parentVirtualFocusRef:we,handleFocus:ee}=ae(l,T,b,g),ce={transitionStatus:h,side:I,align:d,open:b,nested:T.type==="menu",instant:x},_=ke("div",t,{state:ce,ref:[o,l.context.popupRef,z,J],stateAttributesMapping:Js,props:[S,{id:W,...N?{role:"presentation"}:{role:"menu","aria-orientation":p==="horizontal"?"horizontal":void 0,"aria-labelledby":k},onKeyDown(G){if(ne?.onPopupKeyDown?.(G),C&&ec.has(G.key))G.stopPropagation()},onFocus:ee},tc(h),u,{"data-rootownerid":B}]}),K=T.type===void 0||H;if(v||T.type==="menubar"&&M!==kl)K=!0;let U=ne?.getReturnElement??we;return jd(Ha,{context:E,openInteractionType:X,modal:H,disabled:!y,returnFocus:s??U??K,explicitReturnFocus:s===void 0&&U?!1:void 0,initialFocus:Y,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type!=="menubar"?F:void 0,previousFocusableElement:v,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:_})}),Bb={parentVirtualFocusRef:void 0,handleFocus:void 0};function Hb(){return Bb}var $d=hn.forwardRef(function(t,o){let r=Ol()?.Popup??Nb;return jd(r,{...t,ref:o})});import*as Jd from"react";import*as nc from"react";var Gu=nc.createContext(void 0);function Yd(){let e=nc.useContext(Gu);if(e===void 0)throw Error(Je(32));return e}import{jsx as Kd}from"react/jsx-runtime";var Qd=Jd.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=go();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return Kd(Gu.Provider,{value:r,children:Kd(Na,{ref:o,...n,portalOwnerRole:u})})});import*as Gr from"react";function Gn(e){if(En(19))return e;return e?"true":void 0}import*as yo from"react";import*as Fo from"react";function e0(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=Fo.useState(null),m=Fo.useRef(null),f=to(o),g=Fo.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),p=Wd({...e,elements:{...g,...u&&{reference:u}}}),w=Fo.useCallback((b)=>{let h=He(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;l(h),p.refs.setReference(h)},[p.refs]),I=Fo.useMemo(()=>({...p.refs,setPositionReference:w,domReference:m}),[p.refs,w]),d=Fo.useMemo(()=>({...p.elements,domReference:s}),[p.elements,s]),C=Fo.useMemo(()=>({...p,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:I,elements:d,nodeId:t,rootStore:r}),[p,I,d,t,r,i,c]);return q(()=>{if(s)m.current=s},[s]),q(()=>{r.context.dataRef.current.floatingContext=C;let b=f?.nodesRef.current.find((h)=>h.id===t);if(b)b.context=C}),Fo.useMemo(()=>({...p,context:C,refs:I,elements:d,rootStore:r}),[p,I,d,C,r])}import*as ac from"react";var Vb=ac.createContext(void 0);function sc(){return ac.useContext(Vb)?.direction??"ltr"}var Ub=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=ar(e,t)||{};if(u==null)return{};let m=Ii(l),f={x:o,y:r},g=ka(n),p=Ma(g),w=await s.getDimensions(u),I=g==="y",d=I?"top":"left",C=I?"bottom":"right",b=I?"clientHeight":"clientWidth",h=a.reference[p]+a.reference[g]-f[g]-a.floating[p],S=f[g]-a.reference[g],y=i.floating[b]||a.floating[p],x=h/2-S/2,v=y/2-w[p]/2-1,T=Math.min(m[d],v),M=Math.min(m[C],v),B=T,E=y-w[p]-M,F=y/2-w[p]/2+x,A=gi(B,F,E),R=!c.arrow&&wo(n)!=null&&F!==A&&a.reference[p]/2-(F<B?T:M)-w[p]/2<0,O=R?F<B?F-B:F-E:0;return{[g]:f[g]+O,data:{[g]:A,centerOffset:F-A-O,...R&&{alignmentOffset:O}},reset:R}}}),t0=(e,t)=>{let{name:o,fn:r}=Ub(e);return{name:o,fn:r,options:[e,t]}};var o0={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var r0={sideX:"left",sideY:"top"};var n0="--available-width",a0="--available-height",s0="--anchor-width",i0="--anchor-height",c0="--transform-origin";var l0=n0,u0=a0;function p0(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function m0(e,t,o){let{rects:r,placement:n}=e;return{side:p0(t,fo(n),o),align:wo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function d0(e){return Wb(e,e0)}function Wb(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:f=!1,inline:g,keepMounted:p=!1,floatingRootContext:w,mounted:I,collisionAvoidance:d,shift:C,nodeId:b,adaptiveOrigin:h,lazyFlip:S=!1,externalTree:y}=e,x=d.side||"flip",v=d.align||"flip",T=d.fallbackAxisSide||"end",M=C?.crossAxis??!1,B=C?.rootBoundary,E=typeof o==="function"?o:void 0,F=re(E),A=E?F:o,R=lt(o),O=lt(I),P=sc()==="rtl",[N,W]=yo.useState(null);if(!I&&N!==null)W(null);let J=S==="placement",k=N?fo(N):null,ne=N&&J?wo(N)||"center":null,H=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[n],Y=ne||s,z=Y==="center"?H:`${H}-${Y}`,ae=u;if(typeof ae==="number")ae={top:ae,right:ae,bottom:ae,left:ae};else if(ae)ae={top:ae.top||0,right:ae.right||0,bottom:ae.bottom||0,left:ae.left||0};let we=1,ee=n==="bottom"?we:0,ce=n==="top"?we:0,_=n==="right"?we:0,K=n==="left"?we:0,U={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:ae},G=yo.useRef(null),ie=lt(a),pe=lt(i),Ee=typeof a!=="function"?a:0,Fe=typeof i!=="function"?i:0,le=[];if(g)le.push(g);le.push(Hu((We)=>{let Nt=m0(We,n,P),Ce=typeof ie.current==="function"?ie.current(Nt):ie.current,ve=typeof pe.current==="function"?pe.current(Nt):pe.current;return{mainAxis:Ce,crossAxis:ve,alignmentAxis:ve}},[Ee,Fe,P,n]));let Ie=v==="none"&&x!=="shift",se=!Ie&&(l||M||x==="shift"),Ne=x==="none"?null:_u({...U,padding:{top:ae.top+we+ee,right:ae.right+we+K,bottom:ae.bottom+we+ce,left:ae.left+we+_},mainAxis:!M&&x==="flip",crossAxis:v==="flip"?"alignment":!1,fallbackAxisSideDirection:T}),ue=Ie?null:Vu({...U,rootBoundary:B,mainAxis:v!=="none",crossAxis:se,limiter:l||M?void 0:Uu((We)=>{if(!G.current)return{};let{width:Nt,height:Ce}=G.current.getBoundingClientRect(),ve=ho(fo(We.placement)),Ve=ve==="y"?Nt:Ce,Bt=ve==="y"?ae.left+ae.right:ae.top+ae.bottom;return{offset:Ve/2+Bt/2}})},[U,l,M,B,ae,v]);if(x==="shift"||v==="shift"||Y==="center")le.push(ue,Ne);else le.push(Ne,ue);le.push(Wu({...U,apply({elements:{floating:We},availableWidth:Nt,availableHeight:Ce,rects:ve}){if(!O.current)return;let Ve=We.style;Ve.setProperty(l0,`${Nt}px`),Ve.setProperty(u0,`${Ce}px`);let Bt=ze(We).devicePixelRatio||1,{x:Gt,y:co,width:Vt,height:bo}=ve.reference,Bo=(Math.round((Gt+Vt)*Bt)-Math.round(Gt*Bt))/Bt,Ro=(Math.round((co+bo)*Bt)-Math.round(co*Bt))/Bt;Ve.setProperty(s0,`${Bo}px`),Ve.setProperty(i0,`${Ro}px`)}}),t0((We)=>({element:G.current||ye(We.elements.floating).createElement("div"),padding:G.current?m:0}),[m]),{name:"transformOrigin",fn(We){let{elements:{floating:Nt},middlewareData:Ce,placement:ve,platform:Ve,rects:Bt,y:Gt}=We,co=fo(ve),Vt=wo(ve),bo=ho(co)==="y",Bo=G.current,Ro=typeof a==="function"?a(m0(We,n,P)):a,wn;if(!Bo&&Vt&&Math.abs(bo?Ce.shift?.x||0:Ce.shift?.y||0)<=1)wn=Vt==="start"===(bo&&Ve.isRTL?.(Nt)===!0)?"100%":"0%";else{let $r=bo?Ce.arrow?.x||0:Ce.arrow?.y||0,Yr=bo?Bo?.clientWidth||0:Bo?.clientHeight||0;wn=`${$r+Yr/2}px`}let Yo=co==="top"||co==="left"?`calc(100% + ${Ro}px)`:`${-Ro}px`;if(se&&bo&&Math.abs(Ce.shift?.y||0)>Ro)Yo=`${Bt.reference.y+Bt.reference.height/2-Gt}px`;return Nt.style.setProperty(c0,bo?`${wn} ${Yo}`:`${Yo} ${wn}`),{}}},o0,h),q(()=>{if(!I&&w)w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[I,w]);let Se=yo.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:L,elements:V,x:be,y:j,middlewareData:oe,update:de,placement:ge,context:he,isPositioned:Ae,floatingStyles:je}=t({rootContext:w,open:p?I:void 0,placement:z,middleware:le,strategy:r,whileElementsMounted:p?void 0:(...We)=>Xa(...We,Se),nodeId:b,externalTree:y}),{sideX:ct,sideY:so}=oe.adaptiveOrigin||r0,io=Ae?r:"fixed",No=yo.useMemo(()=>{let We;if(!Ae)We={position:io,top:0,left:0};else if(h)We={position:io,[ct]:be,[so]:j};else We={...je,position:io};if(We[l0]="100vw",We[u0]="100vh",!Ae)We.opacity=0;return We},[h,io,ct,be,so,j,je,Ae]),qt=yo.useRef(null);q(()=>{if(!I)return;let We=R.current,Nt=typeof We==="function"?We():We,ve=(f0(Nt)?Nt.current:Nt)||null||null;if(ve!==qt.current)L.setPositionReference(ve),qt.current=ve},[I,L,A,R]),yo.useEffect(()=>{if(!I)return;let We=R.current;if(typeof We==="function")return;if(f0(We)&&We.current!==qt.current)L.setPositionReference(We.current),qt.current=We.current},[I,L,A,R]),yo.useEffect(()=>{if(p&&I&&V.reference&&V.floating)return Xa(V.reference,V.floating,de,Se);return},[p,I,V,de,Se]);let Wt=fo(ge),po=p0(n,Wt,P),Io=wo(ge)||"center",Jt=Boolean(oe.hide?.referenceHidden);q(()=>{if(S&&I&&Ae&&(Wt!==H||J&&Io!==Y))W(ge)},[S,J,I,Ae,ge,Wt,Io,H,Y]);let Xr=yo.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),jr=oe.arrow?.centerOffset!==0;return yo.useMemo(()=>({positionerStyles:No,arrowStyles:Xr,arrowRef:G,arrowUncentered:jr,side:po,align:Io,physicalSide:Wt,anchorHidden:Jt,refs:L,context:he,isPositioned:Ae,update:de}),[No,Xr,G,jr,po,Io,Wt,Jt,L,he,Ae,de])}function f0(e){return e!=null&&"current"in e}import*as xr from"react";import{jsx as Gb}from"react/jsx-runtime";function g0(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=re(n),[,s]=xr.useState(0),i=qe(Zb).current,c=qe(zb).current,u=xr.useRef(0),l=xr.useRef(!0),m=xr.useRef(null),f=xr.useRef(null),g=re(()=>{if(l.current)return;l.current=!0,s((S)=>S+1)}),p=re((S,y)=>{c.set(S,y),g()}),w=re((S)=>{c.delete(S),g()}),I=re((S)=>{let y=new Map;if(o.current.length=0,r)r.current.length=0;return S.forEach((x)=>{if(y.set(x.element,{...x.registration.metadata??{},index:x.index}),o.current[x.index]=x.element,r)r.current[x.index]=x.registration.label!==void 0?x.registration.label:x.registration.textRef?.current?.textContent??x.element.textContent}),u.current=o.current.length,y});function d(S){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=="function"||S.length<2)return;let y=new MutationObserver((v)=>{if(!jb(v))return;let T=null;for(let M of S){if(!M.isConnected)continue;if(T&&h0(T,M)>0){y.disconnect(),g();return}T=M}});f.current=y;let x=new Set;for(let v=1;v<S.length;v+=1){let T=Xb(S[v-1],S[v]);if(T)x.add(T)}x.forEach((v)=>y.observe(v,{childList:!0}))}let C=re(()=>{let[S,y]=qb(c),x=I(S),v=m.current,T=!v||v.length!==S.length||S.some((M,B)=>{let E=v[B];return M.index!==E.index||M.element!==E.element||M.registration.index!==E.registration.index||M.registration.metadata!==E.registration.metadata});if(d(y),m.current=S,l.current=!1,!T)return;i.forEach((M)=>M(x)),a(x)});q(()=>{if(!l.current&&m.current)I(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,I]),q(()=>{if(l.current)C()}),q(()=>()=>{f.current?.disconnect(),l.current=!0},[]);let b=re((S)=>(i.add(S),()=>{i.delete(S)})),h=xr.useMemo(()=>({register:p,unregister:w,subscribeMapChange:b,nextIndexRef:u}),[p,w,b,u]);return Gb(Ul.Provider,{value:h,children:t})}function zb(){return new Map}function Zb(){return new Set}function qb(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>h0(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function Xb(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function jb(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function h0(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as I0 from"react";import{jsx as $b}from"react/jsx-runtime";var ic=I0.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return $b("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as zu from"react";function b0(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=zu.useRef(null),s=zu.useRef(null),i=Bn(r);q(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),q(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function C0(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return ke("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},tc(r),n],stateAttributesMapping:ga})}import*as v0 from"react";var S0={},w0={},x0="";function cc(e,t){return nn(e)?e:t}function y0(e,t,o){return/hidden|clip/.test(e.getComputedStyle(cc(t,o)).overflowY)}function Yb(e){if(typeof document>"u")return!1;let t=ye(e);return ze(t).innerWidth-t.documentElement.clientWidth>0}function Kb(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=ye(e),{documentElement:r,body:n}=o,a=cc(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function Jb(e){let t=ye(e),{documentElement:o,body:r}=t,n=cc(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function Qb(e){let t=ye(e),{documentElement:o,body:r}=t,n=ze(o),a=0,s=0,i=!1,c=Lo.create();if(gr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let g=n.getComputedStyle(o),p=n.getComputedStyle(r),d=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,S0={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},x0=o.style.scrollBehavior,w0={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let C=o.scrollHeight>o.clientHeight,b=o.scrollWidth>o.clientWidth,h=g.overflowY==="scroll"||p.overflowY==="scroll",S=g.overflowX==="scroll"||p.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),x=Math.max(0,n.innerHeight-r.clientHeight),v=parseFloat(p.marginTop)+parseFloat(p.marginBottom),T=parseFloat(p.marginLeft)+parseFloat(p.marginRight),M=cc(o,r);if(i=Kb(e),i){o.style.scrollbarGutter=d,M.style.overflowY="hidden",M.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:d,overflowY:"hidden",overflowX:"hidden"}),C||h)o.style.overflowY="scroll";if(b||S)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:v||x?`calc(100dvh - ${v+x}px)`:"100dvh",width:T||y?`calc(100vw - ${T+y}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,S0),Object.assign(r.style,w0),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=x0}function m(){l(),c.request(u)}u();let f=Te(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")f()}}class R0{lockCount=0;restore=null;timeoutLock=eo.create();timeoutUnlock=eo.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ye(e),{documentElement:o,body:r}=t,n=ze(o);if(y0(n,o,r)){let s=new n.MutationObserver(()=>{if(y0(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=dr.ios||!Yb(e);this.restore=a?Jb(e):Qb(e)}}var eC=new R0;function lc(e=!0,t=null){q(()=>{if(!e)return;return eC.acquire(t)},[e,t])}var tC=20;function T0(e,t,o,r){let[n,a]=v0.useState(!1);q(()=>{if(!e||!t||o==null){a(!1);return}let s=ye(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-tC)},[e,t,o]),lc(e&&(!t||n),r)}import{jsx as Zu,jsxs as oC}from"react/jsx-runtime";var E0=Gr.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:f=5,arrowPadding:g=5,sticky:p=!1,disableAnchorTracking:w=!1,collisionAvoidance:I=Wp,style:d,...C}=t,{store:b,virtualFocus:h,syncHighlightedItem:S}=go(),y=Yd(),x=Fn(!0),v=b.useState("parent"),T=b.useState("floatingRootContext"),M=b.useState("floatingTreeRoot"),B=b.useState("mounted"),E=b.useState("open"),F=b.useState("modal"),A=b.useState("openMethod"),R=b.useState("activeTriggerElement"),O=b.useState("transitionStatus"),X=b.useState("positionerElement"),P=b.useState("instantType"),N=b.useState("adaptiveOrigin"),W=b.useState("lastOpenChangeReason"),J=b.useState("floatingNodeId"),k=b.useState("floatingParentNodeId"),ne=T.useState("domReferenceElement"),H=r,Y=u,z=l,ae=c,we=I;if(v.type==="context-menu"){if(H=r??v.context?.anchor,ae=ae??"start",!i&&ae!=="center")z=t.alignOffset??2,Y=t.sideOffset??-5}let ee=i,ce=ae;if(v.type==="menu")ee=ee??"inline-end",ce=ce??"start",we=t.collisionAvoidance??Gp;else if(v.type==="menubar")ee=ee??(v.context.orientation==="vertical"?"inline-end":"bottom"),ce=ce??"start";let _=v.type==="context-menu",K=d0({anchor:H,floatingRootContext:T,positionMethod:x?"fixed":n,mounted:B,side:ee,sideOffset:Y,align:ce,alignOffset:z,arrowPadding:_?0:g,collisionBoundary:m,collisionPadding:f,sticky:p,nodeId:J,keepMounted:y,disableAnchorTracking:w,collisionAvoidance:we,shift:_?{crossAxis:!(("side"in we)&&we.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:M,adaptiveOrigin:N,lazyFlip:h?"placement":!1});Gr.useEffect(()=>{function Ie(se){if(se.open){if(se.parentNodeId===J)b.set("hoverEnabled",!1);if(se.nodeId!==J&&se.parentNodeId===b.select("floatingParentNodeId"))b.setOpen(!1,Me(ba))}}return M.events.on("menuopenchange",Ie),()=>{M.events.off("menuopenchange",Ie)}},[b,M.events,J]),Gr.useEffect(()=>{if(b.select("floatingParentNodeId")==null)return;function Ie(se){if(se.open||se.nodeId!==b.select("floatingParentNodeId"))return;let Ne=se.reason??ba;b.setOpen(!1,Me(Ne))}return M.events.on("menuopenchange",Ie),()=>{M.events.off("menuopenchange",Ie)}},[M.events,b]);let U=rt();Gr.useEffect(()=>{if(!E)U.clear()},[E,U]),Gr.useEffect(()=>{function Ie(se){if(!E||se.nodeId!==b.select("floatingParentNodeId"))return;if(se.target&&R&&R!==se.target){let Ne=b.select("closeDelay");if(Ne>0){if(!U.isStarted())U.start(Ne,()=>{b.setOpen(!1,Me(ba))})}else b.setOpen(!1,Me(ba))}else U.clear()}return M.events.on("itemhover",Ie),()=>{M.events.off("itemhover",Ie)}},[M.events,E,R,b,U]),Gr.useEffect(()=>{let Ie={open:E,nodeId:J,parentNodeId:k,reason:b.select("lastOpenChangeReason")};M.events.emit("menuopenchange",Ie)},[M.events,E,b,J,k]),b0({store:b,domReference:ne,positionerElement:X,open:E});let G={open:E,side:K.side,align:K.align,anchorHidden:K.anchorHidden,nested:v.type==="menu",instant:P},ie=v.type==="menubar"&&v.context.modal,pe=F&&W!==uo;T0(E&&(ie||pe),A==="touch",X,R);let Ee=C0(t,G,{styles:K.positionerStyles,transitionStatus:O,props:C,refs:[o,b.useStateSetter("positionerElement")],hidden:!B,inert:!E}),Fe=B&&v.type!=="menu"&&(v.type!=="menubar"&&F&&W!==uo||v.type==="menubar"&&v.context.modal),le=null;if(v.type==="menubar")le=v.context.contentElement;else if(v.type===void 0)le=R;return oC(El.Provider,{value:K,children:[Fe&&Zu(ic,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Gn(!E),cutout:le}),Zu(uu,{id:J,children:Zu(g0,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:Ee})})]})});import*as st from"react";import*as uc from"react";var rC=uc.createContext(null);function mc(e){let t=uc.useContext(rC);if(t===null&&!e)throw Error(Je(5));return t}import*as $a from"react";import*as ja from"react";function P0(e){let t=ja.useRef(""),o=ja.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:ja.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as A0 from"react";function fc(e,t){let o=A0.useRef(e),r=re(t);q(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function qu(e,t){let o=re((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(dr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=P0(o);return $a.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function M0(e){let[t,o]=$a.useState(null),r=qu(e,o);return fc(e,(n)=>{if(n&&!e)o(null)}),$a.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function k0(e){if(e==null)return ha;if(e.type.startsWith("key"))return jf;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return _I;return ha}import*as zn from"react";var nC={...Un,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=Un.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>gr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!Un.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class Xu extends wr{constructor(e,t,o=!1){let r=new Ga,n=sC(r,t,o,e);super(n,aC(r),nC);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function aC(e){return{positionerRef:zn.createRef(),popupRef:zn.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:zn.createRef(),beforeTriggerFocusGuardRef:zn.createRef(),beforeContentFocusGuardRef:zn.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function sC(e,t,o=!1,r){return{...Hi(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:_e,inputProps:_e,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new fn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_e,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as L0 from"react";var ju=L0.createContext(null);function $u(e,t){return(e===ei||e===Ll)&&t?.detail===0}function D0(e,t){return e===ti||$u(e,t)}import{jsx as Ya,jsxs as iC}from"react/jsx-runtime";var cC=za(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:f,closeParentOnEsc:g=!1,handle:p,triggerId:w,defaultTriggerId:I=null,highlightItemOnHover:d=!0,isSubmenu:C=!1,virtualFocus:b=!1,virtualFocusRef:h,allowEscape:S=!0,resetOnPointerLeave:y=!0}=t,x=Fn(!0),v=go(!0),T=mc(!0),M=v?.store,B=v?.virtualFocus??!1,E=st.useMemo(()=>{if(C&&M)return{type:"menu",store:M};if(T)return{type:"menubar",context:T};if(x&&!M)return{type:"context-menu",context:x};return{type:void 0}},[x,M,T,C]),F=mo(),A=mo(),[R,O]=st.useState(void 0),X=(R??A)||void 0,P=xo(),N=E.type==="menu"?E.store:void 0,W=(r??i)&&N?.state.transitionStatus==="starting",J=qe(()=>W?N?.state.instantType:void 0).current,k=qe(()=>{let Ce=new Xu({open:i,openProp:r,activeTriggerId:I,triggerIdProp:w,parent:E,disabled:c,highlightItemOnHover:d,modal:E.type===void 0?u:void 0,rootId:F,instantType:J},X,P!=null);return Ce.context.virtualFocusRef=h,Ce}).current;k.useControlledProp("openProp",r),k.useControlledProp("triggerIdProp",w),k.useContextCallback("onOpenChangeComplete",a);let ne=k.useState("floatingTreeRoot"),H=Ba(ne),Y=k.useState("open"),z=k.useState("activeTriggerElement"),ae=k.useState("positionerElement"),we=k.useState("hoverEnabled"),ee=k.useState("disabled"),ce=k.useState("lastOpenChangeReason"),_=k.useState("parent"),K=k.useState("activeIndex"),U=k.useState("keyboardOpen"),G=k.useState("payload"),ie=k.useState("floatingParentNodeId"),pe=st.useRef(null),Ee=st.useRef(_.type!=="context-menu"),Fe=rt(),le=st.useRef(!0),Ie=rt(),se=ie!=null,{openMethod:Ne,triggerProps:ue}=M0(Y);k.useSyncedValues({disabled:c,highlightItemOnHover:d,modal:_.type===void 0?u:void 0,openMethod:Ne,rootId:F}),ki(k);let{forceUnmount:Se,transitionStatus:L}=Li(Y,k,()=>{k.set("allowMouseEnter",!1)},W),V=Bn(k.context.popupRef);st.useEffect(()=>{if(J===void 0)return;let Ce=()=>{if(k.state.instantType===J)k.set("instantType",void 0)};if(!Y){Ce();return}if(L!==void 0)return;if(k.context.popupRef.current==null){Ce();return}let ve=new AbortController;return V(Ce,ve.signal),()=>{ve.abort()}},[J,Y,L,V,k]),q(()=>{if(x&&!v)k.update({parent:{type:"context-menu",context:x},floatingNodeId:H,floatingParentNodeId:P});else if(v||!k.select("activeTriggerElement"))k.update({floatingNodeId:H,floatingParentNodeId:P})},[x,v,H,P,z,k]),st.useEffect(()=>{if(!Y)pe.current=null;if(_.type!=="context-menu")return;if(!Y){Fe.clear(),Ee.current=!1;return}Fe.start(500,()=>{Ee.current=!0})},[Fe,Y,_.type]),q(()=>{if(!Y&&!we)k.set("hoverEnabled",!0)},[Y,we,k]);let be=re((Ce,ve)=>{let Ve=ve.reason;if(!Ce&&!k.select("open"))return;if(Y===Ce&&ve.trigger===z&&ce===Ve)return;let Bt=ad(ve);if(!Ce&&ve.trigger==null)ve.trigger=z??void 0;if(n?.(Ce,ve),ve.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(Ce,ve);let Gt=ve.event;if(Ce===!1&&Ve!==Ll&&Gt?.type==="click"&&Gt.pointerType==="touch"&&!le.current)return;if(Ce&&Ve===Ia)le.current=!1,Ie.start(300,()=>{le.current=!0});else le.current=!0,Ie.clear();let co=!Ce&&(Ve===Dl||Ve==null);pe.current=ve.event;let Vt=Ai(k.state,Ce,ve.trigger,Bt());if(Vt.openChangeReason=Ve,Vt.keyboardOpen=Ce&&D0(Ve,Gt),_.type==="menubar"&&(Ve===Ia||Ve===On||Ve===uo||Ve===ti||Ve===ba))Vt.instantType="group";else if($u(Ve,Gt))Vt.instantType="click";else if(co)Vt.instantType="dismiss";else Vt.instantType=void 0;k.update(Vt)}),j=Wa({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:X,nested:P!=null,onOpenChange:be}),oe=j.context.events;q(()=>{let Ce=({open:ve,eventDetails:Ve})=>be(ve,Ve);return oe.on("setOpen",Ce),()=>{oe?.off("setOpen",Ce)}},[oe,be]),q(()=>k.subscribeToParentMenu(),[k]);let de=st.useCallback(()=>{k.setOpen(!1,Me($f))},[k]);st.useImperativeHandle(f,()=>({unmount:Se,close:de}),[Se,de]);let ge;if(_.type==="context-menu")ge=_.context;st.useImperativeHandle(ge?.positionerRef,()=>ae,[ae]),st.useImperativeHandle(ge?.actionsRef,()=>({setOpen:be}),[be]);let he=_a(j,{enabled:!ee,bubbles:{escapeKey:g&&_.type==="menu"},outsidePress(){if(_.type!=="context-menu"||pe.current?.type==="contextmenu")return!0;return Ee.current},externalTree:se?ne:void 0}),Ae=sc(),je=ku(j,{enabled:!ee,listRef:k.context.itemDomElements,activeIndex:K,virtual:b,nested:_.type==="menubar"||!b&&_.type!==void 0,parentOrientation:_.type==="menubar"?_.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?U:void 0,allowEscape:b&&l&&S,orientation:m,triggerOrientation:b?"vertical":m,rtl:Ae==="rtl",disabledIndices:pr,onNavigate(Ce,ve){k.setActiveIndex(Ce,k0(ve),ve?.nativeEvent)},openOnArrowKeyDown:_.type!=="context-menu"&&!(b&&C),externalTree:!b&&se?ne:void 0,nestedReturnFocusRef:N?.context.virtualFocusRef,focusItemOnHover:d,resetOnPointerLeave:y}),ct=st.useCallback((Ce)=>{k.context.typingRef.current=Ce},[k]),so=Lu(j,{enabled:!ee&&!b,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:K,resetMs:Bp,onMatch:(Ce,ve)=>{if(Y&&Ce!==K)k.setActiveIndex(Ce,jf,ve.nativeEvent)},onTyping:ct}),io=re(s),No=st.useRef(-1),qt=re(()=>{let Ce=k.state.activeIndex,ve=Ce===null?void 0:k.context.itemDomElements.current[Ce]??void 0;if(ve?.isConnected===!1)return;let Ve=ve===void 0?-1:Ce;if(No.current===Ve&&k.context.reportedItem===ve)return;if(No.current=Ve,k.context.reportedItem=ve,b)k.set("highlightedItem",ve);let{highlightReason:Bt,highlightEvent:Gt}=k.context;if(k.context.highlightReason=ha,k.context.highlightEvent=void 0,!s)return;io(ve,cp(Bt,Gt,{label:ve===void 0?void 0:k.context.itemLabels.current[Ve]??void 0}))});q(()=>{qt()},[K,qt]);let Wt=st.useMemo(()=>{if(!b)return je.reference;if(!je.trigger)return _e;let{onFocus:Ce,...ve}=je.trigger;return ve},[b,je.reference,je.trigger]);k.useSyncedValue("inputProps",b?je.reference??_e:_e);let po=st.useMemo(()=>{let Ce=_t(so.reference,Wt,he.reference,{onMouseMove(){k.set("allowMouseEnter",!0)}},ue);return Ce["aria-haspopup"]="menu",Ce["aria-expanded"]=Y,Ce},[k,so.reference,Wt,he.reference,ue,Y]),Io=st.useMemo(()=>{let Ce=_t(je.trigger,he.trigger,ue);return Ce["aria-haspopup"]="menu",Ce["aria-expanded"]=!1,Ce},[je.trigger,he.trigger,ue]);qe(()=>(k.update({inactiveTriggerProps:Io}),null));let Jt=st.useMemo(()=>_t(Ei,{onMouseMove(){if(k.set("allowMouseEnter",!0),_.type==="menu")k.set("hoverEnabled",!1)},onClick(){if(k.select("hoverEnabled"))k.set("hoverEnabled",!1)},onKeyDown(Ce){let ve=k.select("keyboardEventRelay");if(ve&&!Ce.isPropagationStopped())ve(Ce)}},so.floating,je.floating,he.floating),[_.type,k,so.floating,je.floating,he.floating]),Xr=je.item??_e;Di(k,{floatingRootContext:j,activeTriggerProps:po,inactiveTriggerProps:Io,popupProps:Jt,itemProps:Xr});let jr=st.useMemo(()=>({store:k,parent:E,orientation:m,loopFocus:l,allowEscape:S,defaultFloatingId:A,setRenderedFloatingId:O,virtualFocus:b,parentVirtualFocus:B,syncHighlightedItem:qt}),[k,E,m,l,S,A,b,B,qt]),We=typeof o==="function"?o({payload:G}):o,Nt=iC(pa.Provider,{value:jr,children:[p&&Ya(Pi,{handle:p,store:k}),We]});if(_.type===void 0||_.type==="context-menu")Nt=Ya(mu,{externalTree:ne,children:Nt});return Nt});function F0(e){let t=st.useContext(ju);if(t===null)return Ya(cC,{...e});let o=t.Root;return Ya(ju.Provider,{value:null,children:Ya(o,{...t.options,...e})})}import*as ro from"react";var pc=5;function O0(e,t){let o=lC(t);return e.clientX>=o.left-pc&&e.clientX<=o.right+pc&&e.clientY>=o.top-pc&&e.clientY<=o.bottom+pc}function lC(e){let t=e.getBoundingClientRect(),o=ze(e);if(Sa.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),f=l-t.width,g=m-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}import*as N0 from"react";function B0(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=An(),{ref:n,index:a}=ri(e),s=o===a,i=N0.useRef(null),c=Ao(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function H0(e){let{render:t,className:o,style:r,state:n=_e,props:a=pr,refs:s=pr,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:f}=B0({metadata:i});return ke(u,e,{state:n,ref:[f,...s],props:[m,...a,l],stateAttributesMapping:c})}function Yu(e){if(Ge(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(ko(e))return;return Yu(Mo(e))}import*as V0 from"react-dom";function U0(e,t){function o(a,s,i){let c=a.currentTarget;V0.flushSync(()=>{e.setOpen(!1,Me(On,a.nativeEvent,c))}),Mp(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Sr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as dc from"react";function _0(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=dc.useRef(!1);return dc.useMemo(()=>{if(!t)return _e;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,ye(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Ka,jsxs as uC}from"react/jsx-runtime";var W0=Oi(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:f,payload:g,...p}=t,w=go(!0),d=Vi(f)??w?.store;if(!d)throw Error(Je(85));let C=mo(c),b=d.useState("isTriggerActive",C),h=d.useState("floatingRootContext"),S=d.useState("isOpenedByTrigger",C),y=d.useState("triggerControlsId",C),x=ro.useRef(null),v=fC(),T=An(!0),M=to(),B=ro.useMemo(()=>M??new fn,[M]),E=Ba(B),F=xo(),{registerTrigger:A,isMountedByThisTrigger:R}=Mi(C,x,d,{payload:g,closeDelay:m,parent:v,floatingTreeRoot:B,floatingNodeId:E,floatingParentNodeId:F,keyboardEventRelay:T?.relayKeyboardEvent}),O=v.type==="menubar",X=d.useState("disabled"),P=s||X||O&&v.context.disabled,{getButtonProps:N,buttonRef:W}=lo({disabled:P,native:i});ro.useEffect(()=>{if(!S&&v.type===void 0)d.context.allowMouseUpTriggerRef.current=!1},[d,S,v.type]);let J=ro.useRef(null),k=rt(),ne=re((Ie)=>{if(!J.current)return;k.clear(),d.context.allowMouseUpTriggerRef.current=!1;let se=Ie.target;if(fe(J.current,se)||fe(d.select("positionerElement"),se)||se===J.current)return;if(se!=null&&Yu(se)===d.select("rootId"))return;if(O0(Ie,J.current))return;B.events.emit("close",{domEvent:Ie,reason:WI})});ro.useEffect(()=>{let Ie=ye(J.current);if(S&&d.select("lastOpenChangeReason")===uo)return Ie.addEventListener("mouseup",ne,{once:!0}),()=>{Ie.removeEventListener("mouseup",ne)};return},[S,ne,d]);let H=O&&v.context.hasSubmenuOpen,z=Au(h,{enabled:(u??H)&&!P&&(!O||H&&!R),handleClose:Du({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:v.type===void 0?l:void 0,delay:{close:m},triggerElementRef:x,externalTree:B,isActiveTrigger:b,isClosing:()=>d.select("transitionStatus")==="ending"}),ae=mC(S,d.select("lastOpenChangeReason")),we=Ua(h,{enabled:!P,event:S&&O?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?ae:!1}),ee=Ru(h,{enabled:!P&&H}),ce=_0({open:S,enabled:O,mouseDownAction:"open"}),_=ro.useMemo(()=>_t(ee.reference,we.reference),[ee.reference,we.reference]),K=d.useState("triggerProps",R),U=d.useState("filterTriggerProps"),{handlePreFocusGuardFocus:G,handleFocusTargetFocus:ie}=U0(d,x),pe={disabled:P,open:S},Ee=[J,o,W,A,x],Fe=[_,z??_e,K,{"aria-haspopup":"menu","aria-controls":y,id:C,onMouseDown:(Ie)=>{if(d.select("open"))return;k.start(200,()=>{d.context.allowMouseUpTriggerRef.current=!0}),ye(Ie.currentTarget).addEventListener("mouseup",ne,{once:!0})}},U,O?{role:"menuitem"}:{},ce,p,N],le=ke("button",t,{enabled:!O,stateAttributesMapping:Ml,state:pe,ref:Ee,props:Fe});if(O)return Ka(H0,{tag:"button",render:r,className:n,style:a,state:pe,refs:Ee,props:Fe,stateAttributesMapping:Ml});if(S)return uC(ro.Fragment,{children:[Ka(zo,{ref:d.context.beforeTriggerFocusGuardRef,onFocus:G},`${C}-pre-focus-guard`),Ka(ro.Fragment,{children:le},C),Ka(zo,{ref:d.context.triggerFocusTargetRef,onFocus:ie},`${C}-post-focus-guard`)]});return Ka(ro.Fragment,{children:le},C)});function mC(e,t){let o=rt(),[r,n]=ro.useState(!1);return q(()=>{if(e&&t===uo)n(!0),o.start(Hp,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function fC(){let e=mc(!0);return ro.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as G0 from"react";var z0=G0.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return ke("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as In,jsxs as XXe}from"react/jsx-runtime";function q0({...e}){return In(F0,{"data-slot":"dropdown-menu",...e})}function X0({...e}){return In(W0,{"data-slot":"dropdown-menu-trigger",...e})}function j0({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return In(Qd,{container:a,children:In(E0,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:In($d,{"data-slot":"dropdown-menu-content",className:me("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Ja({className:e,inset:t,variant:o="default",...r}){return In(pp,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:me("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function $0({className:e,...t}){return In(z0,{"data-slot":"dropdown-menu-separator",className:me("-mx-1 my-1 h-px bg-border",e),...t})}import*as ig from"react";import*as gc from"react";var Y0="data-valid",K0="data-invalid";var J0={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},dC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Q0={disabled:!1,...dC},eg={valid(e){if(e===null)return null;if(e)return{[Y0]:""};return{[K0]:""}}};var gC={invalid:void 0,name:void 0,validityData:{state:J0,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Q0,registerFieldControl:Ye,validation:{getValidationProps:(e,t=_e)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},hC=gc.createContext(gC);function Zn(e=!0){let t=gc.useContext(hC);if(t.setValidityData===Ye&&!e)throw Error(Je(28));return t}import*as hc from"react";var IC=hc.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function tg(){return hc.useContext(IC)}import*as Ic from"react";var bC=Ic.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function bc(){return Ic.useContext(bC)}import*as Cc from"react";function og(e,t,o){let{setFocused:r,focusOwnerRef:n}=Zn(),a=re((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return q(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function rg(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Zn(),i=qe(()=>Symbol());q(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),q(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as Ku from"react";function ng(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=bc(),s=mo(),i=qe(()=>Symbol()),c=Ku.useRef(!1),u=Ku.useRef(!1),l=re(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return q(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),q(()=>l,[l]),(o?r:void 0)??t??s}var ag=Cc.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:f,...g}=t,{state:p,name:w,disabled:I,setTouched:d,setDirty:C,validityData:b,setFilled:h,validationMode:S,validation:y}=Zn(),{clearErrors:x,elementRef:v,submitCountRef:T}=tg(),M=I||c,B=w??s,E={...p,disabled:M},{labelId:F}=bc(),A=ng({id:a}),R=i!==void 0,O=i==null?void 0:String(i),X=re(()=>y.inputRef.current?.value);rg(y.inputRef,A,O,X,!M,s),q(()=>{let k=O??y.inputRef.current?.value;if(k!==void 0)h(k!=="")},[O,l,y.inputRef,h]),fc(O,()=>{if(O===void 0)return;x(B),C(O!==(b.initialValue??"")),y.change(O)});let P=Cc.useRef(null),N=og(M,P),W=rt();return ke("input",t,{ref:[o,P],state:E,props:[{id:A,disabled:M,name:B,ref:y.inputRef,"aria-labelledby":F,autoFocus:m,...R?{value:i}:{defaultValue:l},onChange(k){let ne=k.currentTarget.value,H=Me(ha,k.nativeEvent);if(u?.(ne,H),R)return;if(C(ne!==(b.initialValue??"")),h(ne!==""),!k.nativeEvent.defaultPrevented&&!H.isCanceled)x(B),y.change(ne)},onFocus(){N(!0)},onBlur(k){if(d(!0),N(!1),S==="onBlur"){let ne=k.currentTarget.value;if(y.commit(ne),R)queueMicrotask(()=>{let H=y.inputRef.current?.value;if(H!==void 0&&H!==ne&&H!==(b.initialValue??""))y.commit(H)})}},onKeyDown(k){if(k.currentTarget.tagName==="INPUT"&&k.key==="Enter"){d(!0);let ne=k.currentTarget.value,H=k.currentTarget.form;if(H&&H===v.current&&!k.defaultPrevented){let Y=k.currentTarget,z=T.current;W.start(0,()=>{if(T.current===z)y.commit(Y.value)})}else y.commit(ne)}}},g,(k)=>y.getValidationProps(M,k)],stateAttributesMapping:eg})});import{jsx as CC}from"react/jsx-runtime";var Ju=ig.forwardRef(function(t,o){return CC(ag,{ref:o,...t})});import{jsx as SC}from"react/jsx-runtime";function Qu({className:e,type:t,...o}){return SC(Ju,{type:t,"data-slot":"input",className:me("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as wC}from"react/jsx-runtime";function cg({className:e,...t}){return wC("textarea",{"data-slot":"textarea",className:me("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as Sc}from"react/jsx-runtime";function lg({className:e,...t}){return Sc("div",{"data-slot":"input-group",role:"group",className:me("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var xC=Xt("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function ug({className:e,align:t="inline-start",...o}){return Sc("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:me(xC({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var yC=Xt("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function em({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return Sc(Tt,{type:t,"data-size":r,variant:o,className:me(yC({size:r}),e),...n})}function mg({className:e,...t}){return Sc(cg,{"data-slot":"input-group-control",className:me("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as et,jsxs as Kt}from"react/jsx-runtime";function fg({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n}){let[a,s]=qn(""),[i,c]=qn(!1),[u,l]=qn(""),[m,f]=qn([]),[g,p]=qn(!1),w=vC(null),[I,d]=qn(null);RC(()=>{d(w.current?.closest("[data-coristen-widget]")??null)},[]);async function C(h){let S=Array.from(h.target.files??[]).slice(0,Math.max(0,5-m.length));if(h.target.value="",!S.length)return;p(!0),l("");try{let y=[];for(let x of S)y.push(await t(x));f((x)=>[...x,...y].slice(0,5))}catch(y){l(y instanceof Error?y.message:"File upload failed. Try again.")}finally{p(!1)}}async function b(h){h.preventDefault();let S=a.trim();if(!S&&!m.length||i||g||o)return;c(!0),l("");try{await e(S,m),s(""),f([])}catch{l("Message could not be sent. Try again.")}finally{c(!1)}}return Kt("form",{onSubmit:(h)=>void b(h),className:"w-full",children:[et("input",{ref:w,type:"file",multiple:!0,className:"sr-only",onChange:(h)=>void C(h)}),(m.length>0||g)&&Kt(Xs,{className:"px-2 pb-2",children:[m.map((h)=>Kt(Ln,{size:"xs",children:[et(la,{children:et(tn,{})}),Kt(ua,{className:"max-w-32",children:[et(ma,{title:h.name,children:h.name}),Kt(fa,{children:[(h.size/1024).toFixed(0)," KB"]})]}),et(qs,{children:et(_f,{type:"button","aria-label":`Remove ${h.name}`,onClick:()=>f((S)=>S.filter((y)=>y.storageId!==h.storageId)),children:et(Po,{})})})]},h.storageId)),g&&Kt(Ln,{size:"xs",state:"uploading",children:[et(la,{children:et(tn,{})}),Kt(ua,{children:[et(ma,{children:"Uploading file"}),et(fa,{children:"Please wait"})]})]})]}),Kt(lg,{className:"has-disabled:opacity-100",children:[et(mg,{"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(h)=>s(h.target.value),maxLength:2000,rows:2,onKeyDown:(h)=>{if(h.key==="Enter"&&!h.shiftKey)h.preventDefault(),h.currentTarget.form?.requestSubmit()}}),Kt(ug,{align:"block-end",className:"pt-1",children:[Kt(q0,{children:[et(X0,{render:et(em,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:et(Tn,{className:"size-5"})}),Kt(j0,{portalContainer:I,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[Kt(Ja,{onClick:()=>w.current?.click(),children:[et(Ds,{}),"Add Photos & Files"]}),et($0,{}),Kt(Ja,{children:[et(ks,{}),"Create Image"]}),Kt(Ja,{children:[et(Ss,{}),"Deep Research"]}),Kt(Ja,{children:[et(As,{}),"Web Search"]})]})]}),r&&et("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&et("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:Kt("span",{className:"inline-flex items-center gap-1",children:["Powered by",Kt("span",{className:"relative size-4 shrink-0",children:[et("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),et("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),et("span",{className:"font-medium",children:"Coristen"})]})})}),et(em,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:i||g||o||!a.trim()&&!m.length,children:et(ds,{})})]})]}),u&&et("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:u})]})}import{jsx as bn}from"react/jsx-runtime";function tm({className:e,size:t="default",...o}){return bn("div",{"data-slot":"card","data-size":t,className:me("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function om({className:e,...t}){return bn("div",{"data-slot":"card-header",className:me("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function rm({className:e,...t}){return bn("div",{"data-slot":"card-title",className:me("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function nm({className:e,...t}){return bn("div",{"data-slot":"card-description",className:me("text-sm text-muted-foreground",e),...t})}function pg({className:e,...t}){return bn("div",{"data-slot":"card-action",className:me("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function dg({className:e,...t}){return bn("div",{"data-slot":"card-content",className:me("px-(--card-spacing)",e),...t})}function wc({className:e,...t}){return bn("div",{"data-slot":"card-footer",className:me("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as EC}from"react/jsx-runtime";var TC=Xt("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function am({variant:e="default",align:t="start",className:o,...r}){return EC("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:me(TC({variant:e}),o),...r})}function sm({className:e,render:t,...o}){return Pn({defaultTagName:"div",props:_t({className:me("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var v$e=Xt("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as xc}from"react/jsx-runtime";function gg({className:e,...t}){return xc("div",{"data-slot":"empty",className:me("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function hg({className:e,...t}){return xc("div",{"data-slot":"empty-header",className:me("flex max-w-sm flex-col items-center gap-2",e),...t})}var M$e=Xt("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function Ig({className:e,...t}){return xc("div",{"data-slot":"empty-title",className:me("font-heading text-sm font-medium tracking-tight",e),...t})}function bg({className:e,...t}){return xc("div",{"data-slot":"empty-description",className:me("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Qa}from"react/jsx-runtime";function Cg({className:e,align:t="start",...o}){return Qa("div",{"data-slot":"message","data-align":t,className:me("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function Sg({className:e,...t}){return Qa("div",{"data-slot":"message-avatar",className:me("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function wg({className:e,...t}){return Qa("div",{"data-slot":"message-content",className:me("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function xg({className:e,...t}){return Qa("div",{"data-slot":"message-header",className:me("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function yg({className:e,...t}){return Qa("div",{"data-slot":"message-footer",className:me("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as yc from"react";import*as Pt from"react";var Rg=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var im=yc.forwardRef((e,t)=>yc.createElement(Oe,{ref:t,...e,weights:Rg}));im.displayName="ArrowCounterClockwiseIcon";import*as Rc from"react";import*as At from"react";var vg=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var cm=Rc.forwardRef((e,t)=>Rc.createElement(Oe,{ref:t,...e,weights:vg}));cm.displayName="DownloadSimpleIcon";import{useState as Oc}from"react";import*as Tg from"react";import*as vc from"react";var lm=vc.createContext(void 0);function no(e){let t=vc.useContext(lm);if(!e&&t===void 0)throw Error(Je(27));return t}var Eg=Tg.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=no(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),f=c.useState("transitionStatus");return ke("div",t,{state:{open:u,transitionStatus:f},ref:[c.context.backdropRef,o],stateAttributesMapping:Js,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as Pg from"react";var um=Pg.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=no(),l=u.useState("open"),{getButtonProps:m,buttonRef:f}=lo({disabled:s,native:i}),g={disabled:s};function p(w){if(l)u.setOpen(!1,Me(UI,w.nativeEvent))}return ke("button",t,{state:g,ref:[o,f],props:[{onClick:p},c,m]})});import*as Ag from"react";var Mg=Ag.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=no(),u=mo(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ke("p",t,{ref:o,props:[{id:u},i]})});import*as Og from"react";import*as Tc from"react";var mm=Tc.createContext(void 0);function kg(){let e=Tc.useContext(mm);if(e===void 0)throw Error(Je(26));return e}var Lg="--nested-dialogs";var lYe=Pl,uYe=Al,mYe=LI,fYe=DI;var Dg="data-nested-dialog-open";var Fg={...ga,...Dn,nestedDialogOpen(e){return e?{[Dg]:""}:null}};import{jsx as MC}from"react/jsx-runtime";var Ng=Og.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=no(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),g=u.useState("popupProps"),p=u.useState("modal"),w=u.useState("mounted"),I=u.useState("nested"),d=u.useState("nestedOpenDialogCount"),C=u.useState("open"),b=u.useState("openMethod"),h=u.useState("titleElementId"),S=u.useState("transitionStatus"),y=u.useState("role"),x=f.useState("floatingId");kg(),Fr({open:C,ref:u.context.popupRef,onComplete(){if(C)u.context.onOpenChangeComplete?.(!0)}});let v=i===void 0?rd(u.context.popupRef):i,T=d>0,M=u.useStateSetter("popupElement"),E=ke("div",t,{state:{open:C,nested:I,transitionStatus:S,nestedDialogOpen:T},props:[g,{id:x,"aria-labelledby":h,"aria-describedby":l,role:y,...Ei,hidden:!w,onKeyDown(F){if(ec.has(F.key))F.stopPropagation()},style:{[Lg]:d}},c],ref:[o,u.context.popupRef,M],stateAttributesMapping:Fg});return MC(Ha,{context:f,openInteractionType:b,disabled:!w,closeOnFocusOut:!m,initialFocus:v,returnFocus:s,modal:p!==!1,restoreFocus:"popup",children:E})});import*as Hg from"react";import{jsx as Bg,jsxs as kC}from"react/jsx-runtime";var Vg=Hg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=no(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return Bg(mm.Provider,{value:r,children:kC(Na,{ref:o,...n,children:[s&&i===!0&&Bg(ic,{ref:a.context.internalBackdropRef,inert:Gn(!c)}),t.children]})})});import*as Wg from"react";import*as fm from"react";function Ug({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=fm.useState(0),[m,f]=fm.useState(0),g=u===0,p=_a(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in w&&w.button!==0)return!1;if("touches"in w){if(w.type==="touchend"){if(w.changedTouches.length!==1||w.touches.length!==0)return!1}else if(w.touches.length!==1)return!1}let I=Ze(w);if(g&&!a){if(s){let d=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return d||C?d===I||C===I||fe(I,i)&&!I?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:g});return lc(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(w,I)=>{if(!e.select("open")&&!e.select("mounted"))return;l(w),f(I)}),q(()=>{if(!r&&!n)l(0),f(0)},[r,n]),q(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),Di(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as Ec from"react";var LC={...Un,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class pm extends wr{constructor(e,t,o){let r=new Ga,n=DC(e,r,t,o);super(n,FC(r),LC)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null)t.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Ai(this.state,e,t.trigger))}}function DC(e,t,o,r=!1){return{...Hi(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function FC(e){return{popupRef:Ec.createRef(),backdropRef:Ec.createRef(),internalBackdropRef:Ec.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as _g,jsxs as OC}from"react/jsx-runtime";function Gg(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:f=null}=t,g=e==="drawer",p=e==="alert-dialog",w=p?!0:c,I=p||i,d=p?"alertdialog":"dialog",C=no(!0),b=C!=null,h={modal:w,disablePointerDismissal:I,nested:b,role:d},S=nd((B,E)=>new pm({open:n,openProp:r,activeTriggerId:f,triggerIdProp:m,...h},B,E),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",m),S.useSyncedValues(h),S.useContextCallback("onOpenChange",a),S.useContextCallback("onOpenChangeComplete",s);let y=S.useState("open"),x=S.useState("mounted"),v=S.useState("payload");sd(S,y),ki(S);let{forceUnmount:T}=Li(y,S);Wg.useImperativeHandle(u,()=>({unmount:T,close:()=>S.setOpen(!1,Me($f))}),[T,S]);let M=y||x||l!=null;return OC(lm.Provider,{value:S,children:[l&&_g(Pi,{handle:l,store:S}),M&&_g(Ug,{store:S,parentContext:C?.context,isDrawer:g}),typeof o==="function"?o({payload:v}):o]})}var zg=za(function(t){return Gg("dialog",t)});import*as Zg from"react";var qg=Zg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=no(),u=mo(s);return c.useSyncedValueWithCleanup("titleElementId",u),ke("h2",t,{ref:o,props:[{id:u},i]})});import*as Xg from"react";var jg=Oi(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,f=no(!0),p=Vi(l)??f;if(!p)throw Error(Je(79));let w=mo(c),I=p.useState("floatingRootContext"),d=p.useState("isOpenedByTrigger",w),C=p.useState("triggerPopupId",w),b=Xg.useRef(null),{registerTrigger:h,isMountedByThisTrigger:S}=Mi(w,b,p,{payload:u}),{getButtonProps:y,buttonRef:x}=lo({disabled:s,native:i}),v=Ua(I),T=qu(()=>p.select("open"),(E)=>{p.set("openMethod",E)}),M={disabled:s,open:d},B=p.useState("triggerProps",S);return ke("button",t,{state:M,ref:[x,o,h,b],props:[v.reference,B,T,{[Ri]:"",id:w,"aria-haspopup":"dialog","aria-expanded":d,"aria-controls":C},m,y],stateAttributesMapping:Xf})});import{jsx as Xo,jsxs as dm}from"react/jsx-runtime";function Yg({...e}){return Xo(zg,{"data-slot":"dialog",...e})}function Kg({...e}){return Xo(jg,{"data-slot":"dialog-trigger",...e})}function NC({...e}){return Xo(Vg,{"data-slot":"dialog-portal",...e})}function Jg({...e}){return Xo(um,{"data-slot":"dialog-close",...e})}function BC({className:e,...t}){return Xo(Eg,{"data-slot":"dialog-overlay",className:me("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function Qg({className:e,children:t,showCloseButton:o=!0,...r}){return dm(NC,{children:[Xo(BC,{}),dm(Ng,{"data-slot":"dialog-content",className:me("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&dm(um,{"data-slot":"dialog-close",render:Xo(Tt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[Xo(Po,{}),Xo("span",{className:"sr-only",children:"Close"})]})]})]})}function e1({className:e,...t}){return Xo(qg,{"data-slot":"dialog-title",className:me("font-heading text-base leading-none font-medium",e),...t})}function t1({className:e,...t}){return Xo(Mg,{"data-slot":"dialog-description",className:me("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function o1(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var HC=Xt("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Pc({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"span",props:_t({className:me(HC({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as UC}from"react/jsx-runtime";var VC=Xt("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function r1({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"div",props:_t({className:me(VC({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function n1({className:e,...t}){return UC("span",{"data-slot":"marker-content",className:me("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function a1(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as Xn from"react";function s1({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=Ac(_C(r,n),t);if(!o)return Xn.createElement(e,a);if(typeof o=="function")return o(a,r);if(!Xn.isValidElement(o))return null;let s=o.props,i={...Ac(a,s),ref:jn(a.ref,s.ref)};return Xn.cloneElement(o,i)}function Ac(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=jn(s,a):GC(n)&&typeof s=="function"&&typeof a=="function"?t[n]=WC(a,s):t[n]=a}}return t}function _C(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function WC(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function GC(e){return/^on[A-Z]/.test(e)}function jn(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as Q from"react";import{jsx as $n,jsxs as l1}from"react/jsx-runtime";var zC=8,ZC=64,qC=0,Lc=0.5,XC=180,jC=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),u1={start:!1,end:!1},$C=[],Dc={currentAnchorId:null,visibleMessageIds:$C};function YC({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return u1;let n=hm({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function KC({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Dc;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of es(e,r)){let f=m.dataset.messageId;if(!f)continue;let g=m.dataset.scrollAnchor==="true",p=g||c?m.getBoundingClientRect():null;(c&&p?p.bottom>i&&p.top<s.bottom:a.has(f))&&u.push(f),g&&p&&p.top<=i+Lc&&(l=f)}return u.length===0&&l===null?Dc:{currentAnchorId:l,visibleMessageIds:u}}function es(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function JC(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function QC(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function eS(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function tS(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function oS({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of es(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function rS({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=m1(t,n),s=t.getBoundingClientRect().height,i=sS(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function m1(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function Mc(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function nS({content:e,scrollTop:t,spacer:o,viewport:r}){let n=hm({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function hm({content:e,spacer:t,viewport:o}){let r=es(e,t),n=f1(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function aS(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function f1(e){let t=window.getComputedStyle(e);return{end:gm(t.paddingBlockEnd||t.paddingBottom),start:gm(t.paddingBlockStart||t.paddingTop)}}function sS(e){let t=e?.parentElement;return t?f1(t):{end:0,start:0}}function iS(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return gm(o)}function gm(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function p1(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function i1(e,t){return p1(e,t)}function cS(){return p1(Dc,uS)}function lS(e,t){return e.start===t.start&&e.end===t.end}function uS(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function mS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=Q.useRef(e),s=Q.useRef(!1),i=Q.useRef(null),c=Q.useRef(!1),u=Q.useRef(o),l=Q.useRef(0),m=Q.useRef(null),f=Q.useRef(0),g=Q.useRef(e?"following-bottom":"free-scrolling"),p=Q.useRef(new Map),w=Q.useRef(null),I=Q.useRef(null),d=Q.useRef(null),C=Q.useRef(n),b=Q.useRef(!0),h=Q.useRef(null),S=Q.useRef(r),y=Q.useRef(null),x=Q.useRef(0),v=Q.useRef(0),T=Q.useRef(null),M=Q.useRef(null),B=Q.useRef(null),E=Q.useRef(null),F=Q.useRef(null),A=Q.useRef(null),R=Q.useRef(null),O=Q.useRef(null),X=Q.useRef(null),P=Q.useRef(new Set),N=Q.useRef(new WeakSet);return B.current===null&&(B.current=i1(t==="end"||t==="last-anchor",(W,J)=>W===J)),E.current===null&&(E.current=i1(u1,lS)),X.current===null&&(X.current=cS()),a.current=e,u.current=o,S.current=r,C.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:F,streamingTurnRef:d,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:f,messageElementsRef:p,modeRef:g,pendingScrollFrameRef:y,pendingScrollToMessageRef:w,prependRestoreRef:I,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:B.current,rootRef:h,scrollEdgeThresholdRef:u,scrollMarginRef:S,scrollPreviousItemPeekRef:C,spacerGapRef:x,spacerHeightRef:v,spacerRef:T,stateFrameRef:M,stateStore:E.current,viewportRef:A,visibilityFrameRef:R,visibilityObserverRef:O,visibilityStore:X.current,visibleMessageIdsRef:P,handledScrollAnchorsRef:N}}function d1(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function kc(e){e.defaultScrollPositionAppliedRef.current=!0,d1(e)}function fS({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:f,prependRestoreRef:g,scrollMarginRef:p,scrollPreviousItemPeekRef:w,spacerGapRef:I,spacerHeightRef:d,spacerRef:C,viewportRef:b}=e,h=Q.useCallback((E)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==E&&(s.current=E,t()),E&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},XC))},[t]),S=Q.useCallback((E)=>{let F=C.current;if(!F)return;let A=Math.max(0,Math.ceil(E));d.current!==A&&(d.current=A,F.hidden=A===0,F.style.height=`${A}px`,F.style.marginTop=A>0?`${-I.current}px`:"")},[]),y=Q.useCallback((E,{behavior:F="auto",autoscrolling:A=!1}={})=>{let R=b.current;if(!R)return;let O=Math.max(0,E);if(Math.abs(R.scrollTop-O)<=Lc){R.scrollTop=O,t();return}A&&h(!0),R.scrollTo({top:O,behavior:F}),o()},[t,o,h]),x=Q.useCallback(({behavior:E="auto"}={})=>b.current?(S(0),n.current=null,m.current="free-scrolling",y(0,{behavior:E}),r(),!0):!1,[r,y,S]),v=Q.useCallback(({behavior:E="auto"}={})=>{let F=b.current;return F?(S(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(aS(F),{autoscrolling:!0,behavior:E}),r(),!0):!1},[r,y,S]),T=Q.useCallback((E,{align:F="start",behavior:A="auto",scrollMargin:R=p.current}={},{keepPreviousPeek:O=!1}={})=>{let X=c.current,P=b.current;if(!X||!P||!X.contains(E))return!1;let N=rS({align:F,element:E,scrollMargin:O?R+w.current:R,spacer:C.current,viewport:P}),W=nS({content:X,scrollTop:N,spacer:C.current,viewport:P});return S(W),g.current={element:E,viewportTop:Mc(E,P)},m.current=O?"anchored-to-message":"settling-jump",n.current=O?E:null,y(N,{behavior:A}),r(),!0},[r,y,S]),M=Q.useCallback(()=>{let E=n.current;return!E||!E.isConnected||m.current!=="anchored-to-message"?!1:T(E,{align:"start"},{keepPreviousPeek:!0})},[T]),B=Q.useCallback((E,F)=>{let A=l.current.get(E);return A?(kc(e),T(A,F)?(f.current=null,!0):(f.current={messageId:E,options:F},!0)):u.current===0?(f.current={messageId:E,options:F},kc(e),!0):!1},[T]);return{flushPendingScrollToMessage:Q.useCallback(()=>{let E=f.current;if(!E)return!1;let F=l.current.get(E.messageId);return!F||!T(F,E.options)?!1:(f.current=null,kc(e),!0)},[T]),reanchorToAnchoredMessage:M,scrollToElement:T,scrollToEnd:v,scrollToMessage:B,scrollToStart:x}}function c1(e,t){return Q.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function pS({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=zC,scrollPreviousItemPeek:r=ZC,scrollMargin:n=qC}){let a=mS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:f,itemCountRef:g,lastScrollTopRef:p,messageElementsRef:w,modeRef:I,pendingScrollFrameRef:d,pendingScrollToMessageRef:C,prependRestoreRef:b,preserveScrollOnPrependRef:h,pendingDefaultScrollStore:S,rootRef:y,scrollEdgeThresholdRef:x,scrollMarginRef:v,scrollPreviousItemPeekRef:T,spacerGapRef:M,spacerHeightRef:B,spacerRef:E,stateFrameRef:F,stateStore:A,viewportRef:R,visibilityFrameRef:O,visibilityObserverRef:X,visibilityStore:P,visibleMessageIdsRef:N,handledScrollAnchorsRef:W}=a,J=Q.useRef(t);J.current!==t&&(J.current=t,m.current=!1);let k=Q.useCallback((de)=>{let ge=y.current,he=R.current,Ae=[de.start&&"start",de.end&&"end"].filter(Boolean).join(" "),je=c.current;for(let ct of[ge,he])ct&&(Ae?ct.setAttribute("data-scrollable",Ae):ct.removeAttribute("data-scrollable"),ct.toggleAttribute("data-autoscrolling",je))},[]),ne=Q.useCallback((de)=>{let ge=R.current?.scrollTop??0,he=ge<p.current-Lc;p.current=ge,i.current&&!de.end&&I.current!=="settling-jump"&&I.current!=="anchored-to-message"?I.current="following-bottom":I.current==="following-bottom"&&de.end&&he&&!c.current&&(I.current="free-scrolling")},[]),H=Q.useCallback(()=>{let de=YC({content:l.current,scrollEdgeThreshold:x.current,spacer:E.current,viewport:R.current});ne(de);let ge=I.current==="following-bottom"?{...de,end:!1}:de;k(ge),A.setSnapshot(ge)},[ne,A,k]),Y=Q.useCallback(()=>{F.current===null&&(F.current=window.requestAnimationFrame(()=>{F.current=null,H()}))},[H]),z=Q.useCallback(()=>{P.hasListeners()&&O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,P.hasListeners()&&P.setSnapshot(KC({content:l.current,scrollMargin:v.current,scrollPreviousItemPeek:T.current,spacer:E.current,viewport:R.current,visibleMessageIds:N.current}))}))},[P]),{flushPendingScrollToMessage:ae,reanchorToAnchoredMessage:we,scrollToElement:ee,scrollToEnd:ce,scrollToMessage:_,scrollToStart:K}=fS({refs:a,commitScrollState:H,scheduleStateCommit:Y,scheduleVisibilitySync:z}),U=Q.useCallback(()=>{let de=b.current,ge=R.current;if(!de||!ge||!de.element.isConnected)return!1;let he=Mc(de.element,ge)-de.viewportTop;return Math.abs(he)<=Lc?!1:(ge.scrollTop+=he,de.viewportTop=Mc(de.element,ge),Y(),z(),!0)},[Y,z]),G=Q.useCallback(()=>{let de=l.current,ge=R.current;if(!de||!ge){b.current=null;return}let he=oS({content:de,spacer:E.current,viewport:ge});b.current=he?{element:he,viewportTop:Mc(he,ge)}:null},[]),ie=Q.useCallback(()=>{d.current===null&&(d.current=window.requestAnimationFrame(()=>{d.current=null,ae()&&G()}))},[G,ae]),pe=Q.useCallback(()=>{if(!t||m.current||g.current===0)return!1;let de=!1;if(t==="last-anchor"){let ge=l.current,he=R.current,Ae=ge&&he?tS(es(ge,E.current)):null;if(!ge||!he||!Ae)de=ce({behavior:"auto"});else{let je=m1(Ae,he);de=hm({content:ge,spacer:E.current,viewport:he})-je<=he.clientHeight?ce({behavior:"auto"}):ee(Ae,{align:"start"},{keepPreviousPeek:!0})}}else de=t==="end"?ce({behavior:"auto"}):K({behavior:"auto"});return de?(kc(a),!0):!1},[t,ee,ce,K]),Ee=Q.useCallback(()=>{let de=l.current;if(!de)return;let ge=es(de,E.current),he=g.current,Ae=f.current;g.current=ge.length,f.current=ge[0]??null,(()=>{if(ae())return;if(he===0){if(pe()||ge.length>0&&i.current&&ce({behavior:"auto"}))return;H(),z();return}let je=Ae?ge.indexOf(Ae):-1;if(h.current&&je>0){U();return}if(ge.length>he){let ct=JC(ge,he);if(ct){if(i.current&&I.current==="following-bottom"&&eS(ge,he)){ce({behavior:"auto"});return}ee(ct,{align:"start"},{keepPreviousPeek:!0}),W.current.add(ct);return}}if(ge.length===he){let ct=QC(ge,W.current);if(ct){ee(ct,{align:"start"},{keepPreviousPeek:!0}),W.current.add(ct);return}}I.current==="following-bottom"&&i.current?ce({behavior:"auto"}):(H(),z())})(),G()},[pe,G,H,ae,U,z,ee,ce]),Fe=Q.useCallback(()=>{if(I.current==="following-bottom"&&i.current){ce({behavior:"auto"});return}let de=B.current;if(we()){i.current&&de>0&&B.current===0&&ce({behavior:"auto"});return}Y(),z()},[we,Y,z,ce]),le=Q.useCallback(()=>{let de=R.current;if(!(!de||!P.hasListeners())){if(typeof IntersectionObserver>"u"){z();return}X.current||(X.current=new IntersectionObserver((ge)=>{for(let he of ge){let Ae=he.target.dataset.messageId;Ae&&(he.isIntersecting?N.current.add(Ae):N.current.delete(Ae))}z()},{root:de,rootMargin:`${-(v.current+T.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),w.current.forEach((ge)=>{X.current?.observe(ge)}),z()}},[z,P]),Ie=Q.useCallback(()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),X.current?.disconnect(),X.current=null,N.current.clear(),P.setSnapshot(Dc)},[P]),se=Q.useCallback((de,ge,he)=>{if(ge){w.current.set(de,ge),X.current?.observe(ge),z(),C.current?.messageId===de&&ie();return}he&&w.current.get(de)===he&&(w.current.delete(de),N.current.delete(de),X.current?.unobserve(he),z())},[ie,z]),Ne=Q.useCallback(()=>{(I.current==="following-bottom"||I.current==="anchored-to-message"||I.current==="settling-jump")&&(s.current=null,I.current="free-scrolling")},[]),ue=Q.useCallback(()=>k(A.getSnapshot()),[A,k]),Se=c1(y,ue),L=c1(R,ue),V=Q.useCallback((de)=>{l.current=de},[]),be=Q.useCallback((de)=>{E.current=de,M.current=iS(de?.parentElement??null)},[]),j=Q.useCallback(()=>{H(),z(),G()},[G,H,z]),oe=Q.useMemo(()=>({handleContentChange:Ee,handleResize:Fe,observeVisibility:le,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:h,scrollToEnd:ce,scrollToMessage:_,scrollToStart:K,setContentElement:V,setRootElement:Se,setSpacerElement:be,setViewportElement:L,stateStore:A,syncAfterScroll:j,unobserveVisibility:Ie,userScrollIntent:Ne,viewportRef:R,visibilityStore:P}),[Ee,Fe,le,S,ce,_,K,V,Se,be,L,A,j,Ie,Ne,P]);return Q.useLayoutEffect(()=>{pe()||g.current===0&&d1(a)},[pe]),Q.useEffect(()=>()=>{F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null),O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null),X.current?.disconnect(),X.current=null},[]),Q.useLayoutEffect(()=>{if(e&&I.current==="following-bottom"&&g.current>0){ce({behavior:"auto"});return}H()},[e,H,ce]),{context:oe,registerMessage:se}}function dS(e){let t=Q.useRef(e);return t.current=e,t}var g1=Q.createContext(null),h1=Q.createContext(null);function ts(){let e=Q.useContext(g1);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function gS(){let e=Q.useContext(h1);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function hS({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=pS({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return $n(g1.Provider,{value:s,children:$n(h1.Provider,{value:i,children:t})})}function I1(){let{pendingDefaultScrollStore:e}=ts();return Q.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function IS({children:e,...t}){let{setRootElement:o}=ts(),r=I1();return $n("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function bS({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:f,setViewportElement:g,syncAfterScroll:p,userScrollIntent:w,viewportRef:I}=ts(),d=I1();f.current=s;let C=Q.useCallback((x)=>{g(x),jn(i)?.(x)},[i,g]);function b(x){p(),r?.(x)}function h(x){w(),a?.(x)}function S(x){w(),n?.(x)}function y(x){jC.has(x.key)&&w(),o?.(x)}return Q.useEffect(()=>{let x=I.current;if(!x||typeof ResizeObserver>"u")return;let v=0,T=new ResizeObserver(()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(m)});return T.observe(x),()=>{window.cancelAnimationFrame(v),T.disconnect()}},[m,I]),$n("div",{ref:C,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:y,onScroll:b,onTouchMove:S,onWheel:h,...l,...d?{"data-pending-scroll":""}:null,children:t})}function CS({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=ts(),l=Q.useRef(null),m=Q.useCallback((f)=>{l.current=f,c(f),jn(o)?.(f)},[o,c]);return Q.useLayoutEffect(()=>{let f=l.current;if(!f||(s(),typeof MutationObserver>"u"))return;let g=new MutationObserver(()=>{s()});return g.observe(f,{childList:!0}),()=>g.disconnect()},[s]),Q.useEffect(()=>{let f=l.current;if(!f||typeof ResizeObserver>"u")return;let g=0,p=new ResizeObserver(()=>{window.cancelAnimationFrame(g),g=window.requestAnimationFrame(i)});return p.observe(f),()=>{window.cancelAnimationFrame(g),p.disconnect()}},[i]),l1("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,$n("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function SS({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=gS(),a=Q.useRef(null),s=Q.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),jn(t)?.(i)},[e,t,n]);return $n("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function wS({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=ts(),m=dS(r),f=Q.useCallback((I)=>l.subscribe(I),[l]),g=Q.useCallback(()=>{let I=l.getSnapshot();return o==="start"?I.start:I.end},[o,l]),p=Q.useSyncExternalStore(f,g,g),w=Q.useCallback((I)=>{p&&(m.current?.(I),I.defaultPrevented||(I.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,p,m,c,u]);return s1({defaultTagName:"button",props:Ac({type:s,inert:!p,tabIndex:p?a:-1,children:t??l1("span",{children:["Scroll to ",o]}),onClick:w},i),render:n,state:{active:p,direction:o},stateAttributesMapping:{active:(I)=>({"data-active":I?"true":"false"})}})}var Cn={Provider:hS,Root:IS,Viewport:bS,Content:CS,Item:SS,Button:wS};import*as Fc from"react";import*as Mt from"react";var b1=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Mt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var Im=Fc.forwardRef((e,t)=>Fc.createElement(Oe,{ref:t,...e,weights:b1}));Im.displayName="ArrowDownIcon";import{jsx as yr,jsxs as yS,Fragment as xS}from"react/jsx-runtime";function C1(e){return yr(Cn.Provider,{...e})}function S1({className:e,...t}){return yr(Cn.Root,{"data-slot":"message-scroller",className:me("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function w1({className:e,...t}){return yr(Cn.Viewport,{"data-slot":"message-scroller-viewport",className:me("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function x1({className:e,...t}){return yr(Cn.Content,{"data-slot":"message-scroller-content",className:me("flex h-max min-h-full flex-col gap-6",e),...t})}function y1({className:e,scrollAnchor:t=!1,...o}){return yr(Cn.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:me("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function R1({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return yr(Cn.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:me("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??yr(Tt,{variant:n,size:a}),...s,children:o??yS(xS,{children:[yr(Im,{}),yr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as De,jsxs as ao}from"react/jsx-runtime";function RS(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function v1({attachment:e}){let[t,o]=Oc(!1),[r,n]=Oc(!1);return ao("div",{className:"flex flex-col items-end gap-1",children:[De(Tt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await o1(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:De(cm,{})}),r&&De("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function vS({attachments:e,allowDownloads:t=!1}){let[o,r]=Oc(null),[n,a]=Oc(!1);if(!e?.length)return null;return ao(Yg,{onOpenChange:(s)=>{if(!s)r(null)},children:[De(Xs,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return De(Ln,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:De(Kg,{render:De("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:De("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return ao(Ln,{className:"min-w-52",children:[De(la,{children:De(tn,{})}),ao(ua,{className:"max-w-44",children:[De(ma,{title:s.name,children:s.name}),ao(fa,{children:[s.type||"File"," ·"," ",RS(s.size)]})]}),t&&s.url&&De(qs,{children:De(v1,{attachment:s})})]},s.storageId)})}),ao(Qg,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[De(e1,{className:"sr-only",children:o?.name??"Image preview"}),De(t1,{className:"sr-only",children:"Expanded image preview"}),ao("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&De(v1,{attachment:o},o.storageId),De(Jg,{render:De(Tt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:De(Po,{})})]}),n?De("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&De("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function bm({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return De(C1,{children:ao(S1,{children:[De(w1,{children:ao(x1,{className:"p-4",children:[e?.length===0&&De(gg,{children:ao(hg,{children:[De(Ig,{children:"No messages yet"}),De(bg,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),f=e[u-1]?._creationTime,g=i&&m&&(f===void 0||m.toDateString()!==new Date(f).toDateString()),p=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return ao(y1,{messageId:c._id,scrollAnchor:l,children:[g&&De(r1,{variant:"separator",className:"mb-5",children:De(n1,{children:a1(m.getTime())})}),ao(Cg,{align:l?"end":"start",children:[(l?n:a)&&De(Sg,{className:"size-7 min-w-7",children:l?n:a}),ao(wg,{children:[i&&ao(xg,{className:"gap-2",children:[c.sender==="customer"?"You":p?"Ten":"Support",p&&De(Pc,{variant:"secondary",children:"AI"})]}),De(vS,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&De(am,{variant:"muted",children:De(sm,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?De("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):De(am,{variant:l?o:"secondary",children:De(sm,{children:c.body})})),c.citations&&c.citations.length>0&&De("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((w)=>w.url?De("a",{href:w.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:w.title},w.sourceId):De("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:w.title},w.sourceId))}),c.generationStatus==="failed"&&ao("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[De("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&ao(Tt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[De(im,{}),"Retry"]})]}),i&&m&&De(yg,{children:De("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),De(R1,{})]})})}import{jsx as TS}from"react/jsx-runtime";function T1({className:e,...t}){return TS("label",{"data-slot":"label",className:me("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as ES}from"react/jsx-runtime";function cr({className:e,...t}){return ES("div",{"data-slot":"skeleton",className:me("animate-pulse rounded-md bg-muted",e),...t})}import{jsx as Re,jsxs as ut}from"react/jsx-runtime";function AS(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function E1({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,onClose:a,onSettingsChange:s,theme:i,assetBaseUrl:c}){let u=Nc(_o.workspace,{workspaceId:e}),l=u===void 0?t:u,m=PS("");os(()=>{if(!u)return;let U=JSON.stringify(u);if(m.current===U)return;m.current=U,s(u)},[s,u]);let f=l?{...l,theme:i}:l,g=Yn(_o.openWebsite),p=Yn(_o.startCustomer),w=Yn(_o.sendCustomer),I=Yn(_o.retryAgentResponse),d=Yn(_o.generateAttachmentUploadUrl),C=Yn(_o.markCustomerRead),[b,h]=zr(""),[S,y]=zr(),[x,v]=zr(""),[T,M]=zr(!1),[B,E]=zr(""),[F,A]=zr(),[R,O]=zr("chat"),[X,P]=zr(),N=!!o,W=Nc(_o.visitorProfile,b&&N?{workspaceId:e,visitorId:b,sessionToken:o}:"skip");os(()=>{let U=`coristen:${e}`,G=localStorage.getItem(U)??crypto.randomUUID();localStorage.setItem(U,G),h(G);let ie=navigator.userAgent;P({currentPage:window.location.href,referrer:document.referrer,browser:AS(ie),device:/Mobi|Android|iPhone|iPad/i.test(ie)?"Mobile":navigator.platform||"Desktop"})},[e]);async function J(U){if(U.preventDefault(),!X||!o||T)return;M(!0),E("");try{let G=x.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",ie=await g({workspaceId:e,visitorId:b,sessionToken:o,name:G,email:x,...X,newConversation:!0});y(ie??void 0),O("chat")}catch{E("We couldn't save your email. Please try again.")}finally{M(!1)}}async function k(){if(!W){O("chat");return}if(!X||T)return;M(!0),E("");try{let U=await g({workspaceId:e,visitorId:b,sessionToken:o,...W,...X,newConversation:!0});y(U??void 0),O("chat")}catch{E("We couldn't start a new conversation. Please try again.")}finally{M(!1)}}let ne=Nc(_o.customerMessages,S&&b&&N?{conversationId:S,visitorId:b,sessionToken:o}:"skip"),H=Nc(_o.visitorConversations,b&&N?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),Y=ne?.at(-1);if(os(()=>{if(ne!==void 0)A(void 0)},[ne]),os(()=>{if(R==="chat"&&N&&S&&b&&Y?.sender==="merchant")C({conversationId:S,visitorId:b,sessionToken:o}).catch(()=>{})},[S,R,Y?._id,Y?.sender,C,o,N,b]),os(()=>{let U=(G)=>{if(G.key==="Escape"&&!G.defaultPrevented)a()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[a]),f===void 0||!o)return null;if(f===null||f.enabled===!1)return Re(tm,{className:"w-full max-w-md",children:ut(om,{children:[Re(rm,{children:"Chat unavailable"}),Re(nm,{children:f?"This chat is currently offline.":"This chat is no longer available."})]})});let z={none:0,sm:6,md:10,lg:16}[f?.radius??"lg"],ae=`${z}px`,we=f?.accentEnabled?f.brandColor:"#171717",ee=f.theme==="dark"?`color-mix(in oklch, ${we} 20%, white)`:we,ce=f.agentImageUrl?Re("img",{src:f.agentImageUrl,alt:"",className:"size-7 rounded-full object-cover"}):Re(vn,{seed:"Coristen agent",size:28,className:"size-7 contrast-200 grayscale"}),_=ut("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-8 py-10 text-center",children:[Re("div",{className:"flex size-12 items-center justify-center overflow-hidden rounded-full bg-muted",children:f.agentImageUrl?Re("img",{src:f.agentImageUrl,alt:"",className:"size-12 object-cover"}):Re(vn,{seed:"Coristen agent",size:48,className:"size-12 contrast-200 grayscale"})}),ut("div",{className:"space-y-1.5",children:[ut("p",{className:"text-base font-semibold",children:["Hi, I’m ",f.agentName]}),Re("p",{className:"max-w-72 text-sm text-muted-foreground",children:f.welcomeMessage})]})]}),K=R==="history"?"history":S?`conversation:${S}`:W===null?"contact":"new";return Re("div",{className:f.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ut(tm,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) border border-black/10 bg-background text-foreground shadow-none dark:border-white/10",style:{"--primary":f.accentSendIcon?f.theme==="dark"?ee:we:void 0,"--primary-foreground":f.accentSendIcon&&f.theme==="dark"?"#171717":void 0,"--radius":ae,"--radius-small":`${z*0.6}px`,"--radius-medium":`${z*0.8}px`,"--radius-control":ae,"--radius-card":`${z*1.4}px`,"--radius-panel":`${z*1.8}px`,"--radius-dialog":`${z*2.2}px`,"--radius-display":`${z*2.6}px`,"--configured-radius":ae,"--widget-action-radius":"max(0px, calc(var(--configured-radius) - var(--surface-inset-md) - 1px))",backgroundColor:f?.tintedGrayscale?`color-mix(in oklch, ${we} 4%, var(--background))`:void 0},children:[ut(om,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:ee}:void 0,children:[Re(rm,{className:"truncate",children:f.name}),Re(nm,{className:"text-current opacity-85",children:R==="history"?"Continue a previous conversation":"How can we help?"}),ut(pg,{className:"flex gap-1",children:[ut(Tt,{variant:"ghost",size:"sm",onClick:()=>O(R==="chat"?"history":"chat"),children:[R==="chat"?Re(Ts,{weight:"duotone","data-icon":"inline-start"}):Re(xs,{size:32,weight:"duotone","data-icon":"inline-start"}),R==="chat"?"Messages":"Chat"]}),Re(Tt,{variant:"ghost",size:"icon-sm","aria-label":r?"Restore chat size":"Expand chat",title:r?"Restore chat size":"Expand chat","aria-pressed":r,onClick:()=>n(!r),children:r?Re(hs,{weight:"duotone"}):Re(bs,{weight:"duotone"})}),Re(Tt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:a,children:Re(Po,{weight:"duotone"})})]})]}),B&&W!==null&&Re("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:B}),Re(dg,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:R==="history"?Re("div",{className:"flex min-h-0 w-full flex-col",children:ut("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[H===void 0&&Array.from({length:3}).map((U,G)=>ut("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[Re(cr,{className:"h-4 w-4/5"}),Re(cr,{className:"h-3 w-2/5"})]},G)),H?.map((U)=>ut("button",{type:"button",className:"group flex w-full items-center gap-3 rounded-lg border border-transparent p-3 text-left transition-colors hover:border-border hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{y(U._id),O("chat")},children:[Re("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:f.agentImageUrl?Re("img",{src:f.agentImageUrl,alt:"",className:"size-9 object-cover"}):Re(vn,{seed:"Coristen agent",size:36,className:"size-9 contrast-200 grayscale"})}),ut("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ut("span",{className:"flex items-center justify-between gap-2",children:[Re("span",{className:"text-sm font-medium",children:"Conversation"}),Re("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(U.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(U.lastMessageAt)})]}),Re("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:U.lastMessagePreview||"Attachment"}),!!U.customerUnreadCount&&ut(Pc,{variant:"secondary",children:[U.customerUnreadCount," unread"]})]}),Re(Rs,{weight:"duotone",className:"size-4 shrink-0 text-muted-foreground"})]},U._id)),H?.length===0&&Re("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):W===void 0&&!S?ut("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ut("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[Re(cr,{className:"size-12 rounded-full"}),Re(cr,{className:"h-5 w-28"}),ut("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[Re(cr,{className:"h-4 w-full"}),Re(cr,{className:"h-4 w-4/5"})]})]}),ut("div",{className:"flex flex-col gap-3",children:[ut("div",{className:"flex flex-col gap-2",children:[Re(cr,{className:"h-4 w-24"}),Re(cr,{className:"h-9 w-full rounded-(--widget-control-radius)"})]}),Re(cr,{className:"h-10 w-full rounded-(--widget-action-radius)"})]})]}):W===null&&!S?Re("div",{className:"flex min-h-0 w-full flex-col",children:_}):S&&ne===void 0&&F?Re(bm,{messages:[{_id:"pending-first-message",_creationTime:F.createdAt,sender:"customer",body:F.body,attachments:F.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:Re(vn,{seed:b,size:28,className:"size-7"}),otherAvatar:ce}):!S||ne===void 0||ne.length===0?_:Re(bm,{messages:ne,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:Re(vn,{seed:b,size:28,className:"size-7"}),otherAvatar:ce,onRetry:(U)=>{E(""),I({conversationId:S,visitorId:b,customerMessageId:U,sessionToken:o}).catch(()=>E("The reply couldn't be retried. Please try again."))}},S)},K),R==="history"&&Re(wc,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ut(Tt,{variant:"secondary",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:T||W===void 0,onClick:()=>void k(),children:[Re(Tn,{size:32,weight:"duotone","data-icon":"inline-start"}),"Start a conversation"]})}),W===null&&!S&&R==="chat"&&Re(wc,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ut("form",{className:"flex w-full flex-col gap-3",onSubmit:(U)=>void J(U),children:[ut("div",{className:"flex flex-col gap-2",children:[Re(T1,{htmlFor:"customer-email",children:"Email address"}),Re(Qu,{id:"customer-email",type:"email",value:x,onChange:(U)=>v(U.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),B&&Re("p",{role:"alert",className:"text-xs text-destructive",children:B}),Re(Tt,{type:"submit",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:T||!X,children:T?"Continuing...":"Continue"})]})}),W&&R==="chat"&&N&&Re(wc,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:Re(fg,{sendDisabled:!X,showPoweredBy:f.showPoweredBy,assetBaseUrl:c,upload:async(U)=>{if(U.size>f.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${f.maxAttachmentSizeMb} MB or smaller`);if(!f.allowedAttachmentTypes.some((Ee)=>U.type===Ee||U.type.startsWith(Ee)))throw Error("This file type is not allowed");let G=await d({workspaceId:e,visitorId:b,sessionToken:o}),ie=await fetch(G,{method:"POST",headers:{"Content-Type":U.type||"application/octet-stream"},body:U});if(!ie.ok)throw Error("Upload failed");let{storageId:pe}=await ie.json();return{storageId:pe,name:U.name,type:U.type||"application/octet-stream",size:U.size}},send:async(U,G)=>{if(S)return await w({conversationId:S,visitorId:b,sessionToken:o,body:U,attachments:G});if(!X)throw Error("Chat is still loading");await g({workspaceId:e,visitorId:b,sessionToken:o,...W,...X,newConversation:!0});let ie=await p({workspaceId:e,visitorId:b,sessionToken:o,body:U,attachments:G});return A({body:U,attachments:G.map((pe)=>({...pe,url:null})),createdAt:Date.now()}),y(ie),ie}})})]})})}function P1(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as M1 from"react";import*as Bc from"react";var Cm=Bc.createContext(void 0);function Zr(){let e=Bc.useContext(Cm);if(!e)throw Error(Je(73));return e}var A1=0;function Hc(e){return A1+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${A1}`}function Vc(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function Sm(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function wm(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var jo={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class xm extends wr{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Sm(e.toasts)},{},jo)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=wm(this.state.toasts,t);r.toasts=n,r.toastMetadata=Sm(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=jo.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||Hc("toast");if(e.id){let i=jo.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(wm(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(jo.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=jo.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=jo.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((w)=>w.id===e?i:w));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,f=this.timers.has(e),g=u!==c,p=s.type==="loading";if(!m&&f){this.clearTimer(e);return}if(m&&(!f||g||l||p||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),jo.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=jo.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=wm(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=Vc(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=Vc(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=Vc(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=eo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(fe(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!jo.expandedOrOutOfFocus(this.state)?eo.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:Sm(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=nt(ye(this.state.viewport));if(!this.state.viewport||!fe(this.state.viewport,t)||!Nr(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=jo.toasts(this.state),r=jo.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as MS,jsxs as kS}from"react/jsx-runtime";var k1=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=qe(()=>new xm({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Dr(s.disposeEffect),M1.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),kS(Cm.Provider,{value:s,children:[MS(LS,{store:s,timeout:r,limit:n}),o]})};function LS(e){let{store:t,timeout:o,limit:r}=e;return q(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as Oo from"react";var L1="--toast-frontmost-height";import{jsx as Uc,jsxs as ym}from"react/jsx-runtime";var D1=Oo.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=Zr(),u=rt(),l=Oo.useRef(!1),m=Oo.useRef(!1),f=Oo.useRef(!1),g=c.useState("isEmpty"),p=c.useState("toasts"),w=c.useState("focused"),I=c.useState("expanded"),d=c.useState("prevFocusElement"),C=p[0]?.height,b=p.some((P)=>P.transitionStatus==="ending"),h=p.filter((P)=>P.priority==="high");Oo.useEffect(()=>{let P=c.state.viewport;if(!P||g)return;let N=ze(P),W=ye(P);function J(H){if(H.key==="F6"&&Ze(H)!==P)H.preventDefault(),c.set("prevFocusElement",nt(W)),P?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function k(H){if(Ze(H)!==N)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ne(H){if(H.relatedTarget)return;let Y=Ze(H),z=nt(ye(P));if(Y===N||!fe(P,Y)||!Nr(z))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return Zt(Te(N,"keydown",J),Te(N,"blur",k,!0),Te(N,"focus",ne,!0),Te(W,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,g]);function S(P){l.current=!0;let N=P.relatedTarget===c.state.viewport?p.find((W)=>W.transitionStatus!=="ending"&&!W.limited):void 0;if(N)N.ref?.current?.focus();else c.restoreFocusToPrevElement()}function y(P){if(P.key==="Tab"&&P.shiftKey&&Ze(P.nativeEvent)===c.state.viewport)P.preventDefault(),c.restoreFocusToPrevElement()}function x(){if(c.state.toasts.some((N)=>N.transitionStatus==="ending")||f.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}Oo.useEffect(x,[b,c]);function v(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function T(){m.current=!0,x()}function M(P){if(P.pointerType==="touch")f.current=!0}function B(P){if(P.pointerType!=="touch")return;f.current=!1,x()}function E(){if(l.current){l.current=!1;return}if(w)return;if(Nr(nt(ye(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function F(P){if(!w||fe(c.state.viewport,P.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let A={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:v,onMouseMove:v,onMouseLeave:T,onFocus:E,onBlur:F,onKeyDown:y,onClick:E,onPointerDown:M,onPointerUp:B,onPointerCancel:B,style:{[L1]:C?`${C}px`:void 0}},R={expanded:I},O=!g&&d&&Uc(zo,{onFocus:S}),X=ke("div",t,{ref:[o,c.setViewport],state:R,props:[A,i,{children:ym(Oo.Fragment,{children:[O,s,O]})}]});return ym(Oo.Fragment,{children:[O,X,!w&&h.length>0&&Uc("div",{style:ui,children:h.map((P)=>ym("div",{role:"alert","aria-atomic":!0,children:[Uc("div",{children:P.title}),Uc("div",{children:P.description})]},P.id))})]})});import*as tt from"react";import*as G1 from"react-dom";import*as _c from"react";var Rm=_c.createContext(void 0);function qr(){let e=_c.useContext(Rm);if(!e)throw Error(Je(66));return e}import*as vm from"react";function F1(e,t){let o=(t??ze(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function Wc(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var O1="--toast-index",N1="--toast-offset-y",B1="--toast-height",H1="--toast-swipe-movement-x",V1="--toast-swipe-movement-y";var U1="data-swipe-direction",HQe=an,VQe=da;import{jsx as NS}from"react/jsx-runtime";var BS={...Dn,swipeDirection(e){return e?{[U1]:e}:null}},_1=40,HS=10,W1=0.5,VS=1,US=`${Up},${_p}`,z1=tt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,f=Zr(),[g,p]=tt.useState(void 0),[w,I]=tt.useState(!1),[d,C]=tt.useState(!1),[b,h]=tt.useState({x:0,y:0}),[S,y]=tt.useState({x:0,y:0,scale:1}),[x,v]=tt.useState(),[T,M]=tt.useState(),[B,E]=tt.useState(null),F=tt.useRef(null),A=tt.useRef(void 0),R=tt.useRef({x:0,y:0}),O=tt.useRef({x:0,y:0,scale:1}),X=tt.useRef(void 0),P=tt.useRef(0),N=tt.useRef(!1),W=tt.useRef({x:0,y:0}),J=tt.useRef(!1),k=tt.useRef({x:0,y:0}),ne=tt.useRef(null),H=tt.useRef(null),Y=f.useState("toastIndex",r.id),z=f.useState("toastVisibleIndex",r.id),ae=f.useState("toastOffsetY",r.id),we=f.useState("focused"),ee=f.useState("expanded");Fr({open:r.transitionStatus!=="ending",ref:F,onComplete(){if(r.transitionStatus==="ending")f.removeToast(r.id)}});let ce=re((ue=!1)=>{let Se=F.current;if(!Se)return;let L=Se.style.height;Se.style.height="auto";let V=Se.offsetHeight;Se.style.height=L;function be(){f.updateToastInternal(r.id,{ref:F,height:V,transitionStatus:void 0})}if(ue)G1.flushSync(be);else be()});q(()=>{let ue=A.current;if(r.transitionStatus!=="starting"&&ue===r.id)return;if(ue!==void 0)p(void 0),y({x:0,y:0,scale:1}),_({x:0,y:0});A.current=r.id,ce()},[ce,r.id,r.transitionStatus]);function _(ue){k.current=ue,h(ue)}q(()=>()=>{H.current?.abort()},[]);function K(ue,Se){let L=(j)=>j>0?j**W1:-(Math.abs(j)**W1),V=ue>0&&!l.includes("right")||ue<0&&!l.includes("left"),be=Se>0&&!l.includes("down")||Se<0&&!l.includes("up");return{x:V?L(ue):ue,y:be?L(Se):Se}}let U=re((ue)=>{if(ue.pointerId!==ne.current)return;ne.current=null,H.current?.abort(),H.current=null,I(!1),C(!1),E(null);let Se=O.current;if(ue.type==="pointercancel"||N.current){_({x:Se.x,y:Se.y}),p(void 0);return}let L=k.current,V=L.x-Se.x,be=L.y-Se.y,j;for(let oe of l)if(Wc(oe,V,be)>_1){j=oe;break}if(j)p(j),f.closeToast(r.id);else _({x:Se.x,y:Se.y}),p(void 0)});function G(ue){if(ue.button!==0)return;if(ue.pointerType==="touch")f.pauseTimers();let Se=Ze(ue.nativeEvent);if(Ir(Se,`button,a,input,textarea,[role="button"],${US}`))return;N.current=!1,X.current=void 0,P.current=0,ne.current=ue.pointerId,R.current={x:ue.clientX,y:ue.clientY},W.current=R.current;let V=ue.currentTarget,be=F1(V);O.current=be,y(be),_({x:be.x,y:be.y}),f.set("hovering",!0),I(!0),C(!1),E(null),J.current=!0,H.current?.abort();let j=new AbortController;H.current=j;let oe=ye(V);oe.addEventListener("pointerup",U,{signal:j.signal}),oe.addEventListener("pointercancel",U,{signal:j.signal}),V.setPointerCapture?.(ue.pointerId)}function ie(ue){if(ue.pointerId!==ne.current)return;if(ue.preventDefault(),J.current)R.current={x:ue.clientX,y:ue.clientY},J.current=!1;let{clientY:Se,clientX:L,movementX:V,movementY:be}=ue;if(be<0&&Se>W.current.y||be>0&&Se<W.current.y)W.current={x:W.current.x,y:Se};if(V<0&&L>W.current.x||V>0&&L<W.current.x)W.current={x:L,y:W.current.y};let j=L-R.current.x,oe=Se-R.current.y,de=Se-W.current.y,ge=L-W.current.x,he=B;if(!d){if(Math.sqrt(j*j+oe*oe)>=VS){C(!0);let Wt=l.includes("left")||l.includes("right"),po=l.includes("up")||l.includes("down");if(Wt&&po){let Io=Math.abs(j),Jt=Math.abs(oe);he=Io>Jt?"horizontal":"vertical",E(he)}}}let Ae;if(!X.current){if(he==="vertical"){if(oe>0)Ae="down";else if(oe<0)Ae="up"}else if(he==="horizontal"){if(j>0)Ae="right";else if(j<0)Ae="left"}else if(Math.abs(j)>=Math.abs(oe))Ae=j>0?"right":"left";else Ae=oe>0?"down":"up";if(Ae&&l.includes(Ae))X.current=Ae,P.current=Wc(Ae,j,oe),p(Ae)}else{let qt=X.current,Wt=Wc(qt,ge,de);if(Wt>_1)N.current=!1,p(qt);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&P.current-Wt>=HS)N.current=!0}let je=K(j,oe),ct=O.current.x,so=O.current.y,io=l.includes("left")||l.includes("right"),No=l.includes("up")||l.includes("down");if(he!=="vertical"&&io)ct+=je.x;if(he!=="horizontal"&&No)so+=je.y;_({x:ct,y:so})}function pe(ue){if(ue.key==="Escape"){if(!F.current||!fe(F.current,nt(ye(F.current))))return;f.closeToast(r.id)}}tt.useEffect(()=>{let ue=F.current;if(!m||!ue)return;function Se(L){if(ne.current===null||!fe(ue,Ze(L)))return;L.preventDefault()}return Te(ue,"touchmove",Se,{passive:!1})},[m]);function Ee(){let ue=b.x-S.x,Se=b.y-S.y;return{transition:w?"none":void 0,transform:w?`translateX(${b.x}px) translateY(${b.y}px) scale(${S.scale})`:void 0,[H1]:`${ue}px`,[V1]:`${Se}px`}}let Fe=r.priority==="high",le={role:Fe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":x,"aria-describedby":T,"aria-hidden":Fe&&!we?!0:void 0,onPointerDown:m?G:void 0,onPointerMove:m?ie:void 0,onPointerUp:m?U:void 0,onPointerCancel:m?U:void 0,onKeyDown:pe,inert:Gn(r.limited),style:{...Ee(),[O1]:r.transitionStatus==="ending"?Y:z,[N1]:`${ae}px`,[B1]:r.height?`${r.height}px`:void 0}},Ie=tt.useMemo(()=>({toast:r,setTitleId:v,setDescriptionId:M,recalculateHeight:ce,visibleIndex:z,expanded:ee}),[r,v,M,ce,z,ee]),se={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:w,swipeDirection:g},Ne=ke("div",t,{ref:[o,F],state:se,stateAttributesMapping:BS,props:[le,c]});return NS(Rm.Provider,{value:Ie,children:Ne})});import*as Gc from"react";var Z1=Gc.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=qr(),l=Gc.useRef(null);q(()=>{u();let g=l.current;if(!g||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let p=new ResizeObserver(()=>u(!0)),w=new MutationObserver(()=>u(!0));return p.observe(g),w.observe(g,{childList:!0,subtree:!0,characterData:!0}),()=>{p.disconnect(),w.disconnect()}},[u]);let m=i>0;return ke("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as j1 from"react";import*as q1 from"react";function X1(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(X1);return!0}function zc(e){return q1.isValidElement(e)&&X1(e.props.children)}function Zc(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=qr(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:rr(e),children:i,type:r.type,setId:s}}function qc(e,t,o){let r=zc(e);return q(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var $1=j1.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:f}=Zc(s,i,"description"),p=ke("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return qc(p,u,f)});import*as Y1 from"react";var K1=Y1.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:f}=Zc(s,i,"title"),p=ke("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return qc(p,u,f)});import*as Xc from"react";var J1=Xc.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=Zr(),{toast:l,expanded:m}=qr(),[f,g]=Xc.useState(!1),{getButtonProps:p,buttonRef:w}=lo({disabled:s,native:i}),I={type:l.type};return ke("button",t,{ref:[o,w],state:I,props:[{"aria-hidden":!m&&!f,onClick(){u.closeToast(l.id)},onFocus(){g(!0)},onBlur(){g(!1)}},c,p]})});import*as Q1 from"react";var eh=Q1.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=qr(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:f}=lo({disabled:s,native:i}),g={type:u.type},p=ke("button",t,{ref:[o,f],state:g,props:[c,u.actionProps,m,{children:l}]});return zc(p)?p:null});import*as rh from"react";import*as jc from"react";import*as th from"react-dom";import{jsxs as _S}from"react/jsx-runtime";var oh=jc.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=vi({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return _S(jc.Fragment,{children:[l,u&&th.createPortal(r,u)]})});import{jsx as WS}from"react/jsx-runtime";var nh=rh.forwardRef(function(t,o){return WS(oh,{ref:o,...t})});import*as ah from"react";function Tm(){let e=Zr(),t=e.useState("toasts");return ah.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Em(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||Hc("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as $c from"react";import*as kt from"react";var ih=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Pm=$c.forwardRef((e,t)=>$c.createElement(Oe,{ref:t,...e,weights:ih}));Pm.displayName="CheckCircleIcon";import*as Yc from"react";import*as Lt from"react";var ch=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var Am=Yc.forwardRef((e,t)=>Yc.createElement(Oe,{ref:t,...e,weights:ch}));Am.displayName="CircleNotchIcon";import*as Kc from"react";import*as Dt from"react";var lh=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Dt.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Mm=Kc.forwardRef((e,t)=>Kc.createElement(Oe,{ref:t,...e,weights:lh}));Mm.displayName="InfoIcon";import*as Jc from"react";import*as Ft from"react";var uh=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var km=Jc.forwardRef((e,t)=>Jc.createElement(Oe,{ref:t,...e,weights:uh}));km.displayName="WarningIcon";import*as Qc from"react";import*as Ot from"react";var mh=new Map([["bold",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Lm=Qc.forwardRef((e,t)=>Qc.createElement(Oe,{ref:t,...e,weights:mh}));Lm.displayName="XCircleIcon";import{jsx as at,jsxs as Dm}from"react/jsx-runtime";var GS=Em();function zS({...e}){return at(k1,{...e})}function ZS({...e}){return at(nh,{"data-slot":"toast-portal",...e})}function qS({className:e,...t}){return at(D1,{"data-slot":"toast-viewport",className:me("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function XS({className:e,...t}){return at(z1,{"data-slot":"toast",className:me("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function jS({className:e,...t}){return at(Z1,{"data-slot":"toast-content",className:me("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function $S({className:e,...t}){return at(K1,{"data-slot":"toast-title",className:me("text-sm font-medium",e),...t})}function YS({className:e,...t}){return at($1,{"data-slot":"toast-description",className:me("text-sm text-muted-foreground",e),...t})}function KS({className:e,render:t=at(Tt,{variant:"outline",size:"sm"}),...o}){return at(eh,{"data-slot":"toast-action",render:t,className:me("shrink-0",e),...o})}function JS({className:e,children:t,render:o=at(Tt,{variant:"ghost",size:"icon-sm"}),...r}){return at(J1,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:me("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??at(Po,{"aria-hidden":"true"})})}function QS({type:e}){let t=null;if(e==="success")t=at(Pm,{"aria-hidden":"true"});if(e==="info")t=at(Mm,{"aria-hidden":"true"});if(e==="warning")t=at(km,{"aria-hidden":"true"});if(e==="error")t=at(Lm,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=at(Am,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return at("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function ew(){let{toasts:e}=Tm();return e.map((t)=>at(XS,{toast:t,children:Dm(jS,{children:[at(QS,{type:t.type}),Dm("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[at($S,{}),at(YS,{})]}),at(KS,{}),at(JS,{})]})},t.id))}function el({children:e,toastManager:t=GS,container:o,...r}){return Dm(zS,{toastManager:t,...r,children:[e,at(ZS,{container:o,children:at(qS,{children:at(ew,{})})})]})}var fh=Em,Vtt=Tm;import{jsx as $o,jsxs as lw}from"react/jsx-runtime";var sw="https://coristen-three.vercel.app",Kn=fh(),iw=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],cw={name:"Coristen",agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleColor:"#171717",showPoweredBy:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class ph extends tw{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function Xtt({identity:e,apiKey:t,apiUrl:o=sw,defaultOpen:r=!1,fontSize:n,appearance:a,onReady:s,onError:i}){let c=o.replace(/\/$/,""),[u,l]=lr(),[m,f]=lr(""),[g,p]=lr(""),[w,I]=lr(),[d,C]=lr(r),[b,h]=lr(!1),[S,y]=lr(0),[x,v]=lr({}),[T,M]=lr(!1),[B,E]=lr(),F=rs(null),A=rs(void 0),R=rs(!1),O=rs(s),X=rs(i);O.current=s,X.current=i;let P=ow(async(_)=>{let K=t,U;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let pe=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!pe.ok){let Fe=Error("Authentication required");throw Fe.status=pe.status,Fe}let Ee=await pe.json();if(K=Ee.publishableKey,U=Ee.identityToken,!U)throw Error("Invalid Coristen identity response")}if(!K?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let G=await fetch(`${c}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:K,identityToken:U,previousToken:_})});if(!G.ok){let pe=Error(await G.text());throw pe.status=G.status,pe}let ie=await G.json();if(e&&!ie.identity)throw Error("Verified identity required");return ie},[t,c,e]);Sn(()=>{let _=!0,K,U="",G=async()=>{try{let ie=await P(U||void 0);if(!_)return;U=ie.token,l(ie),f(""),O.current?.(),K=window.setTimeout(G,Math.max(5000,ie.expiresAt-Date.now()-30000))}catch(ie){if(!_)return;let pe=ie instanceof Error?ie:Error("Widget failed to load");f(P1(pe)),l((Fe)=>Fe&&Fe.expiresAt>Date.now()?Fe:void 0),X.current?.(pe),console.error("[Coristen widget] Failed to initialize",pe);let Ee=pe.status;if(!Ee||Ee===429||Ee>=500)K=window.setTimeout(G,5000)}};return G(),()=>{if(_=!1,K)window.clearTimeout(K);if(U)fetch(`${c}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:U}),keepalive:!0})}},[c,P,S]),Sn(()=>{let _=m||g;if(!_)return;let K=Kn.add({title:"Support chat couldn't load",description:_,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Kn.close(K),f(""),p(""),y((U)=>U+1)}}});return()=>Kn.close(K)},[m,g]),Sn(()=>{let _=()=>y((G)=>G+1),K=()=>C(!0),U=()=>C(!1);return window.addEventListener("coristen:reset",_),window.addEventListener("coristen:open",K),window.addEventListener("coristen:close",U),()=>{window.removeEventListener("coristen:reset",_),window.removeEventListener("coristen:open",K),window.removeEventListener("coristen:close",U)}},[]),Sn(()=>{if(u)I(u.settings)},[u]),Sn(()=>{if(!d)return;let _=(K)=>{if(!F.current?.contains(K.target))C(!1)};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[d]),Sn(()=>{if(!B)return;let _=()=>E((K)=>{if(!K)return K;let U=window.innerWidth<640?12:20;return{left:Math.min(Math.max(K.left,U),window.innerWidth-56-U),top:Math.min(Math.max(K.top,U),window.innerHeight-56-U)}});return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[B]),Sn(()=>{let _=()=>{let U=getComputedStyle(document.documentElement);M(document.documentElement.classList.contains("dark")),v(Object.fromEntries(iw.flatMap((G)=>{let ie=U.getPropertyValue(G).trim();return ie?[[G,ie]]:[]})))};_();let K=new MutationObserver(_);return K.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>K.disconnect()},[]);let N=rw(()=>u?new aw(u.convexUrl):void 0,[u?.convexUrl]),W={...w??u?.settings??cw,...a,theme:a?.theme??(T?"dark":"light")};if(W.enabled===!1)return null;let J=W.position==="left"?"left":"right",k=B&&typeof window<"u"?B.left+28<window.innerWidth/2?"left":"right":J,ne=B&&typeof window<"u"?B.top+28<window.innerHeight/2?"top":"bottom":"bottom",H={none:0,sm:6,md:10,lg:16}[W.radius],z={...B?{left:`${B.left}px`,top:`${B.top}px`,right:"auto",bottom:"auto"}:J==="left"?{left:"20px"}:{right:"20px"},...x,"--coristen-radius":`${H}px`,"--coristen-bubble-color":W.bubbleColor,...n?{"--coristen-font-size":n}:{}},ae=B&&typeof window<"u"?(()=>{let _=window.innerWidth<640?0:20,K=Math.min(b?580:420,window.innerWidth-_*2),U=Math.min(600,window.innerHeight-_*2);return{position:"fixed",right:"auto",bottom:"auto",left:Math.min(Math.max(k==="left"?B.left:B.left+56-K,_),window.innerWidth-K-_),top:Math.min(Math.max(ne==="top"?B.top:B.top+56-U,_),window.innerHeight-U-_)}})():void 0,we=(_)=>{if(d||_.button!==0)return;let K=_.currentTarget.getBoundingClientRect();A.current={pointerId:_.pointerId,startX:_.clientX,startY:_.clientY,left:K.left,top:K.top,moved:!1},_.currentTarget.setPointerCapture(_.pointerId)},ee=(_)=>{let K=A.current;if(!K||K.pointerId!==_.pointerId)return;if(!K.moved&&Math.hypot(_.clientX-K.startX,_.clientY-K.startY)<=4)return;K.moved=!0;let U=window.innerWidth<640?12:20;E({left:Math.min(Math.max(K.left+_.clientX-K.startX,U),window.innerWidth-56-U),top:Math.min(Math.max(K.top+_.clientY-K.startY,U),window.innerHeight-56-U)})},ce=(_)=>{let K=A.current;if(!K||K.pointerId!==_.pointerId)return;if(K.moved){R.current=!0;let U=window.innerWidth<640?12:20;E((G)=>G?{left:G.left+28<window.innerWidth/2?U:window.innerWidth-56-U,top:G.top}:G)}A.current=void 0};if(m&&(!u||!N))return $o("div",{ref:F,"data-coristen-widget":"",className:W.theme==="dark"?"dark":void 0,style:z,children:$o(el,{toastManager:Kn,container:F})});if(!u||!N)return $o("div",{ref:F,"data-coristen-widget":"",className:W.theme==="dark"?"dark":void 0,style:z,children:$o(el,{toastManager:Kn,container:F})});return lw("div",{ref:F,"data-coristen-widget":"","data-open":d||void 0,"data-expanded":b||void 0,"data-position":k,"data-vertical":ne,className:W.theme==="dark"?"dark":void 0,style:z,children:[$o(el,{toastManager:Kn,container:F}),u&&N&&$o("div",{className:"coristen-panel",role:"dialog","aria-label":`${W.name} chat`,"aria-hidden":!d,inert:!d,style:ae,children:$o(ph,{onError:(_)=>{p("Chat ran into a problem. Please try again."),X.current?.(_)},children:$o(nw,{client:N,children:$o(E1,{workspaceId:u.workspaceId,initialSettings:W,sessionToken:u.token,expanded:b,onExpandedChange:h,onClose:()=>C(!1),onSettingsChange:I,theme:W.theme,assetBaseUrl:c})})},S)}),$o("button",{type:"button",className:"coristen-launcher","aria-label":d?"Close chat":"Open chat","aria-expanded":d,"aria-busy":!u,onPointerDown:we,onPointerMove:ee,onPointerUp:ce,onPointerCancel:ce,onClick:()=>{if(R.current){R.current=!1;return}C((_)=>!_)},children:$o("img",{src:`${c}/widget-icons/${W.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})})]})}var jtt={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{Xtt as CoristenWidget,jtt as coristenWidget};
|
|
2
|
+
var b1=Object.create;var{getPrototypeOf:C1,defineProperty:hl,getOwnPropertyNames:S1}=Object;var Um=Object.prototype.hasOwnProperty;function w1(e){return this[e]}var x1,y1,Wm=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?x1??=new WeakMap:y1??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?b1(C1(e)):{};let s=t||!e||!e.__esModule||!Um.call(e,"default")?hl(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of S1(e))if(!Um.call(s,i))hl(s,i,{get:w1.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var R1=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var v1=(e)=>e;function T1(e,t){this[e]=v1.bind(null,t)}var ps=(e,t)=>{for(var o in t)hl(e,o,{get:t[o],enumerable:!0,configurable:!0,set:T1.bind(t,o)})};import*as jo from"react";var Oi=R1(function(B2){function P2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var A2=typeof Object.is==="function"?Object.is:P2,M2=jo.useState,k2=jo.useEffect,L2=jo.useLayoutEffect,D2=jo.useDebugValue;function F2(e,t){var o=t(),r=M2({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return L2(function(){n.value=o,n.getSnapshot=t,gu(n)&&a({inst:n})},[e,o,t]),k2(function(){return gu(n)&&a({inst:n}),e(function(){gu(n)&&a({inst:n})})},[e]),D2(o),o}function gu(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!A2(e,o)}catch(r){return!0}}function O2(e,t){return t()}var N2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?O2:F2;B2.useSyncExternalStore=jo.useSyncExternalStore!==void 0?jo.useSyncExternalStore:N2});var dr={};ps(dr,{android:()=>Qf,apple:()=>Bl,ios:()=>Nl,linux:()=>YI,mac:()=>ep,windows:()=>$I});var gr={};ps(gr,{blink:()=>JI,gecko:()=>KI,webkit:()=>Hl});var Vl={};ps(Vl,{voiceOver:()=>QI});var Ca={};ps(Ca,{jsdom:()=>e2});import{Component as tw,useCallback as ow,useEffect as jr,useMemo as rw,useRef as ns,useState as lr}from"react";import{ConvexProvider as nw,ConvexReactClient as aw}from"convex/react";import{useEffect as os,useRef as Eh,useState as Rr}from"react";import{useMutation as $n,useQuery as rs}from"convex/react";import{jsx as N1}from"react/jsx-runtime";var Wo=34,en=200,E1=6,P1=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function A1(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return Math.abs(t)}function Gm(e,t){let o=[];for(let r=0;r<t;r++)o.push(A1(e+":"+r));return o}function _m(e,t,o){t/=100,o/=100;let r=(i)=>(i+e/30)%12,n=t*Math.min(o,1-o),a=(i)=>o-n*Math.max(-1,Math.min(r(i)-3,Math.min(9-r(i),1))),s=(i)=>Math.round(i*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}function M1(e){let[t]=Gm(e,1),o=t%360;return{fill:_m(o,85,30),stroke:_m(o,90,65)}}function k1(e){let[t,o]=Gm(e,2),r=t%360*(Math.PI/180),n=o%100/100*0.4-0.2,a=Math.cos(r),s=Math.sin(r),i=[];for(let c=0;c<Wo;c++){let u=[];for(let l=0;l<Wo;l++){let m=l/(Wo-1)*2-1,p=c/(Wo-1)*2-1,f=(m*a+p*s+1+n)/2;u.push(Math.max(0,Math.min(1,f)))}i.push(u)}return i}function L1(e){let t=[];for(let o=0;o<Wo;o++){let r=[];for(let n=0;n<Wo;n++){let a=P1[o%4][n%4]/16;r.push(e[o][n]>=a?1:0)}t.push(r)}return t}function D1(e){let t=[];for(let o=0;o<Wo;o++){let r=e[o],n=[],a=0;while(a<Wo)if(r[a]===1){let c=a;while(a<Wo&&r[a]===1)a++;n.push({start:c,len:a-c})}else a++;if(n.length===0)continue;let s=`M${n[0].start} ${o}`,i=n[0].start;s+=`h${n[0].len}`,i+=n[0].len;for(let c=1;c<n.length;c++){let u=n[c].start-i;s+=`m${u} 0h${n[c].len}`,i=n[c].start+n[c].len}t.push(s)}return t.join("")}function F1(e){let{fill:t,stroke:o}=M1(e),r=k1(e),n=L1(r),a=D1(n),i=en/Wo*(E1/6),c=Wo/2,u=`translate(${en/2},${en/2})scale(${i})translate(-${c},-${c})`;return[`<svg width="${en}" height="${en}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,`<rect width="${en}" height="${en}" fill="${t}"/>`,`<path fill="none" stroke="${o}" transform="${u}" d="${a}"/>`,"</svg>"].join("")}function O1(e){let t=F1(e);return`data:image/svg+xml,${encodeURIComponent(t)}`}function vn({seed:e,size:t=40,className:o,style:r}){let n=O1(e);return N1("img",{src:n,alt:"",width:t,height:t,className:o,style:{borderRadius:"50%",...r}})}import*as ds from"react";import*as tn from"react";import{createContext as B1}from"react";var zm=B1({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Ne=tn.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:p="regular",mirrored:d=!1,...f}=tn.useContext(zm);return tn.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||d?"scale(-1, 1)":void 0,...f,...u},!!o&&tn.createElement("title",null,o),i,c.get(a!=null?a:p))});Ne.displayName="IconBase";import*as pt from"react";var Zm=new Map([["bold",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),pt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var gs=ds.forwardRef((e,t)=>ds.createElement(Ne,{ref:t,...e,weights:Zm}));gs.displayName="ArrowUpIcon";import*as hs from"react";import*as dt from"react";var qm=new Map([["bold",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M216.49,56.48,177,96h19a12,12,0,0,1,0,24H148a12,12,0,0,1-12-12V60a12,12,0,0,1,24,0V79l39.51-39.52a12,12,0,0,1,17,17ZM108,136H60a12,12,0,0,0,0,24H79L39.51,199.51a12,12,0,0,0,17,17L96,177v19a12,12,0,0,0,24,0V148A12,12,0,0,0,108,136Z"}))],["duotone",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),dt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["fill",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M120,144v48a8,8,0,0,1-13.66,5.66L88,179.31,53.66,213.66a8,8,0,0,1-11.32-11.32L76.69,168,58.34,149.66A8,8,0,0,1,64,136h48A8,8,0,0,1,120,144ZM213.66,42.34a8,8,0,0,0-11.32,0L168,76.69,149.66,58.34A8,8,0,0,0,136,64v48a8,8,0,0,0,8,8h48a8,8,0,0,0,5.66-13.66L179.31,88l34.35-34.34A8,8,0,0,0,213.66,42.34Z"}))],["light",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M212.24,52.24,158.48,106H192a6,6,0,0,1,0,12H144a6,6,0,0,1-6-6V64a6,6,0,0,1,12,0V97.52l53.76-53.76a6,6,0,0,1,8.48,8.48ZM112,138H64a6,6,0,0,0,0,12H97.52L43.76,203.76a6,6,0,1,0,8.48,8.48L106,158.48V192a6,6,0,0,0,12,0V144A6,6,0,0,0,112,138Z"}))],["regular",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["thin",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M210.83,50.83,153.66,108H192a4,4,0,0,1,0,8H144a4,4,0,0,1-4-4V64a4,4,0,0,1,8,0v38.34l57.17-57.17a4,4,0,1,1,5.66,5.66ZM112,140H64a4,4,0,0,0,0,8h38.34L45.17,205.17a4,4,0,0,0,5.66,5.66L108,153.66V192a4,4,0,0,0,8,0V144A4,4,0,0,0,112,140Z"}))]]);var Is=hs.forwardRef((e,t)=>hs.createElement(Ne,{ref:t,...e,weights:qm}));Is.displayName="ArrowsInSimpleIcon";import*as bs from"react";import*as gt from"react";var jm=new Map([["bold",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),gt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]);var Cs=bs.forwardRef((e,t)=>bs.createElement(Ne,{ref:t,...e,weights:jm}));Cs.displayName="ArrowsOutSimpleIcon";import*as Ss from"react";import*as ht from"react";var Xm=new Map([["bold",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),ht.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var ws=Ss.forwardRef((e,t)=>Ss.createElement(Ne,{ref:t,...e,weights:Xm}));ws.displayName="BinocularsIcon";import*as xs from"react";import*as It from"react";var $m=new Map([["bold",It.createElement(It.Fragment,null,It.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",It.createElement(It.Fragment,null,It.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),It.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",It.createElement(It.Fragment,null,It.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",It.createElement(It.Fragment,null,It.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",It.createElement(It.Fragment,null,It.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",It.createElement(It.Fragment,null,It.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var ys=xs.forwardRef((e,t)=>xs.createElement(Ne,{ref:t,...e,weights:$m}));ys.displayName="CaretLeftIcon";import*as Rs from"react";import*as bt from"react";var Ym=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),bt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var vs=Rs.forwardRef((e,t)=>Rs.createElement(Ne,{ref:t,...e,weights:Ym}));vs.displayName="CaretRightIcon";import*as Ts from"react";import*as Ct from"react";var Km=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Ct.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var Es=Ts.forwardRef((e,t)=>Ts.createElement(Ne,{ref:t,...e,weights:Km}));Es.displayName="ClockCounterClockwiseIcon";import*as Ps from"react";import*as St from"react";var Jm=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var on=Ps.forwardRef((e,t)=>Ps.createElement(Ne,{ref:t,...e,weights:Jm}));on.displayName="FileTextIcon";import*as As from"react";import*as wt from"react";var Qm=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var Ms=As.forwardRef((e,t)=>As.createElement(Ne,{ref:t,...e,weights:Qm}));Ms.displayName="GlobeIcon";import*as ks from"react";import*as xt from"react";var ef=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var Ls=ks.forwardRef((e,t)=>ks.createElement(Ne,{ref:t,...e,weights:ef}));Ls.displayName="ImageIcon";import*as Ds from"react";import*as yt from"react";var tf=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),yt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var Fs=Ds.forwardRef((e,t)=>Ds.createElement(Ne,{ref:t,...e,weights:tf}));Fs.displayName="PaperclipIcon";import*as Os from"react";import*as Rt from"react";var of=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var Tn=Os.forwardRef((e,t)=>Os.createElement(Ne,{ref:t,...e,weights:of}));Tn.displayName="PlusIcon";import*as Ns from"react";import*as vt from"react";var rf=new Map([["bold",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),vt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Po=Ns.forwardRef((e,t)=>Ns.createElement(Ne,{ref:t,...e,weights:rf}));Po.displayName="XIcon";import{makeFunctionReference as _o}from"convex/server";var Ao={welcomeSuggestions:_o("conversations:welcomeSuggestions"),workspace:_o("conversations:workspace"),visitorProfile:_o("conversations:visitorProfile"),openWebsite:_o("conversations:openWebsite"),visitorConversations:_o("conversations:visitorConversations"),customerMessages:_o("conversations:customerMessages"),startCustomer:_o("conversations:startCustomer"),sendCustomer:_o("conversations:sendCustomer"),retryAgentResponse:_o("conversations:retryAgentResponse"),generateAttachmentUploadUrl:_o("conversations:generateAttachmentUploadUrl"),markCustomerRead:_o("conversations:markCustomerRead")};import{useEffect as vC,useRef as TC,useState as Ja}from"react";function ta(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var nf={};function Wt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Bs(t);let a=Bs(e);if(t)a=oa(a,t);if(o)a=oa(a,o);if(r)a=oa(a,r);if(n)a=oa(a,n);return a}function af(e){if(e.length===0)return nf;if(e.length===1)return Bs(e[0]);let t=Bs(e[0]);for(let o=1;o<e.length;o+=1)t=oa(t,e[o]);return t}function Bs(e){if(cf(e))return{...e(nf)};return H1(e)}function oa(e,t){if(cf(t))return t(e);return V1(e,t)}function H1(e){let t={...e};for(let o in t){let r=t[o];if(sf(o,r))t[o]=lf(r)}return t}function V1(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=ta(e.style,r);break}case"className":{e[o]=Il(e.className,r);break}default:if(sf(o,r))e[o]=U1(e[o],r);else e[o]=r}}return e}function sf(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function cf(e){return typeof e==="function"}function U1(e,t){if(!t)return e;if(!e)return lf(t);return(...o)=>{let r=o[0];if(uf(r)){let a=r;ra(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function lf(e){if(!e)return e;return(...t)=>{let o=t[0];if(uf(o))ra(o);return e(...t)}}function ra(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Il(e,t){if(t){if(e)return t+" "+e;return t}return e}function uf(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as Mr from"react";import*as ff from"react";var mf={};function qe(e,t){let o=ff.useRef(mf);if(o.current===mf)o.current=e(t);return o}function Mo(e,t,o,r){let n=qe(df).current;if(W1(n,e,t,o,r))gf(n,[e,t,o,r]);return n.callback}function pf(e){let t=qe(df).current;if(_1(t,e))gf(t,e);return t.callback}function df(){return{callback:null,cleanup:null,refs:[]}}function W1(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function _1(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function gf(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as If from"react";import*as hf from"react";var G1=parseInt(hf.version,10);function En(e){return G1>=e}function bl(e){if(!If.isValidElement(e))return null;let t=e,o=t.props;return(En(19)?o?.ref:t.ref)??null}function Ye(){}var pr=Object.freeze([]),We=Object.freeze({});function bf(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function Cf(e,t){return typeof e==="function"?e(t):e}function Sf(e,t){return typeof e==="function"?e(t):e}import{createElement as wf}from"react";function De(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=na(r);let n=z1(t,o,r);if(o.enabled===!1)return null;let a=o.state??We;return j1(e,r,n,a)}function z1(e,t,o){let{className:r,style:n}=e,{state:a=We,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Cf(r,a):void 0,m=u?Sf(n,a):void 0,p=u?bf(a,c):We,d=u&&i?Z1(i):void 0,f=u?ta(p,d)??{}:We;if(typeof document<"u")if(!u)Mo(null,null);else if(Array.isArray(s))f.ref=pf([f.ref,bl(o),...s]);else f.ref=Mo(f.ref,bl(o),s);if(!u)return We;if(l!==void 0)f.className=Il(f.className,l);if(m!==void 0)f.style=ta(f.style,m);return f}function Z1(e){if(Array.isArray(e))return af(e);return Wt(void 0,e)}var q1=Symbol.for("react.lazy");function na(e){if(e?.$$typeof!==q1)return e;let t=Mr.Children.toArray(e)[0];return Mr.isValidElement(t)?t:e}function j1(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Wt(o,t.props);return n.ref=o.ref,Mr.cloneElement(t,n)}return X1(e,o)}function X1(e,t){if(e==="button")return wf("button",{type:"button",...t,key:t.key});if(e==="img")return wf("img",{alt:"",...t,key:t.key});return Mr.createElement(e,t)}function Pn(e){return De(e.defaultTagName??"div",e,e)}function xf(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=xf(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function yf(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=xf(e))&&(r&&(r+=" "),r+=t);return r}var Rf=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,vf=yf,jt=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return vf(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let p=Rf(l)||Rf(m);return n[u][p]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,p]=l;if(p===void 0)return u;return u[m]=p,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:p,...d}=l;return Object.entries(d).every((f)=>{let[w,h]=f;return Array.isArray(h)?h.includes({...a,...i}[w]):{...a,...i}[w]===h})?[...u,m,p]:u},[]);return vf(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var or=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Hs=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},kr=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var $1=[],rn=Hs(or("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),Y1=Hs(or(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var K1=(()=>{let e=rn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=rn[n];i<rn[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(rn[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=rn[n];s<rn[n+1];s++)o[r++]=a,a+=t[a]}return o})(),J1=or("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),Q1=Hs(or("123333359346463635126536711576")),eI=or("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),tI=or("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),oI=kr("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),rI=(()=>{let e=new Int32Array(319).fill(-1),t=kr("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=kr("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),nI="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),Tf=kr("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),aI=kr("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),sI=kr("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),Ef=new Int32Array(995),Pf=new Int32Array(995),Af=new Int32Array(995),Cl="",Sl=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<Tf.length;r++)for(let n of nI[sI[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),Sl[a*2]=Cl.length,Sl[a*2+1]=n.length,Cl+=n;Ef[o]=Tf[r],Pf[o]=aI[r],Af[o]=a,o++}}var iI=kr("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),cI=Hs(or("1::24444432:442:44:44>222222:44:4421322511111311111114")),lI=kr("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),uI=or("ij"),mI=or(""),fI=or("1"),pI="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Mf={GROUP_COUNT:384,customValidatorNames:$1,edgeStart:rn,labelStart:Y1,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:K1,nodeGroup:J1,nodeVlist:rI,vlistPat:Q1,vlistOps:eI,vlistRef:tI,vlistGroup:oI,litAnchor:Ef,litGroup:Pf,litPool:Af,poolOffsets:Sl,poolText:Cl,adjGid:iI,adjStart:cI,adjTgt:lI,patGid:uI,patTgt:mI,postfixLookupGroups:fI,orderSensitiveModifiers:pI};var dI="line"in Error();var wl=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},Vs=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},kf=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:p,vlistGroup:d,litAnchor:f,litGroup:w,litPool:h,poolOffsets:g,poolText:C,adjGid:S,adjStart:I,adjTgt:b,patGid:y,patTgt:x,postfixLookupGroups:R,customValidatorNames:T,orderSensitiveModifiers:L}=e,W=new Int32Array(r).fill(-1);for(let D=0;D<S.length;D++)W[S[D]]=D;let M=0;for(let D=0;D+1<I.length;D++){let Z=I[D+1]-I[D];if(Z>M)M=Z}let F=32;while(F<2*(1+M+y.length))F<<=1;let A=new Int32Array(p.length+1);for(let D=0;D<p.length;D++)A[D+1]=A[D]+l[p[D]+1]-l[p[D]];let v=new Uint8Array(r);for(let D=0;D<R.length;D++)v[R[D]]=1;let O=n.length-1,X=new Uint8Array(O),P=0,N=!0;for(let D=0;D<f.length;D++){X[f[D]]=1;let Z=g[h[D]*2+1];if(Z>P)P=Z;let oe=C.charCodeAt(g[h[D]*2]);if(oe===91||oe===40)N=!1}let z=1;while(z<f.length*2)z<<=1;let K=new Int32Array(z).fill(-1);for(let D=0;D<f.length;D++){let Z=g[h[D]*2],oe=(wl(C,Z,Z+g[h[D]*2+1])^Math.imul(f[D],2654435761)|0)&z-1;while(K[oe]!==-1)oe=oe+1&z-1;K[oe]=D}let E=(D,Z,oe,Re)=>{let Be=(wl(Z,oe,Re)^Math.imul(D,2654435761)|0)&z-1,Fe=Re-oe;for(;;){let je=K[Be];if(je===-1)return-1;if(f[je]===D&&g[h[je]*2+1]===Fe){let ft=g[h[je]*2],Ke=!0;for(let Me=0;Me<Fe;Me++)if(C.charCodeAt(ft+Me)!==Z.charCodeAt(oe+Me)){Ke=!1;break}if(Ke)return w[je]}Be=Be+1&z-1}},ue=o.cacheSize??8192,H=o.prefix??e.prefix??"",_=H===""?"":H+":",G=_.length,le=(T??[]).map((D)=>{let Z=t&&t[D];if(!Z)throw Error("cn: missing validator "+D);return Z}),Te=/\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$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,se=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,we=0,q=-1,B=-1,Q=-1,ie=-1,xe=(D)=>D>=97&&D<=122||D>=65&&D<=90||D>=48&&D<=57||D===95,ye=(D)=>/\s/.test(String.fromCharCode(D)),re=(D,Z,oe)=>{if(we=0,q=-1,oe-Z<3)return;let Re=D.charCodeAt(Z),Be=D.charCodeAt(oe-1);if(Re===91&&Be===93)we=1;else if(Re===40&&Be===41)we=2;else return;Q=Z+1,ie=oe-1;let Fe=Z+1;if(xe(D.charCodeAt(Fe))){Fe++;while(Fe<oe-1){let je=D.charCodeAt(Fe);if(!xe(je)&&je!==45)break;Fe++}if(Fe<oe-2&&D.charCodeAt(Fe)===58)q=Z+1,B=Fe,Q=Fe+1}},V=(D,Z,oe,Re)=>{if(oe-Z!==Re.length)return!1;for(let Be=0;Be<Re.length;Be++)if(D.charCodeAt(Z+Be)!==Re.charCodeAt(Be))return!1;return!0},J=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ce=(D)=>!!D&&!Number.isNaN(Number(D)),Ce=(D,Z,oe)=>{if(oe-Z<11||!V(D,Z,Z+10,"@container"))return!1;if(D.charCodeAt(Z+10)===47)return oe-Z>=12;let Re=D.charCodeAt(Z+11);return Re===115&&oe-Z>=17&&V(D,Z+10,Z+16,"-size/")||Re===110&&oe-Z>=19&&V(D,Z+10,Z+18,"-normal/")},k=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],U="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((D)=>D.split(" ")),Ie=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Y=(D,Z,oe,Re)=>{if(D>=10){if(D>=25)return le[D-25](Z.slice(oe,Re));let Be=D-10;if(we!==k[Be])return!1;if(q>=0){for(let Fe of U[Be])if(V(Z,q,B,Fe))return!0;return!1}switch(Ie[Be]){case 0:return!1;case 1:return!0;case 2:{let Fe=Z.slice(Q,ie);return Te.test(Fe)&&!te.test(Fe)}case 3:return ce(Z.slice(Q,ie));case 4:return pe.test(Z.slice(Q,ie));default:return se.test(Z.slice(Q,ie))}}switch(D){case 0:return!0;case 1:return we===0;case 2:return we===1;case 3:return we===2;case 4:return J.test(Z.slice(oe,Re));case 5:return ce(Z.slice(oe,Re));case 6:{let Be=Z.slice(oe,Re);return!!Be&&Number.isInteger(Number(Be))}case 7:return Re>oe&&Z.charCodeAt(Re-1)===37&&ce(Z.slice(oe,Re-1));case 8:return Ee.test(Z.slice(oe,Re));default:return Ce(Z,oe,Re)}},ne=new Set(typeof L==="string"?L.split(" "):L),de=(D,Z,oe,Re,Be,Fe)=>{let je=wl(Z,oe,Re)^(Be?2654435769:0)|0,ft=D.get(je);if(ft!==void 0)e:for(let Ue=0;Ue<ft.length;Ue++){let $e=ft[Ue];if($e.imp!==Be||$e.k.length!==Re-oe)continue;for(let Ut=0;Ut<$e.k.length;Ut++)if($e.k.charCodeAt(Ut)!==Z.charCodeAt(oe+Ut))continue e;return $e.id}else D.set(je,ft=[]);let Ke=Z.slice(oe,Re),Me=Fe(Ke);return ft.push({k:Ke,imp:Be,id:Me}),Me},ge=new Map,he=new Map,ke=2,Xe=4096,ct=(D,Z)=>{let oe=[],Re=0,Be=0,Fe=0;for(let Me=0;Me<D.length;Me++){let Ue=D.charCodeAt(Me);if(Re===0&&Be===0&&Ue===58)oe.push(D.slice(Fe,Me)),Fe=Me+1;else if(Ue===91)Re++;else if(Ue===93)Re--;else if(Ue===40)Be++;else if(Ue===41)Be--}oe.push(D.slice(Fe));let je=oe[0];if(oe.length>1){let Me=[],Ue=[];for(let $e of oe)if($e.charCodeAt(0)===91||ne.has($e)){if(Ue.length)Me.push(...Ue.sort()),Ue=[];Me.push($e)}else Ue.push($e);if(Ue.length)Me.push(...Ue.sort());je=Me.join(":")}let ft=Z?je+" !":je,Ke=he.get(ft);if(Ke===void 0)he.set(ft,Ke=ke++);return Ke},so=new Map,io=r,Bo=r+4096,qt=()=>io++,_t=2097152,po=8192,Io=new Int32Array(po),Jt=Array(po).fill(null),Xr=new Int32Array(po),$r=new Int32Array(po),_e=new Uint8Array(po),Nt=0,Se=(D,Z,oe,Re,Be,Fe,je,ft)=>{let Ke=D;if(Jt[D]!==null)if(Jt[D|1]===null)Ke=D|1;else if((Nt++&3)===0)Ke=D|Nt>>2&1;else return;Jt[Ke]=Z.slice(oe,Re),Io[Ke]=Be,Xr[Ke]=Fe,$r[Ke]=je,_e[Ke]=ft},Pe=()=>Jt.fill(null),Ve=256,Bt=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Gt,co,Vt,bo]=Bt,Ho=new Uint8Array(Ve),Ro=new Uint8Array(Ve),wn=()=>{Ve*=2,Bt=Bt.map((Z)=>{let oe=new Int32Array(Ve);return oe.set(Z),oe}),[Gt,co,Vt,bo]=Bt;let D=new Uint8Array(Ve);D.set(Ho),Ho=D,Ro=new Uint8Array(Ve)},Jo=64,Yr=new Int32Array(Jo),Kr=new Int32Array(Jo),tl=new Int32Array(r),vr=2048,Fm=21,ol=new Float64Array(vr),as=new Int32Array(vr),Tr=0,rl=(D,Z)=>{if(D===0&&Z<r){if(tl[Z]===Tr)return 1;return tl[Z]=Tr,0}let oe=D*2097152+Z+1,Re=Math.imul(oe,2654435761)>>>Fm;for(;;){if(as[Re]!==Tr)break;if(ol[Re]===oe)return 1;Re=Re+1&vr-1}return ol[Re]=oe,as[Re]=Tr,0},ss=(D,Z,oe,Re,Be)=>{if(oe-Z>=2&&D.charCodeAt(Z)===91&&D.charCodeAt(oe-1)===93){let Fe=-1;for(let je=Z+1;je<oe-1;je++)if(D.charCodeAt(je)===58){Fe=je;break}if(Fe===-1||Fe===Z+1)return-1;return de(so,D,Z+1,Fe,0,qt)}if(Re>=0&&c[Re]>=0)return c[Re];for(let Fe=Be-1;Fe>=0;Fe--){let je=Kr[Fe];if(je>oe)continue;let ft=Yr[Fe],Ke=oe-je;if(X[ft]===1&&Ke>0&&Ke<=P){let zt=D.charCodeAt(je);if(N===!1||zt!==91&&zt!==40){let Pr=E(ft,D,je,oe);if(Pr>=0)return Pr}}let Me=u[ft];if(Me<0)continue;let Ue=p[Me],$e=l[Ue],Ut=l[Ue+1];if($e===Ut)continue;re(D,je,oe);let Qt=A[Me]-$e;for(let zt=$e;zt<Ut;zt++)if(Y(m[zt],D,je,oe))return d[Qt+zt]}return-1},is=(D)=>{let Z=D.length,oe=0,Re=0,Be=!1;if(ke>Xe||ge.size>Xe)ge=new Map,he=new Map,ke=2,Pe();if(io>Bo)so=new Map,io=r,Pe();let Fe=0;while(Fe<Z){let Me=D.charCodeAt(Fe);if(Me===32||Me>=9&&Me<=13||Me>=160&&ye(Me)){if(Me!==32)Be=!0;Fe++;continue}let Ue=Fe,$e=0;while(Fe<Z){if(Me=D.charCodeAt(Fe),Me<=32){if(Me===32)break;if(Me>=9&&Me<=13){Be=!0;break}}else if(Me>=160&&ye(Me)){Be=!0;break}$e=Math.imul($e^Me,16777619),Fe++}let Ut=Fe,Qt=Ut-Ue;if(oe===Ve)wn();let zt=oe++;Gt[zt]=Ue,co[zt]=Ut,Re+=Qt,$e^=Math.imul(Qt,2654435761);let Pr=$e^$e>>>15|0,Qo=Pr&8190;{let ot=-1;if(Io[Qo]===Pr&&Jt[Qo]!==null&&Jt[Qo].length===Qt)ot=Qo;else if(Io[Qo|1]===Pr&&Jt[Qo|1]!==null&&Jt[Qo|1].length===Qt)ot=Qo|1;if(ot>=0){let Uo=Jt[ot],mr=!0;for(let fr=0;fr<Qt;fr++)if(Uo.charCodeAt(fr)!==D.charCodeAt(Ue+fr)){mr=!1;break}if(mr){Vt[zt]=Xr[ot],bo[zt]=$r[ot],Ho[zt]=_e[ot];continue}}}let yn=Ue;if(G!==0){if(Ut-Ue<=G||!D.startsWith(_,Ue)){Vt[zt]=-1,Se(Qo,D,Ue,Ut,Pr,-1,0,0);continue}yn=Ue+G}let al=0,sl=0,Qn=-1,il=-1;for(let ot=yn;ot<Ut;ot++){let Uo=D.charCodeAt(ot);if(al===0&&sl===0){if(Uo===58){Qn=ot;continue}if(Uo===47){il=ot;continue}}if(Uo===91)al++;else if(Uo===93)al--;else if(Uo===40)sl++;else if(Uo===41)sl--}let Bm=Qn>=yn?Qn+1:yn,vo=Bm,To=Ut,ea=!1,Hm=0;if(To>vo&&D.charCodeAt(To-1)===33)ea=!0,To--;else if(To>vo&&D.charCodeAt(vo)===33)ea=!0,vo++,Hm=1;let Jr=-1;if(il>Bm){if(Jr=il+Hm,Jr>=To)Jr=-1}let cl=vo;if(To-vo>1&&D.charCodeAt(vo)===45)cl=vo+1;let er=0,Ar=0,Rn=0,Vm=-1,tr=0;if(u[0]>=0||X[0]===1)Yr[0]=0,Kr[0]=cl,tr=1;let ll=-1,ul=0;for(let ot=cl;ot<To;ot++){if(ot===Jr)ll=Ar<Rn?-1:er,ul=tr;if(er!==-1){let Uo=D.charCodeAt(ot),mr=-1;if(Ar<Rn)if(s.charCodeAt(Ar)===Uo){if(Ar++,Ar===Rn)mr=er=Vm}else er=-1;else{let fr=n[er],fs=n[er+1],dl=-1;for(let Qr=fr;Qr<fs;Qr++){let gl=a[Qr];if(s.charCodeAt(gl)===Uo){if(a[Qr+1]-gl===1)mr=dl=i[Qr];else Ar=gl+1,Rn=a[Qr+1],Vm=i[Qr],dl=er;break}}er=dl}if(mr>=0&&(u[mr]>=0||X[mr]===1)&&ot+1<To&&D.charCodeAt(ot+1)===45){if(tr===Jo){Jo*=2;let fr=new Int32Array(Jo);fr.set(Yr),Yr=fr;let fs=new Int32Array(Jo);fs.set(Kr),Kr=fs}Yr[tr]=mr,Kr[tr]=ot+2,tr++}}}if(Jr===To)ll=Ar<Rn?-1:er,ul=tr;let ml=Ar<Rn?-1:er,Eo,ms=!1;if(Jr>=0){if(ms=!0,Eo=ss(D,vo,Jr,ll,ul),Eo!==-1&&Eo<r&&v[Eo]){let ot=ss(D,vo,To,ml,tr);if(ot!==-1&&ot!==Eo)Eo=ot,ms=!1}else if(Eo===-1)Eo=ss(D,vo,To,ml,tr),ms=!1}else Eo=ss(D,vo,To,ml,tr);let fl=0,pl=0;if(Eo===-1)Vt[zt]=-1;else pl=ms?1:0,fl=yn>=Qn?ea?1:0:de(ge,D,yn,Qn,ea?1:0,(ot)=>ct(ot,ea)),Vt[zt]=Eo,Ho[zt]=pl,bo[zt]=fl;Se(Qo,D,Ue,Ut,Pr,Eo,fl,pl)}if(oe===0)return"";if(oe===1)return Gt[0]===0&&co[0]===Z?D:D.slice(Gt[0],co[0]);if(oe*F>vr){while(oe*F>vr)vr<<=1,Fm--;ol=new Float64Array(vr),as=new Int32Array(vr)}if(ke>=_t||io>=_t)throw Error("cn: too many distinct classes in one merge");if(Tr=Tr+1|0,Tr===0)tl.fill(0),as.fill(0),Tr=1;let je=!1;for(let Me=oe-1;Me>=0;Me--){let Ue=Vt[Me];if(Ue===-1){Ro[Me]=1;continue}let $e=bo[Me];if(rl($e,Ue)===1){Ro[Me]=0,je=!0;continue}if(Ro[Me]=1,Ue<r){let Ut=W[Ue];if(Ut>=0)for(let Qt=I[Ut];Qt<I[Ut+1];Qt++)rl($e,b[Qt]);if(Ho[Me]&1){for(let Qt=0;Qt<y.length;Qt++)if(y[Qt]===Ue)rl($e,x[Qt])}}}if(!je&&!Be&&Z===Re+oe-1)return D;let ft="",Ke=0;while(Ke<oe){if(!Ro[Ke]){Ke++;continue}let Me=Gt[Ke],Ue=co[Ke],$e=Ke+1;while($e<oe&&Ro[$e]&&Gt[$e]===Ue+1&&D.charCodeAt(Ue)===32)Ue=co[$e],$e++;if(ft.length>0)ft+=" ";ft+=D.slice(Me,Ue),Ke=$e}return ft},Er=16384,ur=new Int32Array(Er*2),cs=0,Vo=1,Kn=Object.create(null),Om=Object.create(null),xn=new Map,Nm=new Map,ls=0,us=0,Jn=()=>{cs^=Er,Vo=Vo+1|0,us=0},g1=(D)=>{let Z=Kn[D];if(Z!==void 0)return Z;let oe=Vs(D,0,D.length),Re=(oe&16383)+cs,Be=ur[Re]===(oe^Vo)||ur[Re^Er]===(oe^Vo-1);if(Be){if(Z=Om[D],Z!==void 0)return Kn[D]=Z,Z}if(Z=is(D),Be){if(Kn[D]=Z,++ls>ue)ls=0,Om=Kn,Kn=Object.create(null),Jn()}else if(ur[Re]=oe^Vo,++us>Er)Jn();return Z},h1=(D)=>{let Z=xn.get(D);if(Z!==void 0)return Z;let oe=Vs(D,0,D.length),Re=(oe&16383)+cs,Be=ur[Re]===(oe^Vo)||ur[Re^Er]===(oe^Vo-1);if(Be){if(Z=Nm.get(D),Z!==void 0)return xn.set(D,Z),Z}if(Z=is(D),Be){if(xn.set(D,Z),++ls>ue)ls=0,Nm=xn,xn=new Map,Jn()}else if(ur[Re]=oe^Vo,++us>Er)Jn();return Z},I1=(D)=>{let Z=Vs(D,0,D.length),oe=(Z&16383)+cs;if(ur[oe]===(Z^Vo)||ur[oe^Er]===(Z^Vo-1))return!0;if(ur[oe]=Z^Vo,++us>Er)Jn();return!1},nl=ue===0?is:dI?(D)=>{let Z=xn.get(D);return Z!==void 0?Z:h1(D)}:g1;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?nl(arguments[0]):nl(Lf.apply(null,arguments))},mergeString:nl,seenBefore:ue===0?()=>!1:I1,mergeUncached:is}},Us=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Us(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},gI=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Us(n,t);if(a){if(o)o+=" ";o+=a}}return o},Lf=function(){return gI(arguments,!1)};var Df=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,p=(g,C,S)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let I=Vs(g,0,g.length)&4094;if(c[I]===g&&u[I]===C)return l[I];if(c[I|1]===g&&u[I|1]===C)return l[I|1];let b=e(S?C+" "+g:g),y=c[I]===""?I:I|(c[I|1]===""?1:m++&1);return c[y]=g,u[y]=C,l[y]=b,b},d=(g,C,S,I)=>{let b=0;if(C){if(C!==g.a0)return!1;b=1}if(S){if(S!==(b===0?g.a0:g.a1))return!1;b++}if(I){if(I!==(b===0?g.a0:b===1?g.a1:g.a2))return!1;b++}return b===g.t},f=(g,C)=>{let S=g.a,I=0;for(let b=0;b<C.length;b++){let y=C[b];if(!y)continue;if(y!==S[I])return!1;I++}return I===g.t},w=(g,C)=>{let S=g.length,I=i===null?null:i.n;if(!C){if(I!==null&&f(I,g))return i=I,I.r;if(i!==null&&i!==I&&f(i,g))return i.r}let b="",y=-1,x=0,R=!1;for(let W=0;W<S;W++){let M=g[W];if(!M)continue;if(typeof M!=="string"){if(M=g[W]=Us(M,!0),!M)continue;R=!0}if(y<0)b=M,y=W;x++}if(x===0)return"";if(x===1)return e(b);if(R){if(I!==null&&f(I,g))return i=I,I.r;if(i!==null&&i!==I&&f(i,g))return i.r}let T=n.get(b);if(T===void 0){if(T=a.get(b),T!==void 0)n.set(b,T)}let L=null;if(T!==void 0){if(T.skip>0){T.skip--,i=null;let M=b;for(let F=y+1;F<S;F++){let A=g[F];if(A)M+=" "+A}return p(M,"",!1)}let W=T.e;e:for(let M=0;M<W.length;M++){let F=W[M];if(F.t!==x)continue;let A=F.a,v=1;for(let O=y+1;O<S;O++){let X=g[O];if(X&&X!==A[v++])continue e}L=F;break}if(L!==null)T.miss=0}if(L===null){let W=b,M=[b];for(let A=y+1;A<S;A++){let v=g[A];if(!v)continue;W+=" "+v,M.push(v)}if(!o(W))return r(W);if(L={r:e(W),t:M.length,a0:M[0],a1:M[1],a2:M[2]??"",a:M,n:null},T===void 0)n.set(b,T={e:[],miss:0,skip:0,at:0});else if(++T.miss>16)T.miss=16,T.skip=1024,T.e.length=0,T.at=0;let F=T.e;if(F.length<256)F.push(L);else F[T.at]=L,T.at=T.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==L)i.n=L;return i=L,L.r},h=(g)=>Array.isArray(g)?w(g.slice(),!1):e(Us(g,!0));return function(g,C,S){let I=arguments.length;if((I|1)===3){let x=i;if(x!==null){let R=x.n;if(R!==null&&d(R,g,C,S))return i=R,R.r;if(x!==R&&d(x,g,C,S))return x.r}if(I===2&&typeof C==="string"&&C!==""){let R=n.get(g);if(R!==void 0&&R.skip>0)return R.skip--,i=null,p(C,g,!0)}return w([g,C,S],!0)}if(I===1)return typeof g==="string"?e(g):h(g);let b=i;if(b!==null){let x=b.n;if(x!==null){let R=x.a,T=0,L=!0;for(let W=0;W<I;W++){let M=arguments[W];if(!M)continue;if(M!==R[T]){L=!1;break}T++}if(L&&T===x.t)return i=x,x.r}if(b!==x){let R=b.a,T=0,L=!0;for(let W=0;W<I;W++){let M=arguments[W];if(!M)continue;if(M!==R[T]){L=!1;break}T++}if(L&&T===b.t)return b.r}}let y=[];for(let x=0;x<I;x++)y.push(arguments[x]);return w(y,!0)}};var xl=kf(Mf),me=Df(xl.mergeString,xl),cHe=xl.merge;import*as Uf from"react";import*as kn from"react";function Ws(){return typeof window<"u"}function Tt(e){if(_s(e))return(e.nodeName||"").toLowerCase();return"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rr(e){var t;return(t=(_s(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _s(e){if(!Ws())return!1;return e instanceof Node||e instanceof ze(e).Node}function He(e){if(!Ws())return!1;return e instanceof Element||e instanceof ze(e).Element}function Ge(e){if(!Ws())return!1;return e instanceof HTMLElement||e instanceof ze(e).HTMLElement}function Go(e){if(!Ws()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function an(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=Xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Ff(e){return/^(table|td|th)$/.test(Tt(e))}function aa(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var hI=/transform|translate|scale|rotate|perspective|filter/,II=/paint|layout|strict|content/,nn=(e)=>!!e&&e!=="none",yl;function Gs(e){let t=He(e)?Xt(e):e;return nn(t.transform)||nn(t.translate)||nn(t.scale)||nn(t.rotate)||nn(t.perspective)||!zs()&&(nn(t.backdropFilter)||nn(t.filter))||hI.test(t.willChange||"")||II.test(t.contain||"")}function Of(e){let t=ko(e);while(Ge(t)&&!Lo(t)){if(Gs(t))return t;else if(aa(t))return null;t=ko(t)}return null}function zs(){if(yl==null)yl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return yl}function Lo(e){return/^(html|body|#document)$/.test(Tt(e))}function Xt(e){return ze(e).getComputedStyle(e)}function sa(e){if(He(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ko(e){if(Tt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Go(e)&&e.host||rr(e);return Go(t)?t.host:t}function Nf(e){let t=ko(e);if(Lo(t))return(e.ownerDocument||e).body;if(Ge(t)&&an(t))return t;return Nf(t)}function Lr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=Nf(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=ze(n);if(a){let i=Zs(s);return t.concat(s,s.visualViewport||[],an(n)?n:[],i&&o?Lr(i):[])}else return t.concat(n,Lr(n,[],o))}function Zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as bI from"react";var ia={...bI};var Rl=ia.useInsertionEffect,CI=Rl&&Rl!==ia.useLayoutEffect?Rl:(e)=>e();function ae(e){let t=qe(SI).current;return t.next=e,CI(t.effect),t.trampoline}function SI(){let e={next:void 0,callback:wI,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function wI(){}import*as Bf from"react";var xI=()=>{},j=typeof document<"u"?Bf.useLayoutEffect:xI;function yI(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var RI=yI("https://base-ui.com/production-error","Base UI"),Je=RI;import*as qs from"react";var vI=qs.createContext(void 0);function An(e=!1){let t=qs.useContext(vI);if(t===void 0&&!e)throw Error(Je(16));return t}import*as Hf from"react";function Vf(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:Hf.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function ve(e){return e?.ownerDocument||document}function Mn(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(ze(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function lo(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=kn.useRef(null),i=An(!0),c=a??i!==void 0,{props:u}=Vf({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=kn.useCallback(()=>{let d=s.current;if(!vl(d))return;if(c&&t&&u.disabled===void 0&&d.disabled)d.disabled=!1},[t,u.disabled,c]);j(l,[l]);let m=kn.useCallback((d={})=>{let{onClick:f,onMouseDown:w,onKeyUp:h,onKeyDown:g,onPointerDown:C,...S}=d;return Wt({onClick(I){if(t){I.preventDefault();return}f?.(I)},onMouseDown(I){if(!t)w?.(I)},onKeyDown(I){if(t)return;if(ra(I),g?.(I),I.baseUIHandlerPrevented)return;let b=I.target===I.currentTarget,y=I.currentTarget,x=vl(y),R=!n&&TI(y),T=b&&(n?x:!R),L=I.key==="Enter",W=I.key===" ",M=y.getAttribute("role"),F=M?.startsWith("menuitem")||M==="option"||M==="gridcell";if(b&&c&&W){if(I.defaultPrevented&&F)return;if(I.preventDefault(),!n||x)I.preventBaseUIHandler(),Mn(y,I);return}if(!T||n||!W&&!L){if(b&&R&&W)I.preventDefault();return}if(I.defaultPrevented)return;if(I.preventDefault(),L)I.preventBaseUIHandler(),Mn(y,I)},onKeyUp(I){if(t)return;if(ra(I),h?.(I),I.target===I.currentTarget&&n&&c&&vl(I.currentTarget)&&I.key===" "){I.preventDefault();return}if(I.baseUIHandlerPrevented)return;if(I.target===I.currentTarget&&!n&&!c&&!I.defaultPrevented&&I.key===" ")I.preventBaseUIHandler(),Mn(I.currentTarget,I)},onPointerDown(I){if(t){I.preventDefault();return}C?.(I)}},n?{type:"button"}:{role:"button"},u,S)},[t,u,c,n]),p=ae((d)=>{s.current=d,l()});return{getButtonProps:m,buttonRef:p}}function vl(e){return Ge(e)&&e.tagName==="BUTTON"}function TI(e){return Ge(e)&&e.tagName==="A"&&Boolean(e.href)}var Tl=Uf.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=lo({disabled:a,focusableWhenDisabled:s,native:i});return De("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as PI}from"react/jsx-runtime";var EI=jt("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:e,variant:t="default",size:o="default",...r}){return PI(Tl,{"data-slot":"button",className:me(EI({variant:t,size:o,className:e})),...r})}import{jsx as Dr}from"react/jsx-runtime";var AI=jt("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function Ln({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return Dr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:me(AI({size:o,orientation:r}),e),...n})}var MI=jt("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function ca({className:e,variant:t="icon",...o}){return Dr("div",{"data-slot":"attachment-media","data-variant":t,className:me(MI({variant:t}),e),...o})}function la({className:e,...t}){return Dr("div",{"data-slot":"attachment-content",className:me("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function ua({className:e,...t}){return Dr("span",{"data-slot":"attachment-title",className:me("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function ma({className:e,...t}){return Dr("span",{"data-slot":"attachment-description",className:me("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function js({className:e,...t}){return Dr("div",{"data-slot":"attachment-actions",className:me("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function Wf({className:e,variant:t,size:o="icon-xs",...r}){return Dr(mt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:me(e),...r})}function Xs({className:e,...t}){return Dr("div",{"data-slot":"attachment-group",className:me("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as $s from"react";var El=$s.createContext(void 0);function _f(e){let t=$s.useContext(El);if(t===void 0&&!e)throw Error(Je(33));return t}import*as Ys from"react";var fa=Ys.createContext(void 0);function go(e){let t=Ys.useContext(fa);if(t===void 0&&!e)throw Error(Je(36));return t}var sn="data-starting-style",pa="data-ending-style";var kI={[sn]:""},LI={[pa]:""},Dn={transitionStatus(e){if(e==="starting")return kI;if(e==="ending")return LI;return null}};var Pl="data-open",Al="data-closed",DI=sn,FI=pa,Gf="data-anchor-hidden";var Js="data-popup-open",Zf="data-pressed";var OI={[Js]:""},NI={[Js]:"",[Zf]:""},BI={[Pl]:""},HI={[Al]:""},VI={[Gf]:""},jf={open(e){if(e)return OI;return null}},Ml={open(e){if(e)return NI;return null}},da={open(e){if(e)return BI;return HI},anchorHidden(e){if(e)return VI;return null}},Qs={...da,...Dn};import*as ei from"react";var UI=ei.createContext(void 0);function Fn(e=!0){let t=ei.useContext(UI);if(t===void 0&&!e)throw Error(Je(25));return t}var ga="none",ti="trigger-press",uo="trigger-hover",ha="trigger-focus",kl="outside-press",Ll="item-press",WI="close-press";var On="focus-out",Dl="escape-key";var oi="list-navigation",Xf="keyboard",_I="pointer";var GI="cancel-open",Ia="sibling-open";var $f="imperative-action";import*as ba from"react";var Fl=ba.createContext(null);function Ol(e="root"){let t=ba.useContext(Fl),o=ba.useContext(fa);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var zI={visible:!0,ref:null};function ZI(){return zI}function Yf(e,t,o="root"){let r=Ol(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??ZI)({label:e.label,children:e.children,render:e.render}),s=Mo(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as Nn from"react";import*as tp from"react";function qI(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:jI,platform:XI,maxTouchPoints:Kf}=qI(),cn=jI.toLowerCase(),ln=XI.toLowerCase();var Nl=/^i(os$|p)/.test(ln)||ln==="macintel"&&Kf>1,Jf="android",Qf=ln===Jf||cn.includes(Jf),ep=!Nl&&ln.startsWith("mac"),$I=ln.startsWith("win"),YI=!Qf&&/^(linux|chrome os)/.test(ln),Bl=ep||Nl;var Hl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),KI=!Hl&&cn.includes("firefox"),JI=!Hl&&cn.includes("chrom");var QI=Bl;var e2=/jsdom|happydom/.test(cn);function t2(e){e.preventDefault()}function op(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=go(),l=Fn(!0),m=c.type==="submenu-trigger",p=m?u.parentVirtualFocus:u.virtualFocus,f=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:w}=a.useState("floatingTreeRoot"),h=a.useState("open"),g=l!==void 0,C=!p&&h&&o?0:-1;return tp.useMemo(()=>({id:r,role:"menuitem",tabIndex:C,"aria-selected":f,onMouseDown:p?t2:void 0,onKeyDown(S){if(S.key===" "&&s?.current)S.preventDefault()},onMouseMove(S){if(!n)return;w.emit("itemhover",{nodeId:n,target:S.currentTarget})},onClick(S){if(t)w.emit("close",{domEvent:S.nativeEvent,reason:Ll})},onMouseUp(S){if(l){let I=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,g&&I&&Math.abs(S.clientX-I.x)<=1&&Math.abs(S.clientY-I.y)<=1)return;if(g&&!dr.mac&&S.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!g||S.button===2)){if(c.type==="regular-item")Mn(i.current,S,{detail:1,pointerType:"mouse"})}}}),[t,C,r,w,n,a.context.allowMouseUpTriggerRef,s,i,l,g,c.type,f,p])}var rp={type:"regular-item"};function np(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=Nn.useRef(null),{getButtonProps:m,buttonRef:p}=lo({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),d=op({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),f=Nn.useCallback((h)=>Wt(d,{onMouseEnter(g){if(c.type!=="submenu-trigger")return;c.setActive(g.nativeEvent)}},h,m),[d,m,c]),w=Mo(l,p);return Nn.useMemo(()=>({getItemProps:f,itemRef:w}),[f,w])}import*as un from"react";import*as ri from"react";var Ul=ri.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ap(){return ri.useContext(Ul)}function ni(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=ap(),l=un.useRef(-1),[m,p]=un.useState(a==null&&t?()=>{if(l.current===-1){let h=u.current;u.current+=1,l.current=h}return l.current}:-1),d=a??m,f=un.useRef(null),w=un.useCallback((h)=>{let g=f.current;if(g)i(g);if(f.current=h,h)s(h,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return j(()=>{if(a!=null)return;return c((h)=>{let g=f.current?h.get(f.current)?.index:null;if(g!=null)p(g)})},[a,c]),{ref:w,index:d}}import*as ii from"react";import*as ai from"react";function si(){let[,e]=ai.useState({});return ai.useCallback(()=>{e({})},[])}var sp=0;function o2(e,t="mui"){let o=ii.useRef(void 0),r=si(),n=e??o.current;return ii.useEffect(()=>{if(o.current==null){if(sp+=1,o.current=`${t}-${sp}`,e==null)r()}},[e,t,r]),n}var ip=ia.useId;function nr(e,t){if(ip!==void 0){let o=ip();return e??(t?`${t}-${o}`:o)}return o2(e,t)}function mo(e){return nr(e,"base-ui")}function Le(e,t,o,r){let n=!1,a=!1,s=r??We;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function cp(e,t,o){let r=o??We;return{reason:e,event:t??new Event("base-ui"),...r}}import*as Wl from"react";import*as lp from"react";function Fr(e){lp.useEffect(e,pr)}var ci=null,G9e=globalThis.requestAnimationFrame;class up{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var li=new up;class Do{static create(){return new Do}static request(e){return li.request(e)}static cancel(e){return li.cancel(e)}currentId=ci;request(e){this.cancel(),this.currentId=li.request(()=>{this.currentId=ci,e()})}cancel=()=>{if(this.currentId!==ci)li.cancel(this.currentId),this.currentId=ci};disposeEffect=()=>this.cancel}function hr(){let e=qe(Do.create).current;return Fr(e.disposeEffect),e}function mp(e,t=!1,o=!1,r=!1){let[n,a]=Wl.useState(e&&t?"idle":void 0),[s,i]=Wl.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return j(()=>{if(!e&&s&&n!=="ending"&&o){let c=Do.request(()=>{a("ending")});return()=>{Do.cancel(c)}}return},[e,s,n,o]),j(()=>{if(!e||t||n===void 0)return;let c=Do.request(()=>{a(void 0)});return()=>{Do.cancel(c)}},[t,e,n]),j(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=Do.request(()=>{a("idle")});return()=>{Do.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as fp from"react";import*as Gl from"react-dom";function zo(e){if(e==null)return e;return"current"in e?e.current:e}function _l(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var ui=null;function r2(e){if(!ui){let t=[];ui=t,queueMicrotask(()=>{ui=null,Gl.flushSync(()=>{for(let o of t)o()})})}ui.push(e)}function Bn(e,t=!1,o=!1){let r=hr();return ae((n,a=null)=>{r.cancel();let s=zo(e);if(s==null)return;let i=s,c=()=>{if(!o){Gl.flushSync(n);return}r2(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(_l(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(_l(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=sn;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function Or(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=ae(a),i=Bn(r,o,n);fp.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as zl from"react";import{jsx as n2}from"react/jsx-runtime";var a2=zl.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:p}=go(),d=ni({guess:!0,label:s}),f=mo(a),w=p.useState("disabled"),h=p.useState("isActive",d.index),g=p.useState("floatingNodeId"),C=p.useState("itemProps"),S=c||w,{getItemProps:I,itemRef:b}=np({closeOnClick:u,disabled:S,highlighted:h,id:f,store:p,nativeButton:i,nodeId:g,itemMetadata:rp});return De("div",t,{state:{disabled:S,highlighted:h},props:[C,m,I],ref:[b,o,d.ref]})}),pp=zl.forwardRef(function(t,o){let r=Yf(t,o);if(!r.visible)return null;return n2(a2,{...t,ref:r.ref})});import*as In from"react";import*as $t from"react";function Ae(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function lt(e){let t=qe(s2,e).current;return t.next=e,j(t.effect),t}function s2(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Sa=0;class eo{static create(){return new eo}currentId=Sa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Sa,t()},e)}isStarted(){return this.currentId!==Sa}clear=()=>{if(this.currentId!==Sa)clearTimeout(this.currentId),this.currentId=Sa};disposeEffect=()=>this.clear}function rt(){let e=qe(eo.create).current;return Fr(e.disposeEffect),e}import*as fi from"react";var dp={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},mi={...dp,position:"fixed",margin:0,top:0,left:0},w7e={...dp,position:"absolute"};import{jsx as i2}from"react/jsx-runtime";var Zo=fi.forwardRef(function(t,o){let[r,n]=fi.useState();return j(()=>{if(Vl.voiceOver&&gr.webkit)n("button")},[]),i2("span",{...t,ref:o,style:mi,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});function nt(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function fe(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Go(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e,t){let o=e;while(o){if(He(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(Go(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var wa="data-base-ui-focusable";var Zl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",xa="ArrowLeft",ya="ArrowRight",ql="ArrowUp",pi="ArrowDown";var L7e=Js,jl="data-trigger-disabled";function Nr(e,t){if(!He(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(jl);for(let[,r]of t.entries())if(fe(r,o))return!r.hasAttribute(jl);return!1}function di(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function gp(e){return e.matches("html,body")}function br(e){return Ge(e)&&e.matches(Zl)}function Xl(e){return Ir(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Zl}`)!=null}function Ra(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&br(e)}function Br(e){if(!e||Ca.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function va(e){if(!e)return null;return e.hasAttribute(wa)?e:e.querySelector(`[${wa}]`)||e}function So(e){e.preventDefault(),e.stopPropagation()}function hp(e){return"nativeEvent"in e}function Hr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(dr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function Hn(e){if(Ca.jsdom)return!1;return!dr.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(dr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Cr(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Ip(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var{min:Vr,max:qo,round:Ea,floor:Pa}=Math,ar=(e)=>({x:e,y:e}),l2={left:"right",right:"left",bottom:"top",top:"bottom"};function hi(e,t,o){return qo(e,Vr(t,o))}function sr(e,t){return typeof e==="function"?e(t):e}function fo(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function Ii(e){return e==="x"?"y":"x"}function Aa(e){return e==="y"?"height":"width"}function ho(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Ma(e){return Ii(ho(e))}function Sp(e,t,o){if(o===void 0)o=!1;let r=wo(e),n=Ma(e),a=Aa(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=Ta(s);return[s,Ta(s)]}function wp(e){let t=Ta(e);return[gi(e),t,gi(t)]}function gi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var bp=["left","right"],Cp=["right","left"],u2=["top","bottom"],m2=["bottom","top"];function f2(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Cp:bp;return t?bp:Cp;case"left":case"right":return t?u2:m2;default:return[]}}function xp(e,t,o,r){let n=wo(e),a=f2(fo(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(gi))}return a}function Ta(e){let t=fo(e);return l2[t]+e.slice(t.length)}function p2(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function bi(e){return typeof e!=="number"?p2(e):{top:e,right:e,bottom:e,left:e}}function mn(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function Ci(e,t){return t<0||t>=e.length}function Si(e,t){return Yl(e.current,{disabledIndices:t})}function $l(e,t){return Yl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function yp(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>Yl(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let p=r?-1:e.length;if(a&&t!==p)l=-1;else l=r?c:i,m=!0}else l=u();return{index:Ci(e,l)?-1:l,wrapped:m}}function Yl(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&Kl(e,a,r));return a}function Kl(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!fn(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function d2(e){return e.visibility==="hidden"||e.visibility==="collapse"}function fn(e,t=e?Xt(e):null){if(!e||!e.isConnected||!t||d2(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var g2='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function h2(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return Go(o)?o.host:null}function Ql(e){for(let t of Array.from(e.children))if(Tt(t)==="summary")return t;return null}function I2(e,t){let o=Ql(t);return!!o&&(e===o||fe(o,e))}function Rp(e){let t=e?Tt(e):"";return e!=null&&e.matches(g2)&&(t!=="summary"||e.parentElement!=null&&Tt(e.parentElement)==="details"&&Ql(e.parentElement)===e)&&(t!=="details"||Ql(e)==null)&&(t!=="input"||e.type!=="hidden")}function eu(e){if(!Rp(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=h2(t)){let o=t!==e,r=Tt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Tt(t)==="details"&&!t.open&&!I2(e,t)||t.hasAttribute("hidden")||!r&&!b2(t,o))return!1}return!0}function b2(e,t){let o=Xt(e);if(!t)return fn(e,o);return o.display!=="none"}function vp(e){let t=e.tabIndex;if(t<0){let o=Tt(e);if(o==="details"||o==="audio"||o==="video"||Ge(e)&&e.isContentEditable)return 0}return t}function Jl(e){if(Tt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function Tp(e,t){let o=Jl(e);if(!o)return!0;let r=t.find((n)=>{let a=Jl(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=Jl(n);return a?.name===o.name&&a.form===o.form})===o}function Ep(e){if(Ge(e)&&Tt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(Ge(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function tu(e,t){Ep(e).forEach((o)=>{if(Rp(o))t.push(o);tu(o,t)})}function Pp(e,t,o){Ep(e).forEach((r)=>{if(Ge(r)&&r.matches(t))o.push(r);Pp(r,t,o)})}function ka(e){return eu(e)&&vp(e)>=0}function ou(e){let t=[];return tu(e,t),t.filter(eu)}function La(e){let t=ou(e);return t.filter((o)=>vp(o)>=0&&Tp(o,t))}function Ap(e,t){let o=La(e),r=o.length;if(r===0)return;let n=nt(ve(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function wi(e){return Ap(ve(e).body,1)||e}function xi(e){return Ap(ve(e).body,-1)||e}function Mp(e,t,o){if(!e)return null;let r=[];tu(ve(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(eu);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!fe(o,i)&&ka(i)&&Tp(i,a))return i}return r[n]}function Sr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!fe(o,r)}function kp(e){La(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function ru(e){let t=[];Pp(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function Fo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...Fo(e,n.id,o)])}function nu(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function ir(e){return`data-base-ui-${e}`}var yi=0;function Vn(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(yi);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return yi=s,()=>{if(yi===s)cancelAnimationFrame(s),yi=0}}var Lp="data-base-ui-inert",Da=new WeakMap,Ri=new WeakSet,Fa=new WeakMap,au=0;function Np(e){if(!e)return null;return Go(e)?e.host:Np(e.parentNode)}var Dp=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=Np(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),Fp=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},Op=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(Tt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function C2(e,t,o,{mark:r=!0}){let n=Dp(t,e),a=r?Op(t,Fp(n),new Set(n)):[],s=[],i=[];if(o){let c=Dp(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);Op(t,Fp(u),new Set(u)).forEach((m)=>{let p=m.getAttribute("aria-hidden"),d=p!==null&&p!=="false",f=(Da.get(m)||0)+1;if(Da.set(m,f),s.push(m),f===1&&d)Ri.add(m);if(!d)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Fa.get(c)||0)+1;if(Fa.set(c,u),i.push(c),u===1)c.setAttribute(Lp,"")});return au+=1,()=>{if(s.forEach((c)=>{let u=(Da.get(c)||0)-1;if(Da.set(c,u),!u){if(!Ri.has(c))c.removeAttribute("aria-hidden");Ri.delete(c)}}),r)i.forEach((c)=>{let u=(Fa.get(c)||0)-1;if(Fa.set(c,u),!u)c.removeAttribute(Lp)});if(au-=1,!au)Da=new WeakMap,Ri=new WeakSet,Fa=new WeakMap}}function su(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=ve(e[0]).body;return C2(e,n,o,{mark:r})}import*as it from"react";import*as cu from"react-dom";var Bp=500,Hp=500,Vp={style:{transition:"none"}},vi="data-base-ui-click-trigger";var Up="[data-base-ui-swipe-ignore]",Wp="[data-swipe-ignore]",_p={fallbackAxisSide:"none"},Gp={fallbackAxisSide:"end"},zp={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as iu,jsxs as Zp}from"react/jsx-runtime";var qp=it.createContext(null),lu=()=>it.useContext(qp),S2=ir("portal");function Ti(e={}){let{ref:t,container:o,componentProps:r=We,elementProps:n}=e,a=nr(),i=lu()?.portalNode,[c,u]=it.useState(null),[l,m]=it.useState(null),p=ae((h)=>{if(h!==null)m(h)}),d=it.useRef(null);j(()=>{if(o===null){if(d.current)d.current=null,m(null),u(null);return}let h=(o&&(_s(o)?o:o.current))??i??document.body;if(h==null){if(d.current)d.current=null,m(null),u(null);return}if(d.current!==h)d.current=h,m(null),u(h)},[o,i]);let f=De("div",r,{ref:[t,p],props:[{id:a,[S2]:""},n]}),w=c&&f?cu.createPortal(f,c):null;return{node:l,nodeId:it.isValidElement(f)?f.props.id:void 0,subtree:w}}var Oa=it.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:p}=Ti({container:i,ref:o,componentProps:t,elementProps:u}),d=it.useRef(null),f=it.useRef(null),w=it.useRef(null),h=it.useRef(null),[g,C]=it.useState(null),S=it.useRef(!1),I=g?.modal,b=g?.open,y=!!g&&!g.modal&&g.open&&!!l;it.useEffect(()=>{if(!l||I)return;function R(T){if(l&&T.relatedTarget&&Sr(T))if(T.type==="focusin"){if(S.current)ru(l),S.current=!1}else kp(l),S.current=!0}return Zt(Ae(l,"focusin",R,!0),Ae(l,"focusout",R,!0))},[l,I]),j(()=>{if(!l||b!==!0||!S.current)return;ru(l),S.current=!1},[b,l]);let x=it.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:w,afterInsideRef:h,portalNode:l,setFocusManagerState:C}),[l]);return Zp(it.Fragment,{children:[p,Zp(qp.Provider,{value:x,children:[y&&l&&iu(Zo,{"data-type":"outside",ref:d,onFocus:(R)=>{if(Sr(R,l))w.current?.focus();else{let T=g?g.domReference:null;xi(T)?.focus()}}}),y&&l&&iu("span",{role:c,"aria-owns":m,style:zp}),l&&cu.createPortal(s,l),y&&l&&iu(Zo,{"data-type":"outside",ref:f,onFocus:(R)=>{if(Sr(R,l))h.current?.focus();else{let T=g?g.domReference:null;if(wi(T)?.focus(),g?.closeOnFocusOut)g?.onOpenChange(!1,Le(On,R.nativeEvent))}}})]})]})});import*as Ur from"react";function Ei(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class pn{nodesRef={current:[]};events=Ei();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as jp}from"react/jsx-runtime";var Xp=Ur.createContext(null),$p=Ur.createContext(null),xo=()=>Ur.useContext(Xp)?.id||null,to=(e)=>{let t=Ur.useContext($p);return e??t};function Na(e){let t=nr(),o=to(e),r=xo();return j(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function uu(e){let{children:t,id:o}=e,r=xo();return jp(Xp.Provider,{value:Ur.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function mu(e){let{children:t,externalTree:o}=e,r=qe(()=>o??new pn).current;return jp($p.Provider,{value:r,children:t})}import{jsx as Yp,jsxs as w2}from"react/jsx-runtime";function x2(e,t){let o=ze(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Hr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var Kp=20,Wr=[];function fu(){Wr=Wr.filter((e)=>e.deref()?.isConnected)}function Jp(e){if(fu(),e&&Tt(e)!=="body"){if(Wr.push(new WeakRef(e)),Wr.length>Kp)Wr=Wr.slice(-Kp)}}function Qp(){return fu(),Wr[Wr.length-1]?.deref()}function y2(e){if(!e)return null;if(ka(e))return e;return La(e)[0]||e}function ed(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=ou(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return ka(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function Ba(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:d,externalTree:f,getInsideElements:w}=e,h=t.useState("open"),g=t.useState("domReferenceElement"),C=t.useState("floatingElement"),{events:S,dataRef:I}=t.context,b=ae(()=>I.current.floatingContext?.nodeId),y=n===!1,x=Ra(g)&&y,R=lt(n),T=lt(a),L=lt(s),W=lt(l),M=lt(h),F=to(f),A=lu(),v=$t.useRef(!1),O=$t.useRef(!1),X=$t.useRef(!1),P=$t.useRef(null),N=$t.useRef(""),z=$t.useRef(""),K=$t.useRef(null),E=$t.useRef(null),ue=Mo(K,d,A?.beforeInsideRef),H=Mo(E,A?.afterInsideRef),_=rt(),G=rt(),le=hr(),Te=A!=null,te=va(C),se=ae((B=te)=>B?La(B):[]),pe=ae(()=>w?.().filter((B)=>B!=null)??[]);$t.useEffect(()=>{if(r||!c)return;function B(ie){if(ie.key==="Tab"){if(fe(te,nt(ve(te)))&&se().length===0&&!x)So(ie)}}let Q=ve(te);return Ae(Q,"keydown",B)},[r,te,c,x,se]),$t.useEffect(()=>{if(r||!h)return;let B=ve(te);function Q(){X.current=!1}function ie(ye){let re=Ze(ye),V=pe(),J=fe(C,re)||fe(g,re)||fe(A?.portalNode,re)||V.some((Ee)=>Ee===re||fe(Ee,re));if(X.current=!J,z.current=ye.pointerType||"keyboard",Ir(re,`[${vi}]`))O.current=!0,G.start(0,()=>{O.current=!1})}function xe(){z.current="keyboard"}return Zt(Ae(B,"pointerdown",ie,!0),Ae(B,"pointerup",Q,!0),Ae(B,"pointercancel",Q,!0),Ae(B,"keydown",xe,!0),Q)},[r,C,g,te,h,A,G,pe]),$t.useEffect(()=>{if(r||!u)return;let B=ve(te);function Q(){O.current=!0,G.start(0,()=>{O.current=!1})}function ie(V){let J=Ze(V);if(ka(J))P.current=J}function xe(V){let{relatedTarget:J,currentTarget:Ee}=V,ce=Ze(V);if(c&&J==null&&ce!=null&&fe(C,ce))Jp(ce);queueMicrotask(()=>{let Ce=b(),k=t.context.triggerElements,U=pe(),Ie=J?.hasAttribute(ir("focus-guard"))&&[K.current,E.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,zo(p),zo(m)].includes(J),Y=!(fe(g,J)||fe(C,J)||fe(J,C)||fe(A?.portalNode,J)||U.some((ne)=>ne===J||fe(ne,J))||k.hasMatchingElement((ne)=>fe(ne,J))||Ie||F&&(Fo(F.nodesRef.current,Ce).find((ne)=>fe(ne.context?.elements.floating,J)||fe(ne.context?.elements.domReference,J))||nu(F.nodesRef.current,Ce).find((ne)=>[ne.context?.elements.floating,va(ne.context?.elements.floating)].includes(J)||ne.context?.elements.domReference===J)));if(Ee===g&&te)ed(te);if(i&&Ee!==g&&!fn(ce)&&nt(B)===B.body){if(Ge(te)){if(te.focus(),i==="popup"){le.request(()=>{te.focus()});return}}let ne=se(),de=P.current,ge=(de&&ne.includes(de)?de:null)||ne[ne.length-1]||te;if(Ge(ge))ge.focus()}if(I.current.insideReactTree){I.current.insideReactTree=!1;return}if((x?!0:!c)&&J&&Y&&!O.current&&(x||J!==Qp()))v.current=!0,t.setOpen(!1,Le(On,V))})}function ye(){if(X.current)return;I.current.insideReactTree=!0,_.start(0,()=>{I.current.insideReactTree=!1})}let re=Ge(g)?g:null;if(!C&&!re)return;return Zt(re&&Ae(re,"focusout",xe),re&&Ae(re,"pointerdown",Q),C&&Ae(C,"focusin",ie),C&&Ae(C,"focusout",xe),C&&A&&Ae(C,"focusout",ye,!0))},[r,g,C,te,c,F,A,t,u,i,se,x,b,I,_,G,le,m,p,pe]),$t.useEffect(()=>{if(r||!C||!h)return;let B=Array.from(A?.portalNode?.querySelectorAll(`[${ir("portal")}]`)||[]),ie=(F?nu(F.nodesRef.current,b()):[]).find((Ee)=>Ra(Ee.context?.elements.domReference||null))?.context?.elements.domReference,ye=[...[C,...B,K.current,E.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...pe()],ie,zo(p),zo(m),x?g:null].filter((Ee)=>Ee!=null),re=su(ye,{ariaHidden:c||x,mark:!1}),V=[C,...B].filter((Ee)=>Ee!=null),J=su(V);return()=>{J(),re()}},[h,r,g,C,c,A,x,F,b,m,p,pe]),j(()=>{if(!h||r||!Ge(te))return;N.current="",z.current="";let B=ve(te),Q=nt(B);queueMicrotask(()=>{let ie=R.current,xe=typeof ie==="function"?ie(W.current||""):ie;if(xe===void 0||xe===!1)return;if(fe(te,Q))return;let re=null,V=()=>{if(re==null)re=se(te);return re[0]||te},J;if(xe===!0||xe===null)J=V();else J=zo(xe);J=J||V();let Ee=fe(te,nt(B)),ce=I.current.openEvent,Ce=ce?.type==="mousedown"&&Hr(ce);Vn(J,{sync:Ce,preventScroll:J===te,shouldFocus(){if(!M.current)return!1;if(Ee)return!0;let k=nt(B);return!(k!==J&&fe(te,k))}})})},[r,h,te,se,R,W,M,I]);let we=$t.useRef(null);j(()=>{if(r||!te){we.current=null;return}if(we.current)we.current.cancelled=!0,we.current=null;let B=ve(te),Q=nt(B),ie=W.current==null;Jp(Q);function xe(re){if(!re.open)N.current=x2(re.nativeEvent,z.current);if(re.reason===On&&re.triggerElement?.hasAttribute(ir("focus-guard"))||re.reason===uo&&re.nativeEvent.type==="mouseleave")v.current=!0;if(re.reason!==kl)return;if(re.nested)v.current=!1;else if(Hr(re.nativeEvent)||Hn(re.nativeEvent))v.current=!1;else{let V=!1;if(ve(te).createElement("div").focus({get preventScroll(){return V=!0,!1}}),V)v.current=!1;else v.current=!0}}S.on("openchange",xe);function ye(re){let V=T.current,J=typeof V==="function"?V(re):V;if(J===void 0||J===!1)return null;if(J===null)J=!0;let Ee=g?.isConnected?g:null,ce=Q?.isConnected&&Tt(Q)!=="body"?Q:null,Ce=ie?ce||Ee:Ee||ce;if(!Ce)Ce=Qp()||null;if(typeof J==="boolean")return Ce;return zo(J)||Ce||null}return()=>{S.off("openchange",xe);let re=nt(B),V=pe(),J=fe(C,re)||V.some((U)=>U===re||fe(U,re))||F&&Fo(F.nodesRef.current,b(),!1).some((U)=>fe(U.context?.elements.floating,re)),Ee=T.current,ce=N.current,Ce=ye(ce),k={cancelled:!1};we.current=k,queueMicrotask(()=>{if(we.current===k)we.current=null;let U=y2(Ce),Ie=L.current??typeof Ee!=="boolean";if(!k.cancelled&&Ee&&!v.current&&Ge(U)&&(!Ie&&U!==re&&re!==B.body?J:!0)){let Y={preventScroll:!0};if(ce==="keyboard")Y.focusVisible=!0;U.focus(Y)}v.current=!1})}},[r,C,te,T,L,W,S,F,g,b,pe]),j(()=>{if(!gr.webkit||h||!C)return;let B=nt(ve(C));if(!Ge(B)||!br(B))return;if(fe(C,B))B.blur()},[h,C]),j(()=>{if(r||!A)return;return A.setFocusManagerState({modal:c,closeOnFocusOut:u,open:h,onOpenChange:t.setOpen,domReference:g}),()=>{A.setFocusManagerState(null)}},[r,A,c,h,t,u,g]),j(()=>{if(r||!te)return;return ed(te),()=>{queueMicrotask(fu)}},[r,te]);let q=!r&&(c?!x:!0)&&(Te||c);return w2($t.Fragment,{children:[q&&Yp(Zo,{"data-type":"inside",ref:ue,onFocus:(B)=>{if(c){let Q=se();Vn(Q[Q.length-1])}else if(A?.portalNode)if(v.current=!1,Sr(B,A.portalNode))wi(g)?.focus();else zo(p??A.beforeOutsideRef)?.focus()}}),o,q&&Yp(Zo,{"data-type":"inside",ref:H,onFocus:(B)=>{if(c)Vn(se()[0]);else if(A?.portalNode){if(u)v.current=!0;if(Sr(B,A.portalNode))xi(g)?.focus();else zo(m??A.afterOutsideRef)?.focus()}}})]})}import*as Ha from"react";function Va(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=ti}=t,u=e.context.dataRef,l=Ha.useRef(void 0),m=hr(),p=rt(),d=Ha.useMemo(()=>{function f(h,g,C,S){let I=Le(c,g,C);if(h&&S==="touch"&&i>0)p.start(i,()=>{e.setOpen(!0,I)});else e.setOpen(h,I)}function w(h,g,C){let S=u.current.openEvent,I=e.select("domReferenceElement")!==g;if(h&&I)return!0;if(!h)return!0;if(!n)return!0;if(S&&(typeof s==="function"?s():s))return!C(S.type);return!1}return{onPointerDown(h){l.current=Cr(h.pointerType,!0)&&Hn(h.nativeEvent)?"virtual":h.pointerType},onMouseDown(h){let g=l.current,C=h.nativeEvent,S=e.select("open");if(h.button!==0||r==="click"||Cr(g,!0)&&a)return;let I=w(S,h.currentTarget,(R)=>R==="click"||R==="mousedown"),b=Ze(C),y=br(b);if(y||g==="virtual"){f(I,C,y?b:h.currentTarget,g);return}let x=h.currentTarget;m.request(()=>{f(I,C,x,g)})},onClick(h){if(r==="mousedown-only")return;let g=l.current;if(r==="mousedown"&&g){l.current=void 0;return}if(Cr(g,!0)&&a)return;let C=e.select("open"),S=w(C,h.currentTarget,(I)=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");f(S,h.nativeEvent,h.currentTarget,g)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,p,i]);return Ha.useMemo(()=>o?{reference:d}:We,[o,d])}import*as oo from"react";function R2(){return!1}function v2(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Ua(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=R2,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:p}=e.context,d=to(c),f=ae(typeof n==="function"?n:()=>!1),w=typeof n==="function"?f:n,h=w!==!1,g=ae(()=>a),{escapeKey:C,outsidePress:S}=v2(i),I=oo.useRef(!1),b=oo.useRef(!1),y=oo.useRef(!1),x=oo.useRef(!1),R=oo.useRef(!1),T=oo.useRef(""),L=oo.useRef(null),W=rt(),M=rt(),F=rt(),A=ae(()=>{M.clear(),m.current.insideReactTree=!1}),v=ae((H)=>{let _=m.current.floatingContext?.nodeId;return(d?Fo(d.nodesRef.current,_):[]).some((le)=>le.context?.open&&!le.context.dataRef.current[H])}),O=ae((H)=>di(H,e.select("floatingElement"))||di(H,e.select("domReferenceElement"))),X=ae((H)=>{if(!s())return;e.setOpen(!1,Le(ti,H.nativeEvent))}),P=ae((H)=>{if(!u||!o||!r||H.key!=="Escape")return;let _=hp(H)?H.nativeEvent:H;if(R.current||_.isComposing)return;if(!C&&v("__escapeKeyBubbles"))return;let G=Le(Dl,_);if(e.setOpen(!1,G),!G.isCanceled)H.preventDefault();if(!C&&!G.isPropagationAllowed)H.stopPropagation()}),N=ae(()=>{m.current.insideReactTree=!0,M.start(0,A)}),z=ae((H)=>{if(!u||!o||H.button!==0)return;let _=Ze(H.nativeEvent);if(!fe(e.select("floatingElement"),_))return;if(!I.current)I.current=!0,b.current=!1}),K=ae((H)=>{if(!u||!o)return;if(!(H.defaultPrevented||H.nativeEvent.defaultPrevented))return;if(I.current)b.current=!0});oo.useEffect(()=>{function H(_){if(!_.open)x.current=!1}return p.on("openchange",H),()=>{p.off("openchange",H)}},[p]),oo.useEffect(()=>A,[A]),oo.useEffect(()=>{if(!u||!o){if(!u)x.current=!1,R.current=!1,T.current="",L.current=null;return A}m.current.__escapeKeyBubbles=C,m.current.__outsidePressBubbles=S;let H=new eo,_=ve(l);function G(){F.clear(),R.current=!0}function le(){R.current=!0,F.start(gr.webkit?5:0,()=>{R.current=!1})}function Te(){y.current=!0,H.start(0,()=>{y.current=!1})}function te(){I.current=!1,b.current=!1}function se(){let k=T.current,U=k==="pen"||!k?"mouse":k,Ie=g(),Y=typeof Ie==="function"?Ie():Ie;if(typeof Y==="string")return Y;return Y[U]}function pe(k){let U=se();return U==="intentional"&&k.type!=="click"||U==="sloppy"&&k.type==="click"}function we(k){let U=m.current.floatingContext?.nodeId,Ie=d&&Fo(d.nodesRef.current,U).some((Y)=>di(k,Y.context?.elements.floating));return O(k)||Ie}function q(k){if(pe(k)){if(k.type!=="click"&&!O(k))H.clear(),y.current=!1;A();return}if(m.current.insideReactTree){A();return}let U=Ze(k),Ie=`[${ir("inert")}]`,Y=He(U)?U.getRootNode():null,ne=Array.from((Go(Y)?Y:ve(e.select("floatingElement"))).querySelectorAll(Ie)),de=e.context.triggerElements;if(U&&(de.hasElement(U)||de.hasMatchingElement((he)=>fe(he,U))))return;let ge=He(U)?U:null;while(ge&&!Lo(ge)){let he=ko(ge);if(Lo(he)||!He(he))break;ge=he}if(ne.length&&He(U)&&!gp(U)&&!fe(U,e.select("floatingElement"))&&ne.every((he)=>!fe(ge,he)))return;if(Ge(U)&&!("touches"in k)){let he=Lo(U),ke=Xt(U),Xe=/auto|scroll/,ct=he||Xe.test(ke.overflowX),so=he||Xe.test(ke.overflowY),io=ct&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,Bo=so&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,qt=ke.direction==="rtl",_t=Bo&&(qt?k.offsetX<=U.offsetWidth-U.clientWidth:k.offsetX>U.clientWidth),po=io&&k.offsetY>U.clientHeight;if(_t||po)return}if(we(k))return;if(se()==="intentional"){if(k.detail!==0&&!Hr(k)&&!x.current)return;if(y.current){H.clear(),y.current=!1;return}}if(typeof w==="function"&&!w(k))return;if(v("__outsidePressBubbles"))return;e.setOpen(!1,Le(kl,k)),A()}function B(k){if(se()!=="sloppy"||k.pointerType==="touch"||!e.select("open")||!o||O(k))return;q(k)}function Q(k){if(se()!=="sloppy"||!e.select("open")||!o||O(k))return;let U=k.touches[0];if(U)L.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},W.start(1000,()=>{if(L.current)L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1})}function ie(k,U){let Ie=Ze(k);if(!Ie)return;let Y=Ae(Ie,k.type,()=>{U(k),Y()})}function xe(k){T.current="touch",ie(k,Q)}function ye(k){if(W.clear(),k.type==="pointerdown"){if(k.button===0)x.current=!0;T.current=k.pointerType}if(k.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;ie(k,(U)=>{if(U.type==="pointerdown")B(U);else q(U)})}function re(k){if(k.type==="pointercancel")x.current=!1;if(!I.current)return;let U=b.current;if(te(),se()!=="intentional")return;if(k.type==="pointercancel"){if(U)Te();return}if(we(k))return;if(U){Te();return}if(typeof w==="function"&&!w(k))return;H.clear(),y.current=!0,A()}function V(k){if(se()!=="sloppy"||!L.current||O(k))return;let U=k.touches[0];if(!U)return;let Ie=Math.abs(U.clientX-L.current.startX),Y=Math.abs(U.clientY-L.current.startY),ne=Math.sqrt(Ie*Ie+Y*Y);if(ne>5)L.current.dismissOnTouchEnd=!0;if(ne>10)q(k),W.clear(),L.current=null}function J(k){ie(k,V)}function Ee(k){if(se()!=="sloppy"||!L.current||O(k))return;if(L.current.dismissOnTouchEnd)q(k);W.clear(),L.current=null}function ce(k){ie(k,Ee)}let Ce=Zt(r&&Zt(Ae(_,"keydown",P),Ae(_,"compositionstart",G),Ae(_,"compositionend",le)),h&&Zt(Ae(_,"click",ye,!0),Ae(_,"pointerdown",ye,!0),Ae(_,"pointerup",re,!0),Ae(_,"pointercancel",re,!0),Ae(_,"mousedown",ye,!0),Ae(_,"mouseup",re,!0),Ae(_,"touchstart",xe,{capture:!0,passive:!0}),Ae(_,"touchmove",J,{capture:!0,passive:!0}),Ae(_,"touchend",ce,{capture:!0,passive:!0})));return()=>{Ce(),H.clear(),te(),y.current=!1}},[m,l,r,h,w,u,o,C,S,P,A,g,v,O,d,e,W,F]);let E=oo.useMemo(()=>({onKeyDown:P,onPointerDown:X,onClick:X}),[P,X]),ue=oo.useMemo(()=>({onKeyDown:P,onPointerDown:K,onMouseDown:K,onClickCapture:N,onMouseDownCapture(H){N(),z(H)},onPointerDownCapture(H){N(),z(H)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[P,N,z,K]);return oo.useMemo(()=>o?{reference:E,floating:ue,trigger:E}:{},[o,E,ue])}import*as du from"react";import*as T2 from"react-dom";function Wa(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),j(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(He(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as pu from"react";function td(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=ae(n),{mounted:c,setMounted:u,transitionStatus:l}=mp(t,!1,!1,s),m=t?!1:r;j(()=>{if(t)i(!1)},[t,i]);let p=pu.useRef(c),d=pu.useRef(!1),f=si(),w=()=>{p.current=!1,u(!1),a()};j(()=>{if(p.current=c,d.current){if(d.current=!1,!t&&c)w()}});let h=ae(()=>{if(!p.current)return;if(t){d.current=!0,f();return}w()});return Or({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)h()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:h}}var Pi={tabIndex:-1,[wa]:""};function rd(e){return(t)=>t==="touch"?e.current:!0}function nd(e,t=!1){let o=nr(),r=xo()!=null,n=qe(()=>e(o,r)).current;return Wa({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function Ai({handle:e,store:t}){return j(()=>e.attachStore(t),[e,t]),null}function od(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function E2(e,t){let o=du.useRef(null);return ae((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),od(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),od(t)})}function Mi(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function ad(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ki(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=E2(e,o),s=ae((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=ae((c)=>{if(a(c),c)s(c)});return j(()=>(i(t.current),()=>i(null)),[i,t,o,e]),j(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function Li(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=du.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");j(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let p=e.context.triggerElements.getById(l);if(!p){for(let[d,f]of e.context.triggerElements.entries())if(f===e.state.activeTriggerElement){u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,p!==e.state.activeTriggerElement)u.activeTriggerElement=p}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let p=e.context.triggerElements.entries().next();if(!p.done){let[d,f]=p.value;u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let p=Le(ga);if(e.setOpen(!1,p),!p.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function Di(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=td({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return qe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function Fi(e,t){e.useSyncedValues(t),j(()=>()=>{e.update({activeTriggerProps:We,inactiveTriggerProps:We,popupProps:We})},[e])}function sd(e,t){j(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),j(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class _a{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Cu=Wm(Oi(),1);import*as ud from"react";import*as _r from"react";var V2=Oi();function U2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W2=typeof Object.is==="function"?Object.is:U2,_2=V2.useSyncExternalStore,G2=_r.useRef,z2=_r.useEffect,Z2=_r.useMemo,q2=_r.useDebugValue;var hu=function(e,t,o,r,n){var a=G2(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=Z2(function(){function c(d){if(!u){if(u=!0,l=d,d=r(d),n!==void 0&&s.hasValue){var f=s.value;if(n(f,d))return m=f}return m=d}if(f=m,W2(l,d))return f;var w=r(d);if(n!==void 0&&n(f,w))return l=d,f;return l=d,m=w}var u=!1,l,m,p=o===void 0?null:o;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,o,r,n]);var i=_2(e,a[0],a[1]);return z2(function(){s.hasValue=!0,s.value=i},[i]),q2(i),i};import*as id from"react";var Iu=[],bu=void 0;function cd(){return bu}function ld(e){Iu.push(e)}function Ga(e){let t=(o,r)=>{let n=qe(j2).current,a;try{bu=n;for(let s of Iu)s.before(n);a=e(o,r);for(let s of Iu)s.after(n);n.didInitialize=!0}finally{bu=void 0}return a};return t.displayName=e.displayName||e.name,t}function Ni(e){return id.forwardRef(Ga(e))}function j2(){return{didInitialize:!1}}var X2=En(19),$2=X2?K2:J2;function Bi(e,t,o,r,n){return $2(e,t,o,r,n)}function Y2(e,t,o,r,n){let a=ud.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return Cu.useSyncExternalStore(e.subscribe,a,a)}ld({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};Cu.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function K2(e,t,o,r,n){let a=cd();if(!a)return Y2(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function J2(e,t,o,r,n){return hu(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class Su{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=(e)=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return Bi(this,e,t,o,r)}}import*as dn from"react";class wr extends Su{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){dn.useDebugValue(e);let o=this;j(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;j(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);j(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){dn.useDebugValue(e);let o=this,r=t!==void 0;j(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return dn.useDebugValue(e),Bi(this,this.selectors[e],t,o,r)}useContextCallback(e,t){dn.useDebugValue(e);let o=ae(t??Ye);this.context[e]=o}useStateSetter(e){let t=dn.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var Q2={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class wu extends wr{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ei(),nested:o,triggerElements:n},Q2);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Ip(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Vi(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:We,inactiveTriggerProps:We,popupProps:We}}var za=(e)=>e.triggerIdProp??e.activeTriggerId,Hi=(e)=>e.openProp??e.open,md=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function fd(e,t){return t!==void 0&&Hi(e)&&za(e)===t}function eb(e,t){if(fd(e,t))return!0;return t!==void 0&&Hi(e)&&za(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Un={open:Hi,mounted:(e)=>e.mounted,transitionStatus:(e)=>Hi(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:za,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:md,isTriggerActive:(e,t)=>t!==void 0&&za(e)===t,isOpenedByTrigger:(e,t)=>fd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&za(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>eb(e,t)?md(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var pd=Wm(Oi(),1);import*as xu from"react";function Ui(e){let t=xu.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=xu.useCallback(()=>e===void 0?void 0:e.store,[e]);return pd.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as cr from"react";var yu=dr.mac&&gr.webkit;function Ru(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=cr.useRef(!1),i=cr.useRef(null),c=cr.useRef(!0),u=rt();cr.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let p=ze(m);function d(){let h=e.select("domReferenceElement");if(!e.select("open")&&Ge(h)&&h===nt(ve(h)))s.current=!0,i.current=h}function f(){c.current=!0}function w(){c.current=!1}return Zt(Ae(p,"blur",d),yu&&Ae(p,"keydown",f,!0),yu&&Ae(p,"pointerdown",w,!0))},[e,o]),cr.useEffect(()=>{if(!o)return;function m(p){if(p.reason===ti||p.reason===Dl){let d=e.select("domReferenceElement");if(He(d))i.current=d,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=cr.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(p){let d=p.currentTarget;if(s.current){if(i.current===d)return;m()}let f=Ze(p.nativeEvent);if(He(f)){if(yu&&!p.relatedTarget){if(!c.current&&!br(f))return}else if(!Br(f))return}let w=Nr(p.relatedTarget,e.context.triggerElements),{nativeEvent:h,currentTarget:g}=p;if(e.select("open")&&w||!r){e.setOpen(!0,Le(ha,h,g));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Le(ha,h,g))})},onBlur(p){m();let{relatedTarget:d,nativeEvent:f}=p,w=He(d)&&d.hasAttribute(ir("focus-guard"))&&d.getAttribute("data-type")==="outside";u.start(0,()=>{let h=e.select("domReferenceElement"),g=nt(ve(h));if(!d&&g===h)return;if(fe(a.current.floatingContext?.refs.floating.current,g)||fe(h,g)||w)return;if(Nr(d??g,e.context.triggerElements))return;e.setOpen(!1,Le(ha,f))})}}},[a,r,e,u]);return cr.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as Eu from"react";class vu{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new eo;restTimeout=new eo;handleCloseOptions=void 0;static create(){return new vu}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var Wi=new WeakMap;function Wn(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Wi.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Wi.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function _i(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=Wi.get(o);if(a&&a!==e)Wn(a);Wn(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Wi.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function Gi(e){let t=e.context.dataRef.current,o=qe(()=>t.hoverInteractionState??vu.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return Fr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function tb(e,t){if(t!=null&&!Cr(t))return 0;if(typeof e==="function")return e();return e}function Za(e,t,o){let r=tb(e,o);if(typeof r==="number")return r;return r?.[t]}function Tu(e){if(typeof e==="function")return e();return e}function zi(e,t){return t||e==="click"||e==="mousedown"}function dd(e){return e?.includes("mouse")&&e!=="mousedown"}function Pu(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=to(),l=xo(),m=Gi(e),p=rt(),d=ae(()=>zi(c.current.openEvent?.type,m.interactedInside)),f=ae(()=>dd(c.current.openEvent?.type)),w=ae(()=>{Wn(m)});j(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w()},[a,m,w]),Eu.useEffect(()=>w,[w]),j(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&f()&&He(i)&&s){let h=i,g=s,C=ve(s),S=u?.nodesRef.current.find((x)=>x.id===l)?.context?.elements.floating;if(S)S.style.pointerEvents="";let I=m.pointerEventsScopeElement!==g?m.pointerEventsScopeElement:null,b=S!==g?S:null,y=m.handleCloseOptions?.getScope?.()??I??b??Ir(h,"[data-rootownerid]")??C.body;return _i(m,{scopeElement:y,referenceElement:h,floatingElement:g}),()=>{w()}}return},[o,a,i,s,m,f,u,l,w]),Eu.useEffect(()=>{if(!o)return;function h(){return!!(u&&l&&Fo(u.nodesRef.current,l).length>0)}function g(x){let R=Za(r,"close",m.pointerType),T=()=>{e.setOpen(!1,Le(uo,x)),u?.events.emit("floating.closed",x)};if(R)m.openChangeTimeout.start(R,T);else m.openChangeTimeout.clear(),T()}function C(x){let R=Ze(x);if(!Xl(R)){m.interactedInside=!1;return}m.interactedInside=Ir(R,"[aria-haspopup]")!=null}function S(){m.openChangeTimeout.clear(),p.clear(),u?.events.off("floating.closed",b),w()}function I(x){if(h()&&u){u.events.on("floating.closed",b);return}if(Nr(x.relatedTarget,e.context.triggerElements))return;let R=c.current.floatingContext?.nodeId??n,T=x.relatedTarget;if(u&&R&&He(T)&&Fo(u.nodesRef.current,R,!1).some((W)=>fe(W.context?.elements.floating,T)))return;if(m.handler){m.handler(x);return}if(w(),f()&&!d())g(x)}function b(x){if(!u||!l||h())return;p.start(0,()=>{u.events.off("floating.closed",b),e.setOpen(!1,Le(uo,x)),u.events.emit("floating.closed",x)})}let y=s;return Zt(y&&Ae(y,"mouseenter",S),y&&Ae(y,"mouseleave",I),y&&Ae(y,"pointerdown",C,!0),()=>{u?.events.off("floating.closed",b)})},[o,s,e,c,r,n,f,d,w,m,u,l,p])}import*as Gr from"react";import*as gd from"react-dom";var ob={current:null};function Au(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=ob,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:p,shouldOpen:d,guardStaleOpen:f=!1}=t,{dataRef:w,events:h}=e.context,g=to(u),C=Gi(e),S=Gr.useRef(!1),I=lt(n),b=lt(r),y=lt(s),x=lt(o),R=lt(d),T=lt(p),L=ae(()=>zi(w.current.openEvent?.type,C.interactedInside)),W=ae(()=>R.current?.()!==!1),M=ae((v,O,X)=>{let P=e.context.triggerElements;if(P.hasElement(O))return!v||!fe(v,O);if(!He(X))return!1;let N=X;return P.hasMatchingElement((z)=>fe(z,N))&&(!v||!fe(v,N))}),F=ae(()=>{if(!C.handler)return;ve(e.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),A=ae(()=>{Wn(C)});if(l)C.handleCloseOptions=n?.__options;return Gr.useEffect(()=>F,[F]),Gr.useEffect(()=>{if(!o)return;function v(O){if(!O.open)S.current=O.reason===uo,F(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1;else S.current=!1}return h.on("openchange",v),()=>{h.off("openchange",v)}},[o,h,C,F]),Gr.useEffect(()=>{if(!o)return;function v(K,E=!0){let ue=Za(b.current,"close",C.pointerType);if(ue)C.openChangeTimeout.start(ue,()=>{e.setOpen(!1,Le(uo,K)),g?.events.emit("floating.closed",K)});else if(E)C.openChangeTimeout.clear(),e.setOpen(!1,Le(uo,K)),g?.events.emit("floating.closed",K)}let O=c.current??(l?e.select("domReferenceElement"):null);if(!He(O))return;function X(K){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!Cr(C.pointerType))return;let E=Tu(y.current),ue=Za(b.current,"open",C.pointerType),H=Ze(K),_=K.currentTarget??null,G=e.select("domReferenceElement"),le=_;if(He(H)&&!e.context.triggerElements.hasElement(H)){for(let ie of e.context.triggerElements.elements())if(fe(ie,H)){le=ie;break}}if(He(_)&&He(G)&&!e.context.triggerElements.hasElement(_)&&fe(_,G))le=G;let Te=le==null?!1:M(G,le,H),te=e.select("open"),se=T.current?.()??e.select("transitionStatus")==="ending",pe=!te&&se&&S.current,we=!Te&&He(le)&&He(G)&&fe(G,le)&&pe,q=E>0&&!ue,B=Te&&(te||pe)||we,Q=!te||Te;if(B){if(W())e.setOpen(!0,Le(uo,K,le));return}if(q)return;if(ue)C.openChangeTimeout.start(ue,()=>{if(Q&&W())e.setOpen(!0,Le(uo,K,le))});else if(Q){if(W())e.setOpen(!0,Le(uo,K,le))}}function P(K){if(L()){A();return}F();let E=e.select("domReferenceElement"),ue=ve(E);C.restTimeout.clear(),C.restTimeoutPending=!1;let H=w.current.floatingContext??m?.();if(Nr(K.relatedTarget,e.context.triggerElements))return;if(I.current&&H){if(!e.select("open"))C.openChangeTimeout.clear();let G=c.current;C.handler=I.current({...H,tree:g,x:K.clientX,y:K.clientY,onClose(){if(A(),F(),x.current&&!L()&&G===e.select("domReferenceElement"))v(K,!0)}}),ue.addEventListener("mousemove",C.handler),C.handler(K);return}if(C.pointerType==="touch"?!fe(e.select("floatingElement"),K.relatedTarget):!0)v(K)}function N(K){if(fe(O,K.relatedTarget))return;C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1}let z=f?Ae(O,"mouseout",N):void 0;if(i)return Zt(Ae(O,"mousemove",X,{once:!0}),Ae(O,"mouseenter",X),Ae(O,"mouseleave",P),z);return Zt(Ae(O,"mouseenter",X),Ae(O,"mouseleave",P),z)},[F,A,w,b,e,o,I,C,l,M,L,a,i,y,c,g,x,m,T,W,f]),Gr.useMemo(()=>{if(!o)return;function v(O){C.pointerType=O.pointerType}return{onPointerDown:v,onPointerEnter:v,onMouseMove(O){let{nativeEvent:X}=O,P=O.currentTarget,N=e.select("domReferenceElement"),z=e.select("open"),K=M(N,P,O.target);if(a&&!Cr(C.pointerType))return;if(z&&K&&C.handleCloseOptions?.blockPointerEvents){let H=e.select("floatingElement");if(H){let _=C.handleCloseOptions?.getScope?.()??P.ownerDocument.body;_i(C,{scopeElement:_,referenceElement:P,floatingElement:H})}}let E=Tu(y.current);if(z&&!K||E===0)return;if(!K&&C.restTimeoutPending&&O.movementX**2+O.movementY**2<2)return;C.restTimeout.clear();function ue(){if(C.restTimeoutPending=!1,L())return;let H=e.select("open");if(!C.blockMouseMove&&(!H||K)&&W())e.setOpen(!0,Le(uo,X,P))}if(C.pointerType==="touch")gd.flushSync(()=>{ue()});else if(K&&z)ue();else C.restTimeoutPending=!0,C.restTimeout.start(E,ue)}}},[o,C,L,M,a,e,y,W])}import*as Yt from"react";function hd(e){return gr.webkit&&e.movementX===0&&e.movementY===0}function qi(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Zi(e,t){return qi(t,e===ql||e===pi,e===xa||e===ya)}function Mu(e,t,o){return qi(t,e===pi,o?e===xa:e===ya)||e==="Enter"||e===" "||e===""}function rb(e,t,o){return qi(t,o?e===xa:e===ya,e===pi)}function nb(e,t,o,r){let n=o?e===ya:e===xa,a=e===ql;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return qi(t,n,a)}function ku(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:f=!0,disabledIndices:w=void 0,orientation:h="vertical",triggerOrientation:g=h,parentOrientation:C,id:S,resetOnPointerLeave:I=!0,externalTree:b,nestedReturnFocusRef:y,grid:x}=t,R=x!=null,T=e.useState("open"),L=e.useState("floatingElement"),W=e.useState("domReferenceElement"),M=e.context.dataRef,F=va(L),A=Ra(W),v=lt(F),O=xo(),X=to(b),P=Yt.useRef(p),N=Yt.useRef(s??-1),z=Yt.useRef(null),K=Yt.useRef(!0),E=ae((k)=>{n(N.current===-1?null:N.current,k)}),ue=Yt.useRef(!!L),H=Yt.useRef(T),_=Yt.useRef(!1),G=Yt.useRef(!1),le=Yt.useRef(null),Te=lt(w),te=lt(T),se=lt(s),pe=lt(I),we=hr(),q=hr(),B=ae(()=>{we.cancel();function k(ne){if(!m)le.current=Vn(ne,{sync:_.current,preventScroll:!0})}let U=o.current[N.current],Ie=G.current;if(U)k(U);(_.current?(ne)=>ne():(ne)=>we.request(ne))(()=>{let ne=o.current[N.current]||U;if(!ne)return;if(!U)k(ne);if(V&&(Ie||!K.current))ne.scrollIntoView?.({block:"nearest",inline:"nearest"})})});j(()=>{M.current.orientation=h},[M,h]),j(()=>{if(!T)z.current=null;if(!T||p!=="auto")P.current=p},[T,p]),j(()=>{if(!a)return;if(T&&L){if(N.current=s??-1,P.current&&s!=null)G.current=!0,E()}else if(ue.current)N.current=-1,E()},[a,T,L,s,E]),j(()=>{if(!a)return;if(!T){_.current=!1;return}if(!L)return;if(r==null){if(_.current=!1,se.current!=null)return;if(ue.current)N.current=-1,B();if((!H.current||!ue.current)&&P.current&&(z.current!=null||P.current===!0&&z.current==null)){let k=0,U=()=>{if(o.current[0]==null){if(k<2)(k?(Y)=>q.request(Y):queueMicrotask)(U);k+=1}else N.current=z.current==null||Mu(z.current,g,l)||u?Si(o):$l(o),z.current=null,E()};U()}}else if(!Ci(o.current,r))N.current=r,B(),G.current=!1},[a,T,L,r,se,u,o,g,l,E,B,q]),j(()=>{if(!a||L||!X||m||!ue.current)return;let k=X.nodesRef.current,U=k.find((ne)=>ne.id===O)?.context?.elements.floating,Ie=nt(ve(W??U??null)),Y=k.some((ne)=>ne.context&&fe(ne.context.elements.floating,Ie));if(U&&!Y&&K.current)U.focus({preventScroll:!0})},[a,L,W,X,O,m]),j(()=>{H.current=T,ue.current=!!L});let Q=r!=null,ie=ae((k)=>{if(!te.current)return;let U=o.current.indexOf(k.currentTarget);if(U!==-1&&(N.current!==U||r!==U))N.current=U,E(k)}),xe=ae(()=>C??X?.nodesRef.current.find((k)=>k.id===O)?.context?.dataRef?.current.orientation),ye=ae(()=>Si(o,Te.current)),re=ae((k)=>{if(K.current=!1,_.current=!0,k.which===229)return;if(!te.current&&k.currentTarget===v.current)return;if(u&&nb(k.key,h,l,R)){if(!Zi(k.key,xe()))So(k);e.setOpen(!1,Le(oi,k.nativeEvent));let ne=y?.current??W;if(Ge(ne))ne.focus();return}if(r!=null&&r!==N.current&&!Ci(o.current,r))N.current=r;let U=N.current,Ie=Si(o,w),Y=$l(o,w);if(!A){if(k.key==="Home")So(k),N.current=Ie,E(k);if(k.key==="End")So(k),N.current=Y,E(k)}if(x!=null){let ne=x(k,N.current,o,h,c,l,w,Ie,Y);if(ne!=null&&ne!==N.current)N.current=ne,E(k);if(h==="both")return}if(Zi(k.key,h)){So(k);let ne=nt(k.currentTarget.ownerDocument);if(T&&!m&&fe(k.currentTarget,ne)&&!o.current.some((he)=>he!=null&&fe(he,ne))){if(N.current=Mu(k.key,h,l)?Ie:Y,E(k),r===N.current)B();return}let{index:de,wrapped:ge}=yp(o.current,U,{decrement:!Mu(k.key,h,l),loopFocus:c,allowEscape:i,disabledIndices:w,minIndex:Ie,maxIndex:Y});if(ge)_.current=!1;N.current=de,E(k)}}),V=Yt.useMemo(()=>({onFocus(U){_.current=!0,ie(U)},onClick({currentTarget:U}){if(!m)U.focus({preventScroll:!0})},onMouseMove(U){if(hd(U))return;if(_.current=!0,G.current=!1,d)ie(U)},onPointerLeave(U){if(!te.current||!K.current||U.pointerType==="touch")return;_.current=!0;let Ie=U.relatedTarget;if(!d||o.current.includes(Ie))return;if(!pe.current)return;if(le.current?.(),le.current=null,N.current=-1,E(U),!m){let Y=v.current,ne=nt(ve(Y));if(Y&&fe(Y,ne))Y.focus({preventScroll:!0})}}}),[ie,te,v,d,o,E,pe,m]),J=Yt.useMemo(()=>m&&T&&Q&&{"aria-activedescendant":`${S}-${r}`},[m,T,Q,S,r]),Ee=Yt.useMemo(()=>({...!A?J:{},onKeyDown(k){if(k.key==="Tab"&&k.shiftKey&&T&&!m){let U=Ze(k.nativeEvent);if(U&&!fe(v.current,U))return;So(k);let Ie=Le(On,k.nativeEvent);e.setOpen(!1,Ie);let Y=y?.current??W;if(!Ie.isCanceled&&Ge(Y))Y.focus();return}re(k)},onPointerMove(k){if(hd(k))return;K.current=!0}}),[J,re,v,A,e,T,m,W,y]),ce=Yt.useMemo(()=>{function k(Y){e.setOpen(!0,Le(oi,Y.nativeEvent,Y.currentTarget))}function U(Y){if(p==="auto"&&Hr(Y.nativeEvent))P.current=!m}function Ie(Y){if(P.current=p,p==="auto"&&Hn(Y.nativeEvent))P.current=!0}return{onKeyDown(Y){let ne=e.select("open");K.current=!1;let de=Y.key.startsWith("Arrow"),ge=rb(Y.key,xe(),l),he=Zi(Y.key,ne?h:g),ke=(u?ge:he)||Y.key==="Enter"||Y.key.trim()==="";if(m&&ne&&(!u||br(Y.currentTarget)))return re(Y);if(!ne&&!f&&de)return;if(ke){let Xe=Zi(Y.key,xe());z.current=u&&Xe?null:Y.key}if(u){if(ge)if(So(Y),ne){if(N.current=ye(),E(Y),m)v.current?.focus()}else k(Y);return}if(he){if(se.current!=null)N.current=se.current;if(So(Y),!ne&&f)k(Y);else re(Y);if(ne)E(Y)}return},onFocus(Y){if(Y.target!==Y.currentTarget)return;if(e.select("open")&&!m)N.current=-1,E(Y)},onPointerDown:Ie,onPointerEnter:Ie,onMouseDown:U,onClick:U}},[re,p,ye,u,E,e,f,h,g,xe,l,se,m,v]),Ce=Yt.useMemo(()=>({...J,...ce}),[J,ce]);return Yt.useMemo(()=>a?{reference:Ce,floating:Ee,item:V,trigger:ce}:{},[a,Ce,Ee,ce,V])}import*as gn from"react";function Lu(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=ae(i),p=e.useState("open"),d=rt(),f=gn.useRef(""),w=gn.useRef(l??n??-1),h=gn.useRef(null),g=ae((I)=>{function b(A){return r?.current[A]}function y(A){let v=b(A);if(v&&!fn(v)||v?.matches(":disabled"))return!1;return s==null||!Kl(pr,A,s)}function x(A,v,O=0){if(A.length===0)return-1;let X=(O%A.length+A.length)%A.length,P=v.toLowerCase();for(let N=0;N<A.length;N+=1){let z=(X+N)%A.length;if(!A[z]?.toLowerCase().startsWith(P)||!y(z))continue;return z}return-1}let R=o.current;if(f.current.length>0&&I.key===" ")So(I),m?.(!0);if(f.current.length>0&&f.current[0]!==" "){if(x(R,f.current)===-1&&I.key!==" ")m?.(!1)}if(R==null||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;if(p&&I.key!==" ")So(I),m?.(!0);let T=f.current==="";if(T)w.current=l??n??-1;if(R.every((A,v)=>A&&y(v)?A[0]?.toLowerCase()!==A[1]?.toLowerCase():!0)&&f.current===I.key)f.current="",w.current=h.current;f.current+=I.key,d.start(u,()=>{f.current="",w.current=h.current,m?.(!1)});let M=((T?l??n??-1:w.current)??0)+1,F=x(R,f.current,M);if(F!==-1)a?.(F,I),h.current=F;else if(I.key!==" ")f.current="",m?.(!1)}),C=ae((I)=>{let b=I.relatedTarget,y=e.select("domReferenceElement"),x=e.select("floatingElement");if(fe(y,b)||fe(x,b))return;d.clear(),f.current="",w.current=h.current,m?.(!1)});j(()=>{if(!p&&l!==null)return;if(d.clear(),h.current=null,f.current!=="")f.current="",m?.(!1)},[p,l,d,m]);let S=gn.useMemo(()=>({onKeyDown:g,onBlur:C}),[g,C]);return gn.useMemo(()=>c?{reference:S,floating:S}:{},[c,S])}var Id=0.1,ab=Id*Id,Qe=0.5;function ji(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function Xi(e,t,o,r,n,a,s,i,c,u){let l=!1;if(ji(e,t,o,r,n,a))l=!l;if(ji(e,t,n,a,s,i))l=!l;if(ji(e,t,s,i,c,u))l=!l;if(ji(e,t,c,u,o,r))l=!l;return l}function sb(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function $i(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function Du(e={}){let{blockPointerEvents:t=!1}=e,o=new eo,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],p=!1,d=null,f=null,w=typeof performance<"u"?performance.now():0;function h(C,S){let I=performance.now(),b=I-w;if(d===null||f===null||b===0)return d=C,f=S,w=I,!1;let y=C-d,x=S-f,R=y*y+x*x,T=b*b*ab;return d=C,f=S,w=I,R<T}function g(){o.clear(),c()}return function(S){o.clear();let{domReference:I,floating:b}=i;if(!I||!b||m==null||n==null||a==null)return;let{clientX:y,clientY:x}=S,R=Ze(S),T=S.type==="mouseleave",L=fe(b,R),W=fe(I,R);if(L){if(p=!0,!T)return}if(W){if(p=!1,!T){p=!0;return}}if(T&&He(S.relatedTarget)&&fe(b,S.relatedTarget))return;function M(){return Boolean(l&&Fo(l.nodesRef.current,u).length>0)}function F(){if(!M())g()}if(M())return;let A=I.getBoundingClientRect(),v=b.getBoundingClientRect(),O=n>v.right-v.width/2,X=a>v.bottom-v.height/2,P=v.width>A.width,N=v.height>A.height,z=(P?A:v).left,K=(P?A:v).right,E=(N?A:v).top,ue=(N?A:v).bottom;if(m==="top"&&a>=A.bottom-1||m==="bottom"&&a<=A.top+1||m==="left"&&n>=A.right-1||m==="right"&&n<=A.left+1){F();return}let H=!1;switch(m){case"top":H=$i(y,x,z,A.top+1,K,v.bottom-1);break;case"bottom":H=$i(y,x,z,v.top+1,K,A.bottom-1);break;case"left":H=$i(y,x,v.right-1,ue,A.left+1,E);break;case"right":H=$i(y,x,A.right-1,ue,v.left+1,E);break;default:}if(H)return;if(p&&!sb(y,x,A)){F();return}if(!T&&h(y,x)){F();return}let _=!1;switch(m){case"top":{let G=P?Qe/2:Qe*4,le=P?n+G:O?n+G:n-G,Te=P?n-G:O?n+G:n-G,te=a+Qe+1,se=O?v.bottom-Qe:P?v.bottom-Qe:v.top,pe=O?P?v.bottom-Qe:v.top:v.bottom-Qe;_=Xi(y,x,le,te,Te,te,v.left,se,v.right,pe);break}case"bottom":{let G=P?Qe/2:Qe*4,le=P?n+G:O?n+G:n-G,Te=P?n-G:O?n+G:n-G,te=a-Qe,se=O?v.top+Qe:P?v.top+Qe:v.bottom,pe=O?P?v.top+Qe:v.bottom:v.top+Qe;_=Xi(y,x,le,te,Te,te,v.left,se,v.right,pe);break}case"left":{let G=N?Qe/2:Qe*4,le=N?a+G:X?a+G:a-G,Te=N?a-G:X?a+G:a-G,te=n+Qe+1,se=X?v.right-Qe:N?v.right-Qe:v.left,pe=X?N?v.right-Qe:v.left:v.right-Qe;_=Xi(y,x,se,v.top,pe,v.bottom,te,le,te,Te);break}case"right":{let G=N?Qe/2:Qe*4,le=N?a+G:X?a+G:a-G,Te=N?a-G:X?a+G:a-G,te=n-Qe,se=X?v.left+Qe:N?v.left+Qe:v.right,pe=X?N?v.left+Qe:v.right:v.left+Qe;_=Xi(y,x,te,le,te,Te,se,v.top,pe,v.bottom);break}default:}if(!_)F();else if(!p)o.start(40,F);return}};return r.__options={...e,blockPointerEvents:t},r}function bd(e,t,o){let{reference:r,floating:n}=e,a=ho(t),s=Ma(t),i=Aa(s),c=fo(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,p=r[i]/2-n[i]/2,d;switch(c){case"top":d={x:l,y:r.y-n.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:m};break;case"left":d={x:r.x-n.width,y:m};break;default:d={x:r.x,y:r.y}}let f=wo(t);if(f)d[s]+=p*(f==="end"?1:-1)*(o&&u?-1:1);return d}async function Cd(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:p=!1,padding:d=0}=sr(t,e),f=bi(d),h=i[p?m==="floating"?"reference":"floating":m],g=mn(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(h)))!=null?o:!0)?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),C=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),I=await(a.isElement==null?void 0:a.isElement(S))&&await(a.getScale==null?void 0:a.getScale(S))||{x:1,y:1},b=mn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:S,strategy:c}):C);return{top:(g.top-b.top+f.top)/I.y,bottom:(b.bottom-g.bottom+f.bottom)/I.y,left:(g.left-b.left+f.left)/I.x,right:(b.right-g.right+f.right)/I.x}}var ib=50,Sd=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:Cd},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=bd(u,r,c),p=r,d=0,f={};for(let w=0;w<a.length;w++){let h=a[w];if(!h)continue;let{name:g,fn:C}=h,{x:S,y:I,data:b,reset:y}=await C({x:l,y:m,initialPlacement:r,placement:p,strategy:n,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=S!=null?S:l,m=I!=null?I:m,f[g]={...f[g],...b},y&&d<ib){if(d++,typeof y==="object"){if(y.placement)p=y.placement;if(y.rects)u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:l,y:m}=bd(u,p,c))}w=-1}}return{x:l,y:m,placement:p,strategy:n,middlewareData:f}};var wd=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:w=!0,...h}=sr(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let g=fo(n),C=ho(i),S=fo(i)===i,I=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=p||(S||!w?[Ta(i)]:wp(i)),y=f!=="none";if(!p&&y)b.push(...xp(i,w,f,I));let x=[i,...b],R=await c.detectOverflow(t,h),T=[],L=((r=a.flip)==null?void 0:r.overflows)||[];if(l)T.push(R[g]);if(m){let A=Sp(n,s,I);T.push(R[A[0]],R[A[1]])}if(L=[...L,{placement:n,overflows:T}],!T.every((A)=>A<=0)){var W,M;let A=(((W=a.flip)==null?void 0:W.index)||0)+1,v=x[A];if(v){if(!(m==="alignment"?C!==ho(v):!1)||L.every((P)=>ho(P.placement)===C?P.overflows[0]>0:!0))return{data:{index:A,overflows:L},reset:{placement:v}}}let O=(M=L.filter((X)=>X.overflows[0]<=0).sort((X,P)=>X.overflows[1]-P.overflows[1])[0])==null?void 0:M.placement;if(!O)switch(d){case"bestFit":{var F;let X=(F=L.filter((P)=>{if(y){let N=ho(P.placement);return N===C||N==="y"}return!0}).map((P)=>[P.placement,P.overflows.filter((N)=>N>0).reduce((N,z)=>N+z,0)]).sort((P,N)=>P[1]-N[1])[0])==null?void 0:F[0];if(X)O=X;break}case"initialPlacement":O=i;break}if(n!==O)return{reset:{placement:O}}}return{}}}};var xd=new Set(["left","top"]);async function cb(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=fo(o),i=wo(o),c=ho(o)==="y",u=xd.has(s)?-1:1,l=a&&c?-1:1,m=sr(t,e),{mainAxis:p,crossAxis:d,alignmentAxis:f}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof f==="number")d=i==="end"?f*-1:f;return c?{x:d*l,y:p*u}:{x:p*u,y:d*l}}var yd=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await cb(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},Rd=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(C)=>{let{x:S,y:I}=C;return{x:S,y:I}}},...u}=sr(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),p=ho(n),d=Ii(p),f=l[d],w=l[p],h=(C,S)=>hi(S+m[C==="y"?"top":"left"],S,S-m[C==="y"?"bottom":"right"]);if(s)f=h(d,f);if(i)w=h(p,w);let g=c.fn({...t,[d]:f,[p]:w});return{...g,data:{x:g.x-o,y:g.y-r,enabled:{[d]:s,[p]:i}}}}}},vd=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=sr(e,t),p={x:n,y:a},d=ho(s),f=Ii(d),w=p[f],h=p[d],g=sr(u,t),C=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(o=g.mainAxis)!=null?o:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(l){let b=f==="y"?"height":"width",y=i.reference[f]-i.floating[b]+C.mainAxis,x=i.reference[f]+i.reference[b]-C.mainAxis;if(w<y)w=y;else if(w>x)w=x}if(m){var S,I;let b=f==="y"?"width":"height",y=xd.has(fo(s)),x=i.reference[d]-i.floating[b]+(y?((S=c.offset)==null?void 0:S[d])||0:0)+(y?0:C.crossAxis),R=i.reference[d]+i.reference[b]+(y?0:((I=c.offset)==null?void 0:I[d])||0)-(y?C.crossAxis:0);if(h<x)h=x;else if(h>R)h=R}return{[f]:w,[d]:h}}}},Td=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=sr(e,t),c=await n.detectOverflow(t,i),u=fo(o),l=wo(o),m=ho(o)==="y",{width:p,height:d}=r.floating,f,w;if(u==="top"||u==="bottom")f=u,w=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else w=u,f=l==="end"?"top":"bottom";let h=d-c.top-c.bottom,g=p-c.left-c.right,C=Vr(d-c[f],h),S=Vr(p-c[w],g),I=t.middlewareData.shift,b=!I,y=C,x=S;if(I!=null&&I.enabled.x)x=g;if(I!=null&&I.enabled.y)y=h;if(b&&!l)if(m)x=p-2*qo(c.left,c.right);else y=d-2*qo(c.top,c.bottom);await s({...t,availableWidth:x,availableHeight:y});let R=await n.getDimensions(a.floating);if(p!==R.width||d!==R.height)return{reset:{rects:!0}};return{}}}};function Ad(e){let t=Xt(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Ge(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=Ea(o)!==a||Ea(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Ou(e){return!He(e)?e.contextElement:e}function _n(e){let t=Ou(e);if(!Ge(t))return ar(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=Ad(t),s=(a?Ea(o.width):o.width)/r,i=(a?Ea(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var lb=ar(0);function Md(e){let t=ze(e);if(!zs()||!t.visualViewport)return lb;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ub(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===ze(e)}function hn(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Ou(e),s=ar(1);if(t)if(r){if(He(r))s=_n(r)}else s=_n(e);let i=ub(a,o,r)?Md(a):ar(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let p=ze(a),d=He(r)?ze(r):r,f=p,w=Zs(f);while(w&&d!==f){let h=_n(w),g=w.getBoundingClientRect(),C=Xt(w),S=g.left+(w.clientLeft+parseFloat(C.paddingLeft))*h.x,I=g.top+(w.clientTop+parseFloat(C.paddingTop))*h.y;c*=h.x,u*=h.y,l*=h.x,m*=h.y,c+=S,u+=I,f=ze(w),w=Zs(f)}}return mn({width:l,height:m,x:c,y:u})}function Yi(e,t){let o=sa(e).scrollLeft;if(!t)return hn(rr(e)).left+o;return t.left+o}function kd(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Yi(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function mb(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=rr(r),i=t?aa(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=ar(1),l=ar(0),m=Ge(r);if(m||!a){if(Tt(r)!=="body"||an(s))c=sa(r);if(m){let d=hn(r);u=_n(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}}let p=s&&!m&&!a?kd(s,c):ar(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:o.y*u.y-c.scrollTop*u.y+l.y+p.y}}function fb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pb(e){let t=sa(e),o=e.ownerDocument.body,r=qo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=qo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Yi(e),s=-t.scrollTop;if(Xt(o).direction==="rtl")a+=qo(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var db=25;function gb(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=ze(e),a=rr(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let p=!zs()||t==="fixed";if(r){if(!p)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,p)u=s.offsetLeft,l=s.offsetTop}if(Yi(a)<=0){let p=a.ownerDocument,d=p.body,f=getComputedStyle(d),w=p.compatMode==="CSS1Compat"?parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0:0,h=Math.abs(a.clientWidth-d.clientWidth-w),g=getComputedStyle(a).scrollbarGutter==="stable both-edges"?h/2:h;if(g<=db)i-=g}return{width:i,height:c,x:u,y:l}}function hb(e,t){let o=hn(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=_n(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function Ed(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=gb(e,o,t);else if(t==="document")r=pb(rr(e));else if(He(t))r=hb(t,o);else{let n=Md(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return mn(r)}function Ib(e,t){let o=t.get(e);if(o)return o;let r=Lr(e,[],!1).filter((i)=>He(i)&&Tt(i)!=="body"),n=null,a=Xt(e).position==="fixed",s=a?ko(e):e;while(He(s)&&!Lo(s)){let i=Xt(s),c=Gs(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=ko(s)}return t.set(e,r),r}function bb(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?aa(t)?[]:Ib(t,this._c):[].concat(o),r],i=Ed(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let p=1;p<s.length;p++){let d=Ed(t,s[p],n);c=qo(d.top,c),u=Vr(d.right,u),l=Vr(d.bottom,l),m=qo(d.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function Cb(e){let{width:t,height:o}=Ad(e);return{width:t,height:o}}function Sb(e,t,o){let r=Ge(t),n=rr(t),a=o==="fixed",s=hn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=ar(0);if(r||!a){if(Tt(t)!=="body"||an(n))i=sa(t);if(r){let p=hn(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}}if(!r&&n)c.x=Yi(n);let u=n&&!r&&!a?kd(n,i):ar(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function Fu(e){return Xt(e).position==="static"}function Pd(e,t){if(!Ge(e)||Xt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(rr(e)===o)o=o.ownerDocument.body;return o}function Ld(e,t){let o=ze(e);if(aa(e))return o;if(!Ge(e)){let n=ko(e);while(n&&!Lo(n)){if(He(n)&&!Fu(n))return n;n=ko(n)}return o}let r=Pd(e,t);while(r&&Ff(r)&&Fu(r))r=Pd(r,t);if(r&&Lo(r)&&Fu(r)&&!Gs(r))return o;return r||Of(e)||o}var wb=async function(e){let t=this.getOffsetParent||Ld,o=this.getDimensions,r=await o(e.floating);return{reference:Sb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xb(e){return Xt(e).direction==="rtl"}var Nu={convertOffsetParentRelativeRectToViewportRelativeRect:mb,getDocumentElement:rr,getClippingRect:bb,getOffsetParent:Ld,getElementRects:wb,getClientRects:fb,getDimensions:Cb,getScale:_n,isElement:He,isRTL:xb};function Dd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yb(e,t,o){let r=null,n,a=rr(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let p=e.getBoundingClientRect(),{left:d,top:f,width:w,height:h}=p;if(!l)t();if(!w||!h)return;let g=Pa(f),C=Pa(a.clientWidth-(d+w)),S=Pa(a.clientHeight-(f+h)),I=Pa(d),y={rootMargin:-g+"px "+-C+"px "+-S+"px "+-I+"px",threshold:qo(0,Vr(1,m))||1},x=!0;function R(T){let L=T[0].intersectionRatio;if(!Dd(p,e.getBoundingClientRect()))return i();if(L!==m){if(!x)return i();if(!L)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,L)}x=!1}try{r=new IntersectionObserver(R,{...y,root:a.ownerDocument})}catch(T){r=new IntersectionObserver(R,y)}r.observe(e)}let c=ze(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function qa(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Ou(e),l=n||a?[...u?Lr(u):[],...t?Lr(t):[]]:[];l.forEach((g)=>{n&&g.addEventListener("scroll",o),a&&g.addEventListener("resize",o)});let m=u&&i?yb(u,o,a):null,p=-1,d=null;if(s){if(d=new ResizeObserver((g)=>{let[C]=g;if(C&&C.target===u&&d&&t)d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=d)==null||S.observe(t)});o()}),u&&!c)d.observe(u);if(t)d.observe(t)}let f,w=c?hn(e):null;if(c)h();function h(){let g=hn(e);if(w&&!Dd(w,g))o();w=g,f=requestAnimationFrame(h)}return o(),()=>{var g;if(l.forEach((C)=>{n&&C.removeEventListener("scroll",o),a&&C.removeEventListener("resize",o)}),m==null||m(),(g=d)==null||g.disconnect(),d=null,c)cancelAnimationFrame(f)}}var Fd=yd;var Od=Rd,Nd=wd,Bd=Td;var Hd=vd,Ki=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...Nu,...n.platform,_c:r};return Sd(e,t,{...n,platform:a})};import*as Ht from"react";import{useLayoutEffect as vb}from"react";import*as Ud from"react-dom";var Tb=typeof document<"u",Eb=function(){},Ji=Tb?vb:Eb;function Qi(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 o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!Qi(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!Qi(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Wd(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vd(e,t){let o=Wd(e);return Math.round(t*o)/o}function Bu(e){let t=Ht.useRef(e);return Ji(()=>{t.current=e}),t}function _d(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=Ht.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=Ht.useState(r);if(!Qi(p,r))d(r);let[f,w]=Ht.useState(null),[h,g]=Ht.useState(null),C=Ht.useCallback((P)=>{if(P!==y.current)y.current=P,w(P)},[]),S=Ht.useCallback((P)=>{if(P!==x.current)x.current=P,g(P)},[]),I=a||f,b=s||h,y=Ht.useRef(null),x=Ht.useRef(null),R=Ht.useRef(l),T=c!=null,L=Bu(c),W=Bu(n),M=Bu(u),F=Ht.useCallback(()=>{if(!y.current||!x.current)return;let P={placement:t,strategy:o,middleware:p};if(W.current)P.platform=W.current;Ki(y.current,x.current,P).then((N)=>{let z={...N,isPositioned:M.current!==!1};if(A.current&&!Qi(R.current,z))R.current=z,Ud.flushSync(()=>{m(z)})})},[p,t,o,W,M]);Ji(()=>{if(u===!1&&R.current.isPositioned)R.current.isPositioned=!1,m((P)=>({...P,isPositioned:!1}))},[u]);let A=Ht.useRef(!1);Ji(()=>(A.current=!0,()=>{A.current=!1}),[]),Ji(()=>{if(I)y.current=I;if(b)x.current=b;if(I&&b){if(L.current)return L.current(I,b,F);F()}},[I,b,F,L,T]);let v=Ht.useMemo(()=>({reference:y,floating:x,setReference:C,setFloating:S}),[C,S]),O=Ht.useMemo(()=>({reference:I,floating:b}),[I,b]),X=Ht.useMemo(()=>{let P={position:o,left:0,top:0};if(!O.floating)return P;let N=Vd(O.floating,l.x),z=Vd(O.floating,l.y);if(i)return{...P,transform:"translate("+N+"px, "+z+"px)",...Wd(O.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:N,top:z}},[o,i,O.floating,l.x,l.y]);return Ht.useMemo(()=>({...l,update:F,refs:v,elements:O,floatingStyles:X}),[l,F,v,O,X])}var Hu=(e,t)=>{let o=Fd(e);return{name:o.name,fn:o.fn,options:[e,t]}},Vu=(e,t)=>{let o=Od(e);return{name:o.name,fn:o.fn,options:[e,t]}},Uu=(e,t)=>({fn:Hd(e).fn,options:[e,t]}),Wu=(e,t)=>{let o=Nd(e);return{name:o.name,fn:o.fn,options:[e,t]}},_u=(e,t)=>{let o=Bd(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as ec from"react";var Pb=ec.createContext(void 0);function Gd(e){let t=ec.useContext(Pb);if(t===void 0&&!e)throw Error(Je(69));return t}var Ab="ArrowUp",Mb="ArrowDown",kb="ArrowLeft",Lb="ArrowRight",Db="Home",Fb="End";var tc=new Set([Ab,Mb,kb,Lb,Db,Fb]);function oc(e){return e==="starting"?Vp:We}import*as rc from"react";var Ob=rc.createContext(void 0);function zd(){return rc.useContext(Ob)}import*as nc from"react";function Nb(e,t){let o=na(e.render);if(nc.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function Zd(e,t,o){let r=Nb(e,t),n=r===t?void 0:r,a=nc.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as qd from"react";function jd(e,t,o){let r=na(e.render),n=qd.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as Xd}from"react/jsx-runtime";var Bb=In.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:p,virtualFocus:d,orientation:f}=go(),w=zd(),{side:h,align:g}=_f(),C=Gd(!0)!=null,S=l.useState("open"),I=l.useState("transitionStatus"),b=l.useState("popupProps"),y=l.useState("mounted"),x=l.useState("instantType"),R=l.useState("activeTriggerElement"),T=l.useState("parent"),L=l.useState("lastOpenChangeReason"),W=l.useState("rootId"),M=l.useState("floatingRootContext"),F=l.useState("floatingTreeRoot"),A=l.useState("closeDelay"),v=l.useState("hoverEnabled"),O=l.useState("disabled"),X=l.useState("openMethod"),P=l.useState("activeTriggerId"),N=l.useState("listElement"),[z,K]=Zd(t,m,p),E=jd(t,R,P),ue=T.type==="menu"?w:void 0,H=T.type==="context-menu",_=c??T.type!=="menu";if(c===void 0&&N&&T.type!=="menu")_=()=>{if(l.state.activeIndex!==null)return!1;return N};Or({open:S,ref:l.context.popupRef,onComplete(){if(S)l.context.onOpenChangeComplete?.(!0)}}),In.useEffect(()=>{function B(Q){l.setOpen(!1,Le(Q.reason,Q.domEvent))}return F.events.on("close",B),()=>{F.events.off("close",B)}},[F.events,l]),Pu(M,{enabled:v&&!O&&!H&&T.type!=="menubar",closeDelay:A});let G=l.useStateSetter("popupElement"),le=In.useContext(Fl)?.useParentHandoff??Vb,{parentVirtualFocusRef:Te,handleFocus:te}=le(l,T,S,d),se={transitionStatus:I,side:h,align:g,open:S,nested:T.type==="menu",instant:x},pe=De("div",t,{state:se,ref:[o,l.context.popupRef,G,K],stateAttributesMapping:Qs,props:[b,{id:z,...N?{role:"presentation"}:{role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":E},onKeyDown(B){if(ue?.onPopupKeyDown?.(B),C&&tc.has(B.key))B.stopPropagation()},onFocus:te},oc(I),u,{"data-rootownerid":W}]}),we=T.type===void 0||H;if(R||T.type==="menubar"&&L!==kl)we=!0;let q=ue?.getReturnElement??Te;return Xd(Ba,{context:M,openInteractionType:X,modal:H,disabled:!y,returnFocus:s??q??we,explicitReturnFocus:s===void 0&&q?!1:void 0,initialFocus:_,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type!=="menubar"?F:void 0,previousFocusableElement:R,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:pe})}),Hb={parentVirtualFocusRef:void 0,handleFocus:void 0};function Vb(){return Hb}var $d=In.forwardRef(function(t,o){let r=Ol()?.Popup??Bb;return Xd(r,{...t,ref:o})});import*as Jd from"react";import*as ac from"react";var Gu=ac.createContext(void 0);function Yd(){let e=ac.useContext(Gu);if(e===void 0)throw Error(Je(32));return e}import{jsx as Kd}from"react/jsx-runtime";var Qd=Jd.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=go();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return Kd(Gu.Provider,{value:r,children:Kd(Oa,{ref:o,...n,portalOwnerRole:u})})});import*as zr from"react";function Gn(e){if(En(19))return e;return e?"true":void 0}import*as yo from"react";import*as Oo from"react";function e0(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=Oo.useState(null),m=Oo.useRef(null),p=to(o),d=Oo.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),f=_d({...e,elements:{...d,...u&&{reference:u}}}),w=Oo.useCallback((S)=>{let I=He(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;l(I),f.refs.setReference(I)},[f.refs]),h=Oo.useMemo(()=>({...f.refs,setPositionReference:w,domReference:m}),[f.refs,w]),g=Oo.useMemo(()=>({...f.elements,domReference:s}),[f.elements,s]),C=Oo.useMemo(()=>({...f,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:h,elements:g,nodeId:t,rootStore:r}),[f,h,g,t,r,i,c]);return j(()=>{if(s)m.current=s},[s]),j(()=>{r.context.dataRef.current.floatingContext=C;let S=p?.nodesRef.current.find((I)=>I.id===t);if(S)S.context=C}),Oo.useMemo(()=>({...f,context:C,refs:h,elements:g,rootStore:r}),[f,h,g,C,r])}import*as sc from"react";var Ub=sc.createContext(void 0);function ic(){return sc.useContext(Ub)?.direction??"ltr"}var Wb=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=sr(e,t)||{};if(u==null)return{};let m=bi(l),p={x:o,y:r},d=Ma(n),f=Aa(d),w=await s.getDimensions(u),h=d==="y",g=h?"top":"left",C=h?"bottom":"right",S=h?"clientHeight":"clientWidth",I=a.reference[f]+a.reference[d]-p[d]-a.floating[f],b=p[d]-a.reference[d],y=i.floating[S]||a.floating[f],x=I/2-b/2,R=y/2-w[f]/2-1,T=Math.min(m[g],R),L=Math.min(m[C],R),W=T,M=y-w[f]-L,F=y/2-w[f]/2+x,A=hi(W,F,M),v=!c.arrow&&wo(n)!=null&&F!==A&&a.reference[f]/2-(F<W?T:L)-w[f]/2<0,O=v?F<W?F-W:F-M:0;return{[d]:p[d]+O,data:{[d]:A,centerOffset:F-A-O,...v&&{alignmentOffset:O}},reset:v}}}),t0=(e,t)=>{let{name:o,fn:r}=Wb(e);return{name:o,fn:r,options:[e,t]}};var o0={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var r0={sideX:"left",sideY:"top"};var n0="--available-width",a0="--available-height",s0="--anchor-width",i0="--anchor-height",c0="--transform-origin";var l0=n0,u0=a0;function p0(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function m0(e,t,o){let{rects:r,placement:n}=e;return{side:p0(t,fo(n),o),align:wo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function d0(e){return Gb(e,e0)}function Gb(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:d,keepMounted:f=!1,floatingRootContext:w,mounted:h,collisionAvoidance:g,shift:C,nodeId:S,adaptiveOrigin:I,lazyFlip:b=!1,externalTree:y}=e,x=g.side||"flip",R=g.align||"flip",T=g.fallbackAxisSide||"end",L=C?.crossAxis??!1,W=C?.rootBoundary,M=typeof o==="function"?o:void 0,F=ae(M),A=M?F:o,v=lt(o),O=lt(h),P=ic()==="rtl",[N,z]=yo.useState(null);if(!h&&N!==null)z(null);let K=b==="placement",E=N?fo(N):null,ue=N&&K?wo(N)||"center":null,H=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[n],_=ue||s,G=_==="center"?H:`${H}-${_}`,le=u;if(typeof le==="number")le={top:le,right:le,bottom:le,left:le};else if(le)le={top:le.top||0,right:le.right||0,bottom:le.bottom||0,left:le.left||0};let Te=1,te=n==="bottom"?Te:0,se=n==="top"?Te:0,pe=n==="right"?Te:0,we=n==="left"?Te:0,q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:le},B=yo.useRef(null),Q=lt(a),ie=lt(i),xe=typeof a!=="function"?a:0,ye=typeof i!=="function"?i:0,re=[];if(d)re.push(d);re.push(Hu((_e)=>{let Nt=m0(_e,n,P),Se=typeof Q.current==="function"?Q.current(Nt):Q.current,Pe=typeof ie.current==="function"?ie.current(Nt):ie.current;return{mainAxis:Se,crossAxis:Pe,alignmentAxis:Pe}},[xe,ye,P,n]));let V=R==="none"&&x!=="shift",J=!V&&(l||L||x==="shift"),Ee=x==="none"?null:Wu({...q,padding:{top:le.top+Te+te,right:le.right+Te+we,bottom:le.bottom+Te+se,left:le.left+Te+pe},mainAxis:!L&&x==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:T}),ce=V?null:Vu({...q,rootBoundary:W,mainAxis:R!=="none",crossAxis:J,limiter:l||L?void 0:Uu((_e)=>{if(!B.current)return{};let{width:Nt,height:Se}=B.current.getBoundingClientRect(),Pe=ho(fo(_e.placement)),Ve=Pe==="y"?Nt:Se,Bt=Pe==="y"?le.left+le.right:le.top+le.bottom;return{offset:Ve/2+Bt/2}})},[q,l,L,W,le,R]);if(x==="shift"||R==="shift"||_==="center")re.push(ce,Ee);else re.push(Ee,ce);re.push(_u({...q,apply({elements:{floating:_e},availableWidth:Nt,availableHeight:Se,rects:Pe}){if(!O.current)return;let Ve=_e.style;Ve.setProperty(l0,`${Nt}px`),Ve.setProperty(u0,`${Se}px`);let Bt=ze(_e).devicePixelRatio||1,{x:Gt,y:co,width:Vt,height:bo}=Pe.reference,Ho=(Math.round((Gt+Vt)*Bt)-Math.round(Gt*Bt))/Bt,Ro=(Math.round((co+bo)*Bt)-Math.round(co*Bt))/Bt;Ve.setProperty(s0,`${Ho}px`),Ve.setProperty(i0,`${Ro}px`)}}),t0((_e)=>({element:B.current||ve(_e.elements.floating).createElement("div"),padding:B.current?m:0}),[m]),{name:"transformOrigin",fn(_e){let{elements:{floating:Nt},middlewareData:Se,placement:Pe,platform:Ve,rects:Bt,y:Gt}=_e,co=fo(Pe),Vt=wo(Pe),bo=ho(co)==="y",Ho=B.current,Ro=typeof a==="function"?a(m0(_e,n,P)):a,wn;if(!Ho&&Vt&&Math.abs(bo?Se.shift?.x||0:Se.shift?.y||0)<=1)wn=Vt==="start"===(bo&&Ve.isRTL?.(Nt)===!0)?"100%":"0%";else{let Yr=bo?Se.arrow?.x||0:Se.arrow?.y||0,Kr=bo?Ho?.clientWidth||0:Ho?.clientHeight||0;wn=`${Yr+Kr/2}px`}let Jo=co==="top"||co==="left"?`calc(100% + ${Ro}px)`:`${-Ro}px`;if(J&&bo&&Math.abs(Se.shift?.y||0)>Ro)Jo=`${Bt.reference.y+Bt.reference.height/2-Gt}px`;return Nt.style.setProperty(c0,bo?`${wn} ${Jo}`:`${Jo} ${wn}`),{}}},o0,I),j(()=>{if(!h&&w)w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,w]);let Ce=yo.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:k,elements:U,x:Ie,y:Y,middlewareData:ne,update:de,placement:ge,context:he,isPositioned:ke,floatingStyles:Xe}=t({rootContext:w,open:f?h:void 0,placement:G,middleware:re,strategy:r,whileElementsMounted:f?void 0:(..._e)=>qa(..._e,Ce),nodeId:S,externalTree:y}),{sideX:ct,sideY:so}=ne.adaptiveOrigin||r0,io=ke?r:"fixed",Bo=yo.useMemo(()=>{let _e;if(!ke)_e={position:io,top:0,left:0};else if(I)_e={position:io,[ct]:Ie,[so]:Y};else _e={...Xe,position:io};if(_e[l0]="100vw",_e[u0]="100vh",!ke)_e.opacity=0;return _e},[I,io,ct,Ie,so,Y,Xe,ke]),qt=yo.useRef(null);j(()=>{if(!h)return;let _e=v.current,Nt=typeof _e==="function"?_e():_e,Pe=(f0(Nt)?Nt.current:Nt)||null||null;if(Pe!==qt.current)k.setPositionReference(Pe),qt.current=Pe},[h,k,A,v]),yo.useEffect(()=>{if(!h)return;let _e=v.current;if(typeof _e==="function")return;if(f0(_e)&&_e.current!==qt.current)k.setPositionReference(_e.current),qt.current=_e.current},[h,k,A,v]),yo.useEffect(()=>{if(f&&h&&U.reference&&U.floating)return qa(U.reference,U.floating,de,Ce);return},[f,h,U,de,Ce]);let _t=fo(ge),po=p0(n,_t,P),Io=wo(ge)||"center",Jt=Boolean(ne.hide?.referenceHidden);j(()=>{if(b&&h&&ke&&(_t!==H||K&&Io!==_))z(ge)},[b,K,h,ke,ge,_t,Io,H,_]);let Xr=yo.useMemo(()=>({position:"absolute",top:ne.arrow?.y,left:ne.arrow?.x}),[ne.arrow]),$r=ne.arrow?.centerOffset!==0;return yo.useMemo(()=>({positionerStyles:Bo,arrowStyles:Xr,arrowRef:B,arrowUncentered:$r,side:po,align:Io,physicalSide:_t,anchorHidden:Jt,refs:k,context:he,isPositioned:ke,update:de}),[Bo,Xr,B,$r,po,Io,_t,Jt,k,he,ke,de])}function f0(e){return e!=null&&"current"in e}import*as xr from"react";import{jsx as zb}from"react/jsx-runtime";function g0(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=ae(n),[,s]=xr.useState(0),i=qe(qb).current,c=qe(Zb).current,u=xr.useRef(0),l=xr.useRef(!0),m=xr.useRef(null),p=xr.useRef(null),d=ae(()=>{if(l.current)return;l.current=!0,s((b)=>b+1)}),f=ae((b,y)=>{c.set(b,y),d()}),w=ae((b)=>{c.delete(b),d()}),h=ae((b)=>{let y=new Map;if(o.current.length=0,r)r.current.length=0;return b.forEach((x)=>{if(y.set(x.element,{...x.registration.metadata??{},index:x.index}),o.current[x.index]=x.element,r)r.current[x.index]=x.registration.label!==void 0?x.registration.label:x.registration.textRef?.current?.textContent??x.element.textContent}),u.current=o.current.length,y});function g(b){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=="function"||b.length<2)return;let y=new MutationObserver((R)=>{if(!$b(R))return;let T=null;for(let L of b){if(!L.isConnected)continue;if(T&&h0(T,L)>0){y.disconnect(),d();return}T=L}});p.current=y;let x=new Set;for(let R=1;R<b.length;R+=1){let T=Xb(b[R-1],b[R]);if(T)x.add(T)}x.forEach((R)=>y.observe(R,{childList:!0}))}let C=ae(()=>{let[b,y]=jb(c),x=h(b),R=m.current,T=!R||R.length!==b.length||b.some((L,W)=>{let M=R[W];return L.index!==M.index||L.element!==M.element||L.registration.index!==M.registration.index||L.registration.metadata!==M.registration.metadata});if(g(y),m.current=b,l.current=!1,!T)return;i.forEach((L)=>L(x)),a(x)});j(()=>{if(!l.current&&m.current)h(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,h]),j(()=>{if(l.current)C()}),j(()=>()=>{p.current?.disconnect(),l.current=!0},[]);let S=ae((b)=>(i.add(b),()=>{i.delete(b)})),I=xr.useMemo(()=>({register:f,unregister:w,subscribeMapChange:S,nextIndexRef:u}),[f,w,S,u]);return zb(Ul.Provider,{value:I,children:t})}function Zb(){return new Map}function qb(){return new Set}function jb(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>h0(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function Xb(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function $b(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function h0(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as I0 from"react";import{jsx as Yb}from"react/jsx-runtime";var cc=I0.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return Yb("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as zu from"react";function b0(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=zu.useRef(null),s=zu.useRef(null),i=Bn(r);j(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),j(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function C0(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return De("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},oc(r),n],stateAttributesMapping:da})}import*as v0 from"react";var S0={},w0={},x0="";function lc(e,t){return an(e)?e:t}function y0(e,t,o){return/hidden|clip/.test(e.getComputedStyle(lc(t,o)).overflowY)}function Kb(e){if(typeof document>"u")return!1;let t=ve(e);return ze(t).innerWidth-t.documentElement.clientWidth>0}function Jb(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=ve(e),{documentElement:r,body:n}=o,a=lc(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function Qb(e){let t=ve(e),{documentElement:o,body:r}=t,n=lc(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function eC(e){let t=ve(e),{documentElement:o,body:r}=t,n=ze(o),a=0,s=0,i=!1,c=Do.create();if(gr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let d=n.getComputedStyle(o),f=n.getComputedStyle(r),g=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,S0={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},x0=o.style.scrollBehavior,w0={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let C=o.scrollHeight>o.clientHeight,S=o.scrollWidth>o.clientWidth,I=d.overflowY==="scroll"||f.overflowY==="scroll",b=d.overflowX==="scroll"||f.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),x=Math.max(0,n.innerHeight-r.clientHeight),R=parseFloat(f.marginTop)+parseFloat(f.marginBottom),T=parseFloat(f.marginLeft)+parseFloat(f.marginRight),L=lc(o,r);if(i=Jb(e),i){o.style.scrollbarGutter=g,L.style.overflowY="hidden",L.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:g,overflowY:"hidden",overflowX:"hidden"}),C||I)o.style.overflowY="scroll";if(S||b)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:R||x?`calc(100dvh - ${R+x}px)`:"100dvh",width:T||y?`calc(100vw - ${T+y}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,S0),Object.assign(r.style,w0),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=x0}function m(){l(),c.request(u)}u();let p=Ae(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")p()}}class R0{lockCount=0;restore=null;timeoutLock=eo.create();timeoutUnlock=eo.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ve(e),{documentElement:o,body:r}=t,n=ze(o);if(y0(n,o,r)){let s=new n.MutationObserver(()=>{if(y0(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=dr.ios||!Kb(e);this.restore=a?Qb(e):eC(e)}}var tC=new R0;function uc(e=!0,t=null){j(()=>{if(!e)return;return tC.acquire(t)},[e,t])}var oC=20;function T0(e,t,o,r){let[n,a]=v0.useState(!1);j(()=>{if(!e||!t||o==null){a(!1);return}let s=ve(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-oC)},[e,t,o]),uc(e&&(!t||n),r)}import{jsx as Zu,jsxs as rC}from"react/jsx-runtime";var E0=zr.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:w=!1,collisionAvoidance:h=_p,style:g,...C}=t,{store:S,virtualFocus:I,syncHighlightedItem:b}=go(),y=Yd(),x=Fn(!0),R=S.useState("parent"),T=S.useState("floatingRootContext"),L=S.useState("floatingTreeRoot"),W=S.useState("mounted"),M=S.useState("open"),F=S.useState("modal"),A=S.useState("openMethod"),v=S.useState("activeTriggerElement"),O=S.useState("transitionStatus"),X=S.useState("positionerElement"),P=S.useState("instantType"),N=S.useState("adaptiveOrigin"),z=S.useState("lastOpenChangeReason"),K=S.useState("floatingNodeId"),E=S.useState("floatingParentNodeId"),ue=T.useState("domReferenceElement"),H=r,_=u,G=l,le=c,Te=h;if(R.type==="context-menu"){if(H=r??R.context?.anchor,le=le??"start",!i&&le!=="center")G=t.alignOffset??2,_=t.sideOffset??-5}let te=i,se=le;if(R.type==="menu")te=te??"inline-end",se=se??"start",Te=t.collisionAvoidance??Gp;else if(R.type==="menubar")te=te??(R.context.orientation==="vertical"?"inline-end":"bottom"),se=se??"start";let pe=R.type==="context-menu",we=d0({anchor:H,floatingRootContext:T,positionMethod:x?"fixed":n,mounted:W,side:te,sideOffset:_,align:se,alignOffset:G,arrowPadding:pe?0:d,collisionBoundary:m,collisionPadding:p,sticky:f,nodeId:K,keepMounted:y,disableAnchorTracking:w,collisionAvoidance:Te,shift:pe?{crossAxis:!(("side"in Te)&&Te.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:N,lazyFlip:I?"placement":!1});zr.useEffect(()=>{function V(J){if(J.open){if(J.parentNodeId===K)S.set("hoverEnabled",!1);if(J.nodeId!==K&&J.parentNodeId===S.select("floatingParentNodeId"))S.setOpen(!1,Le(Ia))}}return L.events.on("menuopenchange",V),()=>{L.events.off("menuopenchange",V)}},[S,L.events,K]),zr.useEffect(()=>{if(S.select("floatingParentNodeId")==null)return;function V(J){if(J.open||J.nodeId!==S.select("floatingParentNodeId"))return;let Ee=J.reason??Ia;S.setOpen(!1,Le(Ee))}return L.events.on("menuopenchange",V),()=>{L.events.off("menuopenchange",V)}},[L.events,S]);let q=rt();zr.useEffect(()=>{if(!M)q.clear()},[M,q]),zr.useEffect(()=>{function V(J){if(!M||J.nodeId!==S.select("floatingParentNodeId"))return;if(J.target&&v&&v!==J.target){let Ee=S.select("closeDelay");if(Ee>0){if(!q.isStarted())q.start(Ee,()=>{S.setOpen(!1,Le(Ia))})}else S.setOpen(!1,Le(Ia))}else q.clear()}return L.events.on("itemhover",V),()=>{L.events.off("itemhover",V)}},[L.events,M,v,S,q]),zr.useEffect(()=>{let V={open:M,nodeId:K,parentNodeId:E,reason:S.select("lastOpenChangeReason")};L.events.emit("menuopenchange",V)},[L.events,M,S,K,E]),b0({store:S,domReference:ue,positionerElement:X,open:M});let B={open:M,side:we.side,align:we.align,anchorHidden:we.anchorHidden,nested:R.type==="menu",instant:P},Q=R.type==="menubar"&&R.context.modal,ie=F&&z!==uo;T0(M&&(Q||ie),A==="touch",X,v);let xe=C0(t,B,{styles:we.positionerStyles,transitionStatus:O,props:C,refs:[o,S.useStateSetter("positionerElement")],hidden:!W,inert:!M}),ye=W&&R.type!=="menu"&&(R.type!=="menubar"&&F&&z!==uo||R.type==="menubar"&&R.context.modal),re=null;if(R.type==="menubar")re=R.context.contentElement;else if(R.type===void 0)re=v;return rC(El.Provider,{value:we,children:[ye&&Zu(cc,{ref:R.type==="context-menu"||R.type==="nested-context-menu"?R.context.internalBackdropRef:null,inert:Gn(!M),cutout:re}),Zu(uu,{id:K,children:Zu(g0,{elementsRef:S.context.itemDomElements,labelsRef:S.context.itemLabels,onMapChange:b,children:xe})})]})});import*as st from"react";import*as mc from"react";var nC=mc.createContext(null);function fc(e){let t=mc.useContext(nC);if(t===null&&!e)throw Error(Je(5));return t}import*as Xa from"react";import*as ja from"react";function P0(e){let t=ja.useRef(""),o=ja.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:ja.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as A0 from"react";function pc(e,t){let o=A0.useRef(e),r=ae(t);j(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function qu(e,t){let o=ae((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(dr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=P0(o);return Xa.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function M0(e){let[t,o]=Xa.useState(null),r=qu(e,o);return pc(e,(n)=>{if(n&&!e)o(null)}),Xa.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function k0(e){if(e==null)return ga;if(e.type.startsWith("key"))return Xf;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return _I;return ga}import*as zn from"react";var aC={...Un,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=Un.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>gr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!Un.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class ju extends wr{constructor(e,t,o=!1){let r=new _a,n=iC(r,t,o,e);super(n,sC(r),aC);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function sC(e){return{positionerRef:zn.createRef(),popupRef:zn.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:zn.createRef(),beforeTriggerFocusGuardRef:zn.createRef(),beforeContentFocusGuardRef:zn.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function iC(e,t,o=!1,r){return{...Vi(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:We,inputProps:We,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new pn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:We,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as L0 from"react";var Xu=L0.createContext(null);function $u(e,t){return(e===ti||e===Ll)&&t?.detail===0}function D0(e,t){return e===oi||$u(e,t)}import{jsx as $a,jsxs as cC}from"react/jsx-runtime";var lC=Ga(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:d=!1,handle:f,triggerId:w,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:C=!1,virtualFocus:S=!1,virtualFocusRef:I,allowEscape:b=!0,resetOnPointerLeave:y=!0}=t,x=Fn(!0),R=go(!0),T=fc(!0),L=R?.store,W=R?.virtualFocus??!1,M=st.useMemo(()=>{if(C&&L)return{type:"menu",store:L};if(T)return{type:"menubar",context:T};if(x&&!L)return{type:"context-menu",context:x};return{type:void 0}},[x,L,T,C]),F=mo(),A=mo(),[v,O]=st.useState(void 0),X=(v??A)||void 0,P=xo(),N=M.type==="menu"?M.store:void 0,z=(r??i)&&N?.state.transitionStatus==="starting",K=qe(()=>z?N?.state.instantType:void 0).current,E=qe(()=>{let Se=new ju({open:i,openProp:r,activeTriggerId:h,triggerIdProp:w,parent:M,disabled:c,highlightItemOnHover:g,modal:M.type===void 0?u:void 0,rootId:F,instantType:K},X,P!=null);return Se.context.virtualFocusRef=I,Se}).current;E.useControlledProp("openProp",r),E.useControlledProp("triggerIdProp",w),E.useContextCallback("onOpenChangeComplete",a);let ue=E.useState("floatingTreeRoot"),H=Na(ue),_=E.useState("open"),G=E.useState("activeTriggerElement"),le=E.useState("positionerElement"),Te=E.useState("hoverEnabled"),te=E.useState("disabled"),se=E.useState("lastOpenChangeReason"),pe=E.useState("parent"),we=E.useState("activeIndex"),q=E.useState("keyboardOpen"),B=E.useState("payload"),Q=E.useState("floatingParentNodeId"),ie=st.useRef(null),xe=st.useRef(pe.type!=="context-menu"),ye=rt(),re=st.useRef(!0),V=rt(),J=Q!=null,{openMethod:Ee,triggerProps:ce}=M0(_);E.useSyncedValues({disabled:c,highlightItemOnHover:g,modal:pe.type===void 0?u:void 0,openMethod:Ee,rootId:F}),Li(E);let{forceUnmount:Ce,transitionStatus:k}=Di(_,E,()=>{E.set("allowMouseEnter",!1)},z),U=Bn(E.context.popupRef);st.useEffect(()=>{if(K===void 0)return;let Se=()=>{if(E.state.instantType===K)E.set("instantType",void 0)};if(!_){Se();return}if(k!==void 0)return;if(E.context.popupRef.current==null){Se();return}let Pe=new AbortController;return U(Se,Pe.signal),()=>{Pe.abort()}},[K,_,k,U,E]),j(()=>{if(x&&!R)E.update({parent:{type:"context-menu",context:x},floatingNodeId:H,floatingParentNodeId:P});else if(R||!E.select("activeTriggerElement"))E.update({floatingNodeId:H,floatingParentNodeId:P})},[x,R,H,P,G,E]),st.useEffect(()=>{if(!_)ie.current=null;if(pe.type!=="context-menu")return;if(!_){ye.clear(),xe.current=!1;return}ye.start(500,()=>{xe.current=!0})},[ye,_,pe.type]),j(()=>{if(!_&&!Te)E.set("hoverEnabled",!0)},[_,Te,E]);let Ie=ae((Se,Pe)=>{let Ve=Pe.reason;if(!Se&&!E.select("open"))return;if(_===Se&&Pe.trigger===G&&se===Ve)return;let Bt=ad(Pe);if(!Se&&Pe.trigger==null)Pe.trigger=G??void 0;if(n?.(Se,Pe),Pe.isCanceled)return;E.state.floatingRootContext.dispatchOpenChange(Se,Pe);let Gt=Pe.event;if(Se===!1&&Ve!==Ll&&Gt?.type==="click"&&Gt.pointerType==="touch"&&!re.current)return;if(Se&&Ve===ha)re.current=!1,V.start(300,()=>{re.current=!0});else re.current=!0,V.clear();let co=!Se&&(Ve===Dl||Ve==null);ie.current=Pe.event;let Vt=Mi(E.state,Se,Pe.trigger,Bt());if(Vt.openChangeReason=Ve,Vt.keyboardOpen=Se&&D0(Ve,Gt),pe.type==="menubar"&&(Ve===ha||Ve===On||Ve===uo||Ve===oi||Ve===Ia))Vt.instantType="group";else if($u(Ve,Gt))Vt.instantType="click";else if(co)Vt.instantType="dismiss";else Vt.instantType=void 0;E.update(Vt)}),Y=Wa({popupStore:E,floatingRootContext:E.state.floatingRootContext,floatingId:X,nested:P!=null,onOpenChange:Ie}),ne=Y.context.events;j(()=>{let Se=({open:Pe,eventDetails:Ve})=>Ie(Pe,Ve);return ne.on("setOpen",Se),()=>{ne?.off("setOpen",Se)}},[ne,Ie]),j(()=>E.subscribeToParentMenu(),[E]);let de=st.useCallback(()=>{E.setOpen(!1,Le($f))},[E]);st.useImperativeHandle(p,()=>({unmount:Ce,close:de}),[Ce,de]);let ge;if(pe.type==="context-menu")ge=pe.context;st.useImperativeHandle(ge?.positionerRef,()=>le,[le]),st.useImperativeHandle(ge?.actionsRef,()=>({setOpen:Ie}),[Ie]);let he=Ua(Y,{enabled:!te,bubbles:{escapeKey:d&&pe.type==="menu"},outsidePress(){if(pe.type!=="context-menu"||ie.current?.type==="contextmenu")return!0;return xe.current},externalTree:J?ue:void 0}),ke=ic(),Xe=ku(Y,{enabled:!te,listRef:E.context.itemDomElements,activeIndex:we,virtual:S,nested:pe.type==="menubar"||!S&&pe.type!==void 0,parentOrientation:pe.type==="menubar"?pe.context.orientation:void 0,loopFocus:l,focusItemOnOpen:S?q:void 0,allowEscape:S&&l&&b,orientation:m,triggerOrientation:S?"vertical":m,rtl:ke==="rtl",disabledIndices:pr,onNavigate(Se,Pe){E.setActiveIndex(Se,k0(Pe),Pe?.nativeEvent)},openOnArrowKeyDown:pe.type!=="context-menu"&&!(S&&C),externalTree:!S&&J?ue:void 0,nestedReturnFocusRef:N?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:y}),ct=st.useCallback((Se)=>{E.context.typingRef.current=Se},[E]),so=Lu(Y,{enabled:!te&&!S,listRef:E.context.itemLabels,elementsRef:E.context.itemDomElements,activeIndex:we,resetMs:Bp,onMatch:(Se,Pe)=>{if(_&&Se!==we)E.setActiveIndex(Se,Xf,Pe.nativeEvent)},onTyping:ct}),io=ae(s),Bo=st.useRef(-1),qt=ae(()=>{let Se=E.state.activeIndex,Pe=Se===null?void 0:E.context.itemDomElements.current[Se]??void 0;if(Pe?.isConnected===!1)return;let Ve=Pe===void 0?-1:Se;if(Bo.current===Ve&&E.context.reportedItem===Pe)return;if(Bo.current=Ve,E.context.reportedItem=Pe,S)E.set("highlightedItem",Pe);let{highlightReason:Bt,highlightEvent:Gt}=E.context;if(E.context.highlightReason=ga,E.context.highlightEvent=void 0,!s)return;io(Pe,cp(Bt,Gt,{label:Pe===void 0?void 0:E.context.itemLabels.current[Ve]??void 0}))});j(()=>{qt()},[we,qt]);let _t=st.useMemo(()=>{if(!S)return Xe.reference;if(!Xe.trigger)return We;let{onFocus:Se,...Pe}=Xe.trigger;return Pe},[S,Xe.reference,Xe.trigger]);E.useSyncedValue("inputProps",S?Xe.reference??We:We);let po=st.useMemo(()=>{let Se=Wt(so.reference,_t,he.reference,{onMouseMove(){E.set("allowMouseEnter",!0)}},ce);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=_,Se},[E,so.reference,_t,he.reference,ce,_]),Io=st.useMemo(()=>{let Se=Wt(Xe.trigger,he.trigger,ce);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=!1,Se},[Xe.trigger,he.trigger,ce]);qe(()=>(E.update({inactiveTriggerProps:Io}),null));let Jt=st.useMemo(()=>Wt(Pi,{onMouseMove(){if(E.set("allowMouseEnter",!0),pe.type==="menu")E.set("hoverEnabled",!1)},onClick(){if(E.select("hoverEnabled"))E.set("hoverEnabled",!1)},onKeyDown(Se){let Pe=E.select("keyboardEventRelay");if(Pe&&!Se.isPropagationStopped())Pe(Se)}},so.floating,Xe.floating,he.floating),[pe.type,E,so.floating,Xe.floating,he.floating]),Xr=Xe.item??We;Fi(E,{floatingRootContext:Y,activeTriggerProps:po,inactiveTriggerProps:Io,popupProps:Jt,itemProps:Xr});let $r=st.useMemo(()=>({store:E,parent:M,orientation:m,loopFocus:l,allowEscape:b,defaultFloatingId:A,setRenderedFloatingId:O,virtualFocus:S,parentVirtualFocus:W,syncHighlightedItem:qt}),[E,M,m,l,b,A,S,W,qt]),_e=typeof o==="function"?o({payload:B}):o,Nt=cC(fa.Provider,{value:$r,children:[f&&$a(Ai,{handle:f,store:E}),_e]});if(pe.type===void 0||pe.type==="context-menu")Nt=$a(mu,{externalTree:ue,children:Nt});return Nt});function F0(e){let t=st.useContext(Xu);if(t===null)return $a(lC,{...e});let o=t.Root;return $a(Xu.Provider,{value:null,children:$a(o,{...t.options,...e})})}import*as ro from"react";var dc=5;function O0(e,t){let o=uC(t);return e.clientX>=o.left-dc&&e.clientX<=o.right+dc&&e.clientY>=o.top-dc&&e.clientY<=o.bottom+dc}function uC(e){let t=e.getBoundingClientRect(),o=ze(e);if(Ca.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),p=l-t.width,d=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-d/2,bottom:t.bottom+d/2}}import*as N0 from"react";function B0(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=An(),{ref:n,index:a}=ni(e),s=o===a,i=N0.useRef(null),c=Mo(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function H0(e){let{render:t,className:o,style:r,state:n=We,props:a=pr,refs:s=pr,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:p}=B0({metadata:i});return De(u,e,{state:n,ref:[p,...s],props:[m,...a,l],stateAttributesMapping:c})}function Yu(e){if(Ge(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(Lo(e))return;return Yu(ko(e))}import*as V0 from"react-dom";function U0(e,t){function o(a,s,i){let c=a.currentTarget;V0.flushSync(()=>{e.setOpen(!1,Le(On,a.nativeEvent,c))}),Mp(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Sr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as gc from"react";function W0(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=gc.useRef(!1);return gc.useMemo(()=>{if(!t)return We;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,ve(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Ya,jsxs as mC}from"react/jsx-runtime";var _0=Ni(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:p,payload:d,...f}=t,w=go(!0),g=Ui(p)??w?.store;if(!g)throw Error(Je(85));let C=mo(c),S=g.useState("isTriggerActive",C),I=g.useState("floatingRootContext"),b=g.useState("isOpenedByTrigger",C),y=g.useState("triggerControlsId",C),x=ro.useRef(null),R=pC(),T=An(!0),L=to(),W=ro.useMemo(()=>L??new pn,[L]),M=Na(W),F=xo(),{registerTrigger:A,isMountedByThisTrigger:v}=ki(C,x,g,{payload:d,closeDelay:m,parent:R,floatingTreeRoot:W,floatingNodeId:M,floatingParentNodeId:F,keyboardEventRelay:T?.relayKeyboardEvent}),O=R.type==="menubar",X=g.useState("disabled"),P=s||X||O&&R.context.disabled,{getButtonProps:N,buttonRef:z}=lo({disabled:P,native:i});ro.useEffect(()=>{if(!b&&R.type===void 0)g.context.allowMouseUpTriggerRef.current=!1},[g,b,R.type]);let K=ro.useRef(null),E=rt(),ue=ae((V)=>{if(!K.current)return;E.clear(),g.context.allowMouseUpTriggerRef.current=!1;let J=V.target;if(fe(K.current,J)||fe(g.select("positionerElement"),J)||J===K.current)return;if(J!=null&&Yu(J)===g.select("rootId"))return;if(O0(V,K.current))return;W.events.emit("close",{domEvent:V,reason:GI})});ro.useEffect(()=>{let V=ve(K.current);if(b&&g.select("lastOpenChangeReason")===uo)return V.addEventListener("mouseup",ue,{once:!0}),()=>{V.removeEventListener("mouseup",ue)};return},[b,ue,g]);let H=O&&R.context.hasSubmenuOpen,G=Au(I,{enabled:(u??H)&&!P&&(!O||H&&!v),handleClose:Du({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:R.type===void 0?l:void 0,delay:{close:m},triggerElementRef:x,externalTree:W,isActiveTrigger:S,isClosing:()=>g.select("transitionStatus")==="ending"}),le=fC(b,g.select("lastOpenChangeReason")),Te=Va(I,{enabled:!P,event:b&&O?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?le:!1}),te=Ru(I,{enabled:!P&&H}),se=W0({open:b,enabled:O,mouseDownAction:"open"}),pe=ro.useMemo(()=>Wt(te.reference,Te.reference),[te.reference,Te.reference]),we=g.useState("triggerProps",v),q=g.useState("filterTriggerProps"),{handlePreFocusGuardFocus:B,handleFocusTargetFocus:Q}=U0(g,x),ie={disabled:P,open:b},xe=[K,o,z,A,x],ye=[pe,G??We,we,{"aria-haspopup":"menu","aria-controls":y,id:C,onMouseDown:(V)=>{if(g.select("open"))return;E.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),ve(V.currentTarget).addEventListener("mouseup",ue,{once:!0})}},q,O?{role:"menuitem"}:{},se,f,N],re=De("button",t,{enabled:!O,stateAttributesMapping:Ml,state:ie,ref:xe,props:ye});if(O)return Ya(H0,{tag:"button",render:r,className:n,style:a,state:ie,refs:xe,props:ye,stateAttributesMapping:Ml});if(b)return mC(ro.Fragment,{children:[Ya(Zo,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:B},`${C}-pre-focus-guard`),Ya(ro.Fragment,{children:re},C),Ya(Zo,{ref:g.context.triggerFocusTargetRef,onFocus:Q},`${C}-post-focus-guard`)]});return Ya(ro.Fragment,{children:re},C)});function fC(e,t){let o=rt(),[r,n]=ro.useState(!1);return j(()=>{if(e&&t===uo)n(!0),o.start(Hp,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function pC(){let e=fc(!0);return ro.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as G0 from"react";var z0=G0.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return De("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as bn,jsxs as jje}from"react/jsx-runtime";function q0({...e}){return bn(F0,{"data-slot":"dropdown-menu",...e})}function j0({...e}){return bn(_0,{"data-slot":"dropdown-menu-trigger",...e})}function X0({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return bn(Qd,{container:a,children:bn(E0,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:bn($d,{"data-slot":"dropdown-menu-content",className:me("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Ka({className:e,inset:t,variant:o="default",...r}){return bn(pp,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:me("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function $0({className:e,...t}){return bn(z0,{"data-slot":"dropdown-menu-separator",className:me("-mx-1 my-1 h-px bg-border",e),...t})}import*as ig from"react";import*as hc from"react";var Y0="data-valid",K0="data-invalid";var J0={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},gC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Q0={disabled:!1,...gC},eg={valid(e){if(e===null)return null;if(e)return{[Y0]:""};return{[K0]:""}}};var hC={invalid:void 0,name:void 0,validityData:{state:J0,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Q0,registerFieldControl:Ye,validation:{getValidationProps:(e,t=We)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},IC=hc.createContext(hC);function Zn(e=!0){let t=hc.useContext(IC);if(t.setValidityData===Ye&&!e)throw Error(Je(28));return t}import*as Ic from"react";var bC=Ic.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function tg(){return Ic.useContext(bC)}import*as bc from"react";var CC=bc.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function Cc(){return bc.useContext(CC)}import*as Sc from"react";function og(e,t,o){let{setFocused:r,focusOwnerRef:n}=Zn(),a=ae((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return j(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function rg(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Zn(),i=qe(()=>Symbol());j(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),j(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as Ku from"react";function ng(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=Cc(),s=mo(),i=qe(()=>Symbol()),c=Ku.useRef(!1),u=Ku.useRef(!1),l=ae(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return j(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),j(()=>l,[l]),(o?r:void 0)??t??s}var ag=Sc.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:p,...d}=t,{state:f,name:w,disabled:h,setTouched:g,setDirty:C,validityData:S,setFilled:I,validationMode:b,validation:y}=Zn(),{clearErrors:x,elementRef:R,submitCountRef:T}=tg(),L=h||c,W=w??s,M={...f,disabled:L},{labelId:F}=Cc(),A=ng({id:a}),v=i!==void 0,O=i==null?void 0:String(i),X=ae(()=>y.inputRef.current?.value);rg(y.inputRef,A,O,X,!L,s),j(()=>{let E=O??y.inputRef.current?.value;if(E!==void 0)I(E!=="")},[O,l,y.inputRef,I]),pc(O,()=>{if(O===void 0)return;x(W),C(O!==(S.initialValue??"")),y.change(O)});let P=Sc.useRef(null),N=og(L,P),z=rt();return De("input",t,{ref:[o,P],state:M,props:[{id:A,disabled:L,name:W,ref:y.inputRef,"aria-labelledby":F,autoFocus:m,...v?{value:i}:{defaultValue:l},onChange(E){let ue=E.currentTarget.value,H=Le(ga,E.nativeEvent);if(u?.(ue,H),v)return;if(C(ue!==(S.initialValue??"")),I(ue!==""),!E.nativeEvent.defaultPrevented&&!H.isCanceled)x(W),y.change(ue)},onFocus(){N(!0)},onBlur(E){if(g(!0),N(!1),b==="onBlur"){let ue=E.currentTarget.value;if(y.commit(ue),v)queueMicrotask(()=>{let H=y.inputRef.current?.value;if(H!==void 0&&H!==ue&&H!==(S.initialValue??""))y.commit(H)})}},onKeyDown(E){if(E.currentTarget.tagName==="INPUT"&&E.key==="Enter"){g(!0);let ue=E.currentTarget.value,H=E.currentTarget.form;if(H&&H===R.current&&!E.defaultPrevented){let _=E.currentTarget,G=T.current;z.start(0,()=>{if(T.current===G)y.commit(_.value)})}else y.commit(ue)}}},d,(E)=>y.getValidationProps(L,E)],stateAttributesMapping:eg})});import{jsx as SC}from"react/jsx-runtime";var Ju=ig.forwardRef(function(t,o){return SC(ag,{ref:o,...t})});import{jsx as wC}from"react/jsx-runtime";function Qu({className:e,type:t,...o}){return wC(Ju,{type:t,"data-slot":"input",className:me("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as xC}from"react/jsx-runtime";function cg({className:e,...t}){return xC("textarea",{"data-slot":"textarea",className:me("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as wc}from"react/jsx-runtime";function lg({className:e,...t}){return wc("div",{"data-slot":"input-group",role:"group",className:me("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var yC=jt("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function ug({className:e,align:t="inline-start",...o}){return wc("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:me(yC({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var RC=jt("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function em({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return wc(mt,{type:t,"data-size":r,variant:o,className:me(RC({size:r}),e),...n})}function mg({className:e,...t}){return wc(cg,{"data-slot":"input-group-control",className:me("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as et,jsxs as Kt}from"react/jsx-runtime";function fg({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n,body:a,onBodyChange:s,inputRef:i}){let[c,u]=Ja(!1),[l,m]=Ja(""),[p,d]=Ja([]),[f,w]=Ja(!1),h=TC(null),[g,C]=Ja(null);vC(()=>{C(h.current?.closest("[data-coristen-widget]")??null)},[]);async function S(b){let y=Array.from(b.target.files??[]).slice(0,Math.max(0,5-p.length));if(b.target.value="",!y.length)return;w(!0),m("");try{let x=[];for(let R of y)x.push(await t(R));d((R)=>[...R,...x].slice(0,5))}catch(x){m(x instanceof Error?x.message:"File upload failed. Try again.")}finally{w(!1)}}async function I(b){b.preventDefault();let y=a.trim();if(!y&&!p.length||c||f||o)return;u(!0),m("");try{await e(y,p),s(""),d([])}catch{m("Message could not be sent. Try again.")}finally{u(!1)}}return Kt("form",{onSubmit:(b)=>void I(b),className:"w-full",children:[et("input",{ref:h,type:"file",multiple:!0,className:"sr-only",onChange:(b)=>void S(b)}),(p.length>0||f)&&Kt(Xs,{className:"px-2 pb-2",children:[p.map((b)=>Kt(Ln,{size:"xs",children:[et(ca,{children:et(on,{})}),Kt(la,{className:"max-w-32",children:[et(ua,{title:b.name,children:b.name}),Kt(ma,{children:[(b.size/1024).toFixed(0)," KB"]})]}),et(js,{children:et(Wf,{type:"button","aria-label":`Remove ${b.name}`,onClick:()=>d((y)=>y.filter((x)=>x.storageId!==b.storageId)),children:et(Po,{})})})]},b.storageId)),f&&Kt(Ln,{size:"xs",state:"uploading",children:[et(ca,{children:et(on,{})}),Kt(la,{children:[et(ua,{children:"Uploading file"}),et(ma,{children:"Please wait"})]})]})]}),Kt(lg,{className:"has-disabled:opacity-100",children:[et(mg,{ref:i,"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(b)=>s(b.target.value),maxLength:2000,rows:2,onKeyDown:(b)=>{if(b.key==="Enter"&&!b.shiftKey)b.preventDefault(),b.currentTarget.form?.requestSubmit()}}),Kt(ug,{align:"block-end",className:"pt-1",children:[Kt(q0,{children:[et(j0,{render:et(em,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:et(Tn,{className:"size-5"})}),Kt(X0,{portalContainer:g,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[Kt(Ka,{onClick:()=>h.current?.click(),children:[et(Fs,{}),"Add Photos & Files"]}),et($0,{}),Kt(Ka,{children:[et(Ls,{}),"Create Image"]}),Kt(Ka,{children:[et(ws,{}),"Deep Research"]}),Kt(Ka,{children:[et(Ms,{}),"Web Search"]})]})]}),r&&et("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&et("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:Kt("span",{className:"inline-flex items-center gap-1",children:["Powered by",Kt("span",{className:"relative size-4 shrink-0",children:[et("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),et("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),et("span",{className:"font-medium",children:"Coristen"})]})})}),et(em,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:c||f||o||!a.trim()&&!p.length,children:et(gs,{})})]})]}),l&&et("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as Cn}from"react/jsx-runtime";function tm({className:e,size:t="default",...o}){return Cn("div",{"data-slot":"card","data-size":t,className:me("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function om({className:e,...t}){return Cn("div",{"data-slot":"card-header",className:me("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function rm({className:e,...t}){return Cn("div",{"data-slot":"card-title",className:me("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function nm({className:e,...t}){return Cn("div",{"data-slot":"card-description",className:me("text-sm text-muted-foreground",e),...t})}function pg({className:e,...t}){return Cn("div",{"data-slot":"card-action",className:me("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function dg({className:e,...t}){return Cn("div",{"data-slot":"card-content",className:me("px-(--card-spacing)",e),...t})}function xc({className:e,...t}){return Cn("div",{"data-slot":"card-footer",className:me("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as PC}from"react/jsx-runtime";var EC=jt("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function am({variant:e="default",align:t="start",className:o,...r}){return PC("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:me(EC({variant:e}),o),...r})}function sm({className:e,render:t,...o}){return Pn({defaultTagName:"div",props:Wt({className:me("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var v$e=jt("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as yc}from"react/jsx-runtime";function gg({className:e,...t}){return yc("div",{"data-slot":"empty",className:me("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function hg({className:e,...t}){return yc("div",{"data-slot":"empty-header",className:me("flex max-w-sm flex-col items-center gap-2",e),...t})}var M$e=jt("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function Ig({className:e,...t}){return yc("div",{"data-slot":"empty-title",className:me("font-heading text-sm font-medium tracking-tight",e),...t})}function bg({className:e,...t}){return yc("div",{"data-slot":"empty-description",className:me("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Qa}from"react/jsx-runtime";function Cg({className:e,align:t="start",...o}){return Qa("div",{"data-slot":"message","data-align":t,className:me("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function Sg({className:e,...t}){return Qa("div",{"data-slot":"message-avatar",className:me("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function wg({className:e,...t}){return Qa("div",{"data-slot":"message-content",className:me("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function xg({className:e,...t}){return Qa("div",{"data-slot":"message-header",className:me("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function yg({className:e,...t}){return Qa("div",{"data-slot":"message-footer",className:me("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as Rc from"react";import*as Pt from"react";var Rg=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var im=Rc.forwardRef((e,t)=>Rc.createElement(Ne,{ref:t,...e,weights:Rg}));im.displayName="ArrowCounterClockwiseIcon";import*as vc from"react";import*as At from"react";var vg=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var cm=vc.forwardRef((e,t)=>vc.createElement(Ne,{ref:t,...e,weights:vg}));cm.displayName="DownloadSimpleIcon";import{useState as Nc}from"react";import*as Tg from"react";import*as Tc from"react";var lm=Tc.createContext(void 0);function no(e){let t=Tc.useContext(lm);if(!e&&t===void 0)throw Error(Je(27));return t}var Eg=Tg.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=no(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return De("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,o],stateAttributesMapping:Qs,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as Pg from"react";var um=Pg.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=no(),l=u.useState("open"),{getButtonProps:m,buttonRef:p}=lo({disabled:s,native:i}),d={disabled:s};function f(w){if(l)u.setOpen(!1,Le(WI,w.nativeEvent))}return De("button",t,{state:d,ref:[o,p],props:[{onClick:f},c,m]})});import*as Ag from"react";var Mg=Ag.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=no(),u=mo(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),De("p",t,{ref:o,props:[{id:u},i]})});import*as Og from"react";import*as Ec from"react";var mm=Ec.createContext(void 0);function kg(){let e=Ec.useContext(mm);if(e===void 0)throw Error(Je(26));return e}var Lg="--nested-dialogs";var lYe=Pl,uYe=Al,mYe=DI,fYe=FI;var Dg="data-nested-dialog-open";var Fg={...da,...Dn,nestedDialogOpen(e){return e?{[Dg]:""}:null}};import{jsx as kC}from"react/jsx-runtime";var Ng=Og.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=no(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),d=u.useState("popupProps"),f=u.useState("modal"),w=u.useState("mounted"),h=u.useState("nested"),g=u.useState("nestedOpenDialogCount"),C=u.useState("open"),S=u.useState("openMethod"),I=u.useState("titleElementId"),b=u.useState("transitionStatus"),y=u.useState("role"),x=p.useState("floatingId");kg(),Or({open:C,ref:u.context.popupRef,onComplete(){if(C)u.context.onOpenChangeComplete?.(!0)}});let R=i===void 0?rd(u.context.popupRef):i,T=g>0,L=u.useStateSetter("popupElement"),M=De("div",t,{state:{open:C,nested:h,transitionStatus:b,nestedDialogOpen:T},props:[d,{id:x,"aria-labelledby":I,"aria-describedby":l,role:y,...Pi,hidden:!w,onKeyDown(F){if(tc.has(F.key))F.stopPropagation()},style:{[Lg]:g}},c],ref:[o,u.context.popupRef,L],stateAttributesMapping:Fg});return kC(Ba,{context:p,openInteractionType:S,disabled:!w,closeOnFocusOut:!m,initialFocus:R,returnFocus:s,modal:f!==!1,restoreFocus:"popup",children:M})});import*as Hg from"react";import{jsx as Bg,jsxs as LC}from"react/jsx-runtime";var Vg=Hg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=no(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return Bg(mm.Provider,{value:r,children:LC(Oa,{ref:o,...n,children:[s&&i===!0&&Bg(cc,{ref:a.context.internalBackdropRef,inert:Gn(!c)}),t.children]})})});import*as _g from"react";import*as fm from"react";function Ug({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=fm.useState(0),[m,p]=fm.useState(0),d=u===0,f=Ua(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in w&&w.button!==0)return!1;if("touches"in w){if(w.type==="touchend"){if(w.changedTouches.length!==1||w.touches.length!==0)return!1}else if(w.touches.length!==1)return!1}let h=Ze(w);if(d&&!a){if(s){let g=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return g||C?g===h||C===h||fe(h,i)&&!h?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:d});return uc(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(w,h)=>{if(!e.select("open")&&!e.select("mounted"))return;l(w),p(h)}),j(()=>{if(!r&&!n)l(0),p(0)},[r,n]),j(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),Fi(e,{activeTriggerProps:f.reference,inactiveTriggerProps:f.trigger,popupProps:f.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as Pc from"react";var DC={...Un,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class pm extends wr{constructor(e,t,o){let r=new _a,n=FC(e,r,t,o);super(n,OC(r),DC)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null)t.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Mi(this.state,e,t.trigger))}}function FC(e,t,o,r=!1){return{...Vi(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function OC(e){return{popupRef:Pc.createRef(),backdropRef:Pc.createRef(),internalBackdropRef:Pc.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as Wg,jsxs as NC}from"react/jsx-runtime";function Gg(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:p=null}=t,d=e==="drawer",f=e==="alert-dialog",w=f?!0:c,h=f||i,g=f?"alertdialog":"dialog",C=no(!0),S=C!=null,I={modal:w,disablePointerDismissal:h,nested:S,role:g},b=nd((W,M)=>new pm({open:n,openProp:r,activeTriggerId:p,triggerIdProp:m,...I},W,M),!0);b.useControlledProp("openProp",r),b.useControlledProp("triggerIdProp",m),b.useSyncedValues(I),b.useContextCallback("onOpenChange",a),b.useContextCallback("onOpenChangeComplete",s);let y=b.useState("open"),x=b.useState("mounted"),R=b.useState("payload");sd(b,y),Li(b);let{forceUnmount:T}=Di(y,b);_g.useImperativeHandle(u,()=>({unmount:T,close:()=>b.setOpen(!1,Le($f))}),[T,b]);let L=y||x||l!=null;return NC(lm.Provider,{value:b,children:[l&&Wg(Ai,{handle:l,store:b}),L&&Wg(Ug,{store:b,parentContext:C?.context,isDrawer:d}),typeof o==="function"?o({payload:R}):o]})}var zg=Ga(function(t){return Gg("dialog",t)});import*as Zg from"react";var qg=Zg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=no(),u=mo(s);return c.useSyncedValueWithCleanup("titleElementId",u),De("h2",t,{ref:o,props:[{id:u},i]})});import*as jg from"react";var Xg=Ni(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,p=no(!0),f=Ui(l)??p;if(!f)throw Error(Je(79));let w=mo(c),h=f.useState("floatingRootContext"),g=f.useState("isOpenedByTrigger",w),C=f.useState("triggerPopupId",w),S=jg.useRef(null),{registerTrigger:I,isMountedByThisTrigger:b}=ki(w,S,f,{payload:u}),{getButtonProps:y,buttonRef:x}=lo({disabled:s,native:i}),R=Va(h),T=qu(()=>f.select("open"),(M)=>{f.set("openMethod",M)}),L={disabled:s,open:g},W=f.useState("triggerProps",b);return De("button",t,{state:L,ref:[x,o,I,S],props:[R.reference,W,T,{[vi]:"",id:w,"aria-haspopup":"dialog","aria-expanded":g,"aria-controls":C},m,y],stateAttributesMapping:jf})});import{jsx as Xo,jsxs as dm}from"react/jsx-runtime";function Yg({...e}){return Xo(zg,{"data-slot":"dialog",...e})}function Kg({...e}){return Xo(Xg,{"data-slot":"dialog-trigger",...e})}function BC({...e}){return Xo(Vg,{"data-slot":"dialog-portal",...e})}function Jg({...e}){return Xo(um,{"data-slot":"dialog-close",...e})}function HC({className:e,...t}){return Xo(Eg,{"data-slot":"dialog-overlay",className:me("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function Qg({className:e,children:t,showCloseButton:o=!0,...r}){return dm(BC,{children:[Xo(HC,{}),dm(Ng,{"data-slot":"dialog-content",className:me("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&dm(um,{"data-slot":"dialog-close",render:Xo(mt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[Xo(Po,{}),Xo("span",{className:"sr-only",children:"Close"})]})]})]})}function eh({className:e,...t}){return Xo(qg,{"data-slot":"dialog-title",className:me("font-heading text-base leading-none font-medium",e),...t})}function th({className:e,...t}){return Xo(Mg,{"data-slot":"dialog-description",className:me("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function oh(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var VC=jt("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ac({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"span",props:Wt({className:me(VC({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as WC}from"react/jsx-runtime";var UC=jt("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function rh({className:e,variant:t="default",render:o,...r}){return Pn({defaultTagName:"div",props:Wt({className:me(UC({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function nh({className:e,...t}){return WC("span",{"data-slot":"marker-content",className:me("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function ah(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as qn from"react";function sh({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=Mc(_C(r,n),t);if(!o)return qn.createElement(e,a);if(typeof o=="function")return o(a,r);if(!qn.isValidElement(o))return null;let s=o.props,i={...Mc(a,s),ref:jn(a.ref,s.ref)};return qn.cloneElement(o,i)}function Mc(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=jn(s,a):zC(n)&&typeof s=="function"&&typeof a=="function"?t[n]=GC(a,s):t[n]=a}}return t}function _C(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function GC(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function zC(e){return/^on[A-Z]/.test(e)}function jn(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as ee from"react";import{jsx as Xn,jsxs as lh}from"react/jsx-runtime";var ZC=8,qC=64,jC=0,Dc=0.5,XC=180,$C=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),uh={start:!1,end:!1},YC=[],Fc={currentAnchorId:null,visibleMessageIds:YC};function KC({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return uh;let n=hm({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function JC({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Fc;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of es(e,r)){let p=m.dataset.messageId;if(!p)continue;let d=m.dataset.scrollAnchor==="true",f=d||c?m.getBoundingClientRect():null;(c&&f?f.bottom>i&&f.top<s.bottom:a.has(p))&&u.push(p),d&&f&&f.top<=i+Dc&&(l=p)}return u.length===0&&l===null?Fc:{currentAnchorId:l,visibleMessageIds:u}}function es(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function QC(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function eS(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function tS(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function oS(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function rS({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of es(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function nS({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=mh(t,n),s=t.getBoundingClientRect().height,i=iS(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function mh(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function kc(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function aS({content:e,scrollTop:t,spacer:o,viewport:r}){let n=hm({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function hm({content:e,spacer:t,viewport:o}){let r=es(e,t),n=fh(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function sS(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function fh(e){let t=window.getComputedStyle(e);return{end:gm(t.paddingBlockEnd||t.paddingBottom),start:gm(t.paddingBlockStart||t.paddingTop)}}function iS(e){let t=e?.parentElement;return t?fh(t):{end:0,start:0}}function cS(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return gm(o)}function gm(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function ph(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function ih(e,t){return ph(e,t)}function lS(){return ph(Fc,mS)}function uS(e,t){return e.start===t.start&&e.end===t.end}function mS(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function fS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=ee.useRef(e),s=ee.useRef(!1),i=ee.useRef(null),c=ee.useRef(!1),u=ee.useRef(o),l=ee.useRef(0),m=ee.useRef(null),p=ee.useRef(0),d=ee.useRef(e?"following-bottom":"free-scrolling"),f=ee.useRef(new Map),w=ee.useRef(null),h=ee.useRef(null),g=ee.useRef(null),C=ee.useRef(n),S=ee.useRef(!0),I=ee.useRef(null),b=ee.useRef(r),y=ee.useRef(null),x=ee.useRef(0),R=ee.useRef(0),T=ee.useRef(null),L=ee.useRef(null),W=ee.useRef(null),M=ee.useRef(null),F=ee.useRef(null),A=ee.useRef(null),v=ee.useRef(null),O=ee.useRef(null),X=ee.useRef(null),P=ee.useRef(new Set),N=ee.useRef(new WeakSet);return W.current===null&&(W.current=ih(t==="end"||t==="last-anchor",(z,K)=>z===K)),M.current===null&&(M.current=ih(uh,uS)),X.current===null&&(X.current=lS()),a.current=e,u.current=o,b.current=r,C.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:F,streamingTurnRef:g,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:p,messageElementsRef:f,modeRef:d,pendingScrollFrameRef:y,pendingScrollToMessageRef:w,prependRestoreRef:h,preserveScrollOnPrependRef:S,pendingDefaultScrollStore:W.current,rootRef:I,scrollEdgeThresholdRef:u,scrollMarginRef:b,scrollPreviousItemPeekRef:C,spacerGapRef:x,spacerHeightRef:R,spacerRef:T,stateFrameRef:L,stateStore:M.current,viewportRef:A,visibilityFrameRef:v,visibilityObserverRef:O,visibilityStore:X.current,visibleMessageIdsRef:P,handledScrollAnchorsRef:N}}function dh(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function Lc(e){e.defaultScrollPositionAppliedRef.current=!0,dh(e)}function pS({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:p,prependRestoreRef:d,scrollMarginRef:f,scrollPreviousItemPeekRef:w,spacerGapRef:h,spacerHeightRef:g,spacerRef:C,viewportRef:S}=e,I=ee.useCallback((M)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==M&&(s.current=M,t()),M&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},XC))},[t]),b=ee.useCallback((M)=>{let F=C.current;if(!F)return;let A=Math.max(0,Math.ceil(M));g.current!==A&&(g.current=A,F.hidden=A===0,F.style.height=`${A}px`,F.style.marginTop=A>0?`${-h.current}px`:"")},[]),y=ee.useCallback((M,{behavior:F="auto",autoscrolling:A=!1}={})=>{let v=S.current;if(!v)return;let O=Math.max(0,M);if(Math.abs(v.scrollTop-O)<=Dc){v.scrollTop=O,t();return}A&&I(!0),v.scrollTo({top:O,behavior:F}),o()},[t,o,I]),x=ee.useCallback(({behavior:M="auto"}={})=>S.current?(b(0),n.current=null,m.current="free-scrolling",y(0,{behavior:M}),r(),!0):!1,[r,y,b]),R=ee.useCallback(({behavior:M="auto"}={})=>{let F=S.current;return F?(b(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(sS(F),{autoscrolling:!0,behavior:M}),r(),!0):!1},[r,y,b]),T=ee.useCallback((M,{align:F="start",behavior:A="auto",scrollMargin:v=f.current}={},{keepPreviousPeek:O=!1}={})=>{let X=c.current,P=S.current;if(!X||!P||!X.contains(M))return!1;let N=nS({align:F,element:M,scrollMargin:O?v+w.current:v,spacer:C.current,viewport:P}),z=aS({content:X,scrollTop:N,spacer:C.current,viewport:P});return b(z),d.current={element:M,viewportTop:kc(M,P)},m.current=O?"anchored-to-message":"settling-jump",n.current=O?M:null,y(N,{behavior:A}),r(),!0},[r,y,b]),L=ee.useCallback(()=>{let M=n.current;return!M||!M.isConnected||m.current!=="anchored-to-message"?!1:T(M,{align:"start"},{keepPreviousPeek:!0})},[T]),W=ee.useCallback((M,F)=>{let A=l.current.get(M);return A?(Lc(e),T(A,F)?(p.current=null,!0):(p.current={messageId:M,options:F},!0)):u.current===0?(p.current={messageId:M,options:F},Lc(e),!0):!1},[T]);return{flushPendingScrollToMessage:ee.useCallback(()=>{let M=p.current;if(!M)return!1;let F=l.current.get(M.messageId);return!F||!T(F,M.options)?!1:(p.current=null,Lc(e),!0)},[T]),reanchorToAnchoredMessage:L,scrollToElement:T,scrollToEnd:R,scrollToMessage:W,scrollToStart:x}}function ch(e,t){return ee.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function dS({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=ZC,scrollPreviousItemPeek:r=qC,scrollMargin:n=jC}){let a=fS({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:p,itemCountRef:d,lastScrollTopRef:f,messageElementsRef:w,modeRef:h,pendingScrollFrameRef:g,pendingScrollToMessageRef:C,prependRestoreRef:S,preserveScrollOnPrependRef:I,pendingDefaultScrollStore:b,rootRef:y,scrollEdgeThresholdRef:x,scrollMarginRef:R,scrollPreviousItemPeekRef:T,spacerGapRef:L,spacerHeightRef:W,spacerRef:M,stateFrameRef:F,stateStore:A,viewportRef:v,visibilityFrameRef:O,visibilityObserverRef:X,visibilityStore:P,visibleMessageIdsRef:N,handledScrollAnchorsRef:z}=a,K=ee.useRef(t);K.current!==t&&(K.current=t,m.current=!1);let E=ee.useCallback((de)=>{let ge=y.current,he=v.current,ke=[de.start&&"start",de.end&&"end"].filter(Boolean).join(" "),Xe=c.current;for(let ct of[ge,he])ct&&(ke?ct.setAttribute("data-scrollable",ke):ct.removeAttribute("data-scrollable"),ct.toggleAttribute("data-autoscrolling",Xe))},[]),ue=ee.useCallback((de)=>{let ge=v.current?.scrollTop??0,he=ge<f.current-Dc;f.current=ge,i.current&&!de.end&&h.current!=="settling-jump"&&h.current!=="anchored-to-message"?h.current="following-bottom":h.current==="following-bottom"&&de.end&&he&&!c.current&&(h.current="free-scrolling")},[]),H=ee.useCallback(()=>{let de=KC({content:l.current,scrollEdgeThreshold:x.current,spacer:M.current,viewport:v.current});ue(de);let ge=h.current==="following-bottom"?{...de,end:!1}:de;E(ge),A.setSnapshot(ge)},[ue,A,E]),_=ee.useCallback(()=>{F.current===null&&(F.current=window.requestAnimationFrame(()=>{F.current=null,H()}))},[H]),G=ee.useCallback(()=>{P.hasListeners()&&O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,P.hasListeners()&&P.setSnapshot(JC({content:l.current,scrollMargin:R.current,scrollPreviousItemPeek:T.current,spacer:M.current,viewport:v.current,visibleMessageIds:N.current}))}))},[P]),{flushPendingScrollToMessage:le,reanchorToAnchoredMessage:Te,scrollToElement:te,scrollToEnd:se,scrollToMessage:pe,scrollToStart:we}=pS({refs:a,commitScrollState:H,scheduleStateCommit:_,scheduleVisibilitySync:G}),q=ee.useCallback(()=>{let de=S.current,ge=v.current;if(!de||!ge||!de.element.isConnected)return!1;let he=kc(de.element,ge)-de.viewportTop;return Math.abs(he)<=Dc?!1:(ge.scrollTop+=he,de.viewportTop=kc(de.element,ge),_(),G(),!0)},[_,G]),B=ee.useCallback(()=>{let de=l.current,ge=v.current;if(!de||!ge){S.current=null;return}let he=rS({content:de,spacer:M.current,viewport:ge});S.current=he?{element:he,viewportTop:kc(he,ge)}:null},[]),Q=ee.useCallback(()=>{g.current===null&&(g.current=window.requestAnimationFrame(()=>{g.current=null,le()&&B()}))},[B,le]),ie=ee.useCallback(()=>{if(!t||m.current||d.current===0)return!1;let de=!1;if(t==="last-anchor"){let ge=l.current,he=v.current,ke=ge&&he?oS(es(ge,M.current)):null;if(!ge||!he||!ke)de=se({behavior:"auto"});else{let Xe=mh(ke,he);de=hm({content:ge,spacer:M.current,viewport:he})-Xe<=he.clientHeight?se({behavior:"auto"}):te(ke,{align:"start"},{keepPreviousPeek:!0})}}else de=t==="end"?se({behavior:"auto"}):we({behavior:"auto"});return de?(Lc(a),!0):!1},[t,te,se,we]),xe=ee.useCallback(()=>{let de=l.current;if(!de)return;let ge=es(de,M.current),he=d.current,ke=p.current;d.current=ge.length,p.current=ge[0]??null,(()=>{if(le())return;if(he===0){if(ie()||ge.length>0&&i.current&&se({behavior:"auto"}))return;H(),G();return}let Xe=ke?ge.indexOf(ke):-1;if(I.current&&Xe>0){q();return}if(ge.length>he){let ct=QC(ge,he);if(ct){if(i.current&&h.current==="following-bottom"&&tS(ge,he)){se({behavior:"auto"});return}te(ct,{align:"start"},{keepPreviousPeek:!0}),z.current.add(ct);return}}if(ge.length===he){let ct=eS(ge,z.current);if(ct){te(ct,{align:"start"},{keepPreviousPeek:!0}),z.current.add(ct);return}}h.current==="following-bottom"&&i.current?se({behavior:"auto"}):(H(),G())})(),B()},[ie,B,H,le,q,G,te,se]),ye=ee.useCallback(()=>{if(h.current==="following-bottom"&&i.current){se({behavior:"auto"});return}let de=W.current;if(Te()){i.current&&de>0&&W.current===0&&se({behavior:"auto"});return}_(),G()},[Te,_,G,se]),re=ee.useCallback(()=>{let de=v.current;if(!(!de||!P.hasListeners())){if(typeof IntersectionObserver>"u"){G();return}X.current||(X.current=new IntersectionObserver((ge)=>{for(let he of ge){let ke=he.target.dataset.messageId;ke&&(he.isIntersecting?N.current.add(ke):N.current.delete(ke))}G()},{root:de,rootMargin:`${-(R.current+T.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),w.current.forEach((ge)=>{X.current?.observe(ge)}),G()}},[G,P]),V=ee.useCallback(()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),X.current?.disconnect(),X.current=null,N.current.clear(),P.setSnapshot(Fc)},[P]),J=ee.useCallback((de,ge,he)=>{if(ge){w.current.set(de,ge),X.current?.observe(ge),G(),C.current?.messageId===de&&Q();return}he&&w.current.get(de)===he&&(w.current.delete(de),N.current.delete(de),X.current?.unobserve(he),G())},[Q,G]),Ee=ee.useCallback(()=>{(h.current==="following-bottom"||h.current==="anchored-to-message"||h.current==="settling-jump")&&(s.current=null,h.current="free-scrolling")},[]),ce=ee.useCallback(()=>E(A.getSnapshot()),[A,E]),Ce=ch(y,ce),k=ch(v,ce),U=ee.useCallback((de)=>{l.current=de},[]),Ie=ee.useCallback((de)=>{M.current=de,L.current=cS(de?.parentElement??null)},[]),Y=ee.useCallback(()=>{H(),G(),B()},[B,H,G]),ne=ee.useMemo(()=>({handleContentChange:xe,handleResize:ye,observeVisibility:re,pendingDefaultScrollStore:b,preserveScrollOnPrependRef:I,scrollToEnd:se,scrollToMessage:pe,scrollToStart:we,setContentElement:U,setRootElement:Ce,setSpacerElement:Ie,setViewportElement:k,stateStore:A,syncAfterScroll:Y,unobserveVisibility:V,userScrollIntent:Ee,viewportRef:v,visibilityStore:P}),[xe,ye,re,b,se,pe,we,U,Ce,Ie,k,A,Y,V,Ee,P]);return ee.useLayoutEffect(()=>{ie()||d.current===0&&dh(a)},[ie]),ee.useEffect(()=>()=>{F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null),O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),g.current!==null&&(window.cancelAnimationFrame(g.current),g.current=null),X.current?.disconnect(),X.current=null},[]),ee.useLayoutEffect(()=>{if(e&&h.current==="following-bottom"&&d.current>0){se({behavior:"auto"});return}H()},[e,H,se]),{context:ne,registerMessage:J}}function gS(e){let t=ee.useRef(e);return t.current=e,t}var gh=ee.createContext(null),hh=ee.createContext(null);function ts(){let e=ee.useContext(gh);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function hS(){let e=ee.useContext(hh);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function IS({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=dS({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Xn(gh.Provider,{value:s,children:Xn(hh.Provider,{value:i,children:t})})}function Ih(){let{pendingDefaultScrollStore:e}=ts();return ee.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function bS({children:e,...t}){let{setRootElement:o}=ts(),r=Ih();return Xn("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function CS({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:p,setViewportElement:d,syncAfterScroll:f,userScrollIntent:w,viewportRef:h}=ts(),g=Ih();p.current=s;let C=ee.useCallback((x)=>{d(x),jn(i)?.(x)},[i,d]);function S(x){f(),r?.(x)}function I(x){w(),a?.(x)}function b(x){w(),n?.(x)}function y(x){$C.has(x.key)&&w(),o?.(x)}return ee.useEffect(()=>{let x=h.current;if(!x||typeof ResizeObserver>"u")return;let R=0,T=new ResizeObserver(()=>{window.cancelAnimationFrame(R),R=window.requestAnimationFrame(m)});return T.observe(x),()=>{window.cancelAnimationFrame(R),T.disconnect()}},[m,h]),Xn("div",{ref:C,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:y,onScroll:S,onTouchMove:b,onWheel:I,...l,...g?{"data-pending-scroll":""}:null,children:t})}function SS({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=ts(),l=ee.useRef(null),m=ee.useCallback((p)=>{l.current=p,c(p),jn(o)?.(p)},[o,c]);return ee.useLayoutEffect(()=>{let p=l.current;if(!p||(s(),typeof MutationObserver>"u"))return;let d=new MutationObserver(()=>{s()});return d.observe(p,{childList:!0}),()=>d.disconnect()},[s]),ee.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let d=0,f=new ResizeObserver(()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(i)});return f.observe(p),()=>{window.cancelAnimationFrame(d),f.disconnect()}},[i]),lh("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Xn("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function wS({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=hS(),a=ee.useRef(null),s=ee.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),jn(t)?.(i)},[e,t,n]);return Xn("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function xS({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=ts(),m=gS(r),p=ee.useCallback((h)=>l.subscribe(h),[l]),d=ee.useCallback(()=>{let h=l.getSnapshot();return o==="start"?h.start:h.end},[o,l]),f=ee.useSyncExternalStore(p,d,d),w=ee.useCallback((h)=>{f&&(m.current?.(h),h.defaultPrevented||(h.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,f,m,c,u]);return sh({defaultTagName:"button",props:Mc({type:s,inert:!f,tabIndex:f?a:-1,children:t??lh("span",{children:["Scroll to ",o]}),onClick:w},i),render:n,state:{active:f,direction:o},stateAttributesMapping:{active:(h)=>({"data-active":h?"true":"false"})}})}var Sn={Provider:IS,Root:bS,Viewport:CS,Content:SS,Item:wS,Button:xS};import*as Oc from"react";import*as Mt from"react";var bh=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Mt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var Im=Oc.forwardRef((e,t)=>Oc.createElement(Ne,{ref:t,...e,weights:bh}));Im.displayName="ArrowDownIcon";import{jsx as yr,jsxs as RS,Fragment as yS}from"react/jsx-runtime";function Ch(e){return yr(Sn.Provider,{...e})}function Sh({className:e,...t}){return yr(Sn.Root,{"data-slot":"message-scroller",className:me("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function wh({className:e,...t}){return yr(Sn.Viewport,{"data-slot":"message-scroller-viewport",className:me("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function xh({className:e,...t}){return yr(Sn.Content,{"data-slot":"message-scroller-content",className:me("flex h-max min-h-full flex-col gap-6",e),...t})}function yh({className:e,scrollAnchor:t=!1,...o}){return yr(Sn.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:me("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function Rh({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return yr(Sn.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:me("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??yr(mt,{variant:n,size:a}),...s,children:o??RS(yS,{children:[yr(Im,{}),yr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as Oe,jsxs as ao}from"react/jsx-runtime";function vS(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function vh({attachment:e}){let[t,o]=Nc(!1),[r,n]=Nc(!1);return ao("div",{className:"flex flex-col items-end gap-1",children:[Oe(mt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await oh(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:Oe(cm,{})}),r&&Oe("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function TS({attachments:e,allowDownloads:t=!1}){let[o,r]=Nc(null),[n,a]=Nc(!1);if(!e?.length)return null;return ao(Yg,{onOpenChange:(s)=>{if(!s)r(null)},children:[Oe(Xs,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return Oe(Ln,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:Oe(Kg,{render:Oe("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:Oe("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return ao(Ln,{className:"min-w-52",children:[Oe(ca,{children:Oe(on,{})}),ao(la,{className:"max-w-44",children:[Oe(ua,{title:s.name,children:s.name}),ao(ma,{children:[s.type||"File"," ·"," ",vS(s.size)]})]}),t&&s.url&&Oe(js,{children:Oe(vh,{attachment:s})})]},s.storageId)})}),ao(Qg,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[Oe(eh,{className:"sr-only",children:o?.name??"Image preview"}),Oe(th,{className:"sr-only",children:"Expanded image preview"}),ao("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&Oe(vh,{attachment:o},o.storageId),Oe(Jg,{render:Oe(mt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:Oe(Po,{})})]}),n?Oe("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&Oe("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function bm({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return Oe(Ch,{children:ao(Sh,{children:[Oe(wh,{children:ao(xh,{className:"p-4",children:[e?.length===0&&Oe(gg,{children:ao(hg,{children:[Oe(Ig,{children:"No messages yet"}),Oe(bg,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),p=e[u-1]?._creationTime,d=i&&m&&(p===void 0||m.toDateString()!==new Date(p).toDateString()),f=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return ao(yh,{messageId:c._id,scrollAnchor:l,children:[d&&Oe(rh,{variant:"separator",className:"mb-5",children:Oe(nh,{children:ah(m.getTime())})}),ao(Cg,{align:l?"end":"start",children:[(l?n:a)&&Oe(Sg,{className:"size-7 min-w-7",children:l?n:a}),ao(wg,{children:[i&&ao(xg,{className:"gap-2",children:[c.sender==="customer"?"You":f?"Ten":"Support",f&&Oe(Ac,{variant:"secondary",children:"AI"})]}),Oe(TS,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&Oe(am,{variant:"muted",children:Oe(sm,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?Oe("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):Oe(am,{variant:l?o:"secondary",children:Oe(sm,{children:c.body})})),c.citations&&c.citations.length>0&&Oe("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((w)=>w.url?Oe("a",{href:w.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:w.title},w.sourceId):Oe("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:w.title},w.sourceId))}),c.generationStatus==="failed"&&ao("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[Oe("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&ao(mt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[Oe(im,{}),"Retry"]})]}),i&&m&&Oe(yg,{children:Oe("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),Oe(Rh,{})]})})}import{jsx as ES}from"react/jsx-runtime";function Th({className:e,...t}){return ES("label",{"data-slot":"label",className:me("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as PS}from"react/jsx-runtime";function $o({className:e,...t}){return PS("div",{"data-slot":"skeleton",className:me("animate-pulse rounded-md bg-muted",e),...t})}import{jsx as be,jsxs as ut}from"react/jsx-runtime";function AS(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function Ph({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,onClose:a,onSettingsChange:s,theme:i,assetBaseUrl:c,defaultEmail:u,welcome:l}){let m=rs(Ao.workspace,{workspaceId:e}),p=m===void 0?t:m,d=Eh("");os(()=>{if(!m)return;let V=JSON.stringify(m);if(d.current===V)return;d.current=V,s(m)},[s,m]);let f=p?{...p,theme:i}:p,w=$n(Ao.openWebsite),h=$n(Ao.startCustomer),g=$n(Ao.sendCustomer),C=$n(Ao.retryAgentResponse),S=$n(Ao.generateAttachmentUploadUrl),I=$n(Ao.markCustomerRead),[b,y]=Rr(""),[x,R]=Rr(),[T,L]=Rr(u),[W,M]=Rr(""),F=Eh(null),[A,v]=Rr(!1),[O,X]=Rr(""),[P,N]=Rr(),[z,K]=Rr("chat"),[E,ue]=Rr(),H=!!o,_=rs(Ao.visitorProfile,b&&H?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),G=rs(Ao.welcomeSuggestions,_&&l?.suggestions===void 0?{workspaceId:e,sessionToken:o}:"skip");os(()=>{let V=`coristen:${e}`,J=localStorage.getItem(V)??crypto.randomUUID();localStorage.setItem(V,J),y(J);let Ee=navigator.userAgent;ue({currentPage:window.location.href,referrer:document.referrer,browser:AS(Ee),device:/Mobi|Android|iPhone|iPad/i.test(Ee)?"Mobile":navigator.platform||"Desktop"})},[e]);async function le(V){if(V.preventDefault(),!E||!o||A)return;v(!0),X("");try{let J=T.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",Ee=await w({workspaceId:e,visitorId:b,sessionToken:o,name:J,email:T,...E,newConversation:!0});R(Ee??void 0),K("chat")}catch{X("We couldn't save your email. Please try again.")}finally{v(!1)}}async function Te(){if(!_){K("chat");return}if(!E||A)return;v(!0),X("");try{let V=await w({workspaceId:e,visitorId:b,sessionToken:o,..._,...E,newConversation:!0});R(V??void 0),K("chat")}catch{X("We couldn't start a new conversation. Please try again.")}finally{v(!1)}}async function te(V,J){if(!_)throw Error("Customer details are still loading");if(x)return await g({conversationId:x,visitorId:b,sessionToken:o,body:V,attachments:J});if(!E)throw Error("Chat is still loading");await w({workspaceId:e,visitorId:b,sessionToken:o,..._,...E,newConversation:!0});let Ee=await h({workspaceId:e,visitorId:b,sessionToken:o,body:V,attachments:J});return N({body:V,attachments:J.map((ce)=>({...ce,url:null})),createdAt:Date.now()}),R(Ee),Ee}let se=rs(Ao.customerMessages,x&&b&&H?{conversationId:x,visitorId:b,sessionToken:o}:"skip"),pe=rs(Ao.visitorConversations,b&&H?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),we=se?.at(-1);if(os(()=>{if(se!==void 0)N(void 0)},[se]),os(()=>{if(z==="chat"&&H&&x&&b&&we?.sender==="merchant")I({conversationId:x,visitorId:b,sessionToken:o}).catch(()=>{})},[x,z,we?._id,we?.sender,I,o,H,b]),os(()=>{let V=(J)=>{if(J.key==="Escape"&&!J.defaultPrevented)a()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[a]),f===void 0||!o)return null;if(f===null||f.enabled===!1)return be(tm,{className:"w-full max-w-md",children:ut(om,{children:[be(rm,{children:"Chat unavailable"}),be(nm,{children:f?"This chat is currently offline.":"This chat is no longer available."})]})});let B=`${{none:0,sm:6,md:10,lg:16}[f?.radius??"lg"]}px`,Q=f?.accentEnabled?f.brandColor:"#171717",ie=f.theme==="dark"?`color-mix(in oklch, ${Q} 20%, white)`:Q,xe=f.agentImageUrl?be("img",{src:f.agentImageUrl,alt:"",className:"size-7 rounded-full object-cover"}):be(vn,{seed:"Coristen agent",size:28,className:"size-7 contrast-200 grayscale"}),ye=ut("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto px-8 py-10 text-center",children:[be("div",{className:"flex size-12 items-center justify-center overflow-hidden rounded-full bg-muted",children:f.agentImageUrl?be("img",{src:f.agentImageUrl,alt:"",className:"size-12 object-cover"}):be(vn,{seed:"Coristen agent",size:48,className:"size-12 contrast-200 grayscale"})}),ut("div",{className:"flex flex-col gap-1.5",children:[be("p",{className:"text-base font-semibold",children:`Hi, I’m ${f.agentName}`}),be("p",{className:"max-w-72 text-sm text-muted-foreground",children:_?l?.message??f.welcomeMessage:"Enter your email below so we can keep your conversation and share replies with you."})]}),_&&be("div",{className:"flex w-full max-w-72 flex-col gap-1 pt-3",children:l?.suggestions===void 0&&G===void 0?be("div",{className:"flex flex-col items-center gap-3","aria-label":"Loading suggestions","aria-busy":"true",children:["w-4/5","w-3/5","w-2/3"].map((V)=>be($o,{className:`h-10 rounded-lg ${V}`},V))}):(l?.suggestions??(G?.length?G:[{title:"Tell me what you can help with",message:"What can you help me with, and where should I start?"},{title:"Help me understand my options",message:"Can you explain the options available and help me decide what to do next?"},{title:"I need help with something",message:"I need help with something and would like guidance on the next step."}])).map((V,J)=>be(mt,{type:"button",variant:"ghost",className:"h-auto min-h-10 w-full justify-center px-2.5 py-2 text-center text-sm font-medium whitespace-normal",disabled:A,onClick:()=>{v(!0),X(""),te(V.message.slice(0,2000),[]).catch(()=>X("Your message couldn't be sent. Please try again.")).finally(()=>v(!1))},children:be("span",{className:"min-w-0 break-words",children:V.title})},`${J}:${V.title}`))})]}),re=z==="history"?"history":x?`conversation:${x}`:_===null?"contact":"new";return be("div",{className:f.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ut(tm,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) bg-background text-foreground shadow-none",style:{"--primary":f.accentSendIcon?f.theme==="dark"?ie:Q:void 0,"--primary-foreground":f.accentSendIcon&&f.theme==="dark"?"#171717":void 0,"--configured-radius":B,backgroundColor:f?.tintedGrayscale?`color-mix(in oklch, ${Q} 4%, var(--background))`:void 0},children:[ut(om,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:ie}:void 0,children:[ut(rm,{className:"flex min-w-0 items-center gap-2",children:[f.logoUrl?be("img",{src:f.logoUrl,alt:"",className:"size-6 shrink-0 object-contain"}):ut("span",{className:"relative size-6 shrink-0","aria-hidden":"true",children:[be("img",{src:`${c}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),be("img",{src:`${c}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),be("span",{className:"truncate",children:f.name})]}),z==="history"&&be(nm,{className:"text-current opacity-85",children:"Continue a previous conversation"}),ut(pg,{className:"flex gap-1",children:[ut(mt,{variant:"ghost",size:"sm",onClick:()=>K(z==="chat"?"history":"chat"),children:[z==="chat"?be(Es,{weight:"duotone","data-icon":"inline-start"}):be(ys,{weight:"duotone","data-icon":"inline-start"}),z==="chat"?"Messages":"Chat"]}),be(mt,{variant:"ghost",size:"icon-sm","aria-label":r?"Restore chat size":"Expand chat",title:r?"Restore chat size":"Expand chat","aria-pressed":r,onClick:()=>n(!r),children:r?be(Is,{weight:"duotone"}):be(Cs,{weight:"duotone"})}),be(mt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:a,children:be(Po,{weight:"duotone"})})]})]}),O&&_!==null&&be("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:O}),be(dg,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:z==="history"?be("div",{className:"flex min-h-0 w-full flex-col",children:ut("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[pe===void 0&&Array.from({length:3}).map((V,J)=>ut("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[be($o,{className:"h-4 w-4/5"}),be($o,{className:"h-3 w-2/5"})]},J)),pe?.map((V)=>ut("button",{type:"button",className:"group flex w-full items-center gap-3 rounded-lg border border-transparent p-3 text-left transition-colors hover:border-border hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{R(V._id),K("chat")},children:[be("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:f.agentImageUrl?be("img",{src:f.agentImageUrl,alt:"",className:"size-9 object-cover"}):be(vn,{seed:"Coristen agent",size:36,className:"size-9 contrast-200 grayscale"})}),ut("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ut("span",{className:"flex items-center justify-between gap-2",children:[be("span",{className:"text-sm font-medium",children:"Conversation"}),be("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(V.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(V.lastMessageAt)})]}),be("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:V.lastMessagePreview||"Attachment"}),!!V.customerUnreadCount&&ut(Ac,{variant:"secondary",children:[V.customerUnreadCount," unread"]})]}),be(vs,{className:"size-4 shrink-0 text-muted-foreground"})]},V._id)),pe?.length===0&&be("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):_===void 0&&!x?ut("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ut("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[be($o,{className:"size-12 rounded-full"}),be($o,{className:"h-5 w-28"}),ut("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[be($o,{className:"h-4 w-full"}),be($o,{className:"h-4 w-4/5"})]})]}),ut("div",{className:"flex flex-col gap-3",children:[ut("div",{className:"flex flex-col gap-2",children:[be($o,{className:"h-4 w-24"}),be($o,{className:"h-8 w-full rounded-lg"})]}),be($o,{className:"h-9 w-full rounded-lg"})]})]}):_===null&&!x?be("div",{className:"flex min-h-0 w-full flex-col",children:ye}):x&&se===void 0&&P?be(bm,{messages:[{_id:"pending-first-message",_creationTime:P.createdAt,sender:"customer",body:P.body,attachments:P.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:be(vn,{seed:b,size:28,className:"size-7"}),otherAvatar:xe}):!x||se===void 0||se.length===0?ye:be(bm,{messages:se,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:be(vn,{seed:b,size:28,className:"size-7"}),otherAvatar:xe,onRetry:(V)=>{X(""),C({conversationId:x,visitorId:b,customerMessageId:V,sessionToken:o}).catch(()=>X("The reply couldn't be retried. Please try again."))}},x)},re),z==="history"&&be(xc,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ut(mt,{variant:"secondary",size:"lg",className:"w-full",disabled:A||_===void 0,onClick:()=>void Te(),children:[be(Tn,{"data-icon":"inline-start"}),"Start a conversation"]})}),_===null&&!x&&z==="chat"&&be(xc,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ut("form",{className:"flex w-full flex-col gap-3",onSubmit:(V)=>void le(V),children:[ut("div",{className:"flex flex-col gap-2",children:[be(Th,{htmlFor:"customer-email",children:"Email address"}),be(Qu,{id:"customer-email",type:"email",value:T,onChange:(V)=>L(V.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),O&&be("p",{role:"alert",className:"text-xs text-destructive",children:O}),be(mt,{type:"submit",size:"lg",className:"w-full",disabled:A||!E,children:A?"Continuing...":"Continue"})]})}),_&&z==="chat"&&H&&be(xc,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:be(fg,{body:W,onBodyChange:M,inputRef:F,sendDisabled:!E,showPoweredBy:f.showPoweredBy,assetBaseUrl:c,upload:async(V)=>{if(V.size>f.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${f.maxAttachmentSizeMb} MB or smaller`);if(!f.allowedAttachmentTypes.some((Ce)=>V.type===Ce||V.type.startsWith(Ce)))throw Error("This file type is not allowed");let J=await S({workspaceId:e,visitorId:b,sessionToken:o}),Ee=await fetch(J,{method:"POST",headers:{"Content-Type":V.type||"application/octet-stream"},body:V});if(!Ee.ok)throw Error("Upload failed");let{storageId:ce}=await Ee.json();return{storageId:ce,name:V.name,type:V.type||"application/octet-stream",size:V.size}},send:te})})]})})}function Ah(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as kh from"react";import*as Bc from"react";var Cm=Bc.createContext(void 0);function Zr(){let e=Bc.useContext(Cm);if(!e)throw Error(Je(73));return e}var Mh=0;function Hc(e){return Mh+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Mh}`}function Vc(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function Sm(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function wm(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var Yo={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class xm extends wr{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Sm(e.toasts)},{},Yo)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=wm(this.state.toasts,t);r.toasts=n,r.toastMetadata=Sm(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=Yo.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||Hc("toast");if(e.id){let i=Yo.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(wm(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(Yo.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=Yo.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=Yo.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((w)=>w.id===e?i:w));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,p=this.timers.has(e),d=u!==c,f=s.type==="loading";if(!m&&p){this.clearTimer(e);return}if(m&&(!p||d||l||f||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),Yo.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=Yo.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=wm(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=Vc(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=Vc(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=Vc(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=eo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(fe(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!Yo.expandedOrOutOfFocus(this.state)?eo.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:Sm(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=nt(ve(this.state.viewport));if(!this.state.viewport||!fe(this.state.viewport,t)||!Br(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=Yo.toasts(this.state),r=Yo.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as MS,jsxs as kS}from"react/jsx-runtime";var Lh=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=qe(()=>new xm({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Fr(s.disposeEffect),kh.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),kS(Cm.Provider,{value:s,children:[MS(LS,{store:s,timeout:r,limit:n}),o]})};function LS(e){let{store:t,timeout:o,limit:r}=e;return j(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as No from"react";var Dh="--toast-frontmost-height";import{jsx as Uc,jsxs as ym}from"react/jsx-runtime";var Fh=No.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=Zr(),u=rt(),l=No.useRef(!1),m=No.useRef(!1),p=No.useRef(!1),d=c.useState("isEmpty"),f=c.useState("toasts"),w=c.useState("focused"),h=c.useState("expanded"),g=c.useState("prevFocusElement"),C=f[0]?.height,S=f.some((P)=>P.transitionStatus==="ending"),I=f.filter((P)=>P.priority==="high");No.useEffect(()=>{let P=c.state.viewport;if(!P||d)return;let N=ze(P),z=ve(P);function K(H){if(H.key==="F6"&&Ze(H)!==P)H.preventDefault(),c.set("prevFocusElement",nt(z)),P?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function E(H){if(Ze(H)!==N)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ue(H){if(H.relatedTarget)return;let _=Ze(H),G=nt(ve(P));if(_===N||!fe(P,_)||!Br(G))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return Zt(Ae(N,"keydown",K),Ae(N,"blur",E,!0),Ae(N,"focus",ue,!0),Ae(z,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,d]);function b(P){l.current=!0;let N=P.relatedTarget===c.state.viewport?f.find((z)=>z.transitionStatus!=="ending"&&!z.limited):void 0;if(N)N.ref?.current?.focus();else c.restoreFocusToPrevElement()}function y(P){if(P.key==="Tab"&&P.shiftKey&&Ze(P.nativeEvent)===c.state.viewport)P.preventDefault(),c.restoreFocusToPrevElement()}function x(){if(c.state.toasts.some((N)=>N.transitionStatus==="ending")||p.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}No.useEffect(x,[S,c]);function R(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function T(){m.current=!0,x()}function L(P){if(P.pointerType==="touch")p.current=!0}function W(P){if(P.pointerType!=="touch")return;p.current=!1,x()}function M(){if(l.current){l.current=!1;return}if(w)return;if(Br(nt(ve(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function F(P){if(!w||fe(c.state.viewport,P.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let A={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:R,onMouseMove:R,onMouseLeave:T,onFocus:M,onBlur:F,onKeyDown:y,onClick:M,onPointerDown:L,onPointerUp:W,onPointerCancel:W,style:{[Dh]:C?`${C}px`:void 0}},v={expanded:h},O=!d&&g&&Uc(Zo,{onFocus:b}),X=De("div",t,{ref:[o,c.setViewport],state:v,props:[A,i,{children:ym(No.Fragment,{children:[O,s,O]})}]});return ym(No.Fragment,{children:[O,X,!w&&I.length>0&&Uc("div",{style:mi,children:I.map((P)=>ym("div",{role:"alert","aria-atomic":!0,children:[Uc("div",{children:P.title}),Uc("div",{children:P.description})]},P.id))})]})});import*as tt from"react";import*as zh from"react-dom";import*as Wc from"react";var Rm=Wc.createContext(void 0);function qr(){let e=Wc.useContext(Rm);if(!e)throw Error(Je(66));return e}import*as vm from"react";function Oh(e,t){let o=(t??ze(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function _c(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var Nh="--toast-index",Bh="--toast-offset-y",Hh="--toast-height",Vh="--toast-swipe-movement-x",Uh="--toast-swipe-movement-y";var Wh="data-swipe-direction",HQe=sn,VQe=pa;import{jsx as NS}from"react/jsx-runtime";var BS={...Dn,swipeDirection(e){return e?{[Wh]:e}:null}},_h=40,HS=10,Gh=0.5,VS=1,US=`${Up},${Wp}`,Zh=tt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,p=Zr(),[d,f]=tt.useState(void 0),[w,h]=tt.useState(!1),[g,C]=tt.useState(!1),[S,I]=tt.useState({x:0,y:0}),[b,y]=tt.useState({x:0,y:0,scale:1}),[x,R]=tt.useState(),[T,L]=tt.useState(),[W,M]=tt.useState(null),F=tt.useRef(null),A=tt.useRef(void 0),v=tt.useRef({x:0,y:0}),O=tt.useRef({x:0,y:0,scale:1}),X=tt.useRef(void 0),P=tt.useRef(0),N=tt.useRef(!1),z=tt.useRef({x:0,y:0}),K=tt.useRef(!1),E=tt.useRef({x:0,y:0}),ue=tt.useRef(null),H=tt.useRef(null),_=p.useState("toastIndex",r.id),G=p.useState("toastVisibleIndex",r.id),le=p.useState("toastOffsetY",r.id),Te=p.useState("focused"),te=p.useState("expanded");Or({open:r.transitionStatus!=="ending",ref:F,onComplete(){if(r.transitionStatus==="ending")p.removeToast(r.id)}});let se=ae((ce=!1)=>{let Ce=F.current;if(!Ce)return;let k=Ce.style.height;Ce.style.height="auto";let U=Ce.offsetHeight;Ce.style.height=k;function Ie(){p.updateToastInternal(r.id,{ref:F,height:U,transitionStatus:void 0})}if(ce)zh.flushSync(Ie);else Ie()});j(()=>{let ce=A.current;if(r.transitionStatus!=="starting"&&ce===r.id)return;if(ce!==void 0)f(void 0),y({x:0,y:0,scale:1}),pe({x:0,y:0});A.current=r.id,se()},[se,r.id,r.transitionStatus]);function pe(ce){E.current=ce,I(ce)}j(()=>()=>{H.current?.abort()},[]);function we(ce,Ce){let k=(Y)=>Y>0?Y**Gh:-(Math.abs(Y)**Gh),U=ce>0&&!l.includes("right")||ce<0&&!l.includes("left"),Ie=Ce>0&&!l.includes("down")||Ce<0&&!l.includes("up");return{x:U?k(ce):ce,y:Ie?k(Ce):Ce}}let q=ae((ce)=>{if(ce.pointerId!==ue.current)return;ue.current=null,H.current?.abort(),H.current=null,h(!1),C(!1),M(null);let Ce=O.current;if(ce.type==="pointercancel"||N.current){pe({x:Ce.x,y:Ce.y}),f(void 0);return}let k=E.current,U=k.x-Ce.x,Ie=k.y-Ce.y,Y;for(let ne of l)if(_c(ne,U,Ie)>_h){Y=ne;break}if(Y)f(Y),p.closeToast(r.id);else pe({x:Ce.x,y:Ce.y}),f(void 0)});function B(ce){if(ce.button!==0)return;if(ce.pointerType==="touch")p.pauseTimers();let Ce=Ze(ce.nativeEvent);if(Ir(Ce,`button,a,input,textarea,[role="button"],${US}`))return;N.current=!1,X.current=void 0,P.current=0,ue.current=ce.pointerId,v.current={x:ce.clientX,y:ce.clientY},z.current=v.current;let U=ce.currentTarget,Ie=Oh(U);O.current=Ie,y(Ie),pe({x:Ie.x,y:Ie.y}),p.set("hovering",!0),h(!0),C(!1),M(null),K.current=!0,H.current?.abort();let Y=new AbortController;H.current=Y;let ne=ve(U);ne.addEventListener("pointerup",q,{signal:Y.signal}),ne.addEventListener("pointercancel",q,{signal:Y.signal}),U.setPointerCapture?.(ce.pointerId)}function Q(ce){if(ce.pointerId!==ue.current)return;if(ce.preventDefault(),K.current)v.current={x:ce.clientX,y:ce.clientY},K.current=!1;let{clientY:Ce,clientX:k,movementX:U,movementY:Ie}=ce;if(Ie<0&&Ce>z.current.y||Ie>0&&Ce<z.current.y)z.current={x:z.current.x,y:Ce};if(U<0&&k>z.current.x||U>0&&k<z.current.x)z.current={x:k,y:z.current.y};let Y=k-v.current.x,ne=Ce-v.current.y,de=Ce-z.current.y,ge=k-z.current.x,he=W;if(!g){if(Math.sqrt(Y*Y+ne*ne)>=VS){C(!0);let _t=l.includes("left")||l.includes("right"),po=l.includes("up")||l.includes("down");if(_t&&po){let Io=Math.abs(Y),Jt=Math.abs(ne);he=Io>Jt?"horizontal":"vertical",M(he)}}}let ke;if(!X.current){if(he==="vertical"){if(ne>0)ke="down";else if(ne<0)ke="up"}else if(he==="horizontal"){if(Y>0)ke="right";else if(Y<0)ke="left"}else if(Math.abs(Y)>=Math.abs(ne))ke=Y>0?"right":"left";else ke=ne>0?"down":"up";if(ke&&l.includes(ke))X.current=ke,P.current=_c(ke,Y,ne),f(ke)}else{let qt=X.current,_t=_c(qt,ge,de);if(_t>_h)N.current=!1,f(qt);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&P.current-_t>=HS)N.current=!0}let Xe=we(Y,ne),ct=O.current.x,so=O.current.y,io=l.includes("left")||l.includes("right"),Bo=l.includes("up")||l.includes("down");if(he!=="vertical"&&io)ct+=Xe.x;if(he!=="horizontal"&&Bo)so+=Xe.y;pe({x:ct,y:so})}function ie(ce){if(ce.key==="Escape"){if(!F.current||!fe(F.current,nt(ve(F.current))))return;p.closeToast(r.id)}}tt.useEffect(()=>{let ce=F.current;if(!m||!ce)return;function Ce(k){if(ue.current===null||!fe(ce,Ze(k)))return;k.preventDefault()}return Ae(ce,"touchmove",Ce,{passive:!1})},[m]);function xe(){let ce=S.x-b.x,Ce=S.y-b.y;return{transition:w?"none":void 0,transform:w?`translateX(${S.x}px) translateY(${S.y}px) scale(${b.scale})`:void 0,[Vh]:`${ce}px`,[Uh]:`${Ce}px`}}let ye=r.priority==="high",re={role:ye?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":x,"aria-describedby":T,"aria-hidden":ye&&!Te?!0:void 0,onPointerDown:m?B:void 0,onPointerMove:m?Q:void 0,onPointerUp:m?q:void 0,onPointerCancel:m?q:void 0,onKeyDown:ie,inert:Gn(r.limited),style:{...xe(),[Nh]:r.transitionStatus==="ending"?_:G,[Bh]:`${le}px`,[Hh]:r.height?`${r.height}px`:void 0}},V=tt.useMemo(()=>({toast:r,setTitleId:R,setDescriptionId:L,recalculateHeight:se,visibleIndex:G,expanded:te}),[r,R,L,se,G,te]),J={transitionStatus:r.transitionStatus,expanded:te,limited:r.limited||!1,type:r.type,swiping:w,swipeDirection:d},Ee=De("div",t,{ref:[o,F],state:J,stateAttributesMapping:BS,props:[re,c]});return NS(Rm.Provider,{value:V,children:Ee})});import*as Gc from"react";var qh=Gc.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=qr(),l=Gc.useRef(null);j(()=>{u();let d=l.current;if(!d||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let f=new ResizeObserver(()=>u(!0)),w=new MutationObserver(()=>u(!0));return f.observe(d),w.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>{f.disconnect(),w.disconnect()}},[u]);let m=i>0;return De("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as $h from"react";import*as jh from"react";function Xh(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(Xh);return!0}function zc(e){return jh.isValidElement(e)&&Xh(e.props.children)}function Zc(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=qr(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:nr(e),children:i,type:r.type,setId:s}}function qc(e,t,o){let r=zc(e);return j(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var Yh=$h.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=Zc(s,i,"description"),f=De("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return qc(f,u,p)});import*as Kh from"react";var Jh=Kh.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=Zc(s,i,"title"),f=De("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return qc(f,u,p)});import*as jc from"react";var Qh=jc.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=Zr(),{toast:l,expanded:m}=qr(),[p,d]=jc.useState(!1),{getButtonProps:f,buttonRef:w}=lo({disabled:s,native:i}),h={type:l.type};return De("button",t,{ref:[o,w],state:h,props:[{"aria-hidden":!m&&!p,onClick(){u.closeToast(l.id)},onFocus(){d(!0)},onBlur(){d(!1)}},c,f]})});import*as e1 from"react";var t1=e1.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=qr(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:p}=lo({disabled:s,native:i}),d={type:u.type},f=De("button",t,{ref:[o,p],state:d,props:[c,u.actionProps,m,{children:l}]});return zc(f)?f:null});import*as n1 from"react";import*as Xc from"react";import*as o1 from"react-dom";import{jsxs as WS}from"react/jsx-runtime";var r1=Xc.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=Ti({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return WS(Xc.Fragment,{children:[l,u&&o1.createPortal(r,u)]})});import{jsx as _S}from"react/jsx-runtime";var a1=n1.forwardRef(function(t,o){return _S(r1,{ref:o,...t})});import*as s1 from"react";function Tm(){let e=Zr(),t=e.useState("toasts");return s1.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Em(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||Hc("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as $c from"react";import*as kt from"react";var c1=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Pm=$c.forwardRef((e,t)=>$c.createElement(Ne,{ref:t,...e,weights:c1}));Pm.displayName="CheckCircleIcon";import*as Yc from"react";import*as Lt from"react";var l1=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var Am=Yc.forwardRef((e,t)=>Yc.createElement(Ne,{ref:t,...e,weights:l1}));Am.displayName="CircleNotchIcon";import*as Kc from"react";import*as Dt from"react";var u1=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Dt.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Mm=Kc.forwardRef((e,t)=>Kc.createElement(Ne,{ref:t,...e,weights:u1}));Mm.displayName="InfoIcon";import*as Jc from"react";import*as Ft from"react";var m1=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var km=Jc.forwardRef((e,t)=>Jc.createElement(Ne,{ref:t,...e,weights:m1}));km.displayName="WarningIcon";import*as Qc from"react";import*as Ot from"react";var f1=new Map([["bold",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var Lm=Qc.forwardRef((e,t)=>Qc.createElement(Ne,{ref:t,...e,weights:f1}));Lm.displayName="XCircleIcon";import{jsx as at,jsxs as Dm}from"react/jsx-runtime";var GS=Em();function zS({...e}){return at(Lh,{...e})}function ZS({...e}){return at(a1,{"data-slot":"toast-portal",...e})}function qS({className:e,...t}){return at(Fh,{"data-slot":"toast-viewport",className:me("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function jS({className:e,...t}){return at(Zh,{"data-slot":"toast",className:me("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function XS({className:e,...t}){return at(qh,{"data-slot":"toast-content",className:me("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function $S({className:e,...t}){return at(Jh,{"data-slot":"toast-title",className:me("text-sm font-medium",e),...t})}function YS({className:e,...t}){return at(Yh,{"data-slot":"toast-description",className:me("text-sm text-muted-foreground",e),...t})}function KS({className:e,render:t=at(mt,{variant:"outline",size:"sm"}),...o}){return at(t1,{"data-slot":"toast-action",render:t,className:me("shrink-0",e),...o})}function JS({className:e,children:t,render:o=at(mt,{variant:"ghost",size:"icon-sm"}),...r}){return at(Qh,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:me("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??at(Po,{"aria-hidden":"true"})})}function QS({type:e}){let t=null;if(e==="success")t=at(Pm,{"aria-hidden":"true"});if(e==="info")t=at(Mm,{"aria-hidden":"true"});if(e==="warning")t=at(km,{"aria-hidden":"true"});if(e==="error")t=at(Lm,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=at(Am,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return at("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function ew(){let{toasts:e}=Tm();return e.map((t)=>at(jS,{toast:t,children:Dm(XS,{children:[at(QS,{type:t.type}),Dm("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[at($S,{}),at(YS,{})]}),at(KS,{}),at(JS,{})]})},t.id))}function el({children:e,toastManager:t=GS,container:o,...r}){return Dm(zS,{toastManager:t,...r,children:[e,at(ZS,{container:o,children:at(qS,{children:at(ew,{})})})]})}var p1=Em,Vtt=Tm;import{jsx as Ko,jsxs as lw}from"react/jsx-runtime";var sw="https://coristen-three.vercel.app",Yn=p1(),iw=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],cw={name:"Coristen",logoUrl:null,agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleColor:"#171717",showPoweredBy:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class d1 extends tw{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function jtt({identity:e,apiKey:t,apiUrl:o=sw,defaultOpen:r=!1,defaultEmail:n="",welcome:a,fontSize:s,appearance:i,onReady:c,onError:u}){let l=o.replace(/\/$/,""),[m,p]=lr(),[d,f]=lr(""),[w,h]=lr(""),[g,C]=lr(),[S,I]=lr(r),[b,y]=lr(!1),[x,R]=lr(0),[T,L]=lr({}),[W,M]=lr(!1),[F,A]=lr(),v=ns(null),O=ns(void 0),X=ns(!1),P=ns(c),N=ns(u);P.current=c,N.current=u,jr(()=>{let q=document.querySelector('meta[name="viewport"]'),B=!q;if(!q)q=document.createElement("meta"),q.name="viewport",document.head.append(q);let Q=q.content;return q.content=(Q?Q.split(","):["width=device-width","initial-scale=1"]).map((ie)=>ie.trim()).filter((ie)=>!/^maximum-scale\s*=/i.test(ie)).concat("maximum-scale=1").filter(Boolean).join(", "),()=>{if(B)q.remove();else q.content=Q}},[]);let z=ow(async(q)=>{let B=t,Q;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let ye=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!ye.ok){let V=Error("Authentication required");throw V.status=ye.status,V}let re=await ye.json();if(B=re.publishableKey,Q=re.identityToken,!Q)throw Error("Invalid Coristen identity response")}if(!B?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let ie=await fetch(`${l}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:B,identityToken:Q,previousToken:q})});if(!ie.ok){let ye=Error(await ie.text());throw ye.status=ie.status,ye}let xe=await ie.json();if(e&&!xe.identity)throw Error("Verified identity required");return xe},[t,l,e]);jr(()=>{let q=!0,B,Q="",ie=async()=>{try{let xe=await z(Q||void 0);if(!q)return;Q=xe.token,p(xe),f(""),P.current?.(),B=window.setTimeout(ie,Math.max(5000,xe.expiresAt-Date.now()-30000))}catch(xe){if(!q)return;let ye=xe instanceof Error?xe:Error("Widget failed to load");f(Ah(ye)),p((V)=>V&&V.expiresAt>Date.now()?V:void 0),N.current?.(ye),console.error("[Coristen widget] Failed to initialize",ye);let re=ye.status;if(!re||re===429||re>=500)B=window.setTimeout(ie,5000)}};return ie(),()=>{if(q=!1,B)window.clearTimeout(B);if(Q)fetch(`${l}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:Q}),keepalive:!0})}},[l,z,x]),jr(()=>{let q=d||w;if(!q)return;let B=Yn.add({title:"Support chat couldn't load",description:q,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Yn.close(B),f(""),h(""),R((Q)=>Q+1)}}});return()=>Yn.close(B)},[d,w]),jr(()=>{let q=()=>R((ie)=>ie+1),B=()=>I(!0),Q=()=>I(!1);return window.addEventListener("coristen:reset",q),window.addEventListener("coristen:open",B),window.addEventListener("coristen:close",Q),()=>{window.removeEventListener("coristen:reset",q),window.removeEventListener("coristen:open",B),window.removeEventListener("coristen:close",Q)}},[]),jr(()=>{if(m)C(m.settings)},[m]),jr(()=>{if(!S)return;let q=(B)=>{if(!v.current?.contains(B.target))I(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[S]),jr(()=>{if(!F)return;let q=()=>A((B)=>{if(!B)return B;let Q=window.innerWidth<640?12:20;return{left:Math.min(Math.max(B.left,Q),window.innerWidth-56-Q),top:Math.min(Math.max(B.top,Q),window.innerHeight-56-Q)}});return window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[F]),jr(()=>{let q=()=>{let ie=getComputedStyle(document.documentElement),xe=v.current?.parentElement??document.body,ye=getComputedStyle(xe);M(document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||ie.colorScheme==="dark"),L({...Object.fromEntries(iw.flatMap((re)=>{let V=ie.getPropertyValue(re).trim();return V?[[re,V]]:[]})),"--coristen-host-font-family":ye.fontFamily,"--coristen-host-font-size":ye.fontSize})};q();let B=new MutationObserver(q);B.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]});let Q=v.current?.parentElement??document.body;if(Q!==document.documentElement)B.observe(Q,{attributes:!0,attributeFilter:["class","style"]});return()=>B.disconnect()},[]);let K=rw(()=>m?new aw(m.convexUrl):void 0,[m?.convexUrl]),E={...g??m?.settings??cw,...i,theme:i?.theme??(W?"dark":"light")};if(E.enabled===!1)return null;let ue=E.position==="left"?"left":"right",H=F&&typeof window<"u"?F.left+28<window.innerWidth/2?"left":"right":ue,_=F&&typeof window<"u"?F.top+28<window.innerHeight/2?"top":"bottom":"bottom",G={none:0,sm:6,md:10,lg:16}[E.radius],Te={...F?{left:`${F.left}px`,top:`${F.top}px`,right:"auto",bottom:"auto"}:ue==="left"?{left:"20px"}:{right:"20px"},...T,"--coristen-radius":`${G}px`,"--coristen-bubble-color":E.bubbleColor,"--radius-small":`${Math.max(0,G-10)}px`,"--radius-medium":`${Math.max(0,G-8)}px`,"--radius-control":`${Math.max(0,G-8)}px`,"--radius-card":`${Math.max(0,G-4)}px`,"--radius-panel":`${G}px`,"--radius-dialog":`${G}px`,"--radius-display":`${G}px`,...s?{"--coristen-font-size":s}:{}},te=F&&typeof window<"u"?(()=>{let q=window.innerWidth<640?0:20,B=Math.min(b?580:420,window.innerWidth-q*2),Q=Math.min(600,window.innerHeight-q*2);return{position:"fixed",right:"auto",bottom:"auto",left:Math.min(Math.max(H==="left"?F.left:F.left+56-B,q),window.innerWidth-B-q),top:Math.min(Math.max(_==="top"?F.top:F.top+56-Q,q),window.innerHeight-Q-q)}})():void 0,se=(q)=>{if(S||q.button!==0)return;let B=q.currentTarget.getBoundingClientRect();O.current={pointerId:q.pointerId,startX:q.clientX,startY:q.clientY,left:B.left,top:B.top,moved:!1},q.currentTarget.setPointerCapture(q.pointerId)},pe=(q)=>{let B=O.current;if(!B||B.pointerId!==q.pointerId)return;if(!B.moved&&Math.hypot(q.clientX-B.startX,q.clientY-B.startY)<=4)return;B.moved=!0;let Q=window.innerWidth<640?12:20;A({left:Math.min(Math.max(B.left+q.clientX-B.startX,Q),window.innerWidth-56-Q),top:Math.min(Math.max(B.top+q.clientY-B.startY,Q),window.innerHeight-56-Q)})},we=(q)=>{let B=O.current;if(!B||B.pointerId!==q.pointerId)return;if(B.moved){X.current=!0;let Q=window.innerWidth<640?12:20;A((ie)=>ie?{left:ie.left+28<window.innerWidth/2?Q:window.innerWidth-56-Q,top:ie.top}:ie)}O.current=void 0};if(d&&(!m||!K))return Ko("div",{ref:v,"data-coristen-widget":"",className:E.theme==="dark"?"dark":void 0,style:Te,children:Ko(el,{toastManager:Yn,container:v})});if(!m||!K)return Ko("div",{ref:v,"data-coristen-widget":"",className:E.theme==="dark"?"dark":void 0,style:Te,children:Ko(el,{toastManager:Yn,container:v})});return lw("div",{ref:v,"data-coristen-widget":"","data-open":S||void 0,"data-expanded":b||void 0,"data-position":H,"data-vertical":_,className:E.theme==="dark"?"dark":void 0,style:Te,children:[Ko(el,{toastManager:Yn,container:v}),m&&K&&Ko("div",{className:"coristen-panel",role:"dialog","aria-label":`${E.name} chat`,"aria-hidden":!S,inert:!S,style:te,children:Ko(d1,{onError:(q)=>{h("Chat ran into a problem. Please try again."),N.current?.(q)},children:Ko(nw,{client:K,children:Ko(Ph,{workspaceId:m.workspaceId,initialSettings:E,sessionToken:m.token,expanded:b,onExpandedChange:y,onClose:()=>I(!1),onSettingsChange:C,theme:E.theme,assetBaseUrl:l,defaultEmail:n,welcome:a})})},x)}),Ko("button",{type:"button",className:"coristen-launcher","aria-label":S?"Close chat":"Open chat","aria-expanded":S,"aria-busy":!m,onPointerDown:se,onPointerMove:pe,onPointerUp:we,onPointerCancel:we,onClick:()=>{if(X.current){X.current=!1;return}I((q)=>!q)},children:Ko("img",{src:`${l}/widget-icons/${E.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})})]})}var Xtt={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{jtt as CoristenWidget,Xtt as coristenWidget};
|