@coristen/widget 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var W0=Object.create;var{getPrototypeOf:G0,defineProperty:Bc,getOwnPropertyNames:_0}=Object;var ju=Object.prototype.hasOwnProperty;function z0(e){return this[e]}var Z0,q0,$u=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?Z0??=new WeakMap:q0??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?W0(G0(e)):{};let s=t||!e||!e.__esModule||!ju.call(e,"default")?Bc(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of _0(e))if(!ju.call(s,i))Bc(s,i,{get:z0.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var j0=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $0=(e)=>e;function X0(e,t){this[e]=$0.bind(null,t)}var Ya=(e,t)=>{for(var o in t)Bc(e,o,{get:t[o],enumerable:!0,configurable:!0,set:X0.bind(t,o)})};import*as No from"react";var Ui=j0(function(l2){function e2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var t2=typeof Object.is==="function"?Object.is:e2,o2=No.useState,r2=No.useEffect,n2=No.useLayoutEffect,a2=No.useDebugValue;function s2(e,t){var o=t(),r=o2({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return n2(function(){n.value=o,n.getSnapshot=t,iu(n)&&a({inst:n})},[e,o,t]),r2(function(){return iu(n)&&a({inst:n}),e(function(){iu(n)&&a({inst:n})})},[e]),a2(o),o}function iu(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!t2(e,o)}catch(r){return!0}}function i2(e,t){return t()}var c2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i2:s2;l2.useSyncExternalStore=No.useSyncExternalStore!==void 0?No.useSyncExternalStore:c2});var tr={};Ya(tr,{android:()=>af,apple:()=>al,ios:()=>nl,linux:()=>CI,mac:()=>sf,windows:()=>bI});var or={};Ya(or,{blink:()=>wI,gecko:()=>SI,webkit:()=>sl});var il={};Ya(il,{voiceOver:()=>xI});var na={};Ya(na,{jsdom:()=>yI});import{Component as eC,useCallback as tC,useEffect as Nn,useMemo as oC,useRef as Wa,useState as ur}from"react";import{ConvexProvider as rC,ConvexReactClient as nC}from"convex/react";import{useEffect as Ua,useRef as Jb,useState as Mr}from"react";import{useMutation as On,useQuery as wc}from"convex/react";import{jsx as ah}from"react/jsx-runtime";var Mo=34,Br=200,K0=6,Y0=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function J0(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 Ku(e,t){let o=[];for(let r=0;r<t;r++)o.push(J0(e+":"+r));return o}function Xu(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 Q0(e){let[t]=Ku(e,1),o=t%360;return{fill:Xu(o,85,30),stroke:Xu(o,90,65)}}function eh(e){let[t,o]=Ku(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<Mo;c++){let l=[];for(let u=0;u<Mo;u++){let m=u/(Mo-1)*2-1,f=c/(Mo-1)*2-1,p=(m*a+f*s+1+n)/2;l.push(Math.max(0,Math.min(1,p)))}i.push(l)}return i}function th(e){let t=[];for(let o=0;o<Mo;o++){let r=[];for(let n=0;n<Mo;n++){let a=Y0[o%4][n%4]/16;r.push(e[o][n]>=a?1:0)}t.push(r)}return t}function oh(e){let t=[];for(let o=0;o<Mo;o++){let r=e[o],n=[],a=0;while(a<Mo)if(r[a]===1){let c=a;while(a<Mo&&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 l=n[c].start-i;s+=`m${l} 0h${n[c].len}`,i=n[c].start+n[c].len}t.push(s)}return t.join("")}function rh(e){let{fill:t,stroke:o}=Q0(e),r=eh(e),n=th(r),a=oh(n),i=Br/Mo*(K0/6),c=Mo/2,l=`translate(${Br/2},${Br/2})scale(${i})translate(-${c},-${c})`;return[`<svg width="${Br}" height="${Br}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,`<rect width="${Br}" height="${Br}" fill="${t}"/>`,`<path fill="none" stroke="${o}" transform="${l}" d="${a}"/>`,"</svg>"].join("")}function nh(e){let t=rh(e);return`data:image/svg+xml,${encodeURIComponent(t)}`}function ln({seed:e,size:t=40,className:o,style:r}){let n=nh(e);return ah("img",{src:n,alt:"",width:t,height:t,className:o,style:{borderRadius:"50%",...r}})}import*as Ja from"react";import*as Hr from"react";import{createContext as sh}from"react";var Yu=sh({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var We=Hr.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...l}=e,{color:u="currentColor",size:m,weight:f="regular",mirrored:h=!1,...p}=Hr.useContext(Yu);return Hr.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:u,viewBox:"0 0 256 256",transform:s||h?"scale(-1, 1)":void 0,...p,...l},!!o&&Hr.createElement("title",null,o),i,c.get(a!=null?a:f))});We.displayName="IconBase";import*as ct from"react";var Ju=new Map([["bold",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),ct.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",ct.createElement(ct.Fragment,null,ct.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]);var Qa=Ja.forwardRef((e,t)=>Ja.createElement(We,{ref:t,...e,weights:Ju}));Qa.displayName="ArrowLeftIcon";import*as es from"react";import*as lt from"react";var Qu=new Map([["bold",lt.createElement(lt.Fragment,null,lt.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",lt.createElement(lt.Fragment,null,lt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),lt.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",lt.createElement(lt.Fragment,null,lt.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",lt.createElement(lt.Fragment,null,lt.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",lt.createElement(lt.Fragment,null,lt.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",lt.createElement(lt.Fragment,null,lt.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 ts=es.forwardRef((e,t)=>es.createElement(We,{ref:t,...e,weights:Qu}));ts.displayName="ArrowUpIcon";import*as os from"react";import*as ut from"react";var em=new Map([["bold",ut.createElement(ut.Fragment,null,ut.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",ut.createElement(ut.Fragment,null,ut.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"}),ut.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",ut.createElement(ut.Fragment,null,ut.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",ut.createElement(ut.Fragment,null,ut.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",ut.createElement(ut.Fragment,null,ut.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",ut.createElement(ut.Fragment,null,ut.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 rs=os.forwardRef((e,t)=>os.createElement(We,{ref:t,...e,weights:em}));rs.displayName="ArrowsInSimpleIcon";import*as ns from"react";import*as mt from"react";var tm=new Map([["bold",mt.createElement(mt.Fragment,null,mt.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",mt.createElement(mt.Fragment,null,mt.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"}),mt.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",mt.createElement(mt.Fragment,null,mt.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",mt.createElement(mt.Fragment,null,mt.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",mt.createElement(mt.Fragment,null,mt.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",mt.createElement(mt.Fragment,null,mt.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 as=ns.forwardRef((e,t)=>ns.createElement(We,{ref:t,...e,weights:tm}));as.displayName="ArrowsOutSimpleIcon";import*as ss from"react";import*as ft from"react";var om=new Map([["bold",ft.createElement(ft.Fragment,null,ft.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",ft.createElement(ft.Fragment,null,ft.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"}),ft.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",ft.createElement(ft.Fragment,null,ft.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",ft.createElement(ft.Fragment,null,ft.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",ft.createElement(ft.Fragment,null,ft.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",ft.createElement(ft.Fragment,null,ft.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 is=ss.forwardRef((e,t)=>ss.createElement(We,{ref:t,...e,weights:om}));is.displayName="BinocularsIcon";import*as cs from"react";import*as pt from"react";var rm=new Map([["bold",pt.createElement(pt.Fragment,null,pt.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",pt.createElement(pt.Fragment,null,pt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),pt.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",pt.createElement(pt.Fragment,null,pt.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",pt.createElement(pt.Fragment,null,pt.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",pt.createElement(pt.Fragment,null,pt.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",pt.createElement(pt.Fragment,null,pt.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 ls=cs.forwardRef((e,t)=>cs.createElement(We,{ref:t,...e,weights:rm}));ls.displayName="CaretRightIcon";import*as us from"react";import*as dt from"react";var nm=new Map([["bold",dt.createElement(dt.Fragment,null,dt.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",dt.createElement(dt.Fragment,null,dt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),dt.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",dt.createElement(dt.Fragment,null,dt.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",dt.createElement(dt.Fragment,null,dt.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",dt.createElement(dt.Fragment,null,dt.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",dt.createElement(dt.Fragment,null,dt.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 ms=us.forwardRef((e,t)=>us.createElement(We,{ref:t,...e,weights:nm}));ms.displayName="ClockCounterClockwiseIcon";import*as fs from"react";import*as gt from"react";var am=new Map([["bold",gt.createElement(gt.Fragment,null,gt.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",gt.createElement(gt.Fragment,null,gt.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),gt.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",gt.createElement(gt.Fragment,null,gt.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",gt.createElement(gt.Fragment,null,gt.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",gt.createElement(gt.Fragment,null,gt.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",gt.createElement(gt.Fragment,null,gt.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 Vr=fs.forwardRef((e,t)=>fs.createElement(We,{ref:t,...e,weights:am}));Vr.displayName="FileTextIcon";import*as ps from"react";import*as ht from"react";var sm=new Map([["bold",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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 ds=ps.forwardRef((e,t)=>ps.createElement(We,{ref:t,...e,weights:sm}));ds.displayName="GlobeIcon";import*as gs from"react";import*as It from"react";var im=new Map([["bold",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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"}),It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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 hs=gs.forwardRef((e,t)=>gs.createElement(We,{ref:t,...e,weights:im}));hs.displayName="ImageIcon";import*as Is from"react";import*as bt from"react";var cm=new Map([["bold",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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"}),bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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 bs=Is.forwardRef((e,t)=>Is.createElement(We,{ref:t,...e,weights:cm}));bs.displayName="PaperclipIcon";import*as Cs from"react";import*as Ct from"react";var lm=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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"}),Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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 un=Cs.forwardRef((e,t)=>Cs.createElement(We,{ref:t,...e,weights:lm}));un.displayName="PlusIcon";import*as Ss from"react";import*as St from"react";var um=new Map([["bold",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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"}),St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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 Go=Ss.forwardRef((e,t)=>Ss.createElement(We,{ref:t,...e,weights:um}));Go.displayName="XIcon";import{makeFunctionReference as _o}from"convex/server";var ko={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 $2,useRef as X2,useState as kn}from"react";function Wn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var mm={};function kt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return ws(t);let a=ws(e);if(t)a=Gn(a,t);if(o)a=Gn(a,o);if(r)a=Gn(a,r);if(n)a=Gn(a,n);return a}function fm(e){if(e.length===0)return mm;if(e.length===1)return ws(e[0]);let t=ws(e[0]);for(let o=1;o<e.length;o+=1)t=Gn(t,e[o]);return t}function ws(e){if(dm(e))return{...e(mm)};return ih(e)}function Gn(e,t){if(dm(t))return t(e);return ch(e,t)}function ih(e){let t={...e};for(let o in t){let r=t[o];if(pm(o,r))t[o]=gm(r)}return t}function ch(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=Wn(e.style,r);break}case"className":{e[o]=Hc(e.className,r);break}default:if(pm(o,r))e[o]=lh(e[o],r);else e[o]=r}}return e}function pm(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 dm(e){return typeof e==="function"}function lh(e,t){if(!t)return e;if(!e)return gm(t);return(...o)=>{let r=o[0];if(hm(r)){let a=r;_n(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function gm(e){if(!e)return e;return(...t)=>{let o=t[0];if(hm(o))_n(o);return e(...t)}}function _n(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Hc(e,t){if(t){if(e)return t+" "+e;return t}return e}function hm(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as hr from"react";import*as bm from"react";var Im={};function Ze(e,t){let o=bm.useRef(Im);if(o.current===Im)o.current=e(t);return o}function So(e,t,o,r){let n=Ze(Sm).current;if(uh(n,e,t,o,r))wm(n,[e,t,o,r]);return n.callback}function Cm(e){let t=Ze(Sm).current;if(mh(t,e))wm(t,e);return t.callback}function Sm(){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 mh(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function wm(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 ym from"react";import*as xm from"react";var fh=parseInt(xm.version,10);function mn(e){return fh>=e}function Vc(e){if(!ym.isValidElement(e))return null;let t=e,o=t.props;return(mn(19)?o?.ref:t.ref)??null}function qe(){}var er=Object.freeze([]),Fe=Object.freeze({});function vm(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 Rm(e,t){return typeof e==="function"?e(t):e}function Am(e,t){return typeof e==="function"?e(t):e}import{createElement as Pm}from"react";function _e(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=zn(r);let n=ph(t,o,r);if(o.enabled===!1)return null;let a=o.state??Fe;return hh(e,r,n,a)}function ph(e,t,o){let{className:r,style:n}=e,{state:a=Fe,ref:s,props:i,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Rm(r,a):void 0,m=l?Am(n,a):void 0,f=l?vm(a,c):Fe,h=l&&i?dh(i):void 0,p=l?Wn(f,h)??{}:Fe;if(typeof document<"u")if(!l)So(null,null);else if(Array.isArray(s))p.ref=Cm([p.ref,Vc(o),...s]);else p.ref=So(p.ref,Vc(o),s);if(!l)return Fe;if(u!==void 0)p.className=Hc(p.className,u);if(m!==void 0)p.style=Wn(p.style,m);return p}function dh(e){if(Array.isArray(e))return fm(e);return kt(void 0,e)}var gh=Symbol.for("react.lazy");function zn(e){if(e?.$$typeof!==gh)return e;let t=hr.Children.toArray(e)[0];return hr.isValidElement(t)?t:e}function hh(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=kt(o,t.props);return n.ref=o.ref,hr.cloneElement(t,n)}return Ih(e,o)}function Ih(e,t){if(e==="button")return Pm("button",{type:"button",...t,key:t.key});if(e==="img")return Pm("img",{alt:"",...t,key:t.key});return hr.createElement(e,t)}function fn(e){return _e(e.defaultTagName??"div",e,e)}function Em(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=Em(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Tm(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=Em(e))&&(r&&(r+=" "),r+=t);return r}var Mm=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,km=Tm,Bt=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return km(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((l)=>{let u=o===null||o===void 0?void 0:o[l],m=a===null||a===void 0?void 0:a[l];if(u===null)return null;let f=Mm(u)||Mm(m);return n[l][f]}),i=o&&Object.entries(o).reduce((l,u)=>{let[m,f]=u;if(f===void 0)return l;return l[m]=f,l},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:m,className:f,...h}=u;return Object.entries(h).every((p)=>{let[w,I]=p;return Array.isArray(I)?I.includes({...a,...i}[w]):{...a,...i}[w]===I})?[...l,m,f]:l},[]);return km(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var zo=(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},xs=(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},Ir=(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 bh=[],Ur=xs(zo("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),Ch=xs(zo(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var Sh=(()=>{let e=Ur.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=Ur[n];i<Ur[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(Ur[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=Ur[n];s<Ur[n+1];s++)o[r++]=a,a+=t[a]}return o})(),wh=zo("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),xh=xs(zo("123333359346463635126536711576")),yh=zo("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),vh=zo("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),Rh=Ir("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),Ah=(()=>{let e=new Int32Array(319).fill(-1),t=Ir("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Ir("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),Ph="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}),Lm=Ir("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),Eh=Ir("ɠ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"),Th=Ir("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),Dm=new Int32Array(995),Fm=new Int32Array(995),Om=new Int32Array(995),Uc="",Wc=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<Lm.length;r++)for(let n of Ph[Th[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),Wc[a*2]=Uc.length,Wc[a*2+1]=n.length,Uc+=n;Dm[o]=Lm[r],Fm[o]=Eh[r],Om[o]=a,o++}}var Mh=Ir("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),kh=xs(zo("1::24444432:442:44:44>222222:44:4421322511111311111114")),Lh=Ir("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"),Dh=zo("ij"),Fh=zo(""),Oh=zo("1"),Nh="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Nm={GROUP_COUNT:384,customValidatorNames:bh,edgeStart:Ur,labelStart:Ch,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:Sh,nodeGroup:wh,nodeVlist:Ah,vlistPat:xh,vlistOps:yh,vlistRef:vh,vlistGroup:Rh,litAnchor:Dm,litGroup:Fm,litPool:Om,poolOffsets:Wc,poolText:Uc,adjGid:Mh,adjStart:kh,adjTgt:Lh,patGid:Dh,patTgt:Fh,postfixLookupGroups:Oh,orderSensitiveModifiers:Nh};var Bh="line"in Error();var Gc=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},ys=(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},Bm=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:m,vlistRef:f,vlistGroup:h,litAnchor:p,litGroup:w,litPool:I,poolOffsets:d,poolText:C,adjGid:b,adjStart:g,adjTgt:S,patGid:y,patTgt:x,postfixLookupGroups:R,customValidatorNames:v,orderSensitiveModifiers:E}=e,H=new Int32Array(r).fill(-1);for(let M=0;M<b.length;M++)H[b[M]]=M;let P=0;for(let M=0;M+1<g.length;M++){let G=g[M+1]-g[M];if(G>P)P=G}let N=32;while(N<2*(1+P+y.length))N<<=1;let T=new Int32Array(f.length+1);for(let M=0;M<f.length;M++)T[M+1]=T[M]+u[f[M]+1]-u[f[M]];let A=new Uint8Array(r);for(let M=0;M<R.length;M++)A[R[M]]=1;let O=n.length-1,Z=new Uint8Array(O),D=0,B=!0;for(let M=0;M<p.length;M++){Z[p[M]]=1;let G=d[I[M]*2+1];if(G>D)D=G;let J=C.charCodeAt(d[I[M]*2]);if(J===91||J===40)B=!1}let Q=1;while(Q<p.length*2)Q<<=1;let ee=new Int32Array(Q).fill(-1);for(let M=0;M<p.length;M++){let G=d[I[M]*2],J=(Gc(C,G,G+d[I[M]*2+1])^Math.imul(p[M],2654435761)|0)&Q-1;while(ee[J]!==-1)J=J+1&Q-1;ee[J]=M}let k=(M,G,J,be)=>{let Me=(Gc(G,J,be)^Math.imul(M,2654435761)|0)&Q-1,Pe=be-J;for(;;){let Ge=ee[Me];if(Ge===-1)return-1;if(p[Ge]===M&&d[I[Ge]*2+1]===Pe){let it=d[I[Ge]*2],Ke=!0;for(let ye=0;ye<Pe;ye++)if(C.charCodeAt(it+ye)!==G.charCodeAt(J+ye)){Ke=!1;break}if(Ke)return w[Ge]}Me=Me+1&Q-1}},se=o.cacheSize??8192,W=o.prefix??e.prefix??"",X=W===""?"":W+":",z=X.length,re=(v??[]).map((M)=>{let G=t&&t[M];if(!G)throw Error("cn: missing validator "+M);return G}),Ce=/\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$/,F=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Y=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,le=0,j=-1,_=-1,ce=-1,ge=-1,Te=(M)=>M>=97&&M<=122||M>=65&&M<=90||M>=48&&M<=57||M===95,Ue=(M)=>/\s/.test(String.fromCharCode(M)),ae=(M,G,J)=>{if(le=0,j=-1,J-G<3)return;let be=M.charCodeAt(G),Me=M.charCodeAt(J-1);if(be===91&&Me===93)le=1;else if(be===40&&Me===41)le=2;else return;ce=G+1,ge=J-1;let Pe=G+1;if(Te(M.charCodeAt(Pe))){Pe++;while(Pe<J-1){let Ge=M.charCodeAt(Pe);if(!Te(Ge)&&Ge!==45)break;Pe++}if(Pe<J-2&&M.charCodeAt(Pe)===58)j=G+1,_=Pe,ce=Pe+1}},de=(M,G,J,be)=>{if(J-G!==be.length)return!1;for(let Me=0;Me<be.length;Me++)if(M.charCodeAt(G+Me)!==be.charCodeAt(Me))return!1;return!0},ne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Be=(M)=>!!M&&!Number.isNaN(Number(M)),$e=(M,G,J)=>{if(J-G<11||!de(M,G,G+10,"@container"))return!1;if(M.charCodeAt(G+10)===47)return J-G>=12;let be=M.charCodeAt(G+11);return be===115&&J-G>=17&&de(M,G+10,G+16,"-size/")||be===110&&J-G>=19&&de(M,G+10,G+18,"-normal/")},L=[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((M)=>M.split(" ")),xe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],oe=(M,G,J,be)=>{if(M>=10){if(M>=25)return re[M-25](G.slice(J,be));let Me=M-10;if(le!==L[Me])return!1;if(j>=0){for(let Pe of U[Me])if(de(G,j,_,Pe))return!0;return!1}switch(xe[Me]){case 0:return!1;case 1:return!0;case 2:{let Pe=G.slice(ce,ge);return Ce.test(Pe)&&!F.test(Pe)}case 3:return Be(G.slice(ce,ge));case 4:return Y.test(G.slice(ce,ge));default:return V.test(G.slice(ce,ge))}}switch(M){case 0:return!0;case 1:return le===0;case 2:return le===1;case 3:return le===2;case 4:return ne.test(G.slice(J,be));case 5:return Be(G.slice(J,be));case 6:{let Me=G.slice(J,be);return!!Me&&Number.isInteger(Number(Me))}case 7:return be>J&&G.charCodeAt(be-1)===37&&Be(G.slice(J,be-1));case 8:return Oe.test(G.slice(J,be));default:return $e(G,J,be)}},ie=new Set(typeof E==="string"?E.split(" "):E),ue=(M,G,J,be,Me,Pe)=>{let Ge=Gc(G,J,be)^(Me?2654435769:0)|0,it=M.get(Ge);if(it!==void 0)e:for(let De=0;De<it.length;De++){let ze=it[De];if(ze.imp!==Me||ze.k.length!==be-J)continue;for(let Mt=0;Mt<ze.k.length;Mt++)if(ze.k.charCodeAt(Mt)!==G.charCodeAt(J+Mt))continue e;return ze.id}else M.set(Ge,it=[]);let Ke=G.slice(J,be),ye=Pe(Ke);return it.push({k:Ke,imp:Me,id:ye}),ye},me=new Map,he=new Map,He=2,Xe=4096,st=(M,G)=>{let J=[],be=0,Me=0,Pe=0;for(let ye=0;ye<M.length;ye++){let De=M.charCodeAt(ye);if(be===0&&Me===0&&De===58)J.push(M.slice(Pe,ye)),Pe=ye+1;else if(De===91)be++;else if(De===93)be--;else if(De===40)Me++;else if(De===41)Me--}J.push(M.slice(Pe));let Ge=J[0];if(J.length>1){let ye=[],De=[];for(let ze of J)if(ze.charCodeAt(0)===91||ie.has(ze)){if(De.length)ye.push(...De.sort()),De=[];ye.push(ze)}else De.push(ze);if(De.length)ye.push(...De.sort());Ge=ye.join(":")}let it=G?Ge+" !":Ge,Ke=he.get(it);if(Ke===void 0)he.set(it,Ke=He++);return Ke},po=new Map,ro=r,Ko=r+4096,no=()=>ro++,ao=2097152,go=8192,Ao=new Int32Array(go),Qt=Array(go).fill(null),kr=new Int32Array(go),Lr=new Int32Array(go),Ne=new Uint8Array(go),At=0,Ie=(M,G,J,be,Me,Pe,Ge,it)=>{let Ke=M;if(Qt[M]!==null)if(Qt[M|1]===null)Ke=M|1;else if((At++&3)===0)Ke=M|At>>2&1;else return;Qt[Ke]=G.slice(J,be),Ao[Ke]=Me,kr[Ke]=Pe,Lr[Ke]=Ge,Ne[Ke]=it},Se=()=>Qt.fill(null),Le=256,Pt=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[Dt,Xt,Tt,so]=Pt,Po=new Uint8Array(Le),ho=new Uint8Array(Le),nn=()=>{Le*=2,Pt=Pt.map((G)=>{let J=new Int32Array(Le);return J.set(G),J}),[Dt,Xt,Tt,so]=Pt;let M=new Uint8Array(Le);M.set(Po),Po=M,ho=new Uint8Array(Le)},Ho=64,Dr=new Int32Array(Ho),Fr=new Int32Array(Ho),xc=new Int32Array(r),mr=2048,Wu=21,yc=new Float64Array(mr),_a=new Int32Array(mr),fr=0,vc=(M,G)=>{if(M===0&&G<r){if(xc[G]===fr)return 1;return xc[G]=fr,0}let J=M*2097152+G+1,be=Math.imul(J,2654435761)>>>Wu;for(;;){if(_a[be]!==fr)break;if(yc[be]===J)return 1;be=be+1&mr-1}return yc[be]=J,_a[be]=fr,0},za=(M,G,J,be,Me)=>{if(J-G>=2&&M.charCodeAt(G)===91&&M.charCodeAt(J-1)===93){let Pe=-1;for(let Ge=G+1;Ge<J-1;Ge++)if(M.charCodeAt(Ge)===58){Pe=Ge;break}if(Pe===-1||Pe===G+1)return-1;return ue(po,M,G+1,Pe,0,no)}if(be>=0&&c[be]>=0)return c[be];for(let Pe=Me-1;Pe>=0;Pe--){let Ge=Fr[Pe];if(Ge>J)continue;let it=Dr[Pe],Ke=J-Ge;if(Z[it]===1&&Ke>0&&Ke<=D){let Ft=M.charCodeAt(Ge);if(B===!1||Ft!==91&&Ft!==40){let dr=k(it,M,Ge,J);if(dr>=0)return dr}}let ye=l[it];if(ye<0)continue;let De=f[ye],ze=u[De],Mt=u[De+1];if(ze===Mt)continue;ae(M,Ge,J);let Gt=T[ye]-ze;for(let Ft=ze;Ft<Mt;Ft++)if(oe(m[Ft],M,Ge,J))return h[Gt+Ft]}return-1},Za=(M)=>{let G=M.length,J=0,be=0,Me=!1;if(He>Xe||me.size>Xe)me=new Map,he=new Map,He=2,Se();if(ro>Ko)po=new Map,ro=r,Se();let Pe=0;while(Pe<G){let ye=M.charCodeAt(Pe);if(ye===32||ye>=9&&ye<=13||ye>=160&&Ue(ye)){if(ye!==32)Me=!0;Pe++;continue}let De=Pe,ze=0;while(Pe<G){if(ye=M.charCodeAt(Pe),ye<=32){if(ye===32)break;if(ye>=9&&ye<=13){Me=!0;break}}else if(ye>=160&&Ue(ye)){Me=!0;break}ze=Math.imul(ze^ye,16777619),Pe++}let Mt=Pe,Gt=Mt-De;if(J===Le)nn();let Ft=J++;Dt[Ft]=De,Xt[Ft]=Mt,be+=Gt,ze^=Math.imul(Gt,2654435761);let dr=ze^ze>>>15|0,Vo=dr&8190;{let Qe=-1;if(Ao[Vo]===dr&&Qt[Vo]!==null&&Qt[Vo].length===Gt)Qe=Vo;else if(Ao[Vo|1]===dr&&Qt[Vo|1]!==null&&Qt[Vo|1].length===Gt)Qe=Vo|1;if(Qe>=0){let To=Qt[Qe],Jo=!0;for(let Qo=0;Qo<Gt;Qo++)if(To.charCodeAt(Qo)!==M.charCodeAt(De+Qo)){Jo=!1;break}if(Jo){Tt[Ft]=kr[Qe],so[Ft]=Lr[Qe],Po[Ft]=Ne[Qe];continue}}}let sn=De;if(z!==0){if(Mt-De<=z||!M.startsWith(X,De)){Tt[Ft]=-1,Ie(Vo,M,De,Mt,dr,-1,0,0);continue}sn=De+z}let Ac=0,Pc=0,Vn=-1,Ec=-1;for(let Qe=sn;Qe<Mt;Qe++){let To=M.charCodeAt(Qe);if(Ac===0&&Pc===0){if(To===58){Vn=Qe;continue}if(To===47){Ec=Qe;continue}}if(To===91)Ac++;else if(To===93)Ac--;else if(To===40)Pc++;else if(To===41)Pc--}let zu=Vn>=sn?Vn+1:sn,Io=zu,bo=Mt,Un=!1,Zu=0;if(bo>Io&&M.charCodeAt(bo-1)===33)Un=!0,bo--;else if(bo>Io&&M.charCodeAt(Io)===33)Un=!0,Io++,Zu=1;let Or=-1;if(Ec>zu){if(Or=Ec+Zu,Or>=bo)Or=-1}let Tc=Io;if(bo-Io>1&&M.charCodeAt(Io)===45)Tc=Io+1;let Uo=0,gr=0,cn=0,qu=-1,Wo=0;if(l[0]>=0||Z[0]===1)Dr[0]=0,Fr[0]=Tc,Wo=1;let Mc=-1,kc=0;for(let Qe=Tc;Qe<bo;Qe++){if(Qe===Or)Mc=gr<cn?-1:Uo,kc=Wo;if(Uo!==-1){let To=M.charCodeAt(Qe),Jo=-1;if(gr<cn)if(s.charCodeAt(gr)===To){if(gr++,gr===cn)Jo=Uo=qu}else Uo=-1;else{let Qo=n[Uo],Ka=n[Uo+1],Oc=-1;for(let Nr=Qo;Nr<Ka;Nr++){let Nc=a[Nr];if(s.charCodeAt(Nc)===To){if(a[Nr+1]-Nc===1)Jo=Oc=i[Nr];else gr=Nc+1,cn=a[Nr+1],qu=i[Nr],Oc=Uo;break}}Uo=Oc}if(Jo>=0&&(l[Jo]>=0||Z[Jo]===1)&&Qe+1<bo&&M.charCodeAt(Qe+1)===45){if(Wo===Ho){Ho*=2;let Qo=new Int32Array(Ho);Qo.set(Dr),Dr=Qo;let Ka=new Int32Array(Ho);Ka.set(Fr),Fr=Ka}Dr[Wo]=Jo,Fr[Wo]=Qe+2,Wo++}}}if(Or===bo)Mc=gr<cn?-1:Uo,kc=Wo;let Lc=gr<cn?-1:Uo,Co,Xa=!1;if(Or>=0){if(Xa=!0,Co=za(M,Io,Or,Mc,kc),Co!==-1&&Co<r&&A[Co]){let Qe=za(M,Io,bo,Lc,Wo);if(Qe!==-1&&Qe!==Co)Co=Qe,Xa=!1}else if(Co===-1)Co=za(M,Io,bo,Lc,Wo),Xa=!1}else Co=za(M,Io,bo,Lc,Wo);let Dc=0,Fc=0;if(Co===-1)Tt[Ft]=-1;else Fc=Xa?1:0,Dc=sn>=Vn?Un?1:0:ue(me,M,sn,Vn,Un?1:0,(Qe)=>st(Qe,Un)),Tt[Ft]=Co,Po[Ft]=Fc,so[Ft]=Dc;Ie(Vo,M,De,Mt,dr,Co,Dc,Fc)}if(J===0)return"";if(J===1)return Dt[0]===0&&Xt[0]===G?M:M.slice(Dt[0],Xt[0]);if(J*N>mr){while(J*N>mr)mr<<=1,Wu--;yc=new Float64Array(mr),_a=new Int32Array(mr)}if(He>=ao||ro>=ao)throw Error("cn: too many distinct classes in one merge");if(fr=fr+1|0,fr===0)xc.fill(0),_a.fill(0),fr=1;let Ge=!1;for(let ye=J-1;ye>=0;ye--){let De=Tt[ye];if(De===-1){ho[ye]=1;continue}let ze=so[ye];if(vc(ze,De)===1){ho[ye]=0,Ge=!0;continue}if(ho[ye]=1,De<r){let Mt=H[De];if(Mt>=0)for(let Gt=g[Mt];Gt<g[Mt+1];Gt++)vc(ze,S[Gt]);if(Po[ye]&1){for(let Gt=0;Gt<y.length;Gt++)if(y[Gt]===De)vc(ze,x[Gt])}}}if(!Ge&&!Me&&G===be+J-1)return M;let it="",Ke=0;while(Ke<J){if(!ho[Ke]){Ke++;continue}let ye=Dt[Ke],De=Xt[Ke],ze=Ke+1;while(ze<J&&ho[ze]&&Dt[ze]===De+1&&M.charCodeAt(De)===32)De=Xt[ze],ze++;if(it.length>0)it+=" ";it+=M.slice(ye,De),Ke=ze}return it},pr=16384,Yo=new Int32Array(pr*2),qa=0,Eo=1,Bn=Object.create(null),Gu=Object.create(null),an=new Map,_u=new Map,ja=0,$a=0,Hn=()=>{qa^=pr,Eo=Eo+1|0,$a=0},H0=(M)=>{let G=Bn[M];if(G!==void 0)return G;let J=ys(M,0,M.length),be=(J&16383)+qa,Me=Yo[be]===(J^Eo)||Yo[be^pr]===(J^Eo-1);if(Me){if(G=Gu[M],G!==void 0)return Bn[M]=G,G}if(G=Za(M),Me){if(Bn[M]=G,++ja>se)ja=0,Gu=Bn,Bn=Object.create(null),Hn()}else if(Yo[be]=J^Eo,++$a>pr)Hn();return G},V0=(M)=>{let G=an.get(M);if(G!==void 0)return G;let J=ys(M,0,M.length),be=(J&16383)+qa,Me=Yo[be]===(J^Eo)||Yo[be^pr]===(J^Eo-1);if(Me){if(G=_u.get(M),G!==void 0)return an.set(M,G),G}if(G=Za(M),Me){if(an.set(M,G),++ja>se)ja=0,_u=an,an=new Map,Hn()}else if(Yo[be]=J^Eo,++$a>pr)Hn();return G},U0=(M)=>{let G=ys(M,0,M.length),J=(G&16383)+qa;if(Yo[J]===(G^Eo)||Yo[J^pr]===(G^Eo-1))return!0;if(Yo[J]=G^Eo,++$a>pr)Hn();return!1},Rc=se===0?Za:Bh?(M)=>{let G=an.get(M);return G!==void 0?G:V0(M)}:H0;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?Rc(arguments[0]):Rc(Hm.apply(null,arguments))},mergeString:Rc,seenBefore:se===0?()=>!1:U0,mergeUncached:Za}},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},Hh=(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},Hm=function(){return Hh(arguments,!1)};var Vm=(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,l=[],u=[],m=0,f=(d,C,b)=>{if(c===null)c=Array(4096).fill(""),l=Array(4096).fill(""),u=Array(4096).fill("");let g=ys(d,0,d.length)&4094;if(c[g]===d&&l[g]===C)return u[g];if(c[g|1]===d&&l[g|1]===C)return u[g|1];let S=e(b?C+" "+d:d),y=c[g]===""?g:g|(c[g|1]===""?1:m++&1);return c[y]=d,l[y]=C,u[y]=S,S},h=(d,C,b,g)=>{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(g){if(g!==(S===0?d.a0:S===1?d.a1:d.a2))return!1;S++}return S===d.t},p=(d,C)=>{let b=d.a,g=0;for(let S=0;S<C.length;S++){let y=C[S];if(!y)continue;if(y!==b[g])return!1;g++}return g===d.t},w=(d,C)=>{let b=d.length,g=i===null?null:i.n;if(!C){if(g!==null&&p(g,d))return i=g,g.r;if(i!==null&&i!==g&&p(i,d))return i.r}let S="",y=-1,x=0,R=!1;for(let H=0;H<b;H++){let P=d[H];if(!P)continue;if(typeof P!=="string"){if(P=d[H]=vs(P,!0),!P)continue;R=!0}if(y<0)S=P,y=H;x++}if(x===0)return"";if(x===1)return e(S);if(R){if(g!==null&&p(g,d))return i=g,g.r;if(i!==null&&i!==g&&p(i,d))return i.r}let v=n.get(S);if(v===void 0){if(v=a.get(S),v!==void 0)n.set(S,v)}let E=null;if(v!==void 0){if(v.skip>0){v.skip--,i=null;let P=S;for(let N=y+1;N<b;N++){let T=d[N];if(T)P+=" "+T}return f(P,"",!1)}let H=v.e;e:for(let P=0;P<H.length;P++){let N=H[P];if(N.t!==x)continue;let T=N.a,A=1;for(let O=y+1;O<b;O++){let Z=d[O];if(Z&&Z!==T[A++])continue e}E=N;break}if(E!==null)v.miss=0}if(E===null){let H=S,P=[S];for(let T=y+1;T<b;T++){let A=d[T];if(!A)continue;H+=" "+A,P.push(A)}if(!o(H))return r(H);if(E={r:e(H),t:P.length,a0:P[0],a1:P[1],a2:P[2]??"",a:P,n:null},v===void 0)n.set(S,v={e:[],miss:0,skip:0,at:0});else if(++v.miss>16)v.miss=16,v.skip=1024,v.e.length=0,v.at=0;let N=v.e;if(N.length<256)N.push(E);else N[v.at]=E,v.at=v.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==E)i.n=E;return i=E,E.r},I=(d)=>Array.isArray(d)?w(d.slice(),!1):e(vs(d,!0));return function(d,C,b){let g=arguments.length;if((g|1)===3){let x=i;if(x!==null){let R=x.n;if(R!==null&&h(R,d,C,b))return i=R,R.r;if(x!==R&&h(x,d,C,b))return x.r}if(g===2&&typeof C==="string"&&C!==""){let R=n.get(d);if(R!==void 0&&R.skip>0)return R.skip--,i=null,f(C,d,!0)}return w([d,C,b],!0)}if(g===1)return typeof d==="string"?e(d):I(d);let S=i;if(S!==null){let x=S.n;if(x!==null){let R=x.a,v=0,E=!0;for(let H=0;H<g;H++){let P=arguments[H];if(!P)continue;if(P!==R[v]){E=!1;break}v++}if(E&&v===x.t)return i=x,x.r}if(S!==x){let R=S.a,v=0,E=!0;for(let H=0;H<g;H++){let P=arguments[H];if(!P)continue;if(P!==R[v]){E=!1;break}v++}if(E&&v===S.t)return S.r}}let y=[];for(let x=0;x<g;x++)y.push(arguments[x]);return w(y,!0)}};var _c=Bm(Nm),fe=Vm(_c.mergeString,_c),sBe=_c.merge;import*as qm from"react";import*as gn from"react";function Rs(){return typeof window<"u"}function wt(e){if(As(e))return(e.nodeName||"").toLowerCase();return"#document"}function je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zo(e){var t;return(t=(As(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function As(e){if(!Rs())return!1;return e instanceof Node||e instanceof je(e).Node}function ke(e){if(!Rs())return!1;return e instanceof Element||e instanceof je(e).Element}function Ve(e){if(!Rs())return!1;return e instanceof HTMLElement||e instanceof je(e).HTMLElement}function Lo(e){if(!Rs()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof je(e).ShadowRoot}function Gr(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=Ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Um(e){return/^(table|td|th)$/.test(wt(e))}function Zn(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Vh=/transform|translate|scale|rotate|perspective|filter/,Uh=/paint|layout|strict|content/,Wr=(e)=>!!e&&e!=="none",zc;function Ps(e){let t=ke(e)?Ht(e):e;return Wr(t.transform)||Wr(t.translate)||Wr(t.scale)||Wr(t.rotate)||Wr(t.perspective)||!Es()&&(Wr(t.backdropFilter)||Wr(t.filter))||Vh.test(t.willChange||"")||Uh.test(t.contain||"")}function Wm(e){let t=wo(e);while(Ve(t)&&!xo(t)){if(Ps(t))return t;else if(Zn(t))return null;t=wo(t)}return null}function Es(){if(zc==null)zc=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return zc}function xo(e){return/^(html|body|#document)$/.test(wt(e))}function Ht(e){return je(e).getComputedStyle(e)}function qn(e){if(ke(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wo(e){if(wt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Lo(e)&&e.host||Zo(e);return Lo(t)?t.host:t}function Gm(e){let t=wo(e);if(xo(t))return(e.ownerDocument||e).body;if(Ve(t)&&Gr(t))return t;return Gm(t)}function br(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=Gm(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=je(n);if(a){let i=Ts(s);return t.concat(s,s.visualViewport||[],Gr(n)?n:[],i&&o?br(i):[])}else return t.concat(n,br(n,[],o))}function Ts(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as Wh from"react";var jn={...Wh};var Zc=jn.useInsertionEffect,Gh=Zc&&Zc!==jn.useLayoutEffect?Zc:(e)=>e();function te(e){let t=Ze(_h).current;return t.next=e,Gh(t.effect),t.trampoline}function _h(){let e={next:void 0,callback:zh,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zh(){}import*as _m from"react";var Zh=()=>{},q=typeof document<"u"?_m.useLayoutEffect:Zh;function qh(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 jh=qh("https://base-ui.com/production-error","Base UI"),rt=jh;import*as Ms from"react";var $h=Ms.createContext(void 0);function pn(e=!1){let t=Ms.useContext($h);if(t===void 0&&!e)throw Error(rt(16));return t}import*as zm from"react";function Zm(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:zm.useMemo(()=>{let l={onKeyDown(u){if(o&&t&&u.key!=="Tab")u.preventDefault()}};if(!r){if(l.tabIndex=n,!a&&o)l.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)l["aria-disabled"]=o;if(a&&(!t||i))l.disabled=o;return l},[r,o,t,s,i,a,n])}}function Re(e){return e?.ownerDocument||document}function dn(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(je(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 Do(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=gn.useRef(null),i=pn(!0),c=a??i!==void 0,{props:l}=Zm({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),u=gn.useCallback(()=>{let h=s.current;if(!qc(h))return;if(c&&t&&l.disabled===void 0&&h.disabled)h.disabled=!1},[t,l.disabled,c]);q(u,[u]);let m=gn.useCallback((h={})=>{let{onClick:p,onMouseDown:w,onKeyUp:I,onKeyDown:d,onPointerDown:C,...b}=h;return kt({onClick(g){if(t){g.preventDefault();return}p?.(g)},onMouseDown(g){if(!t)w?.(g)},onKeyDown(g){if(t)return;if(_n(g),d?.(g),g.baseUIHandlerPrevented)return;let S=g.target===g.currentTarget,y=g.currentTarget,x=qc(y),R=!n&&Xh(y),v=S&&(n?x:!R),E=g.key==="Enter",H=g.key===" ",P=y.getAttribute("role"),N=P?.startsWith("menuitem")||P==="option"||P==="gridcell";if(S&&c&&H){if(g.defaultPrevented&&N)return;if(g.preventDefault(),!n||x)g.preventBaseUIHandler(),dn(y,g);return}if(!v||n||!H&&!E){if(S&&R&&H)g.preventDefault();return}if(g.defaultPrevented)return;if(g.preventDefault(),E)g.preventBaseUIHandler(),dn(y,g)},onKeyUp(g){if(t)return;if(_n(g),I?.(g),g.target===g.currentTarget&&n&&c&&qc(g.currentTarget)&&g.key===" "){g.preventDefault();return}if(g.baseUIHandlerPrevented)return;if(g.target===g.currentTarget&&!n&&!c&&!g.defaultPrevented&&g.key===" ")g.preventBaseUIHandler(),dn(g.currentTarget,g)},onPointerDown(g){if(t){g.preventDefault();return}C?.(g)}},n?{type:"button"}:{role:"button"},l,b)},[t,l,c,n]),f=te((h)=>{s.current=h,u()});return{getButtonProps:m,buttonRef:f}}function qc(e){return Ve(e)&&e.tagName==="BUTTON"}function Xh(e){return Ve(e)&&e.tagName==="A"&&Boolean(e.href)}var jc=qm.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...l}=t,{getButtonProps:u,buttonRef:m}=Do({disabled:a,focusableWhenDisabled:s,native:i});return _e("button",t,{state:{disabled:a},ref:[o,m],props:[l,u]})});import{jsx as Yh}from"react/jsx-runtime";var Kh=Bt("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 Ot({className:e,variant:t="default",size:o="default",...r}){return Yh(jc,{"data-slot":"button",className:fe(Kh({variant:t,size:o,className:e})),...r})}import{jsx as Cr}from"react/jsx-runtime";var Jh=Bt("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 hn({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return Cr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:fe(Jh({size:o,orientation:r}),e),...n})}var Qh=Bt("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 $n({className:e,variant:t="icon",...o}){return Cr("div",{"data-slot":"attachment-media","data-variant":t,className:fe(Qh({variant:t}),e),...o})}function Xn({className:e,...t}){return Cr("div",{"data-slot":"attachment-content",className:fe("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function Kn({className:e,...t}){return Cr("span",{"data-slot":"attachment-title",className:fe("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 Yn({className:e,...t}){return Cr("span",{"data-slot":"attachment-description",className:fe("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 ks({className:e,...t}){return Cr("div",{"data-slot":"attachment-actions",className:fe("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 jm({className:e,variant:t,size:o="icon-xs",...r}){return Cr(Ot,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:fe(e),...r})}function Ls({className:e,...t}){return Cr("div",{"data-slot":"attachment-group",className:fe("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 Ds from"react";var $c=Ds.createContext(void 0);function $m(e){let t=Ds.useContext($c);if(t===void 0&&!e)throw Error(rt(33));return t}import*as Fs from"react";var Jn=Fs.createContext(void 0);function eo(e){let t=Fs.useContext(Jn);if(t===void 0&&!e)throw Error(rt(36));return t}var In="data-starting-style",Os="data-ending-style";var eI={[In]:""},tI={[Os]:""},Ns={transitionStatus(e){if(e==="starting")return eI;if(e==="ending")return tI;return null}};var Kc="data-open",Yc="data-closed",oI=In,rI=Os,Xm="data-anchor-hidden";var Bs="data-popup-open",Ym="data-pressed";var nI={[Bs]:""},aI={[Bs]:"",[Ym]:""},sI={[Kc]:""},iI={[Yc]:""},cI={[Xm]:""},Qm={open(e){if(e)return nI;return null}},Jc={open(e){if(e)return aI;return null}},Qn={open(e){if(e)return sI;return iI},anchorHidden(e){if(e)return cI;return null}},Hs={...Qn,...Ns};import*as Vs from"react";var lI=Vs.createContext(void 0);function bn(e=!0){let t=Vs.useContext(lI);if(t===void 0&&!e)throw Error(rt(25));return t}var ea="none",Us="trigger-press",Kt="trigger-hover",ta="trigger-focus",Qc="outside-press",el="item-press",uI="close-press";var Cn="focus-out",tl="escape-key";var Ws="list-navigation",ef="keyboard",mI="pointer";var fI="cancel-open",oa="sibling-open";var tf="imperative-action";import*as ra from"react";var ol=ra.createContext(null);function rl(e="root"){let t=ra.useContext(ol),o=ra.useContext(Jn);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var pI={visible:!0,ref:null};function dI(){return pI}function of(e,t,o="root"){let r=rl(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??dI)({label:e.label,children:e.children,render:e.render}),s=So(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as Sn from"react";import*as cf from"react";function gI(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:hI,platform:II,maxTouchPoints:rf}=gI(),_r=hI.toLowerCase(),zr=II.toLowerCase();var nl=/^i(os$|p)/.test(zr)||zr==="macintel"&&rf>1,nf="android",af=zr===nf||_r.includes(nf),sf=!nl&&zr.startsWith("mac"),bI=zr.startsWith("win"),CI=!af&&/^(linux|chrome os)/.test(zr),al=sf||nl;var sl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),SI=!sl&&_r.includes("firefox"),wI=!sl&&_r.includes("chrom");var xI=al;var yI=/jsdom|happydom/.test(_r);function vI(e){e.preventDefault()}function lf(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,l=eo(),u=bn(!0),m=c.type==="submenu-trigger",f=m?l.parentVirtualFocus:l.virtualFocus,p=(m&&l.parent.type==="menu"?l.parent.store:l.store).useState("webkitAriaSelected",o),{events:w}=a.useState("floatingTreeRoot"),I=a.useState("open"),d=u!==void 0,C=!f&&I&&o?0:-1;return cf.useMemo(()=>({id:r,role:"menuitem",tabIndex:C,"aria-selected":p,onMouseDown:f?vI: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:el})},onMouseUp(b){if(u){let g=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&g&&Math.abs(b.clientX-g.x)<=1&&Math.abs(b.clientY-g.y)<=1)return;if(d&&!tr.mac&&b.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!d||b.button===2)){if(c.type==="regular-item")dn(i.current,b,{detail:1,pointerType:"mouse"})}}}),[t,C,r,w,n,a.context.allowMouseUpTriggerRef,s,i,u,d,c.type,p,f])}var uf={type:"regular-item"};function mf(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:l}=e,u=Sn.useRef(null),{getButtonProps:m,buttonRef:f}=Do({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),h=lf({closeOnClick:t,highlighted:r,id:n,nodeId:l,store:a,typingRef:s,itemRef:u,itemMetadata:c}),p=Sn.useCallback((I)=>kt(h,{onMouseEnter(d){if(c.type!=="submenu-trigger")return;c.setActive(d.nativeEvent)}},I,m),[h,m,c]),w=So(u,f);return Sn.useMemo(()=>({getItemProps:p,itemRef:w}),[p,w])}import*as Zr from"react";import*as Gs from"react";var cl=Gs.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ff(){return Gs.useContext(cl)}function _s(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:l}=ff(),u=Zr.useRef(-1),[m,f]=Zr.useState(a==null&&t?()=>{if(u.current===-1){let I=l.current;l.current+=1,u.current=I}return u.current}:-1),h=a??m,p=Zr.useRef(null),w=Zr.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:h}}import*as qs from"react";import*as zs from"react";function Zs(){let[,e]=zs.useState({});return zs.useCallback(()=>{e({})},[])}var pf=0;function RI(e,t="mui"){let o=qs.useRef(void 0),r=Zs(),n=e??o.current;return qs.useEffect(()=>{if(o.current==null){if(pf+=1,o.current=`${t}-${pf}`,e==null)r()}},[e,t,r]),n}var df=jn.useId;function Sr(e,t){if(df!==void 0){let o=df();return e??(t?`${t}-${o}`:o)}return RI(e,t)}function Yt(e){return Sr(e,"base-ui")}function ve(e,t,o,r){let n=!1,a=!1,s=r??Fe;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 gf(e,t,o){let r=o??Fe;return{reason:e,event:t??new Event("base-ui"),...r}}import*as ll from"react";import*as hf from"react";function wn(e){hf.useEffect(e,er)}var js=null,W5e=globalThis.requestAnimationFrame;class If{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 $s=new If;class yo{static create(){return new yo}static request(e){return $s.request(e)}static cancel(e){return $s.cancel(e)}currentId=js;request(e){this.cancel(),this.currentId=$s.request(()=>{this.currentId=js,e()})}cancel=()=>{if(this.currentId!==js)$s.cancel(this.currentId),this.currentId=js};disposeEffect=()=>this.cancel}function rr(){let e=Ze(yo.create).current;return wn(e.disposeEffect),e}function bf(e,t=!1,o=!1,r=!1){let[n,a]=ll.useState(e&&t?"idle":void 0),[s,i]=ll.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=yo.request(()=>{a("ending")});return()=>{yo.cancel(c)}}return},[e,s,n,o]),q(()=>{if(!e||t||n===void 0)return;let c=yo.request(()=>{a(void 0)});return()=>{yo.cancel(c)}},[t,e,n]),q(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=yo.request(()=>{a("idle")});return()=>{yo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as Cf from"react";import*as ml from"react-dom";function Fo(e){if(e==null)return e;return"current"in e?e.current:e}function ul(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var Xs=null;function AI(e){if(!Xs){let t=[];Xs=t,queueMicrotask(()=>{Xs=null,ml.flushSync(()=>{for(let o of t)o()})})}Xs.push(e)}function xn(e,t=!1,o=!1){let r=rr();return te((n,a=null)=>{r.cancel();let s=Fo(e);if(s==null)return;let i=s,c=()=>{if(!o){ml.flushSync(n);return}AI(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(ul(i).map((u)=>u.finished.then(qe))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(ul(i).some((m)=>m.pending||m.playState!=="finished")){l();return}c()})}if(t){let u=In;if(!i.hasAttribute(u)){r.request(l);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(u))m.disconnect(),l()});m.observe(i,{attributes:!0,attributeFilter:[u]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(l)})}function yn(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=te(a),i=xn(r,o,n);Cf.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as fl from"react";import{jsx as PI}from"react/jsx-runtime";var EI=fl.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:l=!0,style:u,...m}=t,{store:f}=eo(),h=_s({guess:!0,label:s}),p=Yt(a),w=f.useState("disabled"),I=f.useState("isActive",h.index),d=f.useState("floatingNodeId"),C=f.useState("itemProps"),b=c||w,{getItemProps:g,itemRef:S}=mf({closeOnClick:l,disabled:b,highlighted:I,id:p,store:f,nativeButton:i,nodeId:d,itemMetadata:uf});return _e("div",t,{state:{disabled:b,highlighted:I},props:[C,m,g],ref:[S,o,h.ref]})}),Sf=fl.forwardRef(function(t,o){let r=of(t,o);if(!r.visible)return null;return PI(EI,{...t,ref:r.ref})});import*as Jr from"react";import*as Vt from"react";function Ae(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function _t(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function nt(e){let t=Ze(TI,e).current;return t.next=e,q(t.effect),t}function TI(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var aa=0;class co{static create(){return new co}currentId=aa;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=aa,t()},e)}isStarted(){return this.currentId!==aa}clear=()=>{if(this.currentId!==aa)clearTimeout(this.currentId),this.currentId=aa};disposeEffect=()=>this.clear}function tt(){let e=Ze(co.create).current;return wn(e.disposeEffect),e}import*as Ks from"react";var wf={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},xf={...wf,position:"fixed",margin:0,top:0,left:0},CHe={...wf,position:"absolute"};import{jsx as MI}from"react/jsx-runtime";var nr=Ks.forwardRef(function(t,o){let[r,n]=Ks.useState();return q(()=>{if(il.voiceOver&&or.webkit)n("button")},[]),MI("span",{...t,ref:o,style:xf,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});function Lt(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function pe(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Lo(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qr(e,t){let o=e;while(o){if(ke(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(Lo(o)?o.host:null)}return null}function at(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var sa="data-base-ui-focusable";var pl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ia="ArrowLeft",ca="ArrowRight",dl="ArrowUp",Ys="ArrowDown";var MHe=Bs,gl="data-trigger-disabled";function wr(e,t){if(!ke(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(gl);for(let[,r]of t.entries())if(pe(r,o))return!r.hasAttribute(gl);return!1}function Js(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 yf(e){return e.matches("html,body")}function ar(e){return Ve(e)&&e.matches(pl)}function hl(e){return qr(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${pl}`)!=null}function la(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&ar(e)}function vf(e){if(!e||na.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function ua(e){if(!e)return null;return e.hasAttribute(sa)?e:e.querySelector(`[${sa}]`)||e}function lo(e){e.preventDefault(),e.stopPropagation()}function Rf(e){return"nativeEvent"in e}function xr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(tr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function vn(e){if(na.jsdom)return!1;return!tr.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"&&(tr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function sr(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Af(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var{min:yr,max:Oo,round:fa,floor:pa}=Math,qo=(e)=>({x:e,y:e}),LI={left:"right",right:"left",bottom:"top",top:"bottom"};function ei(e,t,o){return Oo(e,yr(t,o))}function jo(e,t){return typeof e==="function"?e(t):e}function Jt(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function ti(e){return e==="x"?"y":"x"}function da(e){return e==="y"?"height":"width"}function to(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ga(e){return ti(to(e))}function Tf(e,t,o){if(o===void 0)o=!1;let r=uo(e),n=ga(e),a=da(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=ma(s);return[s,ma(s)]}function Mf(e){let t=ma(e);return[Qs(e),t,Qs(t)]}function Qs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Pf=["left","right"],Ef=["right","left"],DI=["top","bottom"],FI=["bottom","top"];function OI(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Ef:Pf;return t?Pf:Ef;case"left":case"right":return t?DI:FI;default:return[]}}function kf(e,t,o,r){let n=uo(e),a=OI(Jt(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(Qs))}return a}function ma(e){let t=Jt(e);return LI[t]+e.slice(t.length)}function NI(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 oi(e){return typeof e!=="number"?NI(e):{top:e,right:e,bottom:e,left:e}}function jr(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 ri(e,t){return t<0||t>=e.length}function ni(e,t){return bl(e.current,{disabledIndices:t})}function Il(e,t){return bl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Lf(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,l=()=>bl(e,{startingIndex:t,decrement:r,disabledIndices:s}),u,m=!1;if(!n)u=r?Math.max(i,l()):Math.min(c,l());else if(r?t<=i:t>=c){let f=r?-1:e.length;if(a&&t!==f)u=-1;else u=r?c:i,m=!0}else u=l();return{index:ri(e,u)?-1:u,wrapped:m}}function bl(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&&Cl(e,a,r));return a}function Cl(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!$r(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function BI(e){return e.visibility==="hidden"||e.visibility==="collapse"}function $r(e,t=e?Ht(e):null){if(!e||!e.isConnected||!t||BI(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var HI='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function VI(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return Lo(o)?o.host:null}function wl(e){for(let t of Array.from(e.children))if(wt(t)==="summary")return t;return null}function UI(e,t){let o=wl(t);return!!o&&(e===o||pe(o,e))}function Df(e){let t=e?wt(e):"";return e!=null&&e.matches(HI)&&(t!=="summary"||e.parentElement!=null&&wt(e.parentElement)==="details"&&wl(e.parentElement)===e)&&(t!=="details"||wl(e)==null)&&(t!=="input"||e.type!=="hidden")}function xl(e){if(!Df(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=VI(t)){let o=t!==e,r=wt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&wt(t)==="details"&&!t.open&&!UI(e,t)||t.hasAttribute("hidden")||!r&&!WI(t,o))return!1}return!0}function WI(e,t){let o=Ht(e);if(!t)return $r(e,o);return o.display!=="none"}function Ff(e){let t=e.tabIndex;if(t<0){let o=wt(e);if(o==="details"||o==="audio"||o==="video"||Ve(e)&&e.isContentEditable)return 0}return t}function Sl(e){if(wt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function Of(e,t){let o=Sl(e);if(!o)return!0;let r=t.find((n)=>{let a=Sl(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=Sl(n);return a?.name===o.name&&a.form===o.form})===o}function Nf(e){if(Ve(e)&&wt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(Ve(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function yl(e,t){Nf(e).forEach((o)=>{if(Df(o))t.push(o);yl(o,t)})}function Bf(e,t,o){Nf(e).forEach((r)=>{if(Ve(r)&&r.matches(t))o.push(r);Bf(r,t,o)})}function ha(e){return xl(e)&&Ff(e)>=0}function vl(e){let t=[];return yl(e,t),t.filter(xl)}function Ia(e){let t=vl(e);return t.filter((o)=>Ff(o)>=0&&Of(o,t))}function Hf(e,t){let o=Ia(e),r=o.length;if(r===0)return;let n=Lt(Re(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function ai(e){return Hf(Re(e).body,1)||e}function si(e){return Hf(Re(e).body,-1)||e}function Vf(e,t,o){if(!e)return null;let r=[];yl(Re(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(xl);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!pe(o,i)&&ha(i)&&Of(i,a))return i}return r[n]}function ir(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!pe(o,r)}function Uf(e){Ia(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function Rl(e){let t=[];Bf(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 vo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...vo(e,n.id,o)])}function Al(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 $o(e){return`data-base-ui-${e}`}var ii=0;function Rn(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(ii);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),qe;let s=requestAnimationFrame(a);return ii=s,()=>{if(ii===s)cancelAnimationFrame(s),ii=0}}var Wf="data-base-ui-inert",ba=new WeakMap,ci=new WeakSet,Ca=new WeakMap,Pl=0;function Zf(e){if(!e)return null;return Lo(e)?e.host:Zf(e.parentNode)}var Gf=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=Zf(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),_f=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},zf=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(wt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function GI(e,t,o,{mark:r=!0}){let n=Gf(t,e),a=r?zf(t,_f(n),new Set(n)):[],s=[],i=[];if(o){let c=Gf(t,Array.from(t.querySelectorAll("[aria-live]"))),l=n.concat(c);zf(t,_f(l),new Set(l)).forEach((m)=>{let f=m.getAttribute("aria-hidden"),h=f!==null&&f!=="false",p=(ba.get(m)||0)+1;if(ba.set(m,p),s.push(m),p===1&&h)ci.add(m);if(!h)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let l=(Ca.get(c)||0)+1;if(Ca.set(c,l),i.push(c),l===1)c.setAttribute(Wf,"")});return Pl+=1,()=>{if(s.forEach((c)=>{let l=(ba.get(c)||0)-1;if(ba.set(c,l),!l){if(!ci.has(c))c.removeAttribute("aria-hidden");ci.delete(c)}}),r)i.forEach((c)=>{let l=(Ca.get(c)||0)-1;if(Ca.set(c,l),!l)c.removeAttribute(Wf)});if(Pl-=1,!Pl)ba=new WeakMap,ci=new WeakSet,Ca=new WeakMap}}function El(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=Re(e[0]).body;return GI(e,n,o,{mark:r})}import*as ot from"react";import*as Ml from"react-dom";var qf=500,jf=500,$f={style:{transition:"none"}},li="data-base-ui-click-trigger";var Xf={fallbackAxisSide:"none"},Kf={fallbackAxisSide:"end"},Yf={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as Tl,jsxs as Jf}from"react/jsx-runtime";var Qf=ot.createContext(null),kl=()=>ot.useContext(Qf),_I=$o("portal");function ep(e={}){let{ref:t,container:o,componentProps:r=Fe,elementProps:n}=e,a=Sr(),i=kl()?.portalNode,[c,l]=ot.useState(null),[u,m]=ot.useState(null),f=te((I)=>{if(I!==null)m(I)}),h=ot.useRef(null);q(()=>{if(o===null){if(h.current)h.current=null,m(null),l(null);return}let I=(o&&(As(o)?o:o.current))??i??document.body;if(I==null){if(h.current)h.current=null,m(null),l(null);return}if(h.current!==I)h.current=I,m(null),l(I)},[o,i]);let p=_e("div",r,{ref:[t,f],props:[{id:a,[_I]:""},n]}),w=c&&p?Ml.createPortal(p,c):null;return{node:u,nodeId:ot.isValidElement(p)?p.props.id:void 0,subtree:w}}var Sa=ot.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...l}=t,{node:u,nodeId:m,subtree:f}=ep({container:i,ref:o,componentProps:t,elementProps:l}),h=ot.useRef(null),p=ot.useRef(null),w=ot.useRef(null),I=ot.useRef(null),[d,C]=ot.useState(null),b=ot.useRef(!1),g=d?.modal,S=d?.open,y=!!d&&!d.modal&&d.open&&!!u;ot.useEffect(()=>{if(!u||g)return;function R(v){if(u&&v.relatedTarget&&ir(v))if(v.type==="focusin"){if(b.current)Rl(u),b.current=!1}else Uf(u),b.current=!0}return _t(Ae(u,"focusin",R,!0),Ae(u,"focusout",R,!0))},[u,g]),q(()=>{if(!u||S!==!0||!b.current)return;Rl(u),b.current=!1},[S,u]);let x=ot.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:p,beforeInsideRef:w,afterInsideRef:I,portalNode:u,setFocusManagerState:C}),[u]);return Jf(ot.Fragment,{children:[f,Jf(Qf.Provider,{value:x,children:[y&&u&&Tl(nr,{"data-type":"outside",ref:h,onFocus:(R)=>{if(ir(R,u))w.current?.focus();else{let v=d?d.domReference:null;si(v)?.focus()}}}),y&&u&&Tl("span",{role:c,"aria-owns":m,style:Yf}),u&&Ml.createPortal(s,u),y&&u&&Tl(nr,{"data-type":"outside",ref:p,onFocus:(R)=>{if(ir(R,u))I.current?.focus();else{let v=d?d.domReference:null;if(ai(v)?.focus(),d?.closeOnFocusOut)d?.onOpenChange(!1,ve(Cn,R.nativeEvent))}}})]})]})});import*as vr from"react";function ui(){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 Xr{nodesRef={current:[]};events=ui();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 tp}from"react/jsx-runtime";var op=vr.createContext(null),rp=vr.createContext(null),mo=()=>vr.useContext(op)?.id||null,zt=(e)=>{let t=vr.useContext(rp);return e??t};function wa(e){let t=Sr(),o=zt(e),r=mo();return q(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function Ll(e){let{children:t,id:o}=e,r=mo();return tp(op.Provider,{value:vr.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function Dl(e){let{children:t,externalTree:o}=e,r=Ze(()=>o??new Xr).current;return tp(rp.Provider,{value:r,children:t})}import{jsx as np,jsxs as zI}from"react/jsx-runtime";function ZI(e,t){let o=je(at(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(xr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var ap=20,Rr=[];function Fl(){Rr=Rr.filter((e)=>e.deref()?.isConnected)}function sp(e){if(Fl(),e&&wt(e)!=="body"){if(Rr.push(new WeakRef(e)),Rr.length>ap)Rr=Rr.slice(-ap)}}function ip(){return Fl(),Rr[Rr.length-1]?.deref()}function qI(e){if(!e)return null;if(ha(e))return e;return Ia(e)[0]||e}function cp(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=vl(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return ha(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 xa(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:m,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:p,getInsideElements:w}=e,I=t.useState("open"),d=t.useState("domReferenceElement"),C=t.useState("floatingElement"),{events:b,dataRef:g}=t.context,S=te(()=>g.current.floatingContext?.nodeId),y=n===!1,x=la(d)&&y,R=nt(n),v=nt(a),E=nt(s),H=nt(u),P=nt(I),N=zt(p),T=kl(),A=Vt.useRef(!1),O=Vt.useRef(!1),Z=Vt.useRef(!1),D=Vt.useRef(null),B=Vt.useRef(""),Q=Vt.useRef(""),ee=Vt.useRef(null),k=Vt.useRef(null),se=So(ee,h,T?.beforeInsideRef),W=So(k,T?.afterInsideRef),X=tt(),z=tt(),re=rr(),Ce=T!=null,F=ua(C),V=te((_=F)=>_?Ia(_):[]),Y=te(()=>w?.().filter((_)=>_!=null)??[]);Vt.useEffect(()=>{if(r||!c)return;function _(ge){if(ge.key==="Tab"){if(pe(F,Lt(Re(F)))&&V().length===0&&!x)lo(ge)}}let ce=Re(F);return Ae(ce,"keydown",_)},[r,F,c,x,V]),Vt.useEffect(()=>{if(r||!I)return;let _=Re(F);function ce(){Z.current=!1}function ge(Ue){let ae=at(Ue),de=Y(),ne=pe(C,ae)||pe(d,ae)||pe(T?.portalNode,ae)||de.some((Oe)=>Oe===ae||pe(Oe,ae));if(Z.current=!ne,Q.current=Ue.pointerType||"keyboard",qr(ae,`[${li}]`))O.current=!0,z.start(0,()=>{O.current=!1})}function Te(){Q.current="keyboard"}return _t(Ae(_,"pointerdown",ge,!0),Ae(_,"pointerup",ce,!0),Ae(_,"pointercancel",ce,!0),Ae(_,"keydown",Te,!0),ce)},[r,C,d,F,I,T,z,Y]),Vt.useEffect(()=>{if(r||!l)return;let _=Re(F);function ce(){O.current=!0,z.start(0,()=>{O.current=!1})}function ge(de){let ne=at(de);if(ha(ne))D.current=ne}function Te(de){let{relatedTarget:ne,currentTarget:Oe}=de,Be=at(de);if(c&&ne==null&&Be!=null&&pe(C,Be))sp(Be);queueMicrotask(()=>{let $e=S(),L=t.context.triggerElements,U=Y(),xe=ne?.hasAttribute($o("focus-guard"))&&[ee.current,k.current,T?.beforeInsideRef.current,T?.afterInsideRef.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,Fo(f),Fo(m)].includes(ne),oe=!(pe(d,ne)||pe(C,ne)||pe(ne,C)||pe(T?.portalNode,ne)||U.some((ie)=>ie===ne||pe(ie,ne))||L.hasMatchingElement((ie)=>pe(ie,ne))||xe||N&&(vo(N.nodesRef.current,$e).find((ie)=>pe(ie.context?.elements.floating,ne)||pe(ie.context?.elements.domReference,ne))||Al(N.nodesRef.current,$e).find((ie)=>[ie.context?.elements.floating,ua(ie.context?.elements.floating)].includes(ne)||ie.context?.elements.domReference===ne)));if(Oe===d&&F)cp(F);if(i&&Oe!==d&&!$r(Be)&&Lt(_)===_.body){if(Ve(F)){if(F.focus(),i==="popup"){re.request(()=>{F.focus()});return}}let ie=V(),ue=D.current,me=(ue&&ie.includes(ue)?ue:null)||ie[ie.length-1]||F;if(Ve(me))me.focus()}if(g.current.insideReactTree){g.current.insideReactTree=!1;return}if((x?!0:!c)&&ne&&oe&&!O.current&&(x||ne!==ip()))A.current=!0,t.setOpen(!1,ve(Cn,de))})}function Ue(){if(Z.current)return;g.current.insideReactTree=!0,X.start(0,()=>{g.current.insideReactTree=!1})}let ae=Ve(d)?d:null;if(!C&&!ae)return;return _t(ae&&Ae(ae,"focusout",Te),ae&&Ae(ae,"pointerdown",ce),C&&Ae(C,"focusin",ge),C&&Ae(C,"focusout",Te),C&&T&&Ae(C,"focusout",Ue,!0))},[r,d,C,F,c,N,T,t,l,i,V,x,S,g,X,z,re,m,f,Y]),Vt.useEffect(()=>{if(r||!C||!I)return;let _=Array.from(T?.portalNode?.querySelectorAll(`[${$o("portal")}]`)||[]),ge=(N?Al(N.nodesRef.current,S()):[]).find((Oe)=>la(Oe.context?.elements.domReference||null))?.context?.elements.domReference,Ue=[...[C,..._,ee.current,k.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,...Y()],ge,Fo(f),Fo(m),x?d:null].filter((Oe)=>Oe!=null),ae=El(Ue,{ariaHidden:c||x,mark:!1}),de=[C,..._].filter((Oe)=>Oe!=null),ne=El(de);return()=>{ne(),ae()}},[I,r,d,C,c,T,x,N,S,m,f,Y]),q(()=>{if(!I||r||!Ve(F))return;B.current="",Q.current="";let _=Re(F),ce=Lt(_);queueMicrotask(()=>{let ge=R.current,Te=typeof ge==="function"?ge(H.current||""):ge;if(Te===void 0||Te===!1)return;if(pe(F,ce))return;let ae=null,de=()=>{if(ae==null)ae=V(F);return ae[0]||F},ne;if(Te===!0||Te===null)ne=de();else ne=Fo(Te);ne=ne||de();let Oe=pe(F,Lt(_)),Be=g.current.openEvent,$e=Be?.type==="mousedown"&&xr(Be);Rn(ne,{sync:$e,preventScroll:ne===F,shouldFocus(){if(!P.current)return!1;if(Oe)return!0;let L=Lt(_);return!(L!==ne&&pe(F,L))}})})},[r,I,F,V,R,H,P,g]);let le=Vt.useRef(null);q(()=>{if(r||!F){le.current=null;return}if(le.current)le.current.cancelled=!0,le.current=null;let _=Re(F),ce=Lt(_),ge=H.current==null;sp(ce);function Te(ae){if(!ae.open)B.current=ZI(ae.nativeEvent,Q.current);if(ae.reason===Cn&&ae.triggerElement?.hasAttribute($o("focus-guard"))||ae.reason===Kt&&ae.nativeEvent.type==="mouseleave")A.current=!0;if(ae.reason!==Qc)return;if(ae.nested)A.current=!1;else if(xr(ae.nativeEvent)||vn(ae.nativeEvent))A.current=!1;else{let de=!1;if(Re(F).createElement("div").focus({get preventScroll(){return de=!0,!1}}),de)A.current=!1;else A.current=!0}}b.on("openchange",Te);function Ue(ae){let de=v.current,ne=typeof de==="function"?de(ae):de;if(ne===void 0||ne===!1)return null;if(ne===null)ne=!0;let Oe=d?.isConnected?d:null,Be=ce?.isConnected&&wt(ce)!=="body"?ce:null,$e=ge?Be||Oe:Oe||Be;if(!$e)$e=ip()||null;if(typeof ne==="boolean")return $e;return Fo(ne)||$e||null}return()=>{b.off("openchange",Te);let ae=Lt(_),de=Y(),ne=pe(C,ae)||de.some((U)=>U===ae||pe(U,ae))||N&&vo(N.nodesRef.current,S(),!1).some((U)=>pe(U.context?.elements.floating,ae)),Oe=v.current,Be=B.current,$e=Ue(Be),L={cancelled:!1};le.current=L,queueMicrotask(()=>{if(le.current===L)le.current=null;let U=qI($e),xe=E.current??typeof Oe!=="boolean";if(!L.cancelled&&Oe&&!A.current&&Ve(U)&&(!xe&&U!==ae&&ae!==_.body?ne:!0)){let oe={preventScroll:!0};if(Be==="keyboard")oe.focusVisible=!0;U.focus(oe)}A.current=!1})}},[r,C,F,v,E,H,b,N,d,S,Y]),q(()=>{if(!or.webkit||I||!C)return;let _=Lt(Re(C));if(!Ve(_)||!ar(_))return;if(pe(C,_))_.blur()},[I,C]),q(()=>{if(r||!T)return;return T.setFocusManagerState({modal:c,closeOnFocusOut:l,open:I,onOpenChange:t.setOpen,domReference:d}),()=>{T.setFocusManagerState(null)}},[r,T,c,I,t,l,d]),q(()=>{if(r||!F)return;return cp(F),()=>{queueMicrotask(Fl)}},[r,F]);let j=!r&&(c?!x:!0)&&(Ce||c);return zI(Vt.Fragment,{children:[j&&np(nr,{"data-type":"inside",ref:se,onFocus:(_)=>{if(c){let ce=V();Rn(ce[ce.length-1])}else if(T?.portalNode)if(A.current=!1,ir(_,T.portalNode))ai(d)?.focus();else Fo(f??T.beforeOutsideRef)?.focus()}}),o,j&&np(nr,{"data-type":"inside",ref:W,onFocus:(_)=>{if(c)Rn(V()[0]);else if(T?.portalNode){if(l)A.current=!0;if(ir(_,T.portalNode))si(d)?.focus();else Fo(m??T.afterOutsideRef)?.focus()}}})]})}import*as ya 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=Us}=t,l=e.context.dataRef,u=ya.useRef(void 0),m=rr(),f=tt(),h=ya.useMemo(()=>{function p(I,d,C,b){let g=ve(c,d,C);if(I&&b==="touch"&&i>0)f.start(i,()=>{e.setOpen(!0,g)});else e.setOpen(I,g)}function w(I,d,C){let b=l.current.openEvent,g=e.select("domReferenceElement")!==d;if(I&&g)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){u.current=sr(I.pointerType,!0)&&vn(I.nativeEvent)?"virtual":I.pointerType},onMouseDown(I){let d=u.current,C=I.nativeEvent,b=e.select("open");if(I.button!==0||r==="click"||sr(d,!0)&&a)return;let g=w(b,I.currentTarget,(R)=>R==="click"||R==="mousedown"),S=at(C),y=ar(S);if(y||d==="virtual"){p(g,C,y?S:I.currentTarget,d);return}let x=I.currentTarget;m.request(()=>{p(g,C,x,d)})},onClick(I){if(r==="mousedown-only")return;let d=u.current;if(r==="mousedown"&&d){u.current=void 0;return}if(sr(d,!0)&&a)return;let C=e.select("open"),b=w(C,I.currentTarget,(g)=>g==="click"||g==="mousedown"||g==="keydown"||g==="keyup");p(b,I.nativeEvent,I.currentTarget,d)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,s,n,m,f,i]);return ya.useMemo(()=>o?{reference:h}:Fe,[o,h])}import*as Zt from"react";function jI(){return!1}function $I(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Ra(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=jI,bubbles:i,externalTree:c}=t,l=e.useState("open"),u=e.useState("floatingElement"),{dataRef:m,events:f}=e.context,h=zt(c),p=te(typeof n==="function"?n:()=>!1),w=typeof n==="function"?p:n,I=w!==!1,d=te(()=>a),{escapeKey:C,outsidePress:b}=$I(i),g=Zt.useRef(!1),S=Zt.useRef(!1),y=Zt.useRef(!1),x=Zt.useRef(!1),R=Zt.useRef(!1),v=Zt.useRef(""),E=Zt.useRef(null),H=tt(),P=tt(),N=tt(),T=te(()=>{P.clear(),m.current.insideReactTree=!1}),A=te((W)=>{let X=m.current.floatingContext?.nodeId;return(h?vo(h.nodesRef.current,X):[]).some((re)=>re.context?.open&&!re.context.dataRef.current[W])}),O=te((W)=>Js(W,e.select("floatingElement"))||Js(W,e.select("domReferenceElement"))),Z=te((W)=>{if(!s())return;e.setOpen(!1,ve(Us,W.nativeEvent))}),D=te((W)=>{if(!l||!o||!r||W.key!=="Escape")return;let X=Rf(W)?W.nativeEvent:W;if(R.current||X.isComposing)return;if(!C&&A("__escapeKeyBubbles"))return;let z=ve(tl,X);if(e.setOpen(!1,z),!z.isCanceled)W.preventDefault();if(!C&&!z.isPropagationAllowed)W.stopPropagation()}),B=te(()=>{m.current.insideReactTree=!0,P.start(0,T)}),Q=te((W)=>{if(!l||!o||W.button!==0)return;let X=at(W.nativeEvent);if(!pe(e.select("floatingElement"),X))return;if(!g.current)g.current=!0,S.current=!1}),ee=te((W)=>{if(!l||!o)return;if(!(W.defaultPrevented||W.nativeEvent.defaultPrevented))return;if(g.current)S.current=!0});Zt.useEffect(()=>{function W(X){if(!X.open)x.current=!1}return f.on("openchange",W),()=>{f.off("openchange",W)}},[f]),Zt.useEffect(()=>T,[T]),Zt.useEffect(()=>{if(!l||!o){if(!l)x.current=!1,R.current=!1,v.current="",E.current=null;return T}m.current.__escapeKeyBubbles=C,m.current.__outsidePressBubbles=b;let W=new co,X=Re(u);function z(){N.clear(),R.current=!0}function re(){R.current=!0,N.start(or.webkit?5:0,()=>{R.current=!1})}function Ce(){y.current=!0,W.start(0,()=>{y.current=!1})}function F(){g.current=!1,S.current=!1}function V(){let L=v.current,U=L==="pen"||!L?"mouse":L,xe=d(),oe=typeof xe==="function"?xe():xe;if(typeof oe==="string")return oe;return oe[U]}function Y(L){let U=V();return U==="intentional"&&L.type!=="click"||U==="sloppy"&&L.type==="click"}function le(L){let U=m.current.floatingContext?.nodeId,xe=h&&vo(h.nodesRef.current,U).some((oe)=>Js(L,oe.context?.elements.floating));return O(L)||xe}function j(L){if(Y(L)){if(L.type!=="click"&&!O(L))W.clear(),y.current=!1;T();return}if(m.current.insideReactTree){T();return}let U=at(L),xe=`[${$o("inert")}]`,oe=ke(U)?U.getRootNode():null,ie=Array.from((Lo(oe)?oe:Re(e.select("floatingElement"))).querySelectorAll(xe)),ue=e.context.triggerElements;if(U&&(ue.hasElement(U)||ue.hasMatchingElement((he)=>pe(he,U))))return;let me=ke(U)?U:null;while(me&&!xo(me)){let he=wo(me);if(xo(he)||!ke(he))break;me=he}if(ie.length&&ke(U)&&!yf(U)&&!pe(U,e.select("floatingElement"))&&ie.every((he)=>!pe(me,he)))return;if(Ve(U)&&!("touches"in L)){let he=xo(U),He=Ht(U),Xe=/auto|scroll/,st=he||Xe.test(He.overflowX),po=he||Xe.test(He.overflowY),ro=st&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,Ko=po&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,no=He.direction==="rtl",ao=Ko&&(no?L.offsetX<=U.offsetWidth-U.clientWidth:L.offsetX>U.clientWidth),go=ro&&L.offsetY>U.clientHeight;if(ao||go)return}if(le(L))return;if(V()==="intentional"){if(L.detail!==0&&!xr(L)&&!x.current)return;if(y.current){W.clear(),y.current=!1;return}}if(typeof w==="function"&&!w(L))return;if(A("__outsidePressBubbles"))return;e.setOpen(!1,ve(Qc,L)),T()}function _(L){if(V()!=="sloppy"||L.pointerType==="touch"||!e.select("open")||!o||O(L))return;j(L)}function ce(L){if(V()!=="sloppy"||!e.select("open")||!o||O(L))return;let U=L.touches[0];if(U)E.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1000,()=>{if(E.current)E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1})}function ge(L,U){let xe=at(L);if(!xe)return;let oe=Ae(xe,L.type,()=>{U(L),oe()})}function Te(L){v.current="touch",ge(L,ce)}function Ue(L){if(H.clear(),L.type==="pointerdown"){if(L.button===0)x.current=!0;v.current=L.pointerType}if(L.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)return;ge(L,(U)=>{if(U.type==="pointerdown")_(U);else j(U)})}function ae(L){if(L.type==="pointercancel")x.current=!1;if(!g.current)return;let U=S.current;if(F(),V()!=="intentional")return;if(L.type==="pointercancel"){if(U)Ce();return}if(le(L))return;if(U){Ce();return}if(typeof w==="function"&&!w(L))return;W.clear(),y.current=!0,T()}function de(L){if(V()!=="sloppy"||!E.current||O(L))return;let U=L.touches[0];if(!U)return;let xe=Math.abs(U.clientX-E.current.startX),oe=Math.abs(U.clientY-E.current.startY),ie=Math.sqrt(xe*xe+oe*oe);if(ie>5)E.current.dismissOnTouchEnd=!0;if(ie>10)j(L),H.clear(),E.current=null}function ne(L){ge(L,de)}function Oe(L){if(V()!=="sloppy"||!E.current||O(L))return;if(E.current.dismissOnTouchEnd)j(L);H.clear(),E.current=null}function Be(L){ge(L,Oe)}let $e=_t(r&&_t(Ae(X,"keydown",D),Ae(X,"compositionstart",z),Ae(X,"compositionend",re)),I&&_t(Ae(X,"click",Ue,!0),Ae(X,"pointerdown",Ue,!0),Ae(X,"pointerup",ae,!0),Ae(X,"pointercancel",ae,!0),Ae(X,"mousedown",Ue,!0),Ae(X,"mouseup",ae,!0),Ae(X,"touchstart",Te,{capture:!0,passive:!0}),Ae(X,"touchmove",ne,{capture:!0,passive:!0}),Ae(X,"touchend",Be,{capture:!0,passive:!0})));return()=>{$e(),W.clear(),F(),y.current=!1}},[m,u,r,I,w,l,o,C,b,D,T,d,A,O,h,e,H,N]);let k=Zt.useMemo(()=>({onKeyDown:D,onPointerDown:Z,onClick:Z}),[D,Z]),se=Zt.useMemo(()=>({onKeyDown:D,onPointerDown:ee,onMouseDown:ee,onClickCapture:B,onMouseDownCapture(W){B(),Q(W)},onPointerDownCapture(W){B(),Q(W)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[D,B,Q,ee]);return Zt.useMemo(()=>o?{reference:k,floating:se,trigger:k}:{},[o,k,se])}function Aa(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=s;return t.useSyncedValue("floatingId",n),q(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:l};if(ke(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}import*as Xo from"react";var Ol=tr.mac&&or.webkit;function Nl(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=Xo.useRef(!1),i=Xo.useRef(null),c=Xo.useRef(!0),l=tt();Xo.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let f=je(m);function h(){let I=e.select("domReferenceElement");if(!e.select("open")&&Ve(I)&&I===Lt(Re(I)))s.current=!0,i.current=I}function p(){c.current=!0}function w(){c.current=!1}return _t(Ae(f,"blur",h),Ol&&Ae(f,"keydown",p,!0),Ol&&Ae(f,"pointerdown",w,!0))},[e,o]),Xo.useEffect(()=>{if(!o)return;function m(f){if(f.reason===Us||f.reason===tl){let h=e.select("domReferenceElement");if(ke(h))i.current=h,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let u=Xo.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(f){let h=f.currentTarget;if(s.current){if(i.current===h)return;m()}let p=at(f.nativeEvent);if(ke(p)){if(Ol&&!f.relatedTarget){if(!c.current&&!ar(p))return}else if(!vf(p))return}let w=wr(f.relatedTarget,e.context.triggerElements),{nativeEvent:I,currentTarget:d}=f;if(e.select("open")&&w||!r){e.setOpen(!0,ve(ta,I,d));return}l.start(r,()=>{if(s.current)return;e.setOpen(!0,ve(ta,I,d))})},onBlur(f){m();let{relatedTarget:h,nativeEvent:p}=f,w=ke(h)&&h.hasAttribute($o("focus-guard"))&&h.getAttribute("data-type")==="outside";l.start(0,()=>{let I=e.select("domReferenceElement"),d=Lt(Re(I));if(!h&&d===I)return;if(pe(a.current.floatingContext?.refs.floating.current,d)||pe(I,d)||w)return;if(wr(h??d,e.context.triggerElements))return;e.setOpen(!1,ve(ta,p))})}}},[a,r,e,l]);return Xo.useMemo(()=>o?{reference:u,trigger:u}:{},[o,u])}import*as Vl from"react";class Bl{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new co;restTimeout=new co;handleCloseOptions=void 0;static create(){return new Bl}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var mi=new WeakMap;function An(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&mi.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),mi.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function fi(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=mi.get(o);if(a&&a!==e)An(a);An(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,mi.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function pi(e){let t=e.context.dataRef.current,o=Ze(()=>t.hoverInteractionState??Bl.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return wn(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function XI(e,t){if(t!=null&&!sr(t))return 0;if(typeof e==="function")return e();return e}function Pa(e,t,o){let r=XI(e,o);if(typeof r==="number")return r;return r?.[t]}function Hl(e){if(typeof e==="function")return e();return e}function di(e,t){return t||e==="click"||e==="mousedown"}function lp(e){return e?.includes("mouse")&&e!=="mousedown"}function Ul(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,l=zt(),u=mo(),m=pi(e),f=tt(),h=te(()=>di(c.current.openEvent?.type,m.interactedInside)),p=te(()=>lp(c.current.openEvent?.type)),w=te(()=>{An(m)});q(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w()},[a,m,w]),Vl.useEffect(()=>w,[w]),q(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&p()&&ke(i)&&s){let I=i,d=s,C=Re(s),b=l?.nodesRef.current.find((x)=>x.id===u)?.context?.elements.floating;if(b)b.style.pointerEvents="";let g=m.pointerEventsScopeElement!==d?m.pointerEventsScopeElement:null,S=b!==d?b:null,y=m.handleCloseOptions?.getScope?.()??g??S??qr(I,"[data-rootownerid]")??C.body;return fi(m,{scopeElement:y,referenceElement:I,floatingElement:d}),()=>{w()}}return},[o,a,i,s,m,p,l,u,w]),Vl.useEffect(()=>{if(!o)return;function I(){return!!(l&&u&&vo(l.nodesRef.current,u).length>0)}function d(x){let R=Pa(r,"close",m.pointerType),v=()=>{e.setOpen(!1,ve(Kt,x)),l?.events.emit("floating.closed",x)};if(R)m.openChangeTimeout.start(R,v);else m.openChangeTimeout.clear(),v()}function C(x){let R=at(x);if(!hl(R)){m.interactedInside=!1;return}m.interactedInside=qr(R,"[aria-haspopup]")!=null}function b(){m.openChangeTimeout.clear(),f.clear(),l?.events.off("floating.closed",S),w()}function g(x){if(I()&&l){l.events.on("floating.closed",S);return}if(wr(x.relatedTarget,e.context.triggerElements))return;let R=c.current.floatingContext?.nodeId??n,v=x.relatedTarget;if(l&&R&&ke(v)&&vo(l.nodesRef.current,R,!1).some((H)=>pe(H.context?.elements.floating,v)))return;if(m.handler){m.handler(x);return}if(w(),p()&&!h())d(x)}function S(x){if(!l||!u||I())return;f.start(0,()=>{l.events.off("floating.closed",S),e.setOpen(!1,ve(Kt,x)),l.events.emit("floating.closed",x)})}let y=s;return _t(y&&Ae(y,"mouseenter",b),y&&Ae(y,"mouseleave",g),y&&Ae(y,"pointerdown",C,!0),()=>{l?.events.off("floating.closed",S)})},[o,s,e,c,r,n,p,h,w,m,l,u,f])}import*as Ar from"react";import*as up from"react-dom";var KI={current:null};function Wl(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=KI,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:m,isClosing:f,shouldOpen:h,guardStaleOpen:p=!1}=t,{dataRef:w,events:I}=e.context,d=zt(l),C=pi(e),b=Ar.useRef(!1),g=nt(n),S=nt(r),y=nt(s),x=nt(o),R=nt(h),v=nt(f),E=te(()=>di(w.current.openEvent?.type,C.interactedInside)),H=te(()=>R.current?.()!==!1),P=te((A,O,Z)=>{let D=e.context.triggerElements;if(D.hasElement(O))return!A||!pe(A,O);if(!ke(Z))return!1;let B=Z;return D.hasMatchingElement((Q)=>pe(Q,B))&&(!A||!pe(A,B))}),N=te(()=>{if(!C.handler)return;Re(e.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),T=te(()=>{An(C)});if(u)C.handleCloseOptions=n?.__options;return Ar.useEffect(()=>N,[N]),Ar.useEffect(()=>{if(!o)return;function A(O){if(!O.open)b.current=O.reason===Kt,N(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1;else b.current=!1}return I.on("openchange",A),()=>{I.off("openchange",A)}},[o,I,C,N]),Ar.useEffect(()=>{if(!o)return;function A(ee,k=!0){let se=Pa(S.current,"close",C.pointerType);if(se)C.openChangeTimeout.start(se,()=>{e.setOpen(!1,ve(Kt,ee)),d?.events.emit("floating.closed",ee)});else if(k)C.openChangeTimeout.clear(),e.setOpen(!1,ve(Kt,ee)),d?.events.emit("floating.closed",ee)}let O=c.current??(u?e.select("domReferenceElement"):null);if(!ke(O))return;function Z(ee){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!sr(C.pointerType))return;let k=Hl(y.current),se=Pa(S.current,"open",C.pointerType),W=at(ee),X=ee.currentTarget??null,z=e.select("domReferenceElement"),re=X;if(ke(W)&&!e.context.triggerElements.hasElement(W)){for(let ge of e.context.triggerElements.elements())if(pe(ge,W)){re=ge;break}}if(ke(X)&&ke(z)&&!e.context.triggerElements.hasElement(X)&&pe(X,z))re=z;let Ce=re==null?!1:P(z,re,W),F=e.select("open"),V=v.current?.()??e.select("transitionStatus")==="ending",Y=!F&&V&&b.current,le=!Ce&&ke(re)&&ke(z)&&pe(z,re)&&Y,j=k>0&&!se,_=Ce&&(F||Y)||le,ce=!F||Ce;if(_){if(H())e.setOpen(!0,ve(Kt,ee,re));return}if(j)return;if(se)C.openChangeTimeout.start(se,()=>{if(ce&&H())e.setOpen(!0,ve(Kt,ee,re))});else if(ce){if(H())e.setOpen(!0,ve(Kt,ee,re))}}function D(ee){if(E()){T();return}N();let k=e.select("domReferenceElement"),se=Re(k);C.restTimeout.clear(),C.restTimeoutPending=!1;let W=w.current.floatingContext??m?.();if(wr(ee.relatedTarget,e.context.triggerElements))return;if(g.current&&W){if(!e.select("open"))C.openChangeTimeout.clear();let z=c.current;C.handler=g.current({...W,tree:d,x:ee.clientX,y:ee.clientY,onClose(){if(T(),N(),x.current&&!E()&&z===e.select("domReferenceElement"))A(ee,!0)}}),se.addEventListener("mousemove",C.handler),C.handler(ee);return}if(C.pointerType==="touch"?!pe(e.select("floatingElement"),ee.relatedTarget):!0)A(ee)}function B(ee){if(pe(O,ee.relatedTarget))return;C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1}let Q=p?Ae(O,"mouseout",B):void 0;if(i)return _t(Ae(O,"mousemove",Z,{once:!0}),Ae(O,"mouseenter",Z),Ae(O,"mouseleave",D),Q);return _t(Ae(O,"mouseenter",Z),Ae(O,"mouseleave",D),Q)},[N,T,w,S,e,o,g,C,u,P,E,a,i,y,c,d,x,m,v,H,p]),Ar.useMemo(()=>{if(!o)return;function A(O){C.pointerType=O.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(O){let{nativeEvent:Z}=O,D=O.currentTarget,B=e.select("domReferenceElement"),Q=e.select("open"),ee=P(B,D,O.target);if(a&&!sr(C.pointerType))return;if(Q&&ee&&C.handleCloseOptions?.blockPointerEvents){let W=e.select("floatingElement");if(W){let X=C.handleCloseOptions?.getScope?.()??D.ownerDocument.body;fi(C,{scopeElement:X,referenceElement:D,floatingElement:W})}}let k=Hl(y.current);if(Q&&!ee||k===0)return;if(!ee&&C.restTimeoutPending&&O.movementX**2+O.movementY**2<2)return;C.restTimeout.clear();function se(){if(C.restTimeoutPending=!1,E())return;let W=e.select("open");if(!C.blockMouseMove&&(!W||ee)&&H())e.setOpen(!0,ve(Kt,Z,D))}if(C.pointerType==="touch")up.flushSync(()=>{se()});else if(ee&&Q)se();else C.restTimeoutPending=!0,C.restTimeout.start(k,se)}}},[o,C,E,P,a,e,y,H])}import*as Ut from"react";function mp(e){return or.webkit&&e.movementX===0&&e.movementY===0}function hi(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function gi(e,t){return hi(t,e===dl||e===Ys,e===ia||e===ca)}function Gl(e,t,o){return hi(t,e===Ys,o?e===ia:e===ca)||e==="Enter"||e===" "||e===""}function YI(e,t,o){return hi(t,o?e===ia:e===ca,e===Ys)}function JI(e,t,o,r){let n=o?e===ca:e===ia,a=e===dl;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return hi(t,n,a)}function _l(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:m=!1,focusItemOnOpen:f="auto",focusItemOnHover:h=!0,openOnArrowKeyDown:p=!0,disabledIndices:w=void 0,orientation:I="vertical",triggerOrientation:d=I,parentOrientation:C,id:b,resetOnPointerLeave:g=!0,externalTree:S,nestedReturnFocusRef:y,grid:x}=t,R=x!=null,v=e.useState("open"),E=e.useState("floatingElement"),H=e.useState("domReferenceElement"),P=e.context.dataRef,N=ua(E),T=la(H),A=nt(N),O=mo(),Z=zt(S),D=Ut.useRef(f),B=Ut.useRef(s??-1),Q=Ut.useRef(null),ee=Ut.useRef(!0),k=te((L)=>{n(B.current===-1?null:B.current,L)}),se=Ut.useRef(!!E),W=Ut.useRef(v),X=Ut.useRef(!1),z=Ut.useRef(!1),re=Ut.useRef(null),Ce=nt(w),F=nt(v),V=nt(s),Y=nt(g),le=rr(),j=rr(),_=te(()=>{le.cancel();function L(ie){if(!m)re.current=Rn(ie,{sync:X.current,preventScroll:!0})}let U=o.current[B.current],xe=z.current;if(U)L(U);(X.current?(ie)=>ie():(ie)=>le.request(ie))(()=>{let ie=o.current[B.current]||U;if(!ie)return;if(!U)L(ie);if(de&&(xe||!ee.current))ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{P.current.orientation=I},[P,I]),q(()=>{if(!v)Q.current=null;if(!v||f!=="auto")D.current=f},[v,f]),q(()=>{if(!a)return;if(v&&E){if(B.current=s??-1,D.current&&s!=null)z.current=!0,k()}else if(se.current)B.current=-1,k()},[a,v,E,s,k]),q(()=>{if(!a)return;if(!v){X.current=!1;return}if(!E)return;if(r==null){if(X.current=!1,V.current!=null)return;if(se.current)B.current=-1,_();if((!W.current||!se.current)&&D.current&&(Q.current!=null||D.current===!0&&Q.current==null)){let L=0,U=()=>{if(o.current[0]==null){if(L<2)(L?(oe)=>j.request(oe):queueMicrotask)(U);L+=1}else B.current=Q.current==null||Gl(Q.current,d,u)||l?ni(o):Il(o),Q.current=null,k()};U()}}else if(!ri(o.current,r))B.current=r,_(),z.current=!1},[a,v,E,r,V,l,o,d,u,k,_,j]),q(()=>{if(!a||E||!Z||m||!se.current)return;let L=Z.nodesRef.current,U=L.find((ie)=>ie.id===O)?.context?.elements.floating,xe=Lt(Re(H??U??null)),oe=L.some((ie)=>ie.context&&pe(ie.context.elements.floating,xe));if(U&&!oe&&ee.current)U.focus({preventScroll:!0})},[a,E,H,Z,O,m]),q(()=>{W.current=v,se.current=!!E});let ce=r!=null,ge=te((L)=>{if(!F.current)return;let U=o.current.indexOf(L.currentTarget);if(U!==-1&&(B.current!==U||r!==U))B.current=U,k(L)}),Te=te(()=>C??Z?.nodesRef.current.find((L)=>L.id===O)?.context?.dataRef?.current.orientation),Ue=te(()=>ni(o,Ce.current)),ae=te((L)=>{if(ee.current=!1,X.current=!0,L.which===229)return;if(!F.current&&L.currentTarget===A.current)return;if(l&&JI(L.key,I,u,R)){if(!gi(L.key,Te()))lo(L);e.setOpen(!1,ve(Ws,L.nativeEvent));let ie=y?.current??H;if(Ve(ie))ie.focus();return}if(r!=null&&r!==B.current&&!ri(o.current,r))B.current=r;let U=B.current,xe=ni(o,w),oe=Il(o,w);if(!T){if(L.key==="Home")lo(L),B.current=xe,k(L);if(L.key==="End")lo(L),B.current=oe,k(L)}if(x!=null){let ie=x(L,B.current,o,I,c,u,w,xe,oe);if(ie!=null&&ie!==B.current)B.current=ie,k(L);if(I==="both")return}if(gi(L.key,I)){lo(L);let ie=Lt(L.currentTarget.ownerDocument);if(v&&!m&&pe(L.currentTarget,ie)&&!o.current.some((he)=>he!=null&&pe(he,ie))){if(B.current=Gl(L.key,I,u)?xe:oe,k(L),r===B.current)_();return}let{index:ue,wrapped:me}=Lf(o.current,U,{decrement:!Gl(L.key,I,u),loopFocus:c,allowEscape:i,disabledIndices:w,minIndex:xe,maxIndex:oe});if(me)X.current=!1;B.current=ue,k(L)}}),de=Ut.useMemo(()=>({onFocus(U){X.current=!0,ge(U)},onClick({currentTarget:U}){if(!m)U.focus({preventScroll:!0})},onMouseMove(U){if(mp(U))return;if(X.current=!0,z.current=!1,h)ge(U)},onPointerLeave(U){if(!F.current||!ee.current||U.pointerType==="touch")return;X.current=!0;let xe=U.relatedTarget;if(!h||o.current.includes(xe))return;if(!Y.current)return;if(re.current?.(),re.current=null,B.current=-1,k(U),!m){let oe=A.current,ie=Lt(Re(oe));if(oe&&pe(oe,ie))oe.focus({preventScroll:!0})}}}),[ge,F,A,h,o,k,Y,m]),ne=Ut.useMemo(()=>m&&v&&ce&&{"aria-activedescendant":`${b}-${r}`},[m,v,ce,b,r]),Oe=Ut.useMemo(()=>({...!T?ne:{},onKeyDown(L){if(L.key==="Tab"&&L.shiftKey&&v&&!m){let U=at(L.nativeEvent);if(U&&!pe(A.current,U))return;lo(L);let xe=ve(Cn,L.nativeEvent);e.setOpen(!1,xe);let oe=y?.current??H;if(!xe.isCanceled&&Ve(oe))oe.focus();return}ae(L)},onPointerMove(L){if(mp(L))return;ee.current=!0}}),[ne,ae,A,T,e,v,m,H,y]),Be=Ut.useMemo(()=>{function L(oe){e.setOpen(!0,ve(Ws,oe.nativeEvent,oe.currentTarget))}function U(oe){if(f==="auto"&&xr(oe.nativeEvent))D.current=!m}function xe(oe){if(D.current=f,f==="auto"&&vn(oe.nativeEvent))D.current=!0}return{onKeyDown(oe){let ie=e.select("open");ee.current=!1;let ue=oe.key.startsWith("Arrow"),me=YI(oe.key,Te(),u),he=gi(oe.key,ie?I:d),He=(l?me:he)||oe.key==="Enter"||oe.key.trim()==="";if(m&&ie&&(!l||ar(oe.currentTarget)))return ae(oe);if(!ie&&!p&&ue)return;if(He){let Xe=gi(oe.key,Te());Q.current=l&&Xe?null:oe.key}if(l){if(me)if(lo(oe),ie){if(B.current=Ue(),k(oe),m)A.current?.focus()}else L(oe);return}if(he){if(V.current!=null)B.current=V.current;if(lo(oe),!ie&&p)L(oe);else ae(oe);if(ie)k(oe)}return},onFocus(oe){if(oe.target!==oe.currentTarget)return;if(e.select("open")&&!m)B.current=-1,k(oe)},onPointerDown:xe,onPointerEnter:xe,onMouseDown:U,onClick:U}},[ae,f,Ue,l,k,e,p,I,d,Te,u,V,m,A]),$e=Ut.useMemo(()=>({...ne,...Be}),[ne,Be]);return Ut.useMemo(()=>a?{reference:$e,floating:Oe,item:de,trigger:Be}:{},[a,$e,Oe,Be,de])}import*as Kr from"react";function zl(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,m=te(i),f=e.useState("open"),h=tt(),p=Kr.useRef(""),w=Kr.useRef(u??n??-1),I=Kr.useRef(null),d=te((g)=>{function S(T){return r?.current[T]}function y(T){let A=S(T);if(A&&!$r(A)||A?.matches(":disabled"))return!1;return s==null||!Cl(er,T,s)}function x(T,A,O=0){if(T.length===0)return-1;let Z=(O%T.length+T.length)%T.length,D=A.toLowerCase();for(let B=0;B<T.length;B+=1){let Q=(Z+B)%T.length;if(!T[Q]?.toLowerCase().startsWith(D)||!y(Q))continue;return Q}return-1}let R=o.current;if(p.current.length>0&&g.key===" ")lo(g),m?.(!0);if(p.current.length>0&&p.current[0]!==" "){if(x(R,p.current)===-1&&g.key!==" ")m?.(!1)}if(R==null||g.key.length!==1||g.ctrlKey||g.metaKey||g.altKey)return;if(f&&g.key!==" ")lo(g),m?.(!0);let v=p.current==="";if(v)w.current=u??n??-1;if(R.every((T,A)=>T&&y(A)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&p.current===g.key)p.current="",w.current=I.current;p.current+=g.key,h.start(l,()=>{p.current="",w.current=I.current,m?.(!1)});let P=((v?u??n??-1:w.current)??0)+1,N=x(R,p.current,P);if(N!==-1)a?.(N,g),I.current=N;else if(g.key!==" ")p.current="",m?.(!1)}),C=te((g)=>{let S=g.relatedTarget,y=e.select("domReferenceElement"),x=e.select("floatingElement");if(pe(y,S)||pe(x,S))return;h.clear(),p.current="",w.current=I.current,m?.(!1)});q(()=>{if(!f&&u!==null)return;if(h.clear(),I.current=null,p.current!=="")p.current="",m?.(!1)},[f,u,h,m]);let b=Kr.useMemo(()=>({onKeyDown:d,onBlur:C}),[d,C]);return Kr.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var fp=0.1,QI=fp*fp,Ye=0.5;function Ii(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function bi(e,t,o,r,n,a,s,i,c,l){let u=!1;if(Ii(e,t,o,r,n,a))u=!u;if(Ii(e,t,n,a,s,i))u=!u;if(Ii(e,t,s,i,c,l))u=!u;if(Ii(e,t,c,l,o,r))u=!u;return u}function e1(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Ci(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),l=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=l}function Zl(e={}){let{blockPointerEvents:t=!1}=e,o=new co,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:l,tree:u})=>{let m=s?.split("-")[0],f=!1,h=null,p=null,w=typeof performance<"u"?performance.now():0;function I(C,b){let g=performance.now(),S=g-w;if(h===null||p===null||S===0)return h=C,p=b,w=g,!1;let y=C-h,x=b-p,R=y*y+x*x,v=S*S*QI;return h=C,p=b,w=g,R<v}function d(){o.clear(),c()}return function(b){o.clear();let{domReference:g,floating:S}=i;if(!g||!S||m==null||n==null||a==null)return;let{clientX:y,clientY:x}=b,R=at(b),v=b.type==="mouseleave",E=pe(S,R),H=pe(g,R);if(E){if(f=!0,!v)return}if(H){if(f=!1,!v){f=!0;return}}if(v&&ke(b.relatedTarget)&&pe(S,b.relatedTarget))return;function P(){return Boolean(u&&vo(u.nodesRef.current,l).length>0)}function N(){if(!P())d()}if(P())return;let T=g.getBoundingClientRect(),A=S.getBoundingClientRect(),O=n>A.right-A.width/2,Z=a>A.bottom-A.height/2,D=A.width>T.width,B=A.height>T.height,Q=(D?T:A).left,ee=(D?T:A).right,k=(B?T:A).top,se=(B?T:A).bottom;if(m==="top"&&a>=T.bottom-1||m==="bottom"&&a<=T.top+1||m==="left"&&n>=T.right-1||m==="right"&&n<=T.left+1){N();return}let W=!1;switch(m){case"top":W=Ci(y,x,Q,T.top+1,ee,A.bottom-1);break;case"bottom":W=Ci(y,x,Q,A.top+1,ee,T.bottom-1);break;case"left":W=Ci(y,x,A.right-1,se,T.left+1,k);break;case"right":W=Ci(y,x,T.right-1,se,A.left+1,k);break;default:}if(W)return;if(f&&!e1(y,x,T)){N();return}if(!v&&I(y,x)){N();return}let X=!1;switch(m){case"top":{let z=D?Ye/2:Ye*4,re=D?n+z:O?n+z:n-z,Ce=D?n-z:O?n+z:n-z,F=a+Ye+1,V=O?A.bottom-Ye:D?A.bottom-Ye:A.top,Y=O?D?A.bottom-Ye:A.top:A.bottom-Ye;X=bi(y,x,re,F,Ce,F,A.left,V,A.right,Y);break}case"bottom":{let z=D?Ye/2:Ye*4,re=D?n+z:O?n+z:n-z,Ce=D?n-z:O?n+z:n-z,F=a-Ye,V=O?A.top+Ye:D?A.top+Ye:A.bottom,Y=O?D?A.top+Ye:A.bottom:A.top+Ye;X=bi(y,x,re,F,Ce,F,A.left,V,A.right,Y);break}case"left":{let z=B?Ye/2:Ye*4,re=B?a+z:Z?a+z:a-z,Ce=B?a-z:Z?a+z:a-z,F=n+Ye+1,V=Z?A.right-Ye:B?A.right-Ye:A.left,Y=Z?B?A.right-Ye:A.left:A.right-Ye;X=bi(y,x,V,A.top,Y,A.bottom,F,re,F,Ce);break}case"right":{let z=B?Ye/2:Ye*4,re=B?a+z:Z?a+z:a-z,Ce=B?a-z:Z?a+z:a-z,F=n-Ye,V=Z?A.left+Ye:B?A.left+Ye:A.right,Y=Z?B?A.left+Ye:A.right:A.left+Ye;X=bi(y,x,F,re,F,Ce,V,A.top,Y,A.bottom);break}default:}if(!X)N();else if(!f)o.start(40,N);return}};return r.__options={...e,blockPointerEvents:t},r}function pp(e,t,o){let{reference:r,floating:n}=e,a=to(t),s=ga(t),i=da(s),c=Jt(t),l=a==="y",u=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,f=r[i]/2-n[i]/2,h;switch(c){case"top":h={x:u,y:r.y-n.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:m};break;case"left":h={x:r.x-n.width,y:m};break;default:h={x:r.x,y:r.y}}let p=uo(t);if(p)h[s]+=f*(p==="end"?1:-1)*(o&&l?-1:1);return h}async function dp(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:f=!1,padding:h=0}=jo(t,e),p=oi(h),I=i[f?m==="floating"?"reference":"floating":m],d=jr(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:l,rootBoundary:u,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)),g=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=jr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:b,strategy:c}):C);return{top:(d.top-S.top+p.top)/g.y,bottom:(S.bottom-d.bottom+p.bottom)/g.y,left:(d.left-S.left+p.left)/g.x,right:(S.right-d.right+p.right)/g.x}}var t1=50,gp=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:dp},c=await(s.isRTL==null?void 0:s.isRTL(t)),l=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:m}=pp(l,r,c),f=r,h=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:g,data:S,reset:y}=await C({x:u,y:m,initialPlacement:r,placement:f,strategy:n,middlewareData:p,rects:l,platform:i,elements:{reference:e,floating:t}});if(u=b!=null?b:u,m=g!=null?g:m,p[d]={...p[d],...S},y&&h<t1){if(h++,typeof y==="object"){if(y.placement)f=y.placement;if(y.rects)l=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:u,y:m}=pp(l,f,c))}w=-1}}return{x:u,y:m,placement:f,strategy:n,middlewareData:p}};var hp=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:l}=t,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...I}=jo(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let d=Jt(n),C=to(i),b=Jt(i)===i,g=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(b||!w?[ma(i)]:Mf(i)),y=p!=="none";if(!f&&y)S.push(...kf(i,w,p,g));let x=[i,...S],R=await c.detectOverflow(t,I),v=[],E=((r=a.flip)==null?void 0:r.overflows)||[];if(u)v.push(R[d]);if(m){let T=Tf(n,s,g);v.push(R[T[0]],R[T[1]])}if(E=[...E,{placement:n,overflows:v}],!v.every((T)=>T<=0)){var H,P;let T=(((H=a.flip)==null?void 0:H.index)||0)+1,A=x[T];if(A){if(!(m==="alignment"?C!==to(A):!1)||E.every((D)=>to(D.placement)===C?D.overflows[0]>0:!0))return{data:{index:T,overflows:E},reset:{placement:A}}}let O=(P=E.filter((Z)=>Z.overflows[0]<=0).sort((Z,D)=>Z.overflows[1]-D.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(h){case"bestFit":{var N;let Z=(N=E.filter((D)=>{if(y){let B=to(D.placement);return B===C||B==="y"}return!0}).map((D)=>[D.placement,D.overflows.filter((B)=>B>0).reduce((B,Q)=>B+Q,0)]).sort((D,B)=>D[1]-B[1])[0])==null?void 0:N[0];if(Z)O=Z;break}case"initialPlacement":O=i;break}if(n!==O)return{reset:{placement:O}}}return{}}}};var Ip=new Set(["left","top"]);async function o1(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=Jt(o),i=uo(o),c=to(o)==="y",l=Ip.has(s)?-1:1,u=a&&c?-1:1,m=jo(t,e),{mainAxis:f,crossAxis:h,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")h=i==="end"?p*-1:p;return c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}var bp=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 o1(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}}}}},Cp=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:g}=C;return{x:b,y:g}}},...l}=jo(e,t),u={x:o,y:r},m=await a.detectOverflow(t,l),f=to(n),h=ti(f),p=u[h],w=u[f],I=(C,b)=>ei(b+m[C==="y"?"top":"left"],b,b-m[C==="y"?"bottom":"right"]);if(s)p=I(h,p);if(i)w=I(f,w);let d=c.fn({...t,[h]:p,[f]:w});return{...d,data:{x:d.x-o,y:d.y-r,enabled:{[h]:s,[f]:i}}}}}},Sp=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:l=0,mainAxis:u=!0,crossAxis:m=!0}=jo(e,t),f={x:n,y:a},h=to(s),p=ti(h),w=f[p],I=f[h],d=jo(l,t),C=typeof d==="number"?{mainAxis:d,crossAxis:0}:{mainAxis:(o=d.mainAxis)!=null?o:0,crossAxis:(r=d.crossAxis)!=null?r:0};if(u){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,g;let S=p==="y"?"width":"height",y=Ip.has(Jt(s)),x=i.reference[h]-i.floating[S]+(y?((b=c.offset)==null?void 0:b[h])||0:0)+(y?0:C.crossAxis),R=i.reference[h]+i.reference[S]+(y?0:((g=c.offset)==null?void 0:g[h])||0)-(y?C.crossAxis:0);if(I<x)I=x;else if(I>R)I=R}return{[p]:w,[h]:I}}}},wp=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}=jo(e,t),c=await n.detectOverflow(t,i),l=Jt(o),u=uo(o),m=to(o)==="y",{width:f,height:h}=r.floating,p,w;if(l==="top"||l==="bottom")p=l,w=u===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else w=l,p=u==="end"?"top":"bottom";let I=h-c.top-c.bottom,d=f-c.left-c.right,C=yr(h-c[p],I),b=yr(f-c[w],d),g=t.middlewareData.shift,S=!g,y=C,x=b;if(g!=null&&g.enabled.x)x=d;if(g!=null&&g.enabled.y)y=I;if(S&&!u)if(m)x=f-2*Oo(c.left,c.right);else y=h-2*Oo(c.top,c.bottom);await s({...t,availableWidth:x,availableHeight:y});let R=await n.getDimensions(a.floating);if(f!==R.width||h!==R.height)return{reset:{rects:!0}};return{}}}};function vp(e){let t=Ht(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=Ve(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=fa(o)!==a||fa(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function jl(e){return!ke(e)?e.contextElement:e}function Pn(e){let t=jl(e);if(!Ve(t))return qo(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=vp(t),s=(a?fa(o.width):o.width)/r,i=(a?fa(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 r1=qo(0);function Rp(e){let t=je(e);if(!Es()||!t.visualViewport)return r1;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function n1(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===je(e)}function Yr(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=jl(e),s=qo(1);if(t)if(r){if(ke(r))s=Pn(r)}else s=Pn(e);let i=n1(a,o,r)?Rp(a):qo(0),c=(n.left+i.x)/s.x,l=(n.top+i.y)/s.y,u=n.width/s.x,m=n.height/s.y;if(a&&r){let f=je(a),h=ke(r)?je(r):r,p=f,w=Ts(p);while(w&&h!==p){let I=Pn(w),d=w.getBoundingClientRect(),C=Ht(w),b=d.left+(w.clientLeft+parseFloat(C.paddingLeft))*I.x,g=d.top+(w.clientTop+parseFloat(C.paddingTop))*I.y;c*=I.x,l*=I.y,u*=I.x,m*=I.y,c+=b,l+=g,p=je(w),w=Ts(p)}}return jr({width:u,height:m,x:c,y:l})}function Si(e,t){let o=qn(e).scrollLeft;if(!t)return Yr(Zo(e)).left+o;return t.left+o}function Ap(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Si(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function a1(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=Zo(r),i=t?Zn(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},l=qo(1),u=qo(0),m=Ve(r);if(m||!a){if(wt(r)!=="body"||Gr(s))c=qn(r);if(m){let h=Yr(r);l=Pn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}}let f=s&&!m&&!a?Ap(s,c):qo(0);return{width:o.width*l.x,height:o.height*l.y,x:o.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:o.y*l.y-c.scrollTop*l.y+u.y+f.y}}function s1(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function i1(e){let t=qn(e),o=e.ownerDocument.body,r=Oo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=Oo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Si(e),s=-t.scrollTop;if(Ht(o).direction==="rtl")a+=Oo(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var c1=25;function l1(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=je(e),a=Zo(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,l=0,u=0;if(s){let f=!Es()||t==="fixed";if(r){if(!f)l=-s.offsetLeft,u=-s.offsetTop}else if(i=s.width,c=s.height,f)l=s.offsetLeft,u=s.offsetTop}if(Si(a)<=0){let f=a.ownerDocument,h=f.body,p=getComputedStyle(h),w=f.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,I=Math.abs(a.clientWidth-h.clientWidth-w),d=getComputedStyle(a).scrollbarGutter==="stable both-edges"?I/2:I;if(d<=c1)i-=d}return{width:i,height:c,x:l,y:u}}function u1(e,t){let o=Yr(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=Pn(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,l=r*a.y;return{width:s,height:i,x:c,y:l}}function xp(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=l1(e,o,t);else if(t==="document")r=i1(Zo(e));else if(ke(t))r=u1(t,o);else{let n=Rp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jr(r)}function m1(e,t){let o=t.get(e);if(o)return o;let r=br(e,[],!1).filter((i)=>ke(i)&&wt(i)!=="body"),n=null,a=Ht(e).position==="fixed",s=a?wo(e):e;while(ke(s)&&!xo(s)){let i=Ht(s),c=Ps(s),l=n?n.position:a?"fixed":"";if(!c&&(l==="fixed"||l==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=wo(s)}return t.set(e,r),r}function f1(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?Zn(t)?[]:m1(t,this._c):[].concat(o),r],i=xp(t,s[0],n),{top:c,right:l,bottom:u,left:m}=i;for(let f=1;f<s.length;f++){let h=xp(t,s[f],n);c=Oo(h.top,c),l=yr(h.right,l),u=yr(h.bottom,u),m=Oo(h.left,m)}return{width:l-m,height:u-c,x:m,y:c}}function p1(e){let{width:t,height:o}=vp(e);return{width:t,height:o}}function d1(e,t,o){let r=Ve(t),n=Zo(t),a=o==="fixed",s=Yr(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=qo(0);if(r||!a){if(wt(t)!=="body"||Gr(n))i=qn(t);if(r){let f=Yr(t,!0,a,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}}if(!r&&n)c.x=Si(n);let l=n&&!r&&!a?Ap(n,i):qo(0),u=s.left+i.scrollLeft-c.x-l.x,m=s.top+i.scrollTop-c.y-l.y;return{x:u,y:m,width:s.width,height:s.height}}function ql(e){return Ht(e).position==="static"}function yp(e,t){if(!Ve(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(Zo(e)===o)o=o.ownerDocument.body;return o}function Pp(e,t){let o=je(e);if(Zn(e))return o;if(!Ve(e)){let n=wo(e);while(n&&!xo(n)){if(ke(n)&&!ql(n))return n;n=wo(n)}return o}let r=yp(e,t);while(r&&Um(r)&&ql(r))r=yp(r,t);if(r&&xo(r)&&ql(r)&&!Ps(r))return o;return r||Wm(e)||o}var g1=async function(e){let t=this.getOffsetParent||Pp,o=this.getDimensions,r=await o(e.floating);return{reference:d1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function h1(e){return Ht(e).direction==="rtl"}var $l={convertOffsetParentRelativeRectToViewportRelativeRect:a1,getDocumentElement:Zo,getClippingRect:f1,getOffsetParent:Pp,getElementRects:g1,getClientRects:s1,getDimensions:p1,getScale:Pn,isElement:ke,isRTL:h1};function Ep(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function I1(e,t,o){let r=null,n,a=Zo(e);function s(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function i(u,m){if(u===void 0)u=!1;if(m===void 0)m=1;s();let f=e.getBoundingClientRect(),{left:h,top:p,width:w,height:I}=f;if(!u)t();if(!w||!I)return;let d=pa(p),C=pa(a.clientWidth-(h+w)),b=pa(a.clientHeight-(p+I)),g=pa(h),y={rootMargin:-d+"px "+-C+"px "+-b+"px "+-g+"px",threshold:Oo(0,yr(1,m))||1},x=!0;function R(v){let E=v[0].intersectionRatio;if(!Ep(f,e.getBoundingClientRect()))return i();if(E!==m){if(!x)return i();if(!E)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,E)}x=!1}try{r=new IntersectionObserver(R,{...y,root:a.ownerDocument})}catch(v){r=new IntersectionObserver(R,y)}r.observe(e)}let c=je(e),l=()=>i(o);return c.addEventListener("resize",l),i(!0),()=>{c.removeEventListener("resize",l),s()}}function Ea(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,l=jl(e),u=n||a?[...l?br(l):[],...t?br(t):[]]:[];u.forEach((d)=>{n&&d.addEventListener("scroll",o),a&&d.addEventListener("resize",o)});let m=l&&i?I1(l,o,a):null,f=-1,h=null;if(s){if(h=new ResizeObserver((d)=>{let[C]=d;if(C&&C.target===l&&h&&t)h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)});o()}),l&&!c)h.observe(l);if(t)h.observe(t)}let p,w=c?Yr(e):null;if(c)I();function I(){let d=Yr(e);if(w&&!Ep(w,d))o();w=d,p=requestAnimationFrame(I)}return o(),()=>{var d;if(u.forEach((C)=>{n&&C.removeEventListener("scroll",o),a&&C.removeEventListener("resize",o)}),m==null||m(),(d=h)==null||d.disconnect(),h=null,c)cancelAnimationFrame(p)}}var Tp=bp;var Mp=Cp,kp=hp,Lp=wp;var Dp=Sp,wi=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...$l,...n.platform,_c:r};return gp(e,t,{...n,platform:a})};import*as Et from"react";import{useLayoutEffect as C1}from"react";import*as Op from"react-dom";var S1=typeof document<"u",w1=function(){},xi=S1?C1:w1;function yi(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(!yi(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(!yi(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Np(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fp(e,t){let o=Np(e);return Math.round(t*o)/o}function Xl(e){let t=Et.useRef(e);return xi(()=>{t.current=e}),t}function Bp(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:l}=e,[u,m]=Et.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=Et.useState(r);if(!yi(f,r))h(r);let[p,w]=Et.useState(null),[I,d]=Et.useState(null),C=Et.useCallback((D)=>{if(D!==y.current)y.current=D,w(D)},[]),b=Et.useCallback((D)=>{if(D!==x.current)x.current=D,d(D)},[]),g=a||p,S=s||I,y=Et.useRef(null),x=Et.useRef(null),R=Et.useRef(u),v=c!=null,E=Xl(c),H=Xl(n),P=Xl(l),N=Et.useCallback(()=>{if(!y.current||!x.current)return;let D={placement:t,strategy:o,middleware:f};if(H.current)D.platform=H.current;wi(y.current,x.current,D).then((B)=>{let Q={...B,isPositioned:P.current!==!1};if(T.current&&!yi(R.current,Q))R.current=Q,Op.flushSync(()=>{m(Q)})})},[f,t,o,H,P]);xi(()=>{if(l===!1&&R.current.isPositioned)R.current.isPositioned=!1,m((D)=>({...D,isPositioned:!1}))},[l]);let T=Et.useRef(!1);xi(()=>(T.current=!0,()=>{T.current=!1}),[]),xi(()=>{if(g)y.current=g;if(S)x.current=S;if(g&&S){if(E.current)return E.current(g,S,N);N()}},[g,S,N,E,v]);let A=Et.useMemo(()=>({reference:y,floating:x,setReference:C,setFloating:b}),[C,b]),O=Et.useMemo(()=>({reference:g,floating:S}),[g,S]),Z=Et.useMemo(()=>{let D={position:o,left:0,top:0};if(!O.floating)return D;let B=Fp(O.floating,u.x),Q=Fp(O.floating,u.y);if(i)return{...D,transform:"translate("+B+"px, "+Q+"px)",...Np(O.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:B,top:Q}},[o,i,O.floating,u.x,u.y]);return Et.useMemo(()=>({...u,update:N,refs:A,elements:O,floatingStyles:Z}),[u,N,A,O,Z])}var Kl=(e,t)=>{let o=Tp(e);return{name:o.name,fn:o.fn,options:[e,t]}},Yl=(e,t)=>{let o=Mp(e);return{name:o.name,fn:o.fn,options:[e,t]}},Jl=(e,t)=>({fn:Dp(e).fn,options:[e,t]}),Ql=(e,t)=>{let o=kp(e);return{name:o.name,fn:o.fn,options:[e,t]}},eu=(e,t)=>{let o=Lp(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as vi from"react";var x1=vi.createContext(void 0);function Hp(e){let t=vi.useContext(x1);if(t===void 0&&!e)throw Error(rt(69));return t}var y1="ArrowUp",v1="ArrowDown",R1="ArrowLeft",A1="ArrowRight",P1="Home",E1="End";var Ri=new Set([y1,v1,R1,A1,P1,E1]);function Ai(e){return e==="starting"?$f:Fe}import*as Pi from"react";var T1=Pi.createContext(void 0);function Vp(){return Pi.useContext(T1)}import*as Ei from"react";function M1(e,t){let o=zn(e.render);if(Ei.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function Up(e,t,o){let r=M1(e,t),n=r===t?void 0:r,a=Ei.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as Wp from"react";function Gp(e,t,o){let r=zn(e.render),n=Wp.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 _p}from"react/jsx-runtime";var k1=Jr.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...l}=t,{store:u,defaultFloatingId:m,setRenderedFloatingId:f,virtualFocus:h,orientation:p}=eo(),w=Vp(),{side:I,align:d}=$m(),C=Hp(!0)!=null,b=u.useState("open"),g=u.useState("transitionStatus"),S=u.useState("popupProps"),y=u.useState("mounted"),x=u.useState("instantType"),R=u.useState("activeTriggerElement"),v=u.useState("parent"),E=u.useState("lastOpenChangeReason"),H=u.useState("rootId"),P=u.useState("floatingRootContext"),N=u.useState("floatingTreeRoot"),T=u.useState("closeDelay"),A=u.useState("hoverEnabled"),O=u.useState("disabled"),Z=u.useState("openMethod"),D=u.useState("activeTriggerId"),B=u.useState("listElement"),[Q,ee]=Up(t,m,f),k=Gp(t,R,D),se=v.type==="menu"?w:void 0,W=v.type==="context-menu",X=c??v.type!=="menu";if(c===void 0&&B&&v.type!=="menu")X=()=>{if(u.state.activeIndex!==null)return!1;return B};yn({open:b,ref:u.context.popupRef,onComplete(){if(b)u.context.onOpenChangeComplete?.(!0)}}),Jr.useEffect(()=>{function _(ce){u.setOpen(!1,ve(ce.reason,ce.domEvent))}return N.events.on("close",_),()=>{N.events.off("close",_)}},[N.events,u]),Ul(P,{enabled:A&&!O&&!W&&v.type!=="menubar",closeDelay:T});let z=u.useStateSetter("popupElement"),re=Jr.useContext(ol)?.useParentHandoff??D1,{parentVirtualFocusRef:Ce,handleFocus:F}=re(u,v,b,h),V={transitionStatus:g,side:I,align:d,open:b,nested:v.type==="menu",instant:x},Y=_e("div",t,{state:V,ref:[o,u.context.popupRef,z,ee],stateAttributesMapping:Hs,props:[S,{id:Q,...B?{role:"presentation"}:{role:"menu","aria-orientation":p==="horizontal"?"horizontal":void 0,"aria-labelledby":k},onKeyDown(_){if(se?.onPopupKeyDown?.(_),C&&Ri.has(_.key))_.stopPropagation()},onFocus:F},Ai(g),l,{"data-rootownerid":H}]}),le=v.type===void 0||W;if(R||v.type==="menubar"&&E!==Qc)le=!0;let j=se?.getReturnElement??Ce;return _p(xa,{context:P,openInteractionType:Z,modal:W,disabled:!y,returnFocus:s??j??le,explicitReturnFocus:s===void 0&&j?!1:void 0,initialFocus:X,restoreFocus:!0,getInsideElements:v.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:v.type!=="menubar"?N:void 0,previousFocusableElement:R,nextFocusableElement:v.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:Y})}),L1={parentVirtualFocusRef:void 0,handleFocus:void 0};function D1(){return L1}var zp=Jr.forwardRef(function(t,o){let r=rl()?.Popup??k1;return _p(r,{...t,ref:o})});import*as jp from"react";import*as Ti from"react";var tu=Ti.createContext(void 0);function Zp(){let e=Ti.useContext(tu);if(e===void 0)throw Error(rt(32));return e}import{jsx as qp}from"react/jsx-runtime";var $p=jp.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=eo();if(!(a.useState("mounted")||r))return null;let l=s.type==="menu"||s.type==="menubar"?"group":void 0;return qp(tu.Provider,{value:r,children:qp(Sa,{ref:o,...n,portalOwnerRole:l})})});import*as Pr from"react";function Mi(e){if(mn(19))return e;return e?"true":void 0}import*as fo from"react";import*as Ro from"react";function Xp(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"),[l,u]=Ro.useState(null),m=Ro.useRef(null),f=zt(o),h=Ro.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),p=Bp({...e,elements:{...h,...l&&{reference:l}}}),w=Ro.useCallback((b)=>{let g=ke(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;u(g),p.refs.setReference(g)},[p.refs]),I=Ro.useMemo(()=>({...p.refs,setPositionReference:w,domReference:m}),[p.refs,w]),d=Ro.useMemo(()=>({...p.elements,domReference:s}),[p.elements,s]),C=Ro.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((g)=>g.id===t);if(b)b.context=C}),Ro.useMemo(()=>({...p,context:C,refs:I,elements:d,rootStore:r}),[p,I,d,C,r])}import*as ki from"react";var F1=ki.createContext(void 0);function Li(){return ki.useContext(F1)?.direction??"ltr"}var O1=(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:l,padding:u=0}=jo(e,t)||{};if(l==null)return{};let m=oi(u),f={x:o,y:r},h=ga(n),p=da(h),w=await s.getDimensions(l),I=h==="y",d=I?"top":"left",C=I?"bottom":"right",b=I?"clientHeight":"clientWidth",g=a.reference[p]+a.reference[h]-f[h]-a.floating[p],S=f[h]-a.reference[h],y=i.floating[b]||a.floating[p],x=g/2-S/2,R=y/2-w[p]/2-1,v=Math.min(m[d],R),E=Math.min(m[C],R),H=v,P=y-w[p]-E,N=y/2-w[p]/2+x,T=ei(H,N,P),A=!c.arrow&&uo(n)!=null&&N!==T&&a.reference[p]/2-(N<H?v:E)-w[p]/2<0,O=A?N<H?N-H:N-P:0;return{[h]:f[h]+O,data:{[h]:T,centerOffset:N-T-O,...A&&{alignmentOffset:O}},reset:A}}}),Kp=(e,t)=>{let{name:o,fn:r}=O1(e);return{name:o,fn:r,options:[e,t]}};var Yp={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 Jp={sideX:"left",sideY:"top"};var Qp="--available-width",ed="--available-height",td="--anchor-width",od="--anchor-height",rd="--transform-origin";var nd=Qp,ad=ed;function cd(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 sd(e,t,o){let{rects:r,placement:n}=e;return{side:cd(t,Jt(n),o),align:uo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ld(e){return B1(e,Xp)}function B1(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:m=5,disableAnchorTracking:f=!1,inline:h,keepMounted:p=!1,floatingRootContext:w,mounted:I,collisionAvoidance:d,shift:C,nodeId:b,adaptiveOrigin:g,lazyFlip:S=!1,externalTree:y}=e,x=d.side||"flip",R=d.align||"flip",v=d.fallbackAxisSide||"end",E=C?.crossAxis??!1,H=C?.rootBoundary,P=typeof o==="function"?o:void 0,N=te(P),T=P?N:o,A=nt(o),O=nt(I),D=Li()==="rtl",[B,Q]=fo.useState(null);if(!I&&B!==null)Q(null);let ee=S==="placement",k=B?Jt(B):null,se=B&&ee?uo(B)||"center":null,W=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":D?"left":"right","inline-start":D?"right":"left"}[n],X=se||s,z=X==="center"?W:`${W}-${X}`,re=l;if(typeof re==="number")re={top:re,right:re,bottom:re,left:re};else if(re)re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0};let Ce=1,F=n==="bottom"?Ce:0,V=n==="top"?Ce:0,Y=n==="right"?Ce:0,le=n==="left"?Ce:0,j={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:re},_=fo.useRef(null),ce=nt(a),ge=nt(i),Te=typeof a!=="function"?a:0,Ue=typeof i!=="function"?i:0,ae=[];if(h)ae.push(h);ae.push(Kl((Ne)=>{let At=sd(Ne,n,D),Ie=typeof ce.current==="function"?ce.current(At):ce.current,Se=typeof ge.current==="function"?ge.current(At):ge.current;return{mainAxis:Ie,crossAxis:Se,alignmentAxis:Se}},[Te,Ue,D,n]));let de=R==="none"&&x!=="shift",ne=!de&&(u||E||x==="shift"),Oe=x==="none"?null:Ql({...j,padding:{top:re.top+Ce+F,right:re.right+Ce+le,bottom:re.bottom+Ce+V,left:re.left+Ce+Y},mainAxis:!E&&x==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:v}),Be=de?null:Yl({...j,rootBoundary:H,mainAxis:R!=="none",crossAxis:ne,limiter:u||E?void 0:Jl((Ne)=>{if(!_.current)return{};let{width:At,height:Ie}=_.current.getBoundingClientRect(),Se=to(Jt(Ne.placement)),Le=Se==="y"?At:Ie,Pt=Se==="y"?re.left+re.right:re.top+re.bottom;return{offset:Le/2+Pt/2}})},[j,u,E,H,re,R]);if(x==="shift"||R==="shift"||X==="center")ae.push(Be,Oe);else ae.push(Oe,Be);ae.push(eu({...j,apply({elements:{floating:Ne},availableWidth:At,availableHeight:Ie,rects:Se}){if(!O.current)return;let Le=Ne.style;Le.setProperty(nd,`${At}px`),Le.setProperty(ad,`${Ie}px`);let Pt=je(Ne).devicePixelRatio||1,{x:Dt,y:Xt,width:Tt,height:so}=Se.reference,Po=(Math.round((Dt+Tt)*Pt)-Math.round(Dt*Pt))/Pt,ho=(Math.round((Xt+so)*Pt)-Math.round(Xt*Pt))/Pt;Le.setProperty(td,`${Po}px`),Le.setProperty(od,`${ho}px`)}}),Kp((Ne)=>({element:_.current||Re(Ne.elements.floating).createElement("div"),padding:_.current?m:0}),[m]),{name:"transformOrigin",fn(Ne){let{elements:{floating:At},middlewareData:Ie,placement:Se,platform:Le,rects:Pt,y:Dt}=Ne,Xt=Jt(Se),Tt=uo(Se),so=to(Xt)==="y",Po=_.current,ho=typeof a==="function"?a(sd(Ne,n,D)):a,nn;if(!Po&&Tt&&Math.abs(so?Ie.shift?.x||0:Ie.shift?.y||0)<=1)nn=Tt==="start"===(so&&Le.isRTL?.(At)===!0)?"100%":"0%";else{let Dr=so?Ie.arrow?.x||0:Ie.arrow?.y||0,Fr=so?Po?.clientWidth||0:Po?.clientHeight||0;nn=`${Dr+Fr/2}px`}let Ho=Xt==="top"||Xt==="left"?`calc(100% + ${ho}px)`:`${-ho}px`;if(ne&&so&&Math.abs(Ie.shift?.y||0)>ho)Ho=`${Pt.reference.y+Pt.reference.height/2-Dt}px`;return At.style.setProperty(rd,so?`${nn} ${Ho}`:`${Ho} ${nn}`),{}}},Yp,g),q(()=>{if(!I&&w)w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[I,w]);let $e=fo.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:L,elements:U,x:xe,y:oe,middlewareData:ie,update:ue,placement:me,context:he,isPositioned:He,floatingStyles:Xe}=t({rootContext:w,open:p?I:void 0,placement:z,middleware:ae,strategy:r,whileElementsMounted:p?void 0:(...Ne)=>Ea(...Ne,$e),nodeId:b,externalTree:y}),{sideX:st,sideY:po}=ie.adaptiveOrigin||Jp,ro=He?r:"fixed",Ko=fo.useMemo(()=>{let Ne;if(!He)Ne={position:ro,top:0,left:0};else if(g)Ne={position:ro,[st]:xe,[po]:oe};else Ne={...Xe,position:ro};if(Ne[nd]="100vw",Ne[ad]="100vh",!He)Ne.opacity=0;return Ne},[g,ro,st,xe,po,oe,Xe,He]),no=fo.useRef(null);q(()=>{if(!I)return;let Ne=A.current,At=typeof Ne==="function"?Ne():Ne,Se=(id(At)?At.current:At)||null||null;if(Se!==no.current)L.setPositionReference(Se),no.current=Se},[I,L,T,A]),fo.useEffect(()=>{if(!I)return;let Ne=A.current;if(typeof Ne==="function")return;if(id(Ne)&&Ne.current!==no.current)L.setPositionReference(Ne.current),no.current=Ne.current},[I,L,T,A]),fo.useEffect(()=>{if(p&&I&&U.reference&&U.floating)return Ea(U.reference,U.floating,ue,$e);return},[p,I,U,ue,$e]);let ao=Jt(me),go=cd(n,ao,D),Ao=uo(me)||"center",Qt=Boolean(ie.hide?.referenceHidden);q(()=>{if(S&&I&&He&&(ao!==W||ee&&Ao!==X))Q(me)},[S,ee,I,He,me,ao,Ao,W,X]);let kr=fo.useMemo(()=>({position:"absolute",top:ie.arrow?.y,left:ie.arrow?.x}),[ie.arrow]),Lr=ie.arrow?.centerOffset!==0;return fo.useMemo(()=>({positionerStyles:Ko,arrowStyles:kr,arrowRef:_,arrowUncentered:Lr,side:go,align:Ao,physicalSide:ao,anchorHidden:Qt,refs:L,context:he,isPositioned:He,update:ue}),[Ko,kr,_,Lr,go,Ao,ao,Qt,L,he,He,ue])}function id(e){return e!=null&&"current"in e}import*as cr from"react";import{jsx as H1}from"react/jsx-runtime";function ud(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=te(n),[,s]=cr.useState(0),i=Ze(U1).current,c=Ze(V1).current,l=cr.useRef(0),u=cr.useRef(!0),m=cr.useRef(null),f=cr.useRef(null),h=te(()=>{if(u.current)return;u.current=!0,s((S)=>S+1)}),p=te((S,y)=>{c.set(S,y),h()}),w=te((S)=>{c.delete(S),h()}),I=te((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}),l.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((R)=>{if(!_1(R))return;let v=null;for(let E of S){if(!E.isConnected)continue;if(v&&md(v,E)>0){y.disconnect(),h();return}v=E}});f.current=y;let x=new Set;for(let R=1;R<S.length;R+=1){let v=G1(S[R-1],S[R]);if(v)x.add(v)}x.forEach((R)=>y.observe(R,{childList:!0}))}let C=te(()=>{let[S,y]=W1(c),x=I(S),R=m.current,v=!R||R.length!==S.length||S.some((E,H)=>{let P=R[H];return E.index!==P.index||E.element!==P.element||E.registration.index!==P.registration.index||E.registration.metadata!==P.registration.metadata});if(d(y),m.current=S,u.current=!1,!v)return;i.forEach((E)=>E(x)),a(x)});q(()=>{if(!u.current&&m.current)I(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,I]),q(()=>{if(u.current)C()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=te((S)=>(i.add(S),()=>{i.delete(S)})),g=cr.useMemo(()=>({register:p,unregister:w,subscribeMapChange:b,nextIndexRef:l}),[p,w,b,l]);return H1(cl.Provider,{value:g,children:t})}function V1(){return new Map}function U1(){return new Set}function W1(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)=>md(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 G1(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function _1(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 md(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 fd from"react";import{jsx as z1}from"react/jsx-runtime";var Di=fd.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 z1("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as ou from"react";function pd(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=ou.useRef(null),s=ou.useRef(null),i=xn(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,l=a.current;if(c)a.current=c;if(!l||!c||c===l)return;if(!t.select("open"))return;t.set("instantType",void 0);let u=new AbortController;return s.current=u,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},u.signal),()=>{u.abort()}},[o,i,t])}function dd(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return _e("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},Ai(r),n],stateAttributesMapping:Qn})}import*as Sd from"react";var gd={},hd={},Id="";function Fi(e,t){return Gr(e)?e:t}function bd(e,t,o){return/hidden|clip/.test(e.getComputedStyle(Fi(t,o)).overflowY)}function Z1(e){if(typeof document>"u")return!1;let t=Re(e);return je(t).innerWidth-t.documentElement.clientWidth>0}function q1(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=Re(e),{documentElement:r,body:n}=o,a=Fi(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 l=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===l}function j1(e){let t=Re(e),{documentElement:o,body:r}=t,n=Fi(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 $1(e){let t=Re(e),{documentElement:o,body:r}=t,n=je(o),a=0,s=0,i=!1,c=yo.create();if(or.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function l(){let h=n.getComputedStyle(o),p=n.getComputedStyle(r),d=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,gd={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},Id=o.style.scrollBehavior,hd={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,g=h.overflowY==="scroll"||p.overflowY==="scroll",S=h.overflowX==="scroll"||p.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),x=Math.max(0,n.innerHeight-r.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),v=parseFloat(p.marginLeft)+parseFloat(p.marginRight),E=Fi(o,r);if(i=q1(e),i){o.style.scrollbarGutter=d,E.style.overflowY="hidden",E.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:d,overflowY:"hidden",overflowX:"hidden"}),C||g)o.style.overflowY="scroll";if(b||S)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:R||x?`calc(100dvh - ${R+x}px)`:"100dvh",width:v||y?`calc(100vw - ${v+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 u(){if(Object.assign(o.style,gd),Object.assign(r.style,hd),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=Id}function m(){u(),c.request(l)}l();let f=Ae(n,"resize",m);return()=>{if(c.cancel(),u(),typeof n.removeEventListener==="function")f()}}class Cd{lockCount=0;restore=null;timeoutLock=co.create();timeoutUnlock=co.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=Re(e),{documentElement:o,body:r}=t,n=je(o);if(bd(n,o,r)){let s=new n.MutationObserver(()=>{if(bd(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=tr.ios||!Z1(e);this.restore=a?j1(e):$1(e)}}var X1=new Cd;function Oi(e=!0,t=null){q(()=>{if(!e)return;return X1.acquire(t)},[e,t])}var K1=20;function wd(e,t,o,r){let[n,a]=Sd.useState(!1);q(()=>{if(!e||!t||o==null){a(!1);return}let s=Re(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-K1)},[e,t,o]),Oi(e&&(!t||n),r)}import{jsx as ru,jsxs as Y1}from"react/jsx-runtime";var xd=Pr.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:l=0,alignOffset:u=0,collisionBoundary:m="clipping-ancestors",collisionPadding:f=5,arrowPadding:h=5,sticky:p=!1,disableAnchorTracking:w=!1,collisionAvoidance:I=Xf,style:d,...C}=t,{store:b,virtualFocus:g,syncHighlightedItem:S}=eo(),y=Zp(),x=bn(!0),R=b.useState("parent"),v=b.useState("floatingRootContext"),E=b.useState("floatingTreeRoot"),H=b.useState("mounted"),P=b.useState("open"),N=b.useState("modal"),T=b.useState("openMethod"),A=b.useState("activeTriggerElement"),O=b.useState("transitionStatus"),Z=b.useState("positionerElement"),D=b.useState("instantType"),B=b.useState("adaptiveOrigin"),Q=b.useState("lastOpenChangeReason"),ee=b.useState("floatingNodeId"),k=b.useState("floatingParentNodeId"),se=v.useState("domReferenceElement"),W=r,X=l,z=u,re=c,Ce=I;if(R.type==="context-menu"){if(W=r??R.context?.anchor,re=re??"start",!i&&re!=="center")z=t.alignOffset??2,X=t.sideOffset??-5}let F=i,V=re;if(R.type==="menu")F=F??"inline-end",V=V??"start",Ce=t.collisionAvoidance??Kf;else if(R.type==="menubar")F=F??(R.context.orientation==="vertical"?"inline-end":"bottom"),V=V??"start";let Y=R.type==="context-menu",le=ld({anchor:W,floatingRootContext:v,positionMethod:x?"fixed":n,mounted:H,side:F,sideOffset:X,align:V,alignOffset:z,arrowPadding:Y?0:h,collisionBoundary:m,collisionPadding:f,sticky:p,nodeId:ee,keepMounted:y,disableAnchorTracking:w,collisionAvoidance:Ce,shift:Y?{crossAxis:!(("side"in Ce)&&Ce.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:E,adaptiveOrigin:B,lazyFlip:g?"placement":!1});Pr.useEffect(()=>{function de(ne){if(ne.open){if(ne.parentNodeId===ee)b.set("hoverEnabled",!1);if(ne.nodeId!==ee&&ne.parentNodeId===b.select("floatingParentNodeId"))b.setOpen(!1,ve(oa))}}return E.events.on("menuopenchange",de),()=>{E.events.off("menuopenchange",de)}},[b,E.events,ee]),Pr.useEffect(()=>{if(b.select("floatingParentNodeId")==null)return;function de(ne){if(ne.open||ne.nodeId!==b.select("floatingParentNodeId"))return;let Oe=ne.reason??oa;b.setOpen(!1,ve(Oe))}return E.events.on("menuopenchange",de),()=>{E.events.off("menuopenchange",de)}},[E.events,b]);let j=tt();Pr.useEffect(()=>{if(!P)j.clear()},[P,j]),Pr.useEffect(()=>{function de(ne){if(!P||ne.nodeId!==b.select("floatingParentNodeId"))return;if(ne.target&&A&&A!==ne.target){let Oe=b.select("closeDelay");if(Oe>0){if(!j.isStarted())j.start(Oe,()=>{b.setOpen(!1,ve(oa))})}else b.setOpen(!1,ve(oa))}else j.clear()}return E.events.on("itemhover",de),()=>{E.events.off("itemhover",de)}},[E.events,P,A,b,j]),Pr.useEffect(()=>{let de={open:P,nodeId:ee,parentNodeId:k,reason:b.select("lastOpenChangeReason")};E.events.emit("menuopenchange",de)},[E.events,P,b,ee,k]),pd({store:b,domReference:se,positionerElement:Z,open:P});let _={open:P,side:le.side,align:le.align,anchorHidden:le.anchorHidden,nested:R.type==="menu",instant:D},ce=R.type==="menubar"&&R.context.modal,ge=N&&Q!==Kt;wd(P&&(ce||ge),T==="touch",Z,A);let Te=dd(t,_,{styles:le.positionerStyles,transitionStatus:O,props:C,refs:[o,b.useStateSetter("positionerElement")],hidden:!H,inert:!P}),Ue=H&&R.type!=="menu"&&(R.type!=="menubar"&&N&&Q!==Kt||R.type==="menubar"&&R.context.modal),ae=null;if(R.type==="menubar")ae=R.context.contentElement;else if(R.type===void 0)ae=A;return Y1($c.Provider,{value:le,children:[Ue&&ru(Di,{ref:R.type==="context-menu"||R.type==="nested-context-menu"?R.context.internalBackdropRef:null,inert:Mi(!P),cutout:ae}),ru(Ll,{id:ee,children:ru(ud,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:Te})})]})});import*as et from"react";import*as yd from"react";var nu=[],au=void 0;function vd(){return au}function Rd(e){nu.push(e)}function Ta(e){let t=(o,r)=>{let n=Ze(J1).current,a;try{au=n;for(let s of nu)s.before(n);a=e(o,r);for(let s of nu)s.after(n);n.didInitialize=!0}finally{au=void 0}return a};return t.displayName=e.displayName||e.name,t}function Ni(e){return yd.forwardRef(Ta(e))}function J1(){return{didInitialize:!1}}import*as Bi from"react";var Q1=Bi.createContext(null);function Hi(e){let t=Bi.useContext(Q1);if(t===null&&!e)throw Error(rt(5));return t}import*as ka from"react";import*as Ma from"react";function Ad(e){let t=Ma.useRef(""),o=Ma.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:Ma.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 Pd from"react";function Vi(e,t){let o=Pd.useRef(e),r=te(t);q(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function su(e,t){let o=te((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(tr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=Ad(o);return ka.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function Ed(e){let[t,o]=ka.useState(null),r=su(e,o);return Vi(e,(n)=>{if(n&&!e)o(null)}),ka.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Td(e){if(e==null)return ea;if(e.type.startsWith("key"))return ef;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return mI;return ea}import*as Tn from"react";var lu=$u(Ui(),1);import*as Md from"react";import*as Er from"react";var m2=Ui();function f2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var p2=typeof Object.is==="function"?Object.is:f2,d2=m2.useSyncExternalStore,g2=Er.useRef,h2=Er.useEffect,I2=Er.useMemo,b2=Er.useDebugValue;var cu=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=I2(function(){function c(h){if(!l){if(l=!0,u=h,h=r(h),n!==void 0&&s.hasValue){var p=s.value;if(n(p,h))return m=p}return m=h}if(p=m,p2(u,h))return p;var w=r(h);if(n!==void 0&&n(p,w))return u=h,p;return u=h,m=w}var l=!1,u,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=d2(e,a[0],a[1]);return h2(function(){s.hasValue=!0,s.value=i},[i]),b2(i),i};var C2=mn(19),S2=C2?x2:y2;function Wi(e,t,o,r,n){return S2(e,t,o,r,n)}function w2(e,t,o,r,n){let a=Md.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return lu.useSyncExternalStore(e.subscribe,a,a)}Rd({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()}};lu.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function x2(e,t,o,r,n){let a=vd();if(!a)return w2(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 y2(e,t,o,r,n){return cu(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class uu{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 Wi(this,e,t,o,r)}}import*as Qr from"react";class en extends uu{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){Qr.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){Qr.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 Qr.useDebugValue(e),Wi(this,this.selectors[e],t,o,r)}useContextCallback(e,t){Qr.useDebugValue(e);let o=te(t??qe);this.context[e]=o}useStateSetter(e){let t=Qr.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)}})}}import*as fu from"react";import*as v2 from"react-dom";import*as mu from"react";function kd(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=te(n),{mounted:c,setMounted:l,transitionStatus:u}=bf(t,!1,!1,s),m=t?!1:r;q(()=>{if(t)i(!1)},[t,i]);let f=mu.useRef(c),h=mu.useRef(!1),p=Zs(),w=()=>{f.current=!1,l(!1),a()};q(()=>{if(f.current=c,h.current){if(h.current=!1,!t&&c)w()}});let I=te(()=>{if(!f.current)return;if(t){h.current=!0,p();return}w()});return yn({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)I()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:m,forceUnmount:I}}var Gi={tabIndex:-1,[sa]:""};function Dd(e){return(t)=>t==="touch"?e.current:!0}function Fd(e,t=!1){let o=Sr(),r=mo()!=null,n=Ze(()=>e(o,r)).current;return Aa({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function _i({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Ld(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function R2(e,t){let o=fu.useRef(null);return te((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),Ld(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ld(t)})}function zi(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 Od(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Zi(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=R2(e,o),s=te((c)=>{let l=o.select("open"),u=o.select("activeTriggerId");if(u===e){let m={activeTriggerElement:c,...l?r:null};o.update(m);return}if(u==null&&l&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=te((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 qi(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=fu.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,l={};if(e.state.triggerCount!==c)l.triggerCount=c;let u=e.select("activeTriggerId"),m=null;if(u){let f=e.context.triggerElements.getById(u);if(!f){for(let[h,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){l.activeTriggerId=h,l.activeTriggerElement=p,r.current=h;break}if(l.activeTriggerId===void 0)if(r.current===u)m=u;else r.current=null}else if(r.current=u,f!==e.state.activeTriggerElement)l.activeTriggerElement=f}else r.current=null;if(!m&&!u&&!e.state.openedWithoutTrigger&&c===1){let f=e.context.triggerElements.entries().next();if(!f.done){let[h,p]=f.value;l.activeTriggerId=h,l.activeTriggerElement=p,r.current=h}}if(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)e.update(l);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let f=ve(ea);if(e.setOpen(!1,f),!f.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function ji(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=kd({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 Ze(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function $i(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:Fe,inactiveTriggerProps:Fe,popupProps:Fe})},[e])}function Nd(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 La{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 A2={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 pu extends en{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:ui(),nested:o,triggerElements:n},A2);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Af(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 Ki(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new pu({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:Fe,inactiveTriggerProps:Fe,popupProps:Fe}}var Da=(e)=>e.triggerIdProp??e.activeTriggerId,Xi=(e)=>e.openProp??e.open,Bd=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function Hd(e,t){return t!==void 0&&Xi(e)&&Da(e)===t}function P2(e,t){if(Hd(e,t))return!0;return t!==void 0&&Xi(e)&&Da(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var En={open:Xi,mounted:(e)=>e.mounted,transitionStatus:(e)=>Xi(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:Da,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:Bd,isTriggerActive:(e,t)=>t!==void 0&&Da(e)===t,isOpenedByTrigger:(e,t)=>Hd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Da(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>P2(e,t)?Bd(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var Vd=$u(Ui(),1);import*as du from"react";function Yi(e){let t=du.useCallback((r)=>{if(e===void 0)return qe;return e.subscribeStore(r)},[e]),o=du.useCallback(()=>e===void 0?void 0:e.store,[e]);return Vd.useSyncExternalStore(t,o,()=>e?.serverStore)}var E2={...En,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=En.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>or.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"&&!En.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 gu extends en{constructor(e,t,o=!1){let r=new La,n=M2(r,t,o,e);super(n,T2(r),E2);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 T2(e){return{positionerRef:Tn.createRef(),popupRef:Tn.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Tn.createRef(),beforeTriggerFocusGuardRef:Tn.createRef(),beforeContentFocusGuardRef:Tn.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function M2(e,t,o=!1,r){return{...Ki(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:Fe,inputProps:Fe,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Xr,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fe,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as Ud from"react";var hu=Ud.createContext(null);function Iu(e,t){return(e===Us||e===el)&&t?.detail===0}function Wd(e,t){return e===Ws||Iu(e,t)}import{jsx as Fa,jsxs as k2}from"react/jsx-runtime";var L2=Ta(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:l,loopFocus:u=!0,orientation:m="vertical",actionsRef:f,closeParentOnEsc:h=!1,handle:p,triggerId:w,defaultTriggerId:I=null,highlightItemOnHover:d=!0,isSubmenu:C=!1,virtualFocus:b=!1,virtualFocusRef:g,allowEscape:S=!0,resetOnPointerLeave:y=!0}=t,x=bn(!0),R=eo(!0),v=Hi(!0),E=R?.store,H=R?.virtualFocus??!1,P=et.useMemo(()=>{if(C&&E)return{type:"menu",store:E};if(v)return{type:"menubar",context:v};if(x&&!E)return{type:"context-menu",context:x};return{type:void 0}},[x,E,v,C]),N=Yt(),T=Yt(),[A,O]=et.useState(void 0),Z=(A??T)||void 0,D=mo(),B=P.type==="menu"?P.store:void 0,Q=(r??i)&&B?.state.transitionStatus==="starting",ee=Ze(()=>Q?B?.state.instantType:void 0).current,k=Ze(()=>{let Ie=new gu({open:i,openProp:r,activeTriggerId:I,triggerIdProp:w,parent:P,disabled:c,highlightItemOnHover:d,modal:P.type===void 0?l:void 0,rootId:N,instantType:ee},Z,D!=null);return Ie.context.virtualFocusRef=g,Ie}).current;k.useControlledProp("openProp",r),k.useControlledProp("triggerIdProp",w),k.useContextCallback("onOpenChangeComplete",a);let se=k.useState("floatingTreeRoot"),W=wa(se),X=k.useState("open"),z=k.useState("activeTriggerElement"),re=k.useState("positionerElement"),Ce=k.useState("hoverEnabled"),F=k.useState("disabled"),V=k.useState("lastOpenChangeReason"),Y=k.useState("parent"),le=k.useState("activeIndex"),j=k.useState("keyboardOpen"),_=k.useState("payload"),ce=k.useState("floatingParentNodeId"),ge=et.useRef(null),Te=et.useRef(Y.type!=="context-menu"),Ue=tt(),ae=et.useRef(!0),de=tt(),ne=ce!=null,{openMethod:Oe,triggerProps:Be}=Ed(X);k.useSyncedValues({disabled:c,highlightItemOnHover:d,modal:Y.type===void 0?l:void 0,openMethod:Oe,rootId:N}),qi(k);let{forceUnmount:$e,transitionStatus:L}=ji(X,k,()=>{k.set("allowMouseEnter",!1)},Q),U=xn(k.context.popupRef);et.useEffect(()=>{if(ee===void 0)return;let Ie=()=>{if(k.state.instantType===ee)k.set("instantType",void 0)};if(!X){Ie();return}if(L!==void 0)return;if(k.context.popupRef.current==null){Ie();return}let Se=new AbortController;return U(Ie,Se.signal),()=>{Se.abort()}},[ee,X,L,U,k]),q(()=>{if(x&&!R)k.update({parent:{type:"context-menu",context:x},floatingNodeId:W,floatingParentNodeId:D});else if(R||!k.select("activeTriggerElement"))k.update({floatingNodeId:W,floatingParentNodeId:D})},[x,R,W,D,z,k]),et.useEffect(()=>{if(!X)ge.current=null;if(Y.type!=="context-menu")return;if(!X){Ue.clear(),Te.current=!1;return}Ue.start(500,()=>{Te.current=!0})},[Ue,X,Y.type]),q(()=>{if(!X&&!Ce)k.set("hoverEnabled",!0)},[X,Ce,k]);let xe=te((Ie,Se)=>{let Le=Se.reason;if(!Ie&&!k.select("open"))return;if(X===Ie&&Se.trigger===z&&V===Le)return;let Pt=Od(Se);if(!Ie&&Se.trigger==null)Se.trigger=z??void 0;if(n?.(Ie,Se),Se.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(Ie,Se);let Dt=Se.event;if(Ie===!1&&Le!==el&&Dt?.type==="click"&&Dt.pointerType==="touch"&&!ae.current)return;if(Ie&&Le===ta)ae.current=!1,de.start(300,()=>{ae.current=!0});else ae.current=!0,de.clear();let Xt=!Ie&&(Le===tl||Le==null);ge.current=Se.event;let Tt=zi(k.state,Ie,Se.trigger,Pt());if(Tt.openChangeReason=Le,Tt.keyboardOpen=Ie&&Wd(Le,Dt),Y.type==="menubar"&&(Le===ta||Le===Cn||Le===Kt||Le===Ws||Le===oa))Tt.instantType="group";else if(Iu(Le,Dt))Tt.instantType="click";else if(Xt)Tt.instantType="dismiss";else Tt.instantType=void 0;k.update(Tt)}),oe=Aa({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:Z,nested:D!=null,onOpenChange:xe}),ie=oe.context.events;q(()=>{let Ie=({open:Se,eventDetails:Le})=>xe(Se,Le);return ie.on("setOpen",Ie),()=>{ie?.off("setOpen",Ie)}},[ie,xe]),q(()=>k.subscribeToParentMenu(),[k]);let ue=et.useCallback(()=>{k.setOpen(!1,ve(tf))},[k]);et.useImperativeHandle(f,()=>({unmount:$e,close:ue}),[$e,ue]);let me;if(Y.type==="context-menu")me=Y.context;et.useImperativeHandle(me?.positionerRef,()=>re,[re]),et.useImperativeHandle(me?.actionsRef,()=>({setOpen:xe}),[xe]);let he=Ra(oe,{enabled:!F,bubbles:{escapeKey:h&&Y.type==="menu"},outsidePress(){if(Y.type!=="context-menu"||ge.current?.type==="contextmenu")return!0;return Te.current},externalTree:ne?se:void 0}),He=Li(),Xe=_l(oe,{enabled:!F,listRef:k.context.itemDomElements,activeIndex:le,virtual:b,nested:Y.type==="menubar"||!b&&Y.type!==void 0,parentOrientation:Y.type==="menubar"?Y.context.orientation:void 0,loopFocus:u,focusItemOnOpen:b?j:void 0,allowEscape:b&&u&&S,orientation:m,triggerOrientation:b?"vertical":m,rtl:He==="rtl",disabledIndices:er,onNavigate(Ie,Se){k.setActiveIndex(Ie,Td(Se),Se?.nativeEvent)},openOnArrowKeyDown:Y.type!=="context-menu"&&!(b&&C),externalTree:!b&&ne?se:void 0,nestedReturnFocusRef:B?.context.virtualFocusRef,focusItemOnHover:d,resetOnPointerLeave:y}),st=et.useCallback((Ie)=>{k.context.typingRef.current=Ie},[k]),po=zl(oe,{enabled:!F&&!b,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:le,resetMs:qf,onMatch:(Ie,Se)=>{if(X&&Ie!==le)k.setActiveIndex(Ie,ef,Se.nativeEvent)},onTyping:st}),ro=te(s),Ko=et.useRef(-1),no=te(()=>{let Ie=k.state.activeIndex,Se=Ie===null?void 0:k.context.itemDomElements.current[Ie]??void 0;if(Se?.isConnected===!1)return;let Le=Se===void 0?-1:Ie;if(Ko.current===Le&&k.context.reportedItem===Se)return;if(Ko.current=Le,k.context.reportedItem=Se,b)k.set("highlightedItem",Se);let{highlightReason:Pt,highlightEvent:Dt}=k.context;if(k.context.highlightReason=ea,k.context.highlightEvent=void 0,!s)return;ro(Se,gf(Pt,Dt,{label:Se===void 0?void 0:k.context.itemLabels.current[Le]??void 0}))});q(()=>{no()},[le,no]);let ao=et.useMemo(()=>{if(!b)return Xe.reference;if(!Xe.trigger)return Fe;let{onFocus:Ie,...Se}=Xe.trigger;return Se},[b,Xe.reference,Xe.trigger]);k.useSyncedValue("inputProps",b?Xe.reference??Fe:Fe);let go=et.useMemo(()=>{let Ie=kt(po.reference,ao,he.reference,{onMouseMove(){k.set("allowMouseEnter",!0)}},Be);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=X,Ie},[k,po.reference,ao,he.reference,Be,X]),Ao=et.useMemo(()=>{let Ie=kt(Xe.trigger,he.trigger,Be);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=!1,Ie},[Xe.trigger,he.trigger,Be]);Ze(()=>(k.update({inactiveTriggerProps:Ao}),null));let Qt=et.useMemo(()=>kt(Gi,{onMouseMove(){if(k.set("allowMouseEnter",!0),Y.type==="menu")k.set("hoverEnabled",!1)},onClick(){if(k.select("hoverEnabled"))k.set("hoverEnabled",!1)},onKeyDown(Ie){let Se=k.select("keyboardEventRelay");if(Se&&!Ie.isPropagationStopped())Se(Ie)}},po.floating,Xe.floating,he.floating),[Y.type,k,po.floating,Xe.floating,he.floating]),kr=Xe.item??Fe;$i(k,{floatingRootContext:oe,activeTriggerProps:go,inactiveTriggerProps:Ao,popupProps:Qt,itemProps:kr});let Lr=et.useMemo(()=>({store:k,parent:P,orientation:m,loopFocus:u,allowEscape:S,defaultFloatingId:T,setRenderedFloatingId:O,virtualFocus:b,parentVirtualFocus:H,syncHighlightedItem:no}),[k,P,m,u,S,T,b,H,no]),Ne=typeof o==="function"?o({payload:_}):o,At=k2(Jn.Provider,{value:Lr,children:[p&&Fa(_i,{handle:p,store:k}),Ne]});if(Y.type===void 0||Y.type==="context-menu")At=Fa(Dl,{externalTree:se,children:At});return At});function Gd(e){let t=et.useContext(hu);if(t===null)return Fa(L2,{...e});let o=t.Root;return Fa(hu.Provider,{value:null,children:Fa(o,{...t.options,...e})})}import*as qt from"react";var Ji=5;function _d(e,t){let o=D2(t);return e.clientX>=o.left-Ji&&e.clientX<=o.right+Ji&&e.clientY>=o.top-Ji&&e.clientY<=o.bottom+Ji}function D2(e){let t=e.getBoundingClientRect(),o=je(e);if(na.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,l=parseFloat(n.height)||0,u=Math.max(t.width,s,c),m=Math.max(t.height,i,l),f=u-t.width,h=m-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-h/2,bottom:t.bottom+h/2}}import*as zd from"react";function Zd(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=pn(),{ref:n,index:a}=_s(e),s=o===a,i=zd.useRef(null),c=So(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let u=i.current;if(!t||!u)return;let m=u.hasAttribute("disabled")||u.ariaDisabled==="true";if(!s&&!m)u.focus()}},compositeRef:c,index:a}}function qd(e){let{render:t,className:o,style:r,state:n=Fe,props:a=er,refs:s=er,metadata:i,stateAttributesMapping:c,tag:l="div",...u}=e,{compositeProps:m,compositeRef:f}=Zd({metadata:i});return _e(l,e,{state:n,ref:[f,...s],props:[m,...a,u],stateAttributesMapping:c})}function bu(e){if(Ve(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(xo(e))return;return bu(wo(e))}import*as jd from"react-dom";function $d(e,t){function o(a,s,i){let c=a.currentTarget;jd.flushSync(()=>{e.setOpen(!1,ve(Cn,a.nativeEvent,c))}),Vf(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&&ir(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as Qi from"react";function Xd(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=Qi.useRef(!1);return Qi.useMemo(()=>{if(!t)return Fe;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,Re(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 Oa,jsxs as F2}from"react/jsx-runtime";var Kd=Ni(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:l,delay:u=100,closeDelay:m=0,handle:f,payload:h,...p}=t,w=eo(!0),d=Yi(f)??w?.store;if(!d)throw Error(rt(85));let C=Yt(c),b=d.useState("isTriggerActive",C),g=d.useState("floatingRootContext"),S=d.useState("isOpenedByTrigger",C),y=d.useState("triggerControlsId",C),x=qt.useRef(null),R=N2(),v=pn(!0),E=zt(),H=qt.useMemo(()=>E??new Xr,[E]),P=wa(H),N=mo(),{registerTrigger:T,isMountedByThisTrigger:A}=Zi(C,x,d,{payload:h,closeDelay:m,parent:R,floatingTreeRoot:H,floatingNodeId:P,floatingParentNodeId:N,keyboardEventRelay:v?.relayKeyboardEvent}),O=R.type==="menubar",Z=d.useState("disabled"),D=s||Z||O&&R.context.disabled,{getButtonProps:B,buttonRef:Q}=Do({disabled:D,native:i});qt.useEffect(()=>{if(!S&&R.type===void 0)d.context.allowMouseUpTriggerRef.current=!1},[d,S,R.type]);let ee=qt.useRef(null),k=tt(),se=te((de)=>{if(!ee.current)return;k.clear(),d.context.allowMouseUpTriggerRef.current=!1;let ne=de.target;if(pe(ee.current,ne)||pe(d.select("positionerElement"),ne)||ne===ee.current)return;if(ne!=null&&bu(ne)===d.select("rootId"))return;if(_d(de,ee.current))return;H.events.emit("close",{domEvent:de,reason:fI})});qt.useEffect(()=>{let de=Re(ee.current);if(S&&d.select("lastOpenChangeReason")===Kt)return de.addEventListener("mouseup",se,{once:!0}),()=>{de.removeEventListener("mouseup",se)};return},[S,se,d]);let W=O&&R.context.hasSubmenuOpen,z=Wl(g,{enabled:(l??W)&&!D&&(!O||W&&!A),handleClose:Zl({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:R.type===void 0?u:void 0,delay:{close:m},triggerElementRef:x,externalTree:H,isActiveTrigger:b,isClosing:()=>d.select("transitionStatus")==="ending"}),re=O2(S,d.select("lastOpenChangeReason")),Ce=va(g,{enabled:!D,event:S&&O?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?re:!1}),F=Nl(g,{enabled:!D&&W}),V=Xd({open:S,enabled:O,mouseDownAction:"open"}),Y=qt.useMemo(()=>kt(F.reference,Ce.reference),[F.reference,Ce.reference]),le=d.useState("triggerProps",A),j=d.useState("filterTriggerProps"),{handlePreFocusGuardFocus:_,handleFocusTargetFocus:ce}=$d(d,x),ge={disabled:D,open:S},Te=[ee,o,Q,T,x],Ue=[Y,z??Fe,le,{"aria-haspopup":"menu","aria-controls":y,id:C,onMouseDown:(de)=>{if(d.select("open"))return;k.start(200,()=>{d.context.allowMouseUpTriggerRef.current=!0}),Re(de.currentTarget).addEventListener("mouseup",se,{once:!0})}},j,O?{role:"menuitem"}:{},V,p,B],ae=_e("button",t,{enabled:!O,stateAttributesMapping:Jc,state:ge,ref:Te,props:Ue});if(O)return Oa(qd,{tag:"button",render:r,className:n,style:a,state:ge,refs:Te,props:Ue,stateAttributesMapping:Jc});if(S)return F2(qt.Fragment,{children:[Oa(nr,{ref:d.context.beforeTriggerFocusGuardRef,onFocus:_},`${C}-pre-focus-guard`),Oa(qt.Fragment,{children:ae},C),Oa(nr,{ref:d.context.triggerFocusTargetRef,onFocus:ce},`${C}-post-focus-guard`)]});return Oa(qt.Fragment,{children:ae},C)});function O2(e,t){let o=tt(),[r,n]=qt.useState(!1);return q(()=>{if(e&&t===Kt)n(!0),o.start(jf,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function N2(){let e=Hi(!0);return qt.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as Yd from"react";var Jd=Yd.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return _e("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as tn,jsxs as jZe}from"react/jsx-runtime";function eg({...e}){return tn(Gd,{"data-slot":"dropdown-menu",...e})}function tg({...e}){return tn(Kd,{"data-slot":"dropdown-menu-trigger",...e})}function og({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return tn($p,{container:a,children:tn(xd,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:tn(zp,{"data-slot":"dropdown-menu-content",className:fe("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 Na({className:e,inset:t,variant:o="default",...r}){return tn(Sf,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:fe("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 rg({className:e,...t}){return tn(Jd,{"data-slot":"dropdown-menu-separator",className:fe("-mx-1 my-1 h-px bg-border",e),...t})}import*as gg from"react";import*as ec from"react";var ng="data-valid",ag="data-invalid";var sg={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},H2={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ig={disabled:!1,...H2},cg={valid(e){if(e===null)return null;if(e)return{[ng]:""};return{[ag]:""}}};var V2={invalid:void 0,name:void 0,validityData:{state:sg,errors:[],error:"",value:"",initialValue:null},setValidityData:qe,disabled:void 0,setTouched:qe,setDirty:qe,setFilled:qe,setFocused:qe,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:ig,registerFieldControl:qe,validation:{getValidationProps:(e,t=Fe)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:qe,getInputControl:()=>null,commit:async()=>{},change:qe}},U2=ec.createContext(V2);function Mn(e=!0){let t=ec.useContext(U2);if(t.setValidityData===qe&&!e)throw Error(rt(28));return t}import*as tc from"react";var W2=tc.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:qe,validationMode:"onSubmit",submitCountRef:{current:0}});function lg(){return tc.useContext(W2)}import*as oc from"react";var G2=oc.createContext({controlId:void 0,registerControlId:qe,resetControlId:qe,labelId:void 0,setLabelId:qe,messageIds:[],setMessageIds:qe,getDescriptionProps:(e)=>e});function rc(){return oc.useContext(G2)}import*as nc from"react";function ug(e,t,o){let{setFocused:r,focusOwnerRef:n}=Mn(),a=te((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 mg(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Mn(),i=Ze(()=>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 Cu from"react";function fg(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=rc(),s=Yt(),i=Ze(()=>Symbol()),c=Cu.useRef(!1),l=Cu.useRef(!1),u=te(()=>{if(!c.current||n===qe)return;c.current=!1,n(i.current,void 0)});return q(()=>{if(!o||n===qe){u();return}let m;if(t!==void 0)l.current=!0,m=t;else if(l.current)m=s;else{a();return}if(m===void 0){u();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,u]),q(()=>u,[u]),(o?r:void 0)??t??s}var pg=nc.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:m=!1,style:f,...h}=t,{state:p,name:w,disabled:I,setTouched:d,setDirty:C,validityData:b,setFilled:g,validationMode:S,validation:y}=Mn(),{clearErrors:x,elementRef:R,submitCountRef:v}=lg(),E=I||c,H=w??s,P={...p,disabled:E},{labelId:N}=rc(),T=fg({id:a}),A=i!==void 0,O=i==null?void 0:String(i),Z=te(()=>y.inputRef.current?.value);mg(y.inputRef,T,O,Z,!E,s),q(()=>{let k=O??y.inputRef.current?.value;if(k!==void 0)g(k!=="")},[O,u,y.inputRef,g]),Vi(O,()=>{if(O===void 0)return;x(H),C(O!==(b.initialValue??"")),y.change(O)});let D=nc.useRef(null),B=ug(E,D),Q=tt();return _e("input",t,{ref:[o,D],state:P,props:[{id:T,disabled:E,name:H,ref:y.inputRef,"aria-labelledby":N,autoFocus:m,...A?{value:i}:{defaultValue:u},onChange(k){let se=k.currentTarget.value,W=ve(ea,k.nativeEvent);if(l?.(se,W),A)return;if(C(se!==(b.initialValue??"")),g(se!==""),!k.nativeEvent.defaultPrevented&&!W.isCanceled)x(H),y.change(se)},onFocus(){B(!0)},onBlur(k){if(d(!0),B(!1),S==="onBlur"){let se=k.currentTarget.value;if(y.commit(se),A)queueMicrotask(()=>{let W=y.inputRef.current?.value;if(W!==void 0&&W!==se&&W!==(b.initialValue??""))y.commit(W)})}},onKeyDown(k){if(k.currentTarget.tagName==="INPUT"&&k.key==="Enter"){d(!0);let se=k.currentTarget.value,W=k.currentTarget.form;if(W&&W===R.current&&!k.defaultPrevented){let X=k.currentTarget,z=v.current;Q.start(0,()=>{if(v.current===z)y.commit(X.value)})}else y.commit(se)}}},h,(k)=>y.getValidationProps(E,k)],stateAttributesMapping:cg})});import{jsx as _2}from"react/jsx-runtime";var Su=gg.forwardRef(function(t,o){return _2(pg,{ref:o,...t})});import{jsx as z2}from"react/jsx-runtime";function wu({className:e,type:t,...o}){return z2(Su,{type:t,"data-slot":"input",className:fe("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 Z2}from"react/jsx-runtime";function hg({className:e,...t}){return Z2("textarea",{"data-slot":"textarea",className:fe("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 ac}from"react/jsx-runtime";function Ig({className:e,...t}){return ac("div",{"data-slot":"input-group",role:"group",className:fe("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 q2=Bt("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 bg({className:e,align:t="inline-start",...o}){return ac("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:fe(q2({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var j2=Bt("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 xu({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return ac(Ot,{type:t,"data-size":r,variant:o,className:fe(j2({size:r}),e),...n})}function Cg({className:e,...t}){return ac(hg,{"data-slot":"input-group-control",className:fe("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 Je,jsxs as Wt}from"react/jsx-runtime";function Sg({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n}){let[a,s]=kn(""),[i,c]=kn(!1),[l,u]=kn(""),[m,f]=kn([]),[h,p]=kn(!1),w=X2(null),[I,d]=kn(null);$2(()=>{d(w.current?.closest("[data-coristen-widget]")??null)},[]);async function C(g){let S=Array.from(g.target.files??[]).slice(0,Math.max(0,5-m.length));if(g.target.value="",!S.length)return;p(!0),u("");try{let y=[];for(let x of S)y.push(await t(x));f((x)=>[...x,...y].slice(0,5))}catch(y){u(y instanceof Error?y.message:"File upload failed. Try again.")}finally{p(!1)}}async function b(g){g.preventDefault();let S=a.trim();if(!S&&!m.length||i||h||o)return;c(!0),u("");try{await e(S,m),s(""),f([])}catch{u("Message could not be sent. Try again.")}finally{c(!1)}}return Wt("form",{onSubmit:(g)=>void b(g),className:"w-full",children:[Je("input",{ref:w,type:"file",multiple:!0,className:"sr-only",onChange:(g)=>void C(g)}),(m.length>0||h)&&Wt(Ls,{className:"px-2 pb-2",children:[m.map((g)=>Wt(hn,{size:"xs",children:[Je($n,{children:Je(Vr,{})}),Wt(Xn,{className:"max-w-32",children:[Je(Kn,{title:g.name,children:g.name}),Wt(Yn,{children:[(g.size/1024).toFixed(0)," KB"]})]}),Je(ks,{children:Je(jm,{type:"button","aria-label":`Remove ${g.name}`,onClick:()=>f((S)=>S.filter((y)=>y.storageId!==g.storageId)),children:Je(Go,{})})})]},g.storageId)),h&&Wt(hn,{size:"xs",state:"uploading",children:[Je($n,{children:Je(Vr,{})}),Wt(Xn,{children:[Je(Kn,{children:"Uploading file"}),Je(Yn,{children:"Please wait"})]})]})]}),Wt(Ig,{className:"has-disabled:opacity-100",children:[Je(Cg,{"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(g)=>s(g.target.value),maxLength:2000,rows:2,onKeyDown:(g)=>{if(g.key==="Enter"&&!g.shiftKey)g.preventDefault(),g.currentTarget.form?.requestSubmit()}}),Wt(bg,{align:"block-end",className:"pt-1",children:[Wt(eg,{children:[Je(tg,{render:Je(xu,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:Je(un,{className:"size-5"})}),Wt(og,{portalContainer:I,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[Wt(Na,{onClick:()=>w.current?.click(),children:[Je(bs,{}),"Add Photos & Files"]}),Je(rg,{}),Wt(Na,{children:[Je(hs,{}),"Create Image"]}),Wt(Na,{children:[Je(is,{}),"Deep Research"]}),Wt(Na,{children:[Je(ds,{}),"Web Search"]})]})]}),r&&Je("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&Je("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:Wt("span",{className:"inline-flex items-center gap-1",children:["Powered by",Wt("span",{className:"relative size-4 shrink-0",children:[Je("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),Je("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),Je("span",{className:"font-medium",children:"Coristen"})]})})}),Je(xu,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:i||h||o||!a.trim()&&!m.length,children:Je(ts,{})})]})]}),l&&Je("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as on}from"react/jsx-runtime";function yu({className:e,size:t="default",...o}){return on("div",{"data-slot":"card","data-size":t,className:fe("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 vu({className:e,...t}){return on("div",{"data-slot":"card-header",className:fe("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 Ru({className:e,...t}){return on("div",{"data-slot":"card-title",className:fe("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function Au({className:e,...t}){return on("div",{"data-slot":"card-description",className:fe("text-sm text-muted-foreground",e),...t})}function wg({className:e,...t}){return on("div",{"data-slot":"card-action",className:fe("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function xg({className:e,...t}){return on("div",{"data-slot":"card-content",className:fe("px-(--card-spacing)",e),...t})}function sc({className:e,...t}){return on("div",{"data-slot":"card-footer",className:fe("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as Y2}from"react/jsx-runtime";var K2=Bt("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 Pu({variant:e="default",align:t="start",className:o,...r}){return Y2("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:fe(K2({variant:e}),o),...r})}function Eu({className:e,render:t,...o}){return fn({defaultTagName:"div",props:kt({className:fe("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 Rje=Bt("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 ic}from"react/jsx-runtime";function yg({className:e,...t}){return ic("div",{"data-slot":"empty",className:fe("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 vg({className:e,...t}){return ic("div",{"data-slot":"empty-header",className:fe("flex max-w-sm flex-col items-center gap-2",e),...t})}var Mje=Bt("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 Rg({className:e,...t}){return ic("div",{"data-slot":"empty-title",className:fe("font-heading text-sm font-medium tracking-tight",e),...t})}function Ag({className:e,...t}){return ic("div",{"data-slot":"empty-description",className:fe("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Ba}from"react/jsx-runtime";function Pg({className:e,align:t="start",...o}){return Ba("div",{"data-slot":"message","data-align":t,className:fe("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function Eg({className:e,...t}){return Ba("div",{"data-slot":"message-avatar",className:fe("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 Tg({className:e,...t}){return Ba("div",{"data-slot":"message-content",className:fe("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 Mg({className:e,...t}){return Ba("div",{"data-slot":"message-header",className:fe("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 kg({className:e,...t}){return Ba("div",{"data-slot":"message-footer",className:fe("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 cc from"react";import*as yt from"react";var Lg=new Map([["bold",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),yt.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",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.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 Tu=cc.forwardRef((e,t)=>cc.createElement(We,{ref:t,...e,weights:Lg}));Tu.displayName="ArrowCounterClockwiseIcon";import*as lc from"react";import*as vt from"react";var Dg=new Map([["bold",vt.createElement(vt.Fragment,null,vt.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",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),vt.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",vt.createElement(vt.Fragment,null,vt.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",vt.createElement(vt.Fragment,null,vt.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",vt.createElement(vt.Fragment,null,vt.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",vt.createElement(vt.Fragment,null,vt.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 Mu=lc.forwardRef((e,t)=>lc.createElement(We,{ref:t,...e,weights:Dg}));Mu.displayName="DownloadSimpleIcon";import{useState as Sc}from"react";import*as Fg from"react";import*as uc from"react";var ku=uc.createContext(void 0);function jt(e){let t=uc.useContext(ku);if(!e&&t===void 0)throw Error(rt(27));return t}var Og=Fg.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=jt(),l=c.useState("open"),u=c.useState("nested"),m=c.useState("mounted"),f=c.useState("transitionStatus");return _e("div",t,{state:{open:l,transitionStatus:f},ref:[c.context.backdropRef,o],stateAttributesMapping:Hs,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!u})});import*as Ng from"react";var Lu=Ng.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,l=jt(),u=l.useState("open"),{getButtonProps:m,buttonRef:f}=Do({disabled:s,native:i}),h={disabled:s};function p(w){if(u)l.setOpen(!1,ve(uI,w.nativeEvent))}return _e("button",t,{state:h,ref:[o,f],props:[{onClick:p},c,m]})});import*as Bg from"react";var Hg=Bg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=jt(),l=Yt(s);return c.useSyncedValueWithCleanup("descriptionElementId",l),_e("p",t,{ref:o,props:[{id:l},i]})});import*as _g from"react";import*as mc from"react";var Du=mc.createContext(void 0);function Vg(){let e=mc.useContext(Du);if(e===void 0)throw Error(rt(26));return e}var Ug="--nested-dialogs";var l$e=Kc,u$e=Yc,m$e=oI,f$e=rI;var Wg="data-nested-dialog-open";var Gg={...Qn,...Ns,nestedDialogOpen(e){return e?{[Wg]:""}:null}};import{jsx as eb}from"react/jsx-runtime";var zg=_g.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,l=jt(),u=l.useState("descriptionElementId"),m=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),h=l.useState("popupProps"),p=l.useState("modal"),w=l.useState("mounted"),I=l.useState("nested"),d=l.useState("nestedOpenDialogCount"),C=l.useState("open"),b=l.useState("openMethod"),g=l.useState("titleElementId"),S=l.useState("transitionStatus"),y=l.useState("role"),x=f.useState("floatingId");Vg(),yn({open:C,ref:l.context.popupRef,onComplete(){if(C)l.context.onOpenChangeComplete?.(!0)}});let R=i===void 0?Dd(l.context.popupRef):i,v=d>0,E=l.useStateSetter("popupElement"),P=_e("div",t,{state:{open:C,nested:I,transitionStatus:S,nestedDialogOpen:v},props:[h,{id:x,"aria-labelledby":g,"aria-describedby":u,role:y,...Gi,hidden:!w,onKeyDown(N){if(Ri.has(N.key))N.stopPropagation()},style:{[Ug]:d}},c],ref:[o,l.context.popupRef,E],stateAttributesMapping:Gg});return eb(xa,{context:f,openInteractionType:b,disabled:!w,closeOnFocusOut:!m,initialFocus:R,returnFocus:s,modal:p!==!1,restoreFocus:"popup",children:P})});import*as qg from"react";import{jsx as Zg,jsxs as tb}from"react/jsx-runtime";var jg=qg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=jt(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return Zg(Du.Provider,{value:r,children:tb(Sa,{ref:o,...n,children:[s&&i===!0&&Zg(Di,{ref:a.context.internalBackdropRef,inert:Mi(!c)}),t.children]})})});import*as Kg from"react";import*as Fu from"react";function $g({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"),[l,u]=Fu.useState(0),[m,f]=Fu.useState(0),h=l===0,p=Ra(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=at(w);if(h&&!a){if(s){let d=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return d||C?d===I||C===I||pe(I,i)&&!I?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:h});return Oi(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(w,I)=>{if(!e.select("open")&&!e.select("mounted"))return;u(w),f(I)}),q(()=>{if(!r&&!n)u(0),f(0)},[r,n]),q(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(l+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,l,m,t]),$i(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:m}),null}import*as fc from"react";var ob={...En,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 Ou extends en{constructor(e,t,o){let r=new La,n=rb(e,r,t,o);super(n,nb(r),ob)}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(zi(this.state,e,t.trigger))}}function rb(e,t,o,r=!1){return{...Ki(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 nb(e){return{popupRef:fc.createRef(),backdropRef:fc.createRef(),internalBackdropRef:fc.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as Xg,jsxs as ab}from"react/jsx-runtime";function Yg(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:m,defaultTriggerId:f=null}=t,h=e==="drawer",p=e==="alert-dialog",w=p?!0:c,I=p||i,d=p?"alertdialog":"dialog",C=jt(!0),b=C!=null,g={modal:w,disablePointerDismissal:I,nested:b,role:d},S=Fd((H,P)=>new Ou({open:n,openProp:r,activeTriggerId:f,triggerIdProp:m,...g},H,P),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",m),S.useSyncedValues(g),S.useContextCallback("onOpenChange",a),S.useContextCallback("onOpenChangeComplete",s);let y=S.useState("open"),x=S.useState("mounted"),R=S.useState("payload");Nd(S,y),qi(S);let{forceUnmount:v}=ji(y,S);Kg.useImperativeHandle(l,()=>({unmount:v,close:()=>S.setOpen(!1,ve(tf))}),[v,S]);let E=y||x||u!=null;return ab(ku.Provider,{value:S,children:[u&&Xg(_i,{handle:u,store:S}),E&&Xg($g,{store:S,parentContext:C?.context,isDrawer:h}),typeof o==="function"?o({payload:R}):o]})}var Jg=Ta(function(t){return Yg("dialog",t)});import*as Qg from"react";var e0=Qg.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=jt(),l=Yt(s);return c.useSyncedValueWithCleanup("titleElementId",l),_e("h2",t,{ref:o,props:[{id:l},i]})});import*as t0 from"react";var o0=Ni(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:l,handle:u,...m}=t,f=jt(!0),p=Yi(u)??f;if(!p)throw Error(rt(79));let w=Yt(c),I=p.useState("floatingRootContext"),d=p.useState("isOpenedByTrigger",w),C=p.useState("triggerPopupId",w),b=t0.useRef(null),{registerTrigger:g,isMountedByThisTrigger:S}=Zi(w,b,p,{payload:l}),{getButtonProps:y,buttonRef:x}=Do({disabled:s,native:i}),R=va(I),v=su(()=>p.select("open"),(P)=>{p.set("openMethod",P)}),E={disabled:s,open:d},H=p.useState("triggerProps",S);return _e("button",t,{state:E,ref:[x,o,g,b],props:[R.reference,H,v,{[li]:"",id:w,"aria-haspopup":"dialog","aria-expanded":d,"aria-controls":C},m,y],stateAttributesMapping:Qm})});import{jsx as Bo,jsxs as Nu}from"react/jsx-runtime";function n0({...e}){return Bo(Jg,{"data-slot":"dialog",...e})}function a0({...e}){return Bo(o0,{"data-slot":"dialog-trigger",...e})}function sb({...e}){return Bo(jg,{"data-slot":"dialog-portal",...e})}function s0({...e}){return Bo(Lu,{"data-slot":"dialog-close",...e})}function ib({className:e,...t}){return Bo(Og,{"data-slot":"dialog-overlay",className:fe("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 i0({className:e,children:t,showCloseButton:o=!0,...r}){return Nu(sb,{children:[Bo(ib,{}),Nu(zg,{"data-slot":"dialog-content",className:fe("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&&Nu(Lu,{"data-slot":"dialog-close",render:Bo(Ot,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[Bo(Go,{}),Bo("span",{className:"sr-only",children:"Close"})]})]})]})}function c0({className:e,...t}){return Bo(e0,{"data-slot":"dialog-title",className:fe("font-heading text-base leading-none font-medium",e),...t})}function l0({className:e,...t}){return Bo(Hg,{"data-slot":"dialog-description",className:fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function u0(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 cb=Bt("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 fn({defaultTagName:"span",props:kt({className:fe(cb({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as ub}from"react/jsx-runtime";var lb=Bt("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 m0({className:e,variant:t="default",render:o,...r}){return fn({defaultTagName:"div",props:kt({className:fe(lb({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function f0({className:e,...t}){return ub("span",{"data-slot":"marker-content",className:fe("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 p0(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 Ln from"react";function d0({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=dc(mb(r,n),t);if(!o)return Ln.createElement(e,a);if(typeof o=="function")return o(a,r);if(!Ln.isValidElement(o))return null;let s=o.props,i={...dc(a,s),ref:Dn(a.ref,s.ref)};return Ln.cloneElement(o,i)}function dc(...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]=Dn(s,a):pb(n)&&typeof s=="function"&&typeof a=="function"?t[n]=fb(a,s):t[n]=a}}return t}function mb(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 fb(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function pb(e){return/^on[A-Z]/.test(e)}function Dn(...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 K from"react";import{jsx as Fn,jsxs as I0}from"react/jsx-runtime";var db=8,gb=64,hb=0,Ic=0.5,Ib=180,bb=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),b0={start:!1,end:!1},Cb=[],bc={currentAnchorId:null,visibleMessageIds:Cb};function Sb({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return b0;let n=Hu({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function wb({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return bc;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",l=[],u=null;for(let m of Ha(e,r)){let f=m.dataset.messageId;if(!f)continue;let h=m.dataset.scrollAnchor==="true",p=h||c?m.getBoundingClientRect():null;(c&&p?p.bottom>i&&p.top<s.bottom:a.has(f))&&l.push(f),h&&p&&p.top<=i+Ic&&(u=f)}return l.length===0&&u===null?bc:{currentAnchorId:u,visibleMessageIds:l}}function Ha(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function xb(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function yb(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function vb(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 Rb(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function Ab({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of Ha(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 Pb({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=C0(t,n),s=t.getBoundingClientRect().height,i=Mb(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,l=n.scrollTop+i.start,u=n.scrollTop+n.clientHeight-i.end;return a>=l&&c<=u?n.scrollTop:a<l?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function C0(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function gc(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Eb({content:e,scrollTop:t,spacer:o,viewport:r}){let n=Hu({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function Hu({content:e,spacer:t,viewport:o}){let r=Ha(e,t),n=S0(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let l=c.getBoundingClientRect();i=Math.max(i,l.bottom-a.top+s+n.end)}return i}function Tb(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function S0(e){let t=window.getComputedStyle(e);return{end:Bu(t.paddingBlockEnd||t.paddingBottom),start:Bu(t.paddingBlockStart||t.paddingTop)}}function Mb(e){let t=e?.parentElement;return t?S0(t):{end:0,start:0}}function kb(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return Bu(o)}function Bu(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function w0(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 g0(e,t){return w0(e,t)}function Lb(){return w0(bc,Fb)}function Db(e,t){return e.start===t.start&&e.end===t.end}function Fb(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function Ob({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=K.useRef(e),s=K.useRef(!1),i=K.useRef(null),c=K.useRef(!1),l=K.useRef(o),u=K.useRef(0),m=K.useRef(null),f=K.useRef(0),h=K.useRef(e?"following-bottom":"free-scrolling"),p=K.useRef(new Map),w=K.useRef(null),I=K.useRef(null),d=K.useRef(null),C=K.useRef(n),b=K.useRef(!0),g=K.useRef(null),S=K.useRef(r),y=K.useRef(null),x=K.useRef(0),R=K.useRef(0),v=K.useRef(null),E=K.useRef(null),H=K.useRef(null),P=K.useRef(null),N=K.useRef(null),T=K.useRef(null),A=K.useRef(null),O=K.useRef(null),Z=K.useRef(null),D=K.useRef(new Set),B=K.useRef(new WeakSet);return H.current===null&&(H.current=g0(t==="end"||t==="last-anchor",(Q,ee)=>Q===ee)),P.current===null&&(P.current=g0(b0,Db)),Z.current===null&&(Z.current=Lb()),a.current=e,l.current=o,S.current=r,C.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:N,streamingTurnRef:d,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:p,modeRef:h,pendingScrollFrameRef:y,pendingScrollToMessageRef:w,prependRestoreRef:I,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:H.current,rootRef:g,scrollEdgeThresholdRef:l,scrollMarginRef:S,scrollPreviousItemPeekRef:C,spacerGapRef:x,spacerHeightRef:R,spacerRef:v,stateFrameRef:E,stateStore:P.current,viewportRef:T,visibilityFrameRef:A,visibilityObserverRef:O,visibilityStore:Z.current,visibleMessageIdsRef:D,handledScrollAnchorsRef:B}}function x0(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function hc(e){e.defaultScrollPositionAppliedRef.current=!0,x0(e)}function Nb({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:m,pendingScrollToMessageRef:f,prependRestoreRef:h,scrollMarginRef:p,scrollPreviousItemPeekRef:w,spacerGapRef:I,spacerHeightRef:d,spacerRef:C,viewportRef:b}=e,g=K.useCallback((P)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==P&&(s.current=P,t()),P&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},Ib))},[t]),S=K.useCallback((P)=>{let N=C.current;if(!N)return;let T=Math.max(0,Math.ceil(P));d.current!==T&&(d.current=T,N.hidden=T===0,N.style.height=`${T}px`,N.style.marginTop=T>0?`${-I.current}px`:"")},[]),y=K.useCallback((P,{behavior:N="auto",autoscrolling:T=!1}={})=>{let A=b.current;if(!A)return;let O=Math.max(0,P);if(Math.abs(A.scrollTop-O)<=Ic){A.scrollTop=O,t();return}T&&g(!0),A.scrollTo({top:O,behavior:N}),o()},[t,o,g]),x=K.useCallback(({behavior:P="auto"}={})=>b.current?(S(0),n.current=null,m.current="free-scrolling",y(0,{behavior:P}),r(),!0):!1,[r,y,S]),R=K.useCallback(({behavior:P="auto"}={})=>{let N=b.current;return N?(S(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(Tb(N),{autoscrolling:!0,behavior:P}),r(),!0):!1},[r,y,S]),v=K.useCallback((P,{align:N="start",behavior:T="auto",scrollMargin:A=p.current}={},{keepPreviousPeek:O=!1}={})=>{let Z=c.current,D=b.current;if(!Z||!D||!Z.contains(P))return!1;let B=Pb({align:N,element:P,scrollMargin:O?A+w.current:A,spacer:C.current,viewport:D}),Q=Eb({content:Z,scrollTop:B,spacer:C.current,viewport:D});return S(Q),h.current={element:P,viewportTop:gc(P,D)},m.current=O?"anchored-to-message":"settling-jump",n.current=O?P:null,y(B,{behavior:T}),r(),!0},[r,y,S]),E=K.useCallback(()=>{let P=n.current;return!P||!P.isConnected||m.current!=="anchored-to-message"?!1:v(P,{align:"start"},{keepPreviousPeek:!0})},[v]),H=K.useCallback((P,N)=>{let T=u.current.get(P);return T?(hc(e),v(T,N)?(f.current=null,!0):(f.current={messageId:P,options:N},!0)):l.current===0?(f.current={messageId:P,options:N},hc(e),!0):!1},[v]);return{flushPendingScrollToMessage:K.useCallback(()=>{let P=f.current;if(!P)return!1;let N=u.current.get(P.messageId);return!N||!v(N,P.options)?!1:(f.current=null,hc(e),!0)},[v]),reanchorToAnchoredMessage:E,scrollToElement:v,scrollToEnd:R,scrollToMessage:H,scrollToStart:x}}function h0(e,t){return K.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function Bb({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=db,scrollPreviousItemPeek:r=gb,scrollMargin:n=hb}){let a=Ob({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:m,firstItemRef:f,itemCountRef:h,lastScrollTopRef:p,messageElementsRef:w,modeRef:I,pendingScrollFrameRef:d,pendingScrollToMessageRef:C,prependRestoreRef:b,preserveScrollOnPrependRef:g,pendingDefaultScrollStore:S,rootRef:y,scrollEdgeThresholdRef:x,scrollMarginRef:R,scrollPreviousItemPeekRef:v,spacerGapRef:E,spacerHeightRef:H,spacerRef:P,stateFrameRef:N,stateStore:T,viewportRef:A,visibilityFrameRef:O,visibilityObserverRef:Z,visibilityStore:D,visibleMessageIdsRef:B,handledScrollAnchorsRef:Q}=a,ee=K.useRef(t);ee.current!==t&&(ee.current=t,m.current=!1);let k=K.useCallback((ue)=>{let me=y.current,he=A.current,He=[ue.start&&"start",ue.end&&"end"].filter(Boolean).join(" "),Xe=c.current;for(let st of[me,he])st&&(He?st.setAttribute("data-scrollable",He):st.removeAttribute("data-scrollable"),st.toggleAttribute("data-autoscrolling",Xe))},[]),se=K.useCallback((ue)=>{let me=A.current?.scrollTop??0,he=me<p.current-Ic;p.current=me,i.current&&!ue.end&&I.current!=="settling-jump"&&I.current!=="anchored-to-message"?I.current="following-bottom":I.current==="following-bottom"&&ue.end&&he&&!c.current&&(I.current="free-scrolling")},[]),W=K.useCallback(()=>{let ue=Sb({content:u.current,scrollEdgeThreshold:x.current,spacer:P.current,viewport:A.current});se(ue);let me=I.current==="following-bottom"?{...ue,end:!1}:ue;k(me),T.setSnapshot(me)},[se,T,k]),X=K.useCallback(()=>{N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,W()}))},[W]),z=K.useCallback(()=>{D.hasListeners()&&O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,D.hasListeners()&&D.setSnapshot(wb({content:u.current,scrollMargin:R.current,scrollPreviousItemPeek:v.current,spacer:P.current,viewport:A.current,visibleMessageIds:B.current}))}))},[D]),{flushPendingScrollToMessage:re,reanchorToAnchoredMessage:Ce,scrollToElement:F,scrollToEnd:V,scrollToMessage:Y,scrollToStart:le}=Nb({refs:a,commitScrollState:W,scheduleStateCommit:X,scheduleVisibilitySync:z}),j=K.useCallback(()=>{let ue=b.current,me=A.current;if(!ue||!me||!ue.element.isConnected)return!1;let he=gc(ue.element,me)-ue.viewportTop;return Math.abs(he)<=Ic?!1:(me.scrollTop+=he,ue.viewportTop=gc(ue.element,me),X(),z(),!0)},[X,z]),_=K.useCallback(()=>{let ue=u.current,me=A.current;if(!ue||!me){b.current=null;return}let he=Ab({content:ue,spacer:P.current,viewport:me});b.current=he?{element:he,viewportTop:gc(he,me)}:null},[]),ce=K.useCallback(()=>{d.current===null&&(d.current=window.requestAnimationFrame(()=>{d.current=null,re()&&_()}))},[_,re]),ge=K.useCallback(()=>{if(!t||m.current||h.current===0)return!1;let ue=!1;if(t==="last-anchor"){let me=u.current,he=A.current,He=me&&he?Rb(Ha(me,P.current)):null;if(!me||!he||!He)ue=V({behavior:"auto"});else{let Xe=C0(He,he);ue=Hu({content:me,spacer:P.current,viewport:he})-Xe<=he.clientHeight?V({behavior:"auto"}):F(He,{align:"start"},{keepPreviousPeek:!0})}}else ue=t==="end"?V({behavior:"auto"}):le({behavior:"auto"});return ue?(hc(a),!0):!1},[t,F,V,le]),Te=K.useCallback(()=>{let ue=u.current;if(!ue)return;let me=Ha(ue,P.current),he=h.current,He=f.current;h.current=me.length,f.current=me[0]??null,(()=>{if(re())return;if(he===0){if(ge()||me.length>0&&i.current&&V({behavior:"auto"}))return;W(),z();return}let Xe=He?me.indexOf(He):-1;if(g.current&&Xe>0){j();return}if(me.length>he){let st=xb(me,he);if(st){if(i.current&&I.current==="following-bottom"&&vb(me,he)){V({behavior:"auto"});return}F(st,{align:"start"},{keepPreviousPeek:!0}),Q.current.add(st);return}}if(me.length===he){let st=yb(me,Q.current);if(st){F(st,{align:"start"},{keepPreviousPeek:!0}),Q.current.add(st);return}}I.current==="following-bottom"&&i.current?V({behavior:"auto"}):(W(),z())})(),_()},[ge,_,W,re,j,z,F,V]),Ue=K.useCallback(()=>{if(I.current==="following-bottom"&&i.current){V({behavior:"auto"});return}let ue=H.current;if(Ce()){i.current&&ue>0&&H.current===0&&V({behavior:"auto"});return}X(),z()},[Ce,X,z,V]),ae=K.useCallback(()=>{let ue=A.current;if(!(!ue||!D.hasListeners())){if(typeof IntersectionObserver>"u"){z();return}Z.current||(Z.current=new IntersectionObserver((me)=>{for(let he of me){let He=he.target.dataset.messageId;He&&(he.isIntersecting?B.current.add(He):B.current.delete(He))}z()},{root:ue,rootMargin:`${-(R.current+v.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),w.current.forEach((me)=>{Z.current?.observe(me)}),z()}},[z,D]),de=K.useCallback(()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),Z.current?.disconnect(),Z.current=null,B.current.clear(),D.setSnapshot(bc)},[D]),ne=K.useCallback((ue,me,he)=>{if(me){w.current.set(ue,me),Z.current?.observe(me),z(),C.current?.messageId===ue&&ce();return}he&&w.current.get(ue)===he&&(w.current.delete(ue),B.current.delete(ue),Z.current?.unobserve(he),z())},[ce,z]),Oe=K.useCallback(()=>{(I.current==="following-bottom"||I.current==="anchored-to-message"||I.current==="settling-jump")&&(s.current=null,I.current="free-scrolling")},[]),Be=K.useCallback(()=>k(T.getSnapshot()),[T,k]),$e=h0(y,Be),L=h0(A,Be),U=K.useCallback((ue)=>{u.current=ue},[]),xe=K.useCallback((ue)=>{P.current=ue,E.current=kb(ue?.parentElement??null)},[]),oe=K.useCallback(()=>{W(),z(),_()},[_,W,z]),ie=K.useMemo(()=>({handleContentChange:Te,handleResize:Ue,observeVisibility:ae,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:g,scrollToEnd:V,scrollToMessage:Y,scrollToStart:le,setContentElement:U,setRootElement:$e,setSpacerElement:xe,setViewportElement:L,stateStore:T,syncAfterScroll:oe,unobserveVisibility:de,userScrollIntent:Oe,viewportRef:A,visibilityStore:D}),[Te,Ue,ae,S,V,Y,le,U,$e,xe,L,T,oe,de,Oe,D]);return K.useLayoutEffect(()=>{ge()||h.current===0&&x0(a)},[ge]),K.useEffect(()=>()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null),Z.current?.disconnect(),Z.current=null},[]),K.useLayoutEffect(()=>{if(e&&I.current==="following-bottom"&&h.current>0){V({behavior:"auto"});return}W()},[e,W,V]),{context:ie,registerMessage:ne}}function Hb(e){let t=K.useRef(e);return t.current=e,t}var y0=K.createContext(null),v0=K.createContext(null);function Va(){let e=K.useContext(y0);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function Vb(){let e=K.useContext(v0);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function Ub({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=Bb({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Fn(y0.Provider,{value:s,children:Fn(v0.Provider,{value:i,children:t})})}function R0(){let{pendingDefaultScrollStore:e}=Va();return K.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Wb({children:e,...t}){let{setRootElement:o}=Va(),r=R0();return Fn("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function Gb({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:l,...u}){let{handleResize:m,preserveScrollOnPrependRef:f,setViewportElement:h,syncAfterScroll:p,userScrollIntent:w,viewportRef:I}=Va(),d=R0();f.current=s;let C=K.useCallback((x)=>{h(x),Dn(i)?.(x)},[i,h]);function b(x){p(),r?.(x)}function g(x){w(),a?.(x)}function S(x){w(),n?.(x)}function y(x){bb.has(x.key)&&w(),o?.(x)}return K.useEffect(()=>{let x=I.current;if(!x||typeof ResizeObserver>"u")return;let R=0,v=new ResizeObserver(()=>{window.cancelAnimationFrame(R),R=window.requestAnimationFrame(m)});return v.observe(x),()=>{window.cancelAnimationFrame(R),v.disconnect()}},[m,I]),Fn("div",{ref:C,role:c??"region","aria-label":e??"Messages",tabIndex:l??0,onKeyDown:y,onScroll:b,onTouchMove:S,onWheel:g,...u,...d?{"data-pending-scroll":""}:null,children:t})}function _b({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:l}=Va(),u=K.useRef(null),m=K.useCallback((f)=>{u.current=f,c(f),Dn(o)?.(f)},[o,c]);return K.useLayoutEffect(()=>{let f=u.current;if(!f||(s(),typeof MutationObserver>"u"))return;let h=new MutationObserver(()=>{s()});return h.observe(f,{childList:!0}),()=>h.disconnect()},[s]),K.useEffect(()=>{let f=u.current;if(!f||typeof ResizeObserver>"u")return;let h=0,p=new ResizeObserver(()=>{window.cancelAnimationFrame(h),h=window.requestAnimationFrame(i)});return p.observe(f),()=>{window.cancelAnimationFrame(h),p.disconnect()}},[i]),I0("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Fn("div",{ref:l,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function zb({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=Vb(),a=K.useRef(null),s=K.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),Dn(t)?.(i)},[e,t,n]);return Fn("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function Zb({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=Va(),m=Hb(r),f=K.useCallback((I)=>u.subscribe(I),[u]),h=K.useCallback(()=>{let I=u.getSnapshot();return o==="start"?I.start:I.end},[o,u]),p=K.useSyncExternalStore(f,h,h),w=K.useCallback((I)=>{p&&(m.current?.(I),I.defaultPrevented||(I.currentTarget.blur(),o==="start"?l({behavior:e}):c({behavior:e})))},[e,o,p,m,c,l]);return d0({defaultTagName:"button",props:dc({type:s,inert:!p,tabIndex:p?a:-1,children:t??I0("span",{children:["Scroll to ",o]}),onClick:w},i),render:n,state:{active:p,direction:o},stateAttributesMapping:{active:(I)=>({"data-active":I?"true":"false"})}})}var rn={Provider:Ub,Root:Wb,Viewport:Gb,Content:_b,Item:zb,Button:Zb};import*as Cc from"react";import*as Rt from"react";var A0=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.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",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Rt.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",Rt.createElement(Rt.Fragment,null,Rt.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",Rt.createElement(Rt.Fragment,null,Rt.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",Rt.createElement(Rt.Fragment,null,Rt.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",Rt.createElement(Rt.Fragment,null,Rt.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 Vu=Cc.forwardRef((e,t)=>Cc.createElement(We,{ref:t,...e,weights:A0}));Vu.displayName="ArrowDownIcon";import{jsx as lr,jsxs as jb,Fragment as qb}from"react/jsx-runtime";function P0(e){return lr(rn.Provider,{...e})}function E0({className:e,...t}){return lr(rn.Root,{"data-slot":"message-scroller",className:fe("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function T0({className:e,...t}){return lr(rn.Viewport,{"data-slot":"message-scroller-viewport",className:fe("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 M0({className:e,...t}){return lr(rn.Content,{"data-slot":"message-scroller-content",className:fe("flex h-max min-h-full flex-col gap-6",e),...t})}function k0({className:e,scrollAnchor:t=!1,...o}){return lr(rn.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:fe("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function L0({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return lr(rn.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:fe("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??lr(Ot,{variant:n,size:a}),...s,children:o??jb(qb,{children:[lr(Vu,{}),lr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as Ee,jsxs as $t}from"react/jsx-runtime";function $b(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function D0({attachment:e}){let[t,o]=Sc(!1),[r,n]=Sc(!1);return $t("div",{className:"flex flex-col items-end gap-1",children:[Ee(Ot,{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 u0(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:Ee(Mu,{})}),r&&Ee("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function Xb({attachments:e,allowDownloads:t=!1}){let[o,r]=Sc(null),[n,a]=Sc(!1);if(!e?.length)return null;return $t(n0,{onOpenChange:(s)=>{if(!s)r(null)},children:[Ee(Ls,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return Ee(hn,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:Ee(a0,{render:Ee("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:Ee("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return $t(hn,{className:"min-w-52",children:[Ee($n,{children:Ee(Vr,{})}),$t(Xn,{className:"max-w-44",children:[Ee(Kn,{title:s.name,children:s.name}),$t(Yn,{children:[s.type||"File"," ·"," ",$b(s.size)]})]}),t&&s.url&&Ee(ks,{children:Ee(D0,{attachment:s})})]},s.storageId)})}),$t(i0,{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:[Ee(c0,{className:"sr-only",children:o?.name??"Image preview"}),Ee(l0,{className:"sr-only",children:"Expanded image preview"}),$t("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&Ee(D0,{attachment:o},o.storageId),Ee(s0,{render:Ee(Ot,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:Ee(Go,{})})]}),n?Ee("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&Ee("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function Uu({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return Ee(P0,{children:$t(E0,{children:[Ee(T0,{children:$t(M0,{className:"p-4",children:[e?.length===0&&Ee(yg,{children:$t(vg,{children:[Ee(Rg,{children:"No messages yet"}),Ee(Ag,{children:"Send a message to get started."})]})}),e?.map((c,l)=>{let u=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),f=e[l-1]?._creationTime,h=i&&m&&(f===void 0||m.toDateString()!==new Date(f).toDateString()),p=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return $t(k0,{messageId:c._id,scrollAnchor:u,children:[h&&Ee(m0,{variant:"separator",className:"mb-5",children:Ee(f0,{children:p0(m.getTime())})}),$t(Pg,{align:u?"end":"start",children:[(u?n:a)&&Ee(Eg,{className:"size-7 min-w-7",children:u?n:a}),$t(Tg,{children:[i&&$t(Mg,{className:"gap-2",children:[c.sender==="customer"?"You":p?"Ten":"Support",p&&Ee(pc,{variant:"secondary",children:"AI"})]}),Ee(Xb,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&Ee(Pu,{variant:"muted",children:Ee(Eu,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!u&&r?Ee("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):Ee(Pu,{variant:u?o:"secondary",children:Ee(Eu,{children:c.body})})),c.citations&&c.citations.length>0&&Ee("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((w)=>w.url?Ee("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):Ee("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:w.title},w.sourceId))}),c.generationStatus==="failed"&&$t("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[Ee("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&&$t(Ot,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[Ee(Tu,{}),"Retry"]})]}),i&&m&&Ee(kg,{children:Ee("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),Ee(L0,{})]})})}import{jsx as Kb}from"react/jsx-runtime";function F0({className:e,...t}){return Kb("label",{"data-slot":"label",className:fe("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 Yb}from"react/jsx-runtime";function Tr({className:e,...t}){return Yb("div",{"data-slot":"skeleton",className:fe("animate-pulse rounded-md bg-muted",e),...t})}import{jsx as we,jsxs as Nt}from"react/jsx-runtime";function Qb(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 O0({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,onClose:a,onSettingsChange:s,theme:i,assetBaseUrl:c}){let l=wc(ko.workspace,{workspaceId:e}),u=l===void 0?t:l,m=Jb("");Ua(()=>{if(!l)return;let j=JSON.stringify(l);if(m.current===j)return;m.current=j,s(l)},[s,l]);let f=u?{...u,theme:i}:u,h=On(ko.openWebsite),p=On(ko.startCustomer),w=On(ko.sendCustomer),I=On(ko.retryAgentResponse),d=On(ko.generateAttachmentUploadUrl),C=On(ko.markCustomerRead),[b,g]=Mr(""),[S,y]=Mr(),[x,R]=Mr(""),[v,E]=Mr(!1),[H,P]=Mr(""),[N,T]=Mr(),[A,O]=Mr("chat"),[Z,D]=Mr(),B=!!o,Q=wc(ko.visitorProfile,b&&B?{workspaceId:e,visitorId:b,sessionToken:o}:"skip");Ua(()=>{let j=`coristen:${e}`,_=localStorage.getItem(j)??crypto.randomUUID();localStorage.setItem(j,_),g(_);let ce=navigator.userAgent;D({currentPage:window.location.href,referrer:document.referrer,browser:Qb(ce),device:/Mobi|Android|iPhone|iPad/i.test(ce)?"Mobile":navigator.platform||"Desktop"})},[e]);async function ee(j){if(j.preventDefault(),!Z||!o||v)return;E(!0),P("");try{let _=x.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",ce=await h({workspaceId:e,visitorId:b,sessionToken:o,name:_,email:x,...Z,newConversation:!0});y(ce??void 0),O("chat")}catch{P("We couldn't save your email. Please try again.")}finally{E(!1)}}async function k(){if(!Q){O("chat");return}if(!Z||v)return;E(!0),P("");try{let j=await h({workspaceId:e,visitorId:b,sessionToken:o,...Q,...Z,newConversation:!0});y(j??void 0),O("chat")}catch{P("We couldn't start a new conversation. Please try again.")}finally{E(!1)}}let se=wc(ko.customerMessages,S&&b&&B?{conversationId:S,visitorId:b,sessionToken:o}:"skip"),W=wc(ko.visitorConversations,b&&B?{workspaceId:e,visitorId:b,sessionToken:o}:"skip"),X=se?.at(-1);if(Ua(()=>{if(se!==void 0)T(void 0)},[se]),Ua(()=>{if(A==="chat"&&B&&S&&b&&X?.sender==="merchant")C({conversationId:S,visitorId:b,sessionToken:o}).catch(()=>{})},[S,A,X?._id,X?.sender,C,o,B,b]),Ua(()=>{let j=(_)=>{if(_.key==="Escape"&&!_.defaultPrevented)a()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[a]),f===void 0||!o)return null;if(f===null||f.enabled===!1)return we(yu,{className:"w-full max-w-md",children:Nt(vu,{children:[we(Ru,{children:"Chat unavailable"}),we(Au,{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"],re=`${z}px`,Ce=f?.accentEnabled?f.brandColor:"#171717",F=f.theme==="dark"?`color-mix(in oklch, ${Ce} 20%, white)`:Ce,V=f.agentImageUrl?we("img",{src:f.agentImageUrl,alt:"",className:"size-7 rounded-full object-cover"}):we(ln,{seed:"Coristen agent",size:28,className:"size-7 contrast-200 grayscale"}),Y=Nt("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-8 py-10 text-center",children:[we("div",{className:"flex size-12 items-center justify-center overflow-hidden rounded-full bg-muted",children:f.agentImageUrl?we("img",{src:f.agentImageUrl,alt:"",className:"size-12 object-cover"}):we(ln,{seed:"Coristen agent",size:48,className:"size-12 contrast-200 grayscale"})}),Nt("div",{className:"space-y-1.5",children:[Nt("p",{className:"text-base font-semibold",children:["Hi, I’m ",f.agentName]}),we("p",{className:"max-w-72 text-sm text-muted-foreground",children:f.welcomeMessage})]})]}),le=A==="history"?"history":S?`conversation:${S}`:Q===null?"contact":"new";return we("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:Nt(yu,{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"?F:Ce:void 0,"--primary-foreground":f.accentSendIcon&&f.theme==="dark"?"#171717":void 0,"--radius":re,"--radius-small":`${z*0.6}px`,"--radius-medium":`${z*0.8}px`,"--radius-control":re,"--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":re,"--widget-action-radius":"max(0px, calc(var(--configured-radius) - var(--surface-inset-md) - 1px))",backgroundColor:f?.tintedGrayscale?`color-mix(in oklch, ${Ce} 4%, var(--background))`:void 0},children:[Nt(vu,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:F}:void 0,children:[we(Ru,{className:"truncate",children:f.name}),we(Au,{className:"text-current opacity-85",children:A==="history"?"Continue a previous conversation":"How can we help?"}),Nt(wg,{className:"flex gap-1",children:[Nt(Ot,{variant:"ghost",size:"sm",onClick:()=>O(A==="chat"?"history":"chat"),children:[A==="chat"?we(ms,{"data-icon":"inline-start"}):we(Qa,{"data-icon":"inline-start"}),A==="chat"?"Messages":"Chat"]}),we(Ot,{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?we(rs,{}):we(as,{})}),we(Ot,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:a,children:we(Go,{})})]})]}),H&&Q!==null&&we("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:H}),we(xg,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:A==="history"?we("div",{className:"flex min-h-0 w-full flex-col",children:Nt("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[W===void 0&&Array.from({length:3}).map((j,_)=>Nt("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[we(Tr,{className:"h-4 w-4/5"}),we(Tr,{className:"h-3 w-2/5"})]},_)),W?.map((j)=>Nt("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(j._id),O("chat")},children:[we("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:f.agentImageUrl?we("img",{src:f.agentImageUrl,alt:"",className:"size-9 object-cover"}):we(ln,{seed:"Coristen agent",size:36,className:"size-9 contrast-200 grayscale"})}),Nt("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[Nt("span",{className:"flex items-center justify-between gap-2",children:[we("span",{className:"text-sm font-medium",children:"Conversation"}),we("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(j.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(j.lastMessageAt)})]}),we("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:j.lastMessagePreview||"Attachment"}),!!j.customerUnreadCount&&Nt(pc,{variant:"secondary",children:[j.customerUnreadCount," unread"]})]}),we(ls,{className:"size-4 shrink-0 text-muted-foreground"})]},j._id)),W?.length===0&&we("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):Q===void 0&&!S?Nt("div",{className:"flex w-full flex-col justify-center gap-4 p-6",children:[we(Tr,{className:"h-5 w-28"}),we(Tr,{className:"h-4 w-52"}),we(Tr,{className:"h-8 w-full"}),we(Tr,{className:"h-8 w-full"}),we(Tr,{className:"h-8 w-full"})]}):Q===null&&!S?we("div",{className:"flex min-h-0 w-full flex-col",children:Y}):S&&se===void 0&&N?we(Uu,{messages:[{_id:"pending-first-message",_creationTime:N.createdAt,sender:"customer",body:N.body,attachments:N.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:we(ln,{seed:b,size:28,className:"size-7"}),otherAvatar:V}):!S||se===void 0||se.length===0?Y:we(Uu,{messages:se,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:we(ln,{seed:b,size:28,className:"size-7"}),otherAvatar:V,onRetry:(j)=>{P(""),I({conversationId:S,visitorId:b,customerMessageId:j,sessionToken:o}).catch(()=>P("The reply couldn't be retried. Please try again."))}},S)},le),A==="history"&&we(sc,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:Nt(Ot,{variant:"secondary",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:v||Q===void 0,onClick:()=>void k(),children:[we(un,{"data-icon":"inline-start"}),"Start a conversation"]})}),Q===null&&!S&&A==="chat"&&we(sc,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:Nt("form",{className:"flex w-full flex-col gap-3",onSubmit:(j)=>void ee(j),children:[Nt("div",{className:"flex flex-col gap-2",children:[we(F0,{htmlFor:"customer-email",children:"Email address"}),we(wu,{id:"customer-email",type:"email",value:x,onChange:(j)=>R(j.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),H&&we("p",{role:"alert",className:"text-xs text-destructive",children:H}),we(Ot,{type:"submit",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:v||!Z,children:v?"Continuing...":"Continue"})]})}),Q&&A==="chat"&&B&&we(sc,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:we(Sg,{sendDisabled:!Z,showPoweredBy:f.showPoweredBy,assetBaseUrl:c,upload:async(j)=>{if(j.size>f.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${f.maxAttachmentSizeMb} MB or smaller`);if(!f.allowedAttachmentTypes.some((Te)=>j.type===Te||j.type.startsWith(Te)))throw Error("This file type is not allowed");let _=await d({workspaceId:e,visitorId:b,sessionToken:o}),ce=await fetch(_,{method:"POST",headers:{"Content-Type":j.type||"application/octet-stream"},body:j});if(!ce.ok)throw Error("Upload failed");let{storageId:ge}=await ce.json();return{storageId:ge,name:j.name,type:j.type||"application/octet-stream",size:j.size}},send:async(j,_)=>{if(S)return await w({conversationId:S,visitorId:b,sessionToken:o,body:j,attachments:_});if(!Z)throw Error("Chat is still loading");await h({workspaceId:e,visitorId:b,sessionToken:o,...Q,...Z,newConversation:!0});let ce=await p({workspaceId:e,visitorId:b,sessionToken:o,body:j,attachments:_});return T({body:j,attachments:_.map((ge)=>({...ge,url:null})),createdAt:Date.now()}),y(ce),ce}})})]})})}function N0(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{jsx as oo,jsxs as Ga}from"react/jsx-runtime";var aC="https://coristen-three.vercel.app",sC=["--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"],iC={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 B0 extends eC{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 Ga("div",{className:"flex h-full flex-col items-center justify-center gap-3 bg-background p-6 text-center text-foreground",children:[Ga("div",{children:[oo("p",{className:"font-medium",children:"Chat couldn't load"}),oo("p",{className:"mt-1 text-sm text-muted-foreground",children:"Check your connection and try again."})]}),Ga("div",{className:"flex gap-2",children:[oo("button",{type:"button",className:"rounded-lg border px-3 py-2 text-sm",onClick:this.props.onClose,children:"Close"}),oo("button",{type:"button",className:"rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",onClick:this.props.onRetry,children:"Try again"})]})]})}}function oYe({identity:e,apiKey:t,apiUrl:o=aC,defaultOpen:r=!1,fontSize:n,appearance:a,onReady:s,onError:i}){let c=o.replace(/\/$/,""),[l,u]=ur(),[m,f]=ur(""),[h,p]=ur(),[w,I]=ur(r),[d,C]=ur(!1),[b,g]=ur(0),[S,y]=ur({}),[x,R]=ur(!1),[v,E]=ur(),H=Wa(null),P=Wa(void 0),N=Wa(!1),T=Wa(s),A=Wa(i);T.current=s,A.current=i;let O=tC(async(F)=>{let V=t,Y;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let _=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!_.ok){let ge=Error("Authentication required");throw ge.status=_.status,ge}let ce=await _.json();if(V=ce.publishableKey,Y=ce.identityToken,!Y)throw Error("Invalid Coristen identity response")}if(!V?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let le=await fetch(`${c}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:V,identityToken:Y,previousToken:F})});if(!le.ok){let _=Error(await le.text());throw _.status=le.status,_}let j=await le.json();if(e&&!j.identity)throw Error("Verified identity required");return j},[t,c,e]);Nn(()=>{let F=!0,V,Y="",le=async()=>{try{let j=await O(Y||void 0);if(!F)return;Y=j.token,u(j),f(""),T.current?.(),V=window.setTimeout(le,Math.max(5000,j.expiresAt-Date.now()-30000))}catch(j){if(!F)return;let _=j instanceof Error?j:Error("Widget failed to load");f(N0(_)),u((ge)=>ge&&ge.expiresAt>Date.now()?ge:void 0),A.current?.(_),console.error("[Coristen widget] Failed to initialize",_);let ce=_.status;if(!ce||ce===429||ce>=500)V=window.setTimeout(le,5000)}};return le(),()=>{if(F=!1,V)window.clearTimeout(V);if(Y)fetch(`${c}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:Y}),keepalive:!0})}},[c,O,b]),Nn(()=>{let F=()=>g((le)=>le+1),V=()=>I(!0),Y=()=>I(!1);return window.addEventListener("coristen:reset",F),window.addEventListener("coristen:open",V),window.addEventListener("coristen:close",Y),()=>{window.removeEventListener("coristen:reset",F),window.removeEventListener("coristen:open",V),window.removeEventListener("coristen:close",Y)}},[]),Nn(()=>{if(l)p(l.settings)},[l]),Nn(()=>{if(!w)return;let F=(V)=>{if(!H.current?.contains(V.target))I(!1)};return document.addEventListener("pointerdown",F),()=>document.removeEventListener("pointerdown",F)},[w]),Nn(()=>{if(!v)return;let F=()=>E((V)=>{if(!V)return V;let Y=window.innerWidth<640?12:20;return{left:Math.min(Math.max(V.left,Y),window.innerWidth-56-Y),top:Math.min(Math.max(V.top,Y),window.innerHeight-56-Y)}});return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[v]),Nn(()=>{let F=()=>{let Y=getComputedStyle(document.documentElement);R(document.documentElement.classList.contains("dark")),y(Object.fromEntries(sC.flatMap((le)=>{let j=Y.getPropertyValue(le).trim();return j?[[le,j]]:[]})))};F();let V=new MutationObserver(F);return V.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>V.disconnect()},[]);let Z=oC(()=>l?new nC(l.convexUrl):void 0,[l?.convexUrl]),D={...h??l?.settings??iC,...a,theme:a?.theme??(x?"dark":"light")};if(D.enabled===!1)return null;let B=D.position==="left"?"left":"right",Q=v&&typeof window<"u"?v.left+28<window.innerWidth/2?"left":"right":B,ee=v&&typeof window<"u"?v.top+28<window.innerHeight/2?"top":"bottom":"bottom",k={none:0,sm:6,md:10,lg:16}[D.radius],W={...v?{left:`${v.left}px`,top:`${v.top}px`,right:"auto",bottom:"auto"}:B==="left"?{left:"20px"}:{right:"20px"},...S,"--coristen-radius":`${k}px`,"--coristen-bubble-color":D.bubbleColor,...n?{"--coristen-font-size":n}:{}},X=v&&typeof window<"u"?(()=>{let F=window.innerWidth<640?0:20,V=Math.min(d?580:420,window.innerWidth-F*2),Y=Math.min(600,window.innerHeight-F*2);return{position:"fixed",right:"auto",bottom:"auto",left:Math.min(Math.max(Q==="left"?v.left:v.left+56-V,F),window.innerWidth-V-F),top:Math.min(Math.max(ee==="top"?v.top:v.top+56-Y,F),window.innerHeight-Y-F)}})():void 0,z=(F)=>{if(w||F.button!==0)return;let V=F.currentTarget.getBoundingClientRect();P.current={pointerId:F.pointerId,startX:F.clientX,startY:F.clientY,left:V.left,top:V.top,moved:!1},F.currentTarget.setPointerCapture(F.pointerId)},re=(F)=>{let V=P.current;if(!V||V.pointerId!==F.pointerId)return;if(!V.moved&&Math.hypot(F.clientX-V.startX,F.clientY-V.startY)<=4)return;V.moved=!0;let Y=window.innerWidth<640?12:20;E({left:Math.min(Math.max(V.left+F.clientX-V.startX,Y),window.innerWidth-56-Y),top:Math.min(Math.max(V.top+F.clientY-V.startY,Y),window.innerHeight-56-Y)})},Ce=(F)=>{let V=P.current;if(!V||V.pointerId!==F.pointerId)return;if(V.moved){N.current=!0;let Y=window.innerWidth<640?12:20;E((le)=>le?{left:le.left+28<window.innerWidth/2?Y:window.innerWidth-56-Y,top:le.top}:le)}P.current=void 0};if(m&&(!l||!Z))return oo("div",{"data-coristen-widget":"",className:D.theme==="dark"?"dark":void 0,style:W,children:Ga("div",{className:"coristen-load-error",role:"alert",children:[oo("strong",{children:"Support chat couldn't load"}),oo("span",{children:m}),oo("button",{type:"button",onClick:()=>{f(""),g((F)=>F+1)},children:"Try again"})]})});if(!l||!Z)return null;return Ga("div",{ref:H,"data-coristen-widget":"","data-open":w||void 0,"data-expanded":d||void 0,"data-position":Q,"data-vertical":ee,className:D.theme==="dark"?"dark":void 0,style:W,children:[l&&Z&&oo("div",{className:"coristen-panel",role:"dialog","aria-label":`${D.name} chat`,"aria-hidden":!w,inert:!w,style:X,children:oo(B0,{onError:(F)=>A.current?.(F),onClose:()=>I(!1),onRetry:()=>g((F)=>F+1),children:oo(rC,{client:Z,children:oo(O0,{workspaceId:l.workspaceId,initialSettings:D,sessionToken:l.token,expanded:d,onExpandedChange:C,onClose:()=>I(!1),onSettingsChange:p,theme:D.theme,assetBaseUrl:c})})},b)}),oo("button",{type:"button",className:"coristen-launcher","aria-label":w?"Close chat":"Open chat","aria-expanded":w,"aria-busy":!l,onPointerDown:z,onPointerMove:re,onPointerUp:Ce,onPointerCancel:Ce,onClick:()=>{if(N.current){N.current=!1;return}I((F)=>!F)},children:oo("img",{src:`${c}/widget-icons/${D.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})})]})}var rYe={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{oYe as CoristenWidget,rYe as coristenWidget};
|
|
2
|
+
var bh=Object.create;var{getPrototypeOf:Ch,defineProperty:hl,getOwnPropertyNames:Sh}=Object;var Um=Object.prototype.hasOwnProperty;function wh(e){return this[e]}var xh,yh,_m=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?xh??=new WeakMap:yh??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?bh(Ch(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 Sh(e))if(!Um.call(s,i))hl(s,i,{get:wh.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var Rh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var vh=(e)=>e;function Th(e,t){this[e]=vh.bind(null,t)}var fs=(e,t)=>{for(var o in t)hl(e,o,{get:t[o],enumerable:!0,configurable:!0,set:Th.bind(t,o)})};import*as qo from"react";var Fi=Rh(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=qo.useState,k2=qo.useEffect,L2=qo.useLayoutEffect,D2=qo.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=qo.useSyncExternalStore!==void 0?qo.useSyncExternalStore:N2});var fr={};fs(fr,{android:()=>Qf,apple:()=>Bl,ios:()=>Nl,linux:()=>YI,mac:()=>ep,windows:()=>$I});var pr={};fs(pr,{blink:()=>JI,gecko:()=>KI,webkit:()=>Hl});var Vl={};fs(Vl,{voiceOver:()=>QI});var Sa={};fs(Sa,{jsdom:()=>e2});import{Component as ow,useCallback as rw,useEffect as Sn,useMemo as nw,useRef as rs,useState as ir}from"react";import{ConvexProvider as aw,ConvexReactClient as sw}from"convex/react";import{useEffect as os,useRef as AS,useState as zr}from"react";import{useMutation as Yn,useQuery as Nc}from"convex/react";import{jsx as Nh}from"react/jsx-runtime";var Uo=34,Qr=200,Eh=6,Ph=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function Ah(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(Ah(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 Mh(e){let[t]=Gm(e,1),o=t%360;return{fill:Wm(o,85,30),stroke:Wm(o,90,65)}}function kh(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 Lh(e){let t=[];for(let o=0;o<Uo;o++){let r=[];for(let n=0;n<Uo;n++){let a=Ph[o%4][n%4]/16;r.push(e[o][n]>=a?1:0)}t.push(r)}return t}function Dh(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 Fh(e){let{fill:t,stroke:o}=Mh(e),r=kh(e),n=Lh(r),a=Dh(n),i=Qr/Uo*(Eh/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 Oh(e){let t=Fh(e);return`data:image/svg+xml,${encodeURIComponent(t)}`}function vn({seed:e,size:t=40,className:o,style:r}){let n=Oh(e);return Nh("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 Bh}from"react";var zm=Bh({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 mt from"react";var Zm=new Map([["bold",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),mt.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",mt.createElement(mt.Fragment,null,mt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]);var ds=ps.forwardRef((e,t)=>ps.createElement(Oe,{ref:t,...e,weights:Zm}));ds.displayName="ArrowLeftIcon";import*as gs from"react";import*as ft from"react";var qm=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 hs=gs.forwardRef((e,t)=>gs.createElement(Oe,{ref:t,...e,weights:qm}));hs.displayName="ArrowUpIcon";import*as Is from"react";import*as pt from"react";var Xm=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 bs=Is.forwardRef((e,t)=>Is.createElement(Oe,{ref:t,...e,weights:Xm}));bs.displayName="ArrowsInSimpleIcon";import*as Cs from"react";import*as dt from"react";var jm=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 Ss=Cs.forwardRef((e,t)=>Cs.createElement(Oe,{ref:t,...e,weights:jm}));Ss.displayName="ArrowsOutSimpleIcon";import*as ws from"react";import*as gt from"react";var $m=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 xs=ws.forwardRef((e,t)=>ws.createElement(Oe,{ref:t,...e,weights:$m}));xs.displayName="BinocularsIcon";import*as ys from"react";import*as ht from"react";var Ym=new Map([["bold",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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",ht.createElement(ht.Fragment,null,ht.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 It from"react";var Km=new Map([["bold",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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",It.createElement(It.Fragment,null,It.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 bt from"react";var Jm=new Map([["bold",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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",bt.createElement(bt.Fragment,null,bt.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 Ct from"react";var Qm=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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",Ct.createElement(Ct.Fragment,null,Ct.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 St from"react";var ef=new Map([["bold",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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"}),St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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",St.createElement(St.Fragment,null,St.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 wt from"react";var tf=new Map([["bold",wt.createElement(wt.Fragment,null,wt.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",wt.createElement(wt.Fragment,null,wt.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"}),wt.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",wt.createElement(wt.Fragment,null,wt.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",wt.createElement(wt.Fragment,null,wt.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",wt.createElement(wt.Fragment,null,wt.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",wt.createElement(wt.Fragment,null,wt.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 xt from"react";var of=new Map([["bold",xt.createElement(xt.Fragment,null,xt.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",xt.createElement(xt.Fragment,null,xt.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"}),xt.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",xt.createElement(xt.Fragment,null,xt.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",xt.createElement(xt.Fragment,null,xt.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",xt.createElement(xt.Fragment,null,xt.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",xt.createElement(xt.Fragment,null,xt.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 yt from"react";var rf=new Map([["bold",yt.createElement(yt.Fragment,null,yt.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",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:"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",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,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",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.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",yt.createElement(yt.Fragment,null,yt.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 Qo}from"convex/server";var _o={workspace:Qo("conversations:workspace"),visitorProfile:Qo("conversations:visitorProfile"),openWebsite:Qo("conversations:openWebsite"),visitorConversations:Qo("conversations:visitorConversations"),customerMessages:Qo("conversations:customerMessages"),startCustomer:Qo("conversations:startCustomer"),sendCustomer:Qo("conversations:sendCustomer"),retryAgentResponse:Qo("conversations:retryAgentResponse"),generateAttachmentUploadUrl:Qo("conversations:generateAttachmentUploadUrl"),markCustomerRead:Qo("conversations:markCustomerRead")};import{useEffect as vC,useRef as TC,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 Ut(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 Hh(e)}function ra(e,t){if(cf(t))return t(e);return Vh(e,t)}function Hh(e){let t={...e};for(let o in t){let r=t[o];if(sf(o,r))t[o]=lf(r)}return t}function Vh(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]=Uh(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 Uh(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 Pr 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(_h(n,e,t,o,r))gf(n,[e,t,o,r]);return n.callback}function pf(e){let t=qe(df).current;if(Wh(t,e))gf(t,e);return t.callback}function df(){return{callback:null,cleanup:null,refs:[]}}function _h(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function Wh(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 Gh=parseInt(hf.version,10);function En(e){return Gh>=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 mr=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=zh(t,o,r);if(o.enabled===!1)return null;let a=o.state??_e;return Xh(e,r,n,a)}function zh(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 Ut(void 0,e)}var qh=Symbol.for("react.lazy");function aa(e){if(e?.$$typeof!==qh)return e;let t=Pr.Children.toArray(e)[0];return Pr.isValidElement(t)?t:e}function Xh(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Ut(o,t.props);return n.ref=o.ref,Pr.cloneElement(t,n)}return jh(e,o)}function jh(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 Pr.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 er=(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},Ar=(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 $h=[],on=Bs(er("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),Yh=Bs(er(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var Kh=(()=>{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})(),Jh=er("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),Qh=Bs(er("123333359346463635126536711576")),eI=er("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),tI=er("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),oI=Ar("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),rI=(()=>{let e=new Int32Array(319).fill(-1),t=Ar("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=Ar("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=Ar("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),aI=Ar("ɠ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=Ar("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=Ar("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),cI=Bs(er("1::24444432:442:44:44>222222:44:4421322511111311111114")),lI=Ar("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=er("ij"),mI=er(""),fI=er("1"),pI="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",Mf={GROUP_COUNT:384,customValidatorNames:$h,edgeStart:on,labelStart:Yh,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:Kh,nodeGroup:Jh,nodeVlist:rI,vlistPat:Qh,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},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 N=32;while(N<2*(1+E+y.length))N<<=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 F=n.length-1,X=new Uint8Array(F),P=0,O=!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)O=!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 ut=d[I[Xe]*2],Ke=!0;for(let Pe=0;Pe<Le;Pe++)if(C.charCodeAt(ut+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,ut=D.get(Xe);if(ut!==void 0)e:for(let Ue=0;Ue<ut.length;Ue++){let $e=ut[Ue];if($e.imp!==Be||$e.k.length!==xe-te)continue;for(let Vt=0;Vt<$e.k.length;Vt++)if($e.k.charCodeAt(Vt)!==Z.charCodeAt(te+Vt))continue e;return $e.id}else D.set(Xe,ut=[]);let Ke=Z.slice(te,xe),Pe=Le(Ke);return ut.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 ut=Z?Xe+" !":Xe,Ke=he.get(ut);if(Ke===void 0)he.set(ut,Ke=Ae++);return Ke},so=new Map,io=r,No=r+4096,qt=()=>io++,_t=2097152,po=8192,Io=new Int32Array(po),Jt=Array(po).fill(null),Xr=new Int32Array(po),jr=new Int32Array(po),We=new Uint8Array(po),Ot=0,Ce=(D,Z,te,xe,Be,Le,Xe,ut)=>{let Ke=D;if(Jt[D]!==null)if(Jt[D|1]===null)Ke=D|1;else if((Ot++&3)===0)Ke=D|Ot>>2&1;else return;Jt[Ke]=Z.slice(te,xe),Io[Ke]=Be,Xr[Ke]=Le,jr[Ke]=Xe,We[Ke]=ut},Re=()=>Jt.fill(null),Ve=256,Nt=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Wt,co,Ht,bo]=Nt,Bo=new Uint8Array(Ve),Ro=new Uint8Array(Ve),wn=()=>{Ve*=2,Nt=Nt.map((Z)=>{let te=new Int32Array(Ve);return te.set(Z),te}),[Wt,co,Ht,bo]=Nt;let D=new Uint8Array(Ve);D.set(Bo),Bo=D,Ro=new Uint8Array(Ve)},$o=64,$r=new Int32Array($o),Yr=new Int32Array($o),tl=new Int32Array(r),yr=2048,Fm=21,ol=new Float64Array(yr),ns=new Int32Array(yr),Rr=0,rl=(D,Z)=>{if(D===0&&Z<r){if(tl[Z]===Rr)return 1;return tl[Z]=Rr,0}let te=D*2097152+Z+1,xe=Math.imul(te,2654435761)>>>Fm;for(;;){if(ns[xe]!==Rr)break;if(ol[xe]===te)return 1;xe=xe+1&yr-1}return ol[xe]=te,ns[xe]=Rr,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 ut=$r[Le],Ke=te-Xe;if(X[ut]===1&&Ke>0&&Ke<=P){let Gt=D.charCodeAt(Xe);if(O===!1||Gt!==91&&Gt!==40){let Tr=k(ut,D,Xe,te);if(Tr>=0)return Tr}}let Pe=u[ut];if(Pe<0)continue;let Ue=f[Pe],$e=l[Ue],Vt=l[Ue+1];if($e===Vt)continue;le(D,Xe,te);let Qt=A[Pe]-$e;for(let Gt=$e;Gt<Vt;Gt++)if(j(m[Gt],D,Xe,te))return g[Qt+Gt]}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,Re();if(io>No)so=new Map,io=r,Re();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 Vt=Le,Qt=Vt-Ue;if(te===Ve)wn();let Gt=te++;Wt[Gt]=Ue,co[Gt]=Vt,xe+=Qt,$e^=Math.imul(Qt,2654435761);let Tr=$e^$e>>>15|0,Yo=Tr&8190;{let ot=-1;if(Io[Yo]===Tr&&Jt[Yo]!==null&&Jt[Yo].length===Qt)ot=Yo;else if(Io[Yo|1]===Tr&&Jt[Yo|1]!==null&&Jt[Yo|1].length===Qt)ot=Yo|1;if(ot>=0){let Vo=Jt[ot],lr=!0;for(let ur=0;ur<Qt;ur++)if(Vo.charCodeAt(ur)!==D.charCodeAt(Ue+ur)){lr=!1;break}if(lr){Ht[Gt]=Xr[ot],bo[Gt]=jr[ot],Bo[Gt]=We[ot];continue}}}let yn=Ue;if(z!==0){if(Vt-Ue<=z||!D.startsWith(Y,Ue)){Ht[Gt]=-1,Ce(Yo,D,Ue,Vt,Tr,-1,0,0);continue}yn=Ue+z}let al=0,sl=0,ea=-1,il=-1;for(let ot=yn;ot<Vt;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=Vt,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 Ko=0,Er=0,Rn=0,Vm=-1,Jo=0;if(u[0]>=0||X[0]===1)$r[0]=0,Yr[0]=cl,Jo=1;let ll=-1,ul=0;for(let ot=cl;ot<To;ot++){if(ot===Kr)ll=Er<Rn?-1:Ko,ul=Jo;if(Ko!==-1){let Vo=D.charCodeAt(ot),lr=-1;if(Er<Rn)if(s.charCodeAt(Er)===Vo){if(Er++,Er===Rn)lr=Ko=Vm}else Ko=-1;else{let ur=n[Ko],ms=n[Ko+1],dl=-1;for(let Jr=ur;Jr<ms;Jr++){let gl=a[Jr];if(s.charCodeAt(gl)===Vo){if(a[Jr+1]-gl===1)lr=dl=i[Jr];else Er=gl+1,Rn=a[Jr+1],Vm=i[Jr],dl=Ko;break}}Ko=dl}if(lr>=0&&(u[lr]>=0||X[lr]===1)&&ot+1<To&&D.charCodeAt(ot+1)===45){if(Jo===$o){$o*=2;let ur=new Int32Array($o);ur.set($r),$r=ur;let ms=new Int32Array($o);ms.set(Yr),Yr=ms}$r[Jo]=lr,Yr[Jo]=ot+2,Jo++}}}if(Kr===To)ll=Er<Rn?-1:Ko,ul=Jo;let ml=Er<Rn?-1:Ko,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,Jo);if(ot!==-1&&ot!==Eo)Eo=ot,us=!1}else if(Eo===-1)Eo=as(D,vo,To,ml,Jo),us=!1}else Eo=as(D,vo,To,ml,Jo);let fl=0,pl=0;if(Eo===-1)Ht[Gt]=-1;else pl=us?1:0,fl=yn>=ea?ta?1:0:de(ge,D,yn,ea,ta?1:0,(ot)=>ct(ot,ta)),Ht[Gt]=Eo,Bo[Gt]=pl,bo[Gt]=fl;Ce(Yo,D,Ue,Vt,Tr,Eo,fl,pl)}if(te===0)return"";if(te===1)return Wt[0]===0&&co[0]===Z?D:D.slice(Wt[0],co[0]);if(te*N>yr){while(te*N>yr)yr<<=1,Fm--;ol=new Float64Array(yr),ns=new Int32Array(yr)}if(Ae>=_t||io>=_t)throw Error("cn: too many distinct classes in one merge");if(Rr=Rr+1|0,Rr===0)tl.fill(0),ns.fill(0),Rr=1;let Xe=!1;for(let Pe=te-1;Pe>=0;Pe--){let Ue=Ht[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 Vt=B[Ue];if(Vt>=0)for(let Qt=h[Vt];Qt<h[Vt+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 ut="",Ke=0;while(Ke<te){if(!Ro[Ke]){Ke++;continue}let Pe=Wt[Ke],Ue=co[Ke],$e=Ke+1;while($e<te&&Ro[$e]&&Wt[$e]===Ue+1&&D.charCodeAt(Ue)===32)Ue=co[$e],$e++;if(ut.length>0)ut+=" ";ut+=D.slice(Pe,Ue),Ke=$e}return ut},vr=16384,cr=new Int32Array(vr*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^=vr,Ho=Ho+1|0,ls=0},gh=(D)=>{let Z=Jn[D];if(Z!==void 0)return Z;let te=Hs(D,0,D.length),xe=(te&16383)+is,Be=cr[xe]===(te^Ho)||cr[xe^vr]===(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(cr[xe]=te^Ho,++ls>vr)Qn();return Z},hh=(D)=>{let Z=xn.get(D);if(Z!==void 0)return Z;let te=Hs(D,0,D.length),xe=(te&16383)+is,Be=cr[xe]===(te^Ho)||cr[xe^vr]===(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(cr[xe]=te^Ho,++ls>vr)Qn();return Z},Ih=(D)=>{let Z=Hs(D,0,D.length),te=(Z&16383)+is;if(cr[te]===(Z^Ho)||cr[te^vr]===(Z^Ho-1))return!0;if(cr[te]=Z^Ho,++ls>vr)Qn();return!1},nl=ne===0?ss:dI?(D)=>{let Z=xn.get(D);return Z!==void 0?Z:hh(D)}:gh;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:Ih,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},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:Vs(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,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 N=y+1;N<b;N++){let A=d[N];if(A)E+=" "+A}return f(E,"",!1)}let B=T.e;e:for(let E=0;E<B.length;E++){let N=B[E];if(N.t!==x)continue;let A=N.a,R=1;for(let F=y+1;F<b;F++){let X=d[F];if(X&&X!==A[R++])continue e}M=N;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 N=T.e;if(N.length<256)N.push(M);else N[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),lHe=xl.merge;import*as Uf from"react";import*as kn from"react";function Us(){return typeof window<"u"}function Rt(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 tr(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(Rt(e))}function sa(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/,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))||hI.test(t.willChange||"")||II.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(Rt(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(Rt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||tr(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 Mr(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?Mr(i):[])}else return t.concat(n,Mr(n,[],o))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as bI from"react";var ca={...bI};var Rl=ca.useInsertionEffect,CI=Rl&&Rl!==ca.useLayoutEffect?Rl:(e)=>e();function re(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=()=>{},q=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 Zs from"react";var vI=Zs.createContext(void 0);function An(e=!1){let t=Zs.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 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 Ut({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&&TI(y),T=S&&(n?x:!v),M=h.key==="Enter",B=h.key===" ",E=y.getAttribute("role"),N=E?.startsWith("menuitem")||E==="option"||E==="gridcell";if(S&&c&&B){if(h.defaultPrevented&&N)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 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 ke("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as PI}from"react/jsx-runtime";var EI=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 vt({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 kr}from"react/jsx-runtime";var AI=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 kr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:me(AI({size:o,orientation:r}),e),...n})}var MI=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 kr("div",{"data-slot":"attachment-media","data-variant":t,className:me(MI({variant:t}),e),...o})}function ua({className:e,...t}){return kr("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 kr("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 kr("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 kr("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 kr(vt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:me(e),...r})}function Xs({className:e,...t}){return kr("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 kI={[an]:""},LI={[da]:""},Dn={transitionStatus(e){if(e==="starting")return kI;if(e==="ending")return LI;return null}};var Pl="data-open",Al="data-closed",DI=an,FI=da,Gf="data-anchor-hidden";var Ks="data-popup-open",Zf="data-pressed";var OI={[Ks]:""},NI={[Ks]:"",[Zf]:""},BI={[Pl]:""},HI={[Al]:""},VI={[Gf]:""},Xf={open(e){if(e)return OI;return null}},Ml={open(e){if(e)return NI;return null}},ga={open(e){if(e)return BI;return HI},anchorHidden(e){if(e)return VI;return null}},Js={...ga,...Dn};import*as Qs from"react";var UI=Qs.createContext(void 0);function Fn(e=!0){let t=Qs.useContext(UI);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",_I="close-press";var On="focus-out",Dl="escape-key";var ti="list-navigation",jf="keyboard",WI="pointer";var GI="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 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=Ao(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:XI,platform:jI,maxTouchPoints:Kf}=qI(),sn=XI.toLowerCase(),cn=jI.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"),$I=cn.startsWith("win"),YI=!Qf&&/^(linux|chrome os)/.test(cn),Bl=ep||Nl;var Hl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),KI=!Hl&&sn.includes("firefox"),JI=!Hl&&sn.includes("chrom");var QI=Bl;var e2=/jsdom|happydom/.test(sn);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",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?t2: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&&!fr.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)=>Ut(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 o2(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 or(e,t){if(ip!==void 0){let o=ip();return e??(t?`${t}-${o}`:o)}return o2(e,t)}function mo(e){return or(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 Lr(e){lp.useEffect(e,mr)}var ii=null,z9e=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 dr(){let e=qe(Lo.create).current;return Lr(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 r2(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=dr();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}r2(()=>{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 Dr(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 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: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 n2(a2,{...t,ref:r.ref})});import*as hn from"react";import*as $t from"react";function ve(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,q(t.effect),t}function s2(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 Lr(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},x7e={...dp,position:"absolute"};import{jsx as i2}from"react/jsx-runtime";var zo=mi.forwardRef(function(t,o){let[r,n]=mi.useState();return q(()=>{if(Vl.voiceOver&&pr.webkit)n("button")},[]),i2("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 gr(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 D7e=Ks,Xl="data-trigger-disabled";function Fr(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 hr(e){return Ge(e)&&e.matches(Zl)}function jl(e){return gr(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"&&hr(e)}function Or(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 Nr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(fr.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!fr.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"&&(fr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ir(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:Br,max:Zo,round:Pa,floor:Aa}=Math,rr=(e)=>({x:e,y:e}),l2={left:"right",right:"left",bottom:"top",top:"bottom"};function gi(e,t,o){return Zo(e,Br(t,o))}function nr(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"],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(di))}return a}function Ea(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 Ii(e){return typeof e!=="number"?p2(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 d2(e){return e.visibility==="hidden"||e.visibility==="collapse"}function mn(e,t=e?jt(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 Wo(o)?o.host:null}function Ql(e){for(let t of Array.from(e.children))if(Rt(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?Rt(e):"";return e!=null&&e.matches(g2)&&(t!=="summary"||e.parentElement!=null&&Rt(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=Rt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Rt(t)==="details"&&!t.open&&!I2(e,t)||t.hasAttribute("hidden")||!r&&!b2(t,o))return!1}return!0}function b2(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=Rt(e);if(o==="details"||o==="audio"||o==="video"||Ge(e)&&e.isContentEditable)return 0}return t}function Jl(e){if(Rt(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)&&Rt(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 br(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 ar(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(Rt(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 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 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"}},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),S2=ar("portal");function vi(e={}){let{ref:t,container:o,componentProps:r=_e,elementProps:n}=e,a=or(),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,[S2]:""},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&&br(T))if(T.type==="focusin"){if(b.current)ru(l),b.current=!1}else kp(l),b.current=!0}return zt(ve(l,"focusin",v,!0),ve(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(br(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(br(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 Hr 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=Hr.createContext(null),$p=Hr.createContext(null),xo=()=>Hr.useContext(jp)?.id||null,to=(e)=>{let t=Hr.useContext($p);return e??t};function Ba(e){let t=or(),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:Hr.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 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||(Nr(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,Vr=[];function fu(){Vr=Vr.filter((e)=>e.deref()?.isConnected)}function Jp(e){if(fu(),e&&Rt(e)!=="body"){if(Vr.push(new WeakRef(e)),Vr.length>Kp)Vr=Vr.slice(-Kp)}}function Qp(){return fu(),Vr[Vr.length-1]?.deref()}function y2(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),N=to(p),A=lu(),R=$t.useRef(!1),F=$t.useRef(!1),X=$t.useRef(!1),P=$t.useRef(null),O=$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=dr(),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 ve(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",gr(le,`[${Ri}]`))F.current=!0,z.start(0,()=>{F.current=!1})}function Ee(){W.current="keyboard"}return zt(ve(G,"pointerdown",pe,!0),ve(G,"pointerup",ie,!0),ve(G,"pointercancel",ie,!0),ve(G,"keydown",Ee,!0),ie)},[r,C,d,ee,I,A,z,_]),$t.useEffect(()=>{if(r||!u)return;let G=ye(ee);function ie(){F.current=!0,z.start(0,()=>{F.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(ar("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||N&&(Do(N.nodesRef.current,Se).find((oe)=>fe(oe.context?.elements.floating,se)||fe(oe.context?.elements.domReference,se))||nu(N.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&&!F.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&&ve(le,"focusout",Ee),le&&ve(le,"pointerdown",ie),C&&ve(C,"focusin",pe),C&&ve(C,"focusout",Ee),C&&A&&ve(C,"focusout",Fe,!0))},[r,d,C,ee,c,N,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(`[${ar("portal")}]`)||[]),pe=(N?nu(N.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,N,S,m,f,_]),q(()=>{if(!I||r||!Ge(ee))return;O.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"&&Nr(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)O.current=x2(le.nativeEvent,W.current);if(le.reason===On&&le.triggerElement?.hasAttribute(ar("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(Nr(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&&Rt(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))||N&&Do(N.nodesRef.current,S(),!1).some((V)=>fe(V.context?.elements.floating,le)),Ne=T.current,ue=O.current,Se=Fe(ue),L={cancelled:!1};K.current=L,queueMicrotask(()=>{if(K.current===L)K.current=null;let V=y2(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,N,d,S,_]),q(()=>{if(!pr.webkit||I||!C)return;let G=nt(ye(C));if(!Ge(G)||!hr(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 w2($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,br(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(br(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=dr(),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=Ir(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"||Ir(d,!0)&&a)return;let h=w(b,I.currentTarget,(v)=>v==="click"||v==="mousedown"),S=Ze(C),y=hr(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(Ir(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 R2(){return!1}function v2(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=R2,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}=v2(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(),N=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])}),F=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()}),O=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(){N.clear(),v.current=!0}function ae(){v.current=!0,N.start(pr.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 F(L)||be}function U(L){if(_(L)){if(L.type!=="click"&&!F(L))H.clear(),y.current=!1;A();return}if(m.current.insideReactTree){A();return}let V=Ze(L),be=`[${ar("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",_t=No&&(qt?L.offsetX<=V.offsetWidth-V.clientWidth:L.offsetX>V.clientWidth),po=io&&L.offsetY>V.clientHeight;if(_t||po)return}if(K(L))return;if(ce()==="intentional"){if(L.detail!==0&&!Nr(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||F(L))return;U(L)}function ie(L){if(ce()!=="sloppy"||!e.select("open")||!o||F(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=ve(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||F(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||F(L))return;if(M.current.dismissOnTouchEnd)U(L);B.clear(),M.current=null}function ue(L){pe(L,Ne)}let Se=zt(r&&zt(ve(Y,"keydown",P),ve(Y,"compositionstart",z),ve(Y,"compositionend",ae)),I&&zt(ve(Y,"click",Fe,!0),ve(Y,"pointerdown",Fe,!0),ve(Y,"pointerup",le,!0),ve(Y,"pointercancel",le,!0),ve(Y,"mousedown",Fe,!0),ve(Y,"mouseup",le,!0),ve(Y,"touchstart",Ee,{capture:!0,passive:!0}),ve(Y,"touchmove",se,{capture:!0,passive:!0}),ve(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,F,g,e,B,N]);let k=oo.useMemo(()=>({onKeyDown:P,onPointerDown:X,onClick:X}),[P,X]),ne=oo.useMemo(()=>({onKeyDown:P,onPointerDown:J,onMouseDown:J,onClickCapture:O,onMouseDownCapture(H){O(),W(H)},onPointerDownCapture(H){O(),W(H)},onMouseUpCapture:O,onTouchEndCapture:O,onTouchMoveCapture:O}),[P,O,W,J]);return oo.useMemo(()=>o?{reference:k,floating:ne,trigger:k}:{},[o,k,ne])}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),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 Dr({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=or(),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 E2(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=E2(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 Ur from"react";var V2=Fi();function U2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _2=typeof Object.is==="function"?Object.is:U2,W2=V2.useSyncExternalStore,G2=Ur.useRef,z2=Ur.useEffect,Z2=Ur.useMemo,q2=Ur.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(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,_2(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=W2(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 za(e){let t=(o,r)=>{let n=qe(X2).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 X2(){return{didInitialize:!1}}var j2=En(19),$2=j2?K2:J2;function Ni(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 Ni(this,e,t,o,r)}}import*as pn from"react";class Cr 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 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 Cr{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},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 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 eb(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)=>eb(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 sr from"react";var yu=fr.mac&&pr.webkit;function Ru(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=sr.useRef(!1),i=sr.useRef(null),c=sr.useRef(!0),u=rt();sr.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(ve(f,"blur",g),yu&&ve(f,"keydown",p,!0),yu&&ve(f,"pointerdown",w,!0))},[e,o]),sr.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=sr.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&&!hr(p))return}else if(!Or(p))return}let w=Fr(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(ar("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(Fr(g??d,e.context.triggerElements))return;e.setOpen(!1,Me(Ia,p))})}}},[a,r,e,u]);return sr.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 Lr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function tb(e,t){if(t!=null&&!Ir(t))return 0;if(typeof e==="function")return e();return e}function qa(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 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??gr(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=gr(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(Fr(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&&ve(y,"mouseenter",b),y&&ve(y,"mouseleave",h),y&&ve(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 _r 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:f,shouldOpen:g,guardStaleOpen:p=!1}=t,{dataRef:w,events:I}=e.context,d=to(u),C=Wi(e),b=_r.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,F,X)=>{let P=e.context.triggerElements;if(P.hasElement(F))return!R||!fe(R,F);if(!He(X))return!1;let O=X;return P.hasMatchingElement((W)=>fe(W,O))&&(!R||!fe(R,O))}),N=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 _r.useEffect(()=>N,[N]),_r.useEffect(()=>{if(!o)return;function R(F){if(!F.open)b.current=F.reason===uo,N(),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,N]),_r.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 F=c.current??(l?e.select("domReferenceElement"):null);if(!He(F))return;function X(J){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!Ir(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}N();let k=e.select("domReferenceElement"),ne=ye(k);C.restTimeout.clear(),C.restTimeoutPending=!1;let H=w.current.floatingContext??m?.();if(Fr(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(),N(),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 O(J){if(fe(F,J.relatedTarget))return;C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1}let W=p?ve(F,"mouseout",O):void 0;if(i)return zt(ve(F,"mousemove",X,{once:!0}),ve(F,"mouseenter",X),ve(F,"mouseleave",P),W);return zt(ve(F,"mouseenter",X),ve(F,"mouseleave",P),W)},[N,A,w,S,e,o,h,C,l,E,M,a,i,y,c,d,x,m,T,B,p]),_r.useMemo(()=>{if(!o)return;function R(F){C.pointerType=F.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(F){let{nativeEvent:X}=F,P=F.currentTarget,O=e.select("domReferenceElement"),W=e.select("open"),J=E(O,P,F.target);if(a&&!Ir(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&&F.movementX**2+F.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 pr.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 rb(e,t,o){return Zi(t,o?e===ya:e===Ra,e===fi)}function nb(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,N=Ta(M),A=va(B),R=lt(N),F=xo(),X=to(S),P=Yt.useRef(f),O=Yt.useRef(s??-1),W=Yt.useRef(null),J=Yt.useRef(!0),k=re((L)=>{n(O.current===-1?null:O.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=dr(),U=dr(),G=re(()=>{K.cancel();function L(oe){if(!m)ae.current=Vn(oe,{sync:Y.current,preventScroll:!0})}let V=o.current[O.current],be=z.current;if(V)L(V);(Y.current?(oe)=>oe():(oe)=>K.request(oe))(()=>{let oe=o.current[O.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(O.current=s??-1,P.current&&s!=null)z.current=!0,k()}else if(ne.current)O.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)O.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 O.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))O.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===F)?.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,F,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&&(O.current!==V||r!==V))O.current=V,k(L)}),Ee=re(()=>C??X?.nodesRef.current.find((L)=>L.id===F)?.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&&nb(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!==O.current&&!bi(o.current,r))O.current=r;let V=O.current,be=Ci(o,w),j=$l(o,w);if(!A){if(L.key==="Home")So(L),O.current=be,k(L);if(L.key==="End")So(L),O.current=j,k(L)}if(x!=null){let oe=x(L,O.current,o,I,c,l,w,be,j);if(oe!=null&&oe!==O.current)O.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(O.current=Mu(L.key,I,l)?be:j,k(L),r===O.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;O.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,O.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"&&Nr(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=rb(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||hr(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(O.current=Fe(),k(j),m)R.current?.focus()}else L(j);return}if(he){if(ce.current!=null)O.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)O.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(mr,A,s)}function x(A,R,F=0){if(A.length===0)return-1;let X=(F%A.length+A.length)%A.length,P=R.toLowerCase();for(let O=0;O<A.length;O+=1){let W=(X+O)%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,N=x(v,p.current,E);if(N!==-1)a?.(N,h),I.current=N;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,ab=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 sb(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*ab;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 N(){if(!E())d()}if(E())return;let A=h.getBoundingClientRect(),R=S.getBoundingClientRect(),F=n>R.right-R.width/2,X=a>R.bottom-R.height/2,P=R.width>A.width,O=R.height>A.height,W=(P?A:R).left,J=(P?A:R).right,k=(O?A:R).top,ne=(O?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){N();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&&!sb(y,x,A)){N();return}if(!T&&I(y,x)){N();return}let Y=!1;switch(m){case"top":{let z=P?Qe/2:Qe*4,ae=P?n+z:F?n+z:n-z,we=P?n-z:F?n+z:n-z,ee=a+Qe+1,ce=F?R.bottom-Qe:P?R.bottom-Qe:R.top,_=F?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:F?n+z:n-z,we=P?n-z:F?n+z:n-z,ee=a-Qe,ce=F?R.top+Qe:P?R.top+Qe:R.bottom,_=F?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=O?Qe/2:Qe*4,ae=O?a+z:X?a+z:a-z,we=O?a-z:X?a+z:a-z,ee=n+Qe+1,ce=X?R.right-Qe:O?R.right-Qe:R.left,_=X?O?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=O?Qe/2:Qe*4,ae=O?a+z:X?a+z:a-z,we=O?a-z:X?a+z:a-z,ee=n-Qe,ce=X?R.left+Qe:O?R.left+Qe:R.right,_=X?O?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)N();else if(!f)o.start(40,N);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}=nr(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 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),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<ib){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}=nr(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 F=(E=M.filter((X)=>X.overflows[0]<=0).sort((X,P)=>X.overflows[1]-P.overflows[1])[0])==null?void 0:E.placement;if(!F)switch(g){case"bestFit":{var N;let X=(N=M.filter((P)=>{if(y){let O=ho(P.placement);return O===C||O==="y"}return!0}).map((P)=>[P.placement,P.overflows.filter((O)=>O>0).reduce((O,W)=>O+W,0)]).sort((P,O)=>P[1]-O[1])[0])==null?void 0:N[0];if(X)F=X;break}case"initialPlacement":F=i;break}if(n!==F)return{reset:{placement:F}}}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=nr(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 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:b,y:h}=C;return{x:b,y:h}}},...u}=nr(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}=nr(e,t),f={x:n,y:a},g=ho(s),p=hi(g),w=f[p],I=f[g],d=nr(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}=nr(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=Br(g-c[p],I),b=Br(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 rr(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 lb=rr(0);function Md(e){let t=ze(e);if(!Gs()||!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 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=rr(1);if(t)if(r){if(He(r))s=Wn(r)}else s=Wn(e);let i=ub(a,o,r)?Md(a):rr(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(tr(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 mb(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=tr(r),i=t?sa(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=rr(1),l=rr(0),m=Ge(r);if(m||!a){if(Rt(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):rr(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 fb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pb(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 db=25;function gb(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=ze(e),a=tr(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<=db)i-=d}return{width:i,height:c,x:u,y:l}}function hb(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=gb(e,o,t);else if(t==="document")r=pb(tr(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 un(r)}function Ib(e,t){let o=t.get(e);if(o)return o;let r=Mr(e,[],!1).filter((i)=>He(i)&&Rt(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 bb(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?sa(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 f=1;f<s.length;f++){let g=Ed(t,s[f],n);c=Zo(g.top,c),u=Br(g.right,u),l=Br(g.bottom,l),m=Zo(g.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=tr(t),a=o==="fixed",s=gn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=rr(0);if(r||!a){if(Rt(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):rr(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(tr(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 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 jt(e).direction==="rtl"}var Nu={convertOffsetParentRelativeRectToViewportRelativeRect:mb,getDocumentElement:tr,getClippingRect:bb,getOffsetParent:Ld,getElementRects:wb,getClientRects:fb,getDimensions:Cb,getScale:Wn,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=tr(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,Br(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?Mr(u):[],...t?Mr(t):[]]:[];l.forEach((d)=>{n&&d.addEventListener("scroll",o),a&&d.addEventListener("resize",o)});let m=u&&i?yb(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 Bt from"react";import{useLayoutEffect as vb}from"react";import*as Ud from"react-dom";var Tb=typeof document<"u",Eb=function(){},Ki=Tb?vb:Eb;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=Bt.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]=Bt.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=Bt.useState(r);if(!Ji(f,r))g(r);let[p,w]=Bt.useState(null),[I,d]=Bt.useState(null),C=Bt.useCallback((P)=>{if(P!==y.current)y.current=P,w(P)},[]),b=Bt.useCallback((P)=>{if(P!==x.current)x.current=P,d(P)},[]),h=a||p,S=s||I,y=Bt.useRef(null),x=Bt.useRef(null),v=Bt.useRef(l),T=c!=null,M=Bu(c),B=Bu(n),E=Bu(u),N=Bt.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((O)=>{let W={...O,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=Bt.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,N);N()}},[h,S,N,M,T]);let R=Bt.useMemo(()=>({reference:y,floating:x,setReference:C,setFloating:b}),[C,b]),F=Bt.useMemo(()=>({reference:h,floating:S}),[h,S]),X=Bt.useMemo(()=>{let P={position:o,left:0,top:0};if(!F.floating)return P;let O=Vd(F.floating,l.x),W=Vd(F.floating,l.y);if(i)return{...P,transform:"translate("+O+"px, "+W+"px)",..._d(F.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:O,top:W}},[o,i,F.floating,l.x,l.y]);return Bt.useMemo(()=>({...l,update:N,refs:R,elements:F,floatingStyles:X}),[l,N,R,F,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 Pb=Qi.createContext(void 0);function Gd(e){let t=Qi.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 ec=new Set([Ab,Mb,kb,Lb,Db,Fb]);function tc(e){return e==="starting"?Vp:_e}import*as oc from"react";var Ob=oc.createContext(void 0);function zd(){return oc.useContext(Ob)}import*as rc from"react";function Nb(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=Nb(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 Bb=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"),N=l.useState("floatingTreeRoot"),A=l.useState("closeDelay"),R=l.useState("hoverEnabled"),F=l.useState("disabled"),X=l.useState("openMethod"),P=l.useState("activeTriggerId"),O=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&&O&&T.type!=="menu")Y=()=>{if(l.state.activeIndex!==null)return!1;return O};Dr({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 N.events.on("close",G),()=>{N.events.off("close",G)}},[N.events,l]),Pu(E,{enabled:R&&!F&&!H&&T.type!=="menubar",closeDelay:A});let z=l.useStateSetter("popupElement"),ae=hn.useContext(Fl)?.useParentHandoff??Vb,{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,...O?{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"?N:void 0,previousFocusableElement:v,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:_})}),Hb={parentVirtualFocusRef:void 0,handleFocus:void 0};function Vb(){return Hb}var $d=hn.forwardRef(function(t,o){let r=Ol()?.Popup??Bb;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 Wr 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 Ub=ac.createContext(void 0);function sc(){return ac.useContext(Ub)?.direction??"ltr"}var _b=(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}=nr(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,N=y/2-w[p]/2+x,A=gi(B,N,E),R=!c.arrow&&wo(n)!=null&&N!==A&&a.reference[p]/2-(N<B?T:M)-w[p]/2<0,F=R?N<B?N-B:N-E:0;return{[g]:f[g]+F,data:{[g]:A,centerOffset:N-A-F,...R&&{alignmentOffset:F}},reset:R}}}),t0=(e,t)=>{let{name:o,fn:r}=_b(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: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,N=re(E),A=E?N:o,R=lt(o),F=lt(I),P=sc()==="rtl",[O,W]=yo.useState(null);if(!I&&O!==null)W(null);let J=S==="placement",k=O?fo(O):null,ne=O&&J?wo(O)||"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 Ot=m0(We,n,P),Ce=typeof ie.current==="function"?ie.current(Ot):ie.current,Re=typeof pe.current==="function"?pe.current(Ot):pe.current;return{mainAxis:Ce,crossAxis:Re,alignmentAxis:Re}},[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:Ot,height:Ce}=G.current.getBoundingClientRect(),Re=ho(fo(We.placement)),Ve=Re==="y"?Ot:Ce,Nt=Re==="y"?ae.left+ae.right:ae.top+ae.bottom;return{offset:Ve/2+Nt/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:Ot,availableHeight:Ce,rects:Re}){if(!F.current)return;let Ve=We.style;Ve.setProperty(l0,`${Ot}px`),Ve.setProperty(u0,`${Ce}px`);let Nt=ze(We).devicePixelRatio||1,{x:Wt,y:co,width:Ht,height:bo}=Re.reference,Bo=(Math.round((Wt+Ht)*Nt)-Math.round(Wt*Nt))/Nt,Ro=(Math.round((co+bo)*Nt)-Math.round(co*Nt))/Nt;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:Ot},middlewareData:Ce,placement:Re,platform:Ve,rects:Nt,y:Wt}=We,co=fo(Re),Ht=wo(Re),bo=ho(co)==="y",Bo=G.current,Ro=typeof a==="function"?a(m0(We,n,P)):a,wn;if(!Bo&&Ht&&Math.abs(bo?Ce.shift?.x||0:Ce.shift?.y||0)<=1)wn=Ht==="start"===(bo&&Ve.isRTL?.(Ot)===!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 $o=co==="top"||co==="left"?`calc(100% + ${Ro}px)`:`${-Ro}px`;if(se&&bo&&Math.abs(Ce.shift?.y||0)>Ro)$o=`${Nt.reference.y+Nt.reference.height/2-Wt}px`;return Ot.style.setProperty(c0,bo?`${wn} ${$o}`:`${$o} ${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,Ot=typeof We==="function"?We():We,Re=(f0(Ot)?Ot.current:Ot)||null||null;if(Re!==qt.current)L.setPositionReference(Re),qt.current=Re},[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 _t=fo(ge),po=p0(n,_t,P),Io=wo(ge)||"center",Jt=Boolean(oe.hide?.referenceHidden);q(()=>{if(S&&I&&Ae&&(_t!==H||J&&Io!==Y))W(ge)},[S,J,I,Ae,ge,_t,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:_t,anchorHidden:Jt,refs:L,context:he,isPositioned:Ae,update:de}),[No,Xr,G,jr,po,Io,_t,Jt,L,he,Ae,de])}function f0(e){return e!=null&&"current"in e}import*as Sr from"react";import{jsx as zb}from"react/jsx-runtime";function g0(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=re(n),[,s]=Sr.useState(0),i=qe(qb).current,c=qe(Zb).current,u=Sr.useRef(0),l=Sr.useRef(!0),m=Sr.useRef(null),f=Sr.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(!$b(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=jb(S[v-1],S[v]);if(T)x.add(T)}x.forEach((v)=>y.observe(v,{childList:!0}))}let C=re(()=>{let[S,y]=Xb(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=Sr.useMemo(()=>({register:p,unregister:w,subscribeMapChange:b,nextIndexRef:u}),[p,w,b,u]);return zb(Ul.Provider,{value:h,children:t})}function Zb(){return new Map}function qb(){return new Set}function Xb(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 jb(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 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 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);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 Kb(e){if(typeof document>"u")return!1;let t=ye(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=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 Qb(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 eC(e){let t=ye(e),{documentElement:o,body:r}=t,n=ze(o),a=0,s=0,i=!1,c=Lo.create();if(pr.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=Jb(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=ve(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=fr.ios||!Kb(e);this.restore=a?Qb(e):eC(e)}}var tC=new R0;function lc(e=!0,t=null){q(()=>{if(!e)return;return tC.acquire(t)},[e,t])}var oC=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-oC)},[e,t,o]),lc(e&&(!t||n),r)}import{jsx as Zu,jsxs as rC}from"react/jsx-runtime";var E0=Wr.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"),N=b.useState("modal"),A=b.useState("openMethod"),R=b.useState("activeTriggerElement"),F=b.useState("transitionStatus"),X=b.useState("positionerElement"),P=b.useState("instantType"),O=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:O,lazyFlip:h?"placement":!1});Wr.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]),Wr.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();Wr.useEffect(()=>{if(!E)U.clear()},[E,U]),Wr.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]),Wr.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=N&&W!==uo;T0(E&&(ie||pe),A==="touch",X,R);let Ee=C0(t,G,{styles:K.positionerStyles,transitionStatus:F,props:C,refs:[o,b.useStateSetter("positionerElement")],hidden:!B,inert:!E}),Fe=B&&v.type!=="menu"&&(v.type!=="menubar"&&N&&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 rC(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 nC=uc.createContext(null);function mc(e){let t=uc.useContext(nC);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||(fr.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 WI;return ha}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)=>pr.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 Cr{constructor(e,t,o=!1){let r=new Ga,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{...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 cC}from"react/jsx-runtime";var lC=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]),N=mo(),A=mo(),[R,F]=st.useState(void 0),X=(R??A)||void 0,P=xo(),O=E.type==="menu"?E.store:void 0,W=(r??i)&&O?.state.transitionStatus==="starting",J=qe(()=>W?O?.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:N,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:N}),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 Re=new AbortController;return V(Ce,Re.signal),()=>{Re.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,Re)=>{let Ve=Re.reason;if(!Ce&&!k.select("open"))return;if(Y===Ce&&Re.trigger===z&&ce===Ve)return;let Nt=ad(Re);if(!Ce&&Re.trigger==null)Re.trigger=z??void 0;if(n?.(Ce,Re),Re.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(Ce,Re);let Wt=Re.event;if(Ce===!1&&Ve!==Ll&&Wt?.type==="click"&&Wt.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=Re.event;let Ht=Ai(k.state,Ce,Re.trigger,Nt());if(Ht.openChangeReason=Ve,Ht.keyboardOpen=Ce&&D0(Ve,Wt),_.type==="menubar"&&(Ve===Ia||Ve===On||Ve===uo||Ve===ti||Ve===ba))Ht.instantType="group";else if($u(Ve,Wt))Ht.instantType="click";else if(co)Ht.instantType="dismiss";else Ht.instantType=void 0;k.update(Ht)}),j=Wa({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:X,nested:P!=null,onOpenChange:be}),oe=j.context.events;q(()=>{let Ce=({open:Re,eventDetails:Ve})=>be(Re,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:mr,onNavigate(Ce,Re){k.setActiveIndex(Ce,k0(Re),Re?.nativeEvent)},openOnArrowKeyDown:_.type!=="context-menu"&&!(b&&C),externalTree:!b&&se?ne:void 0,nestedReturnFocusRef:O?.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,Re)=>{if(Y&&Ce!==K)k.setActiveIndex(Ce,jf,Re.nativeEvent)},onTyping:ct}),io=re(s),No=st.useRef(-1),qt=re(()=>{let Ce=k.state.activeIndex,Re=Ce===null?void 0:k.context.itemDomElements.current[Ce]??void 0;if(Re?.isConnected===!1)return;let Ve=Re===void 0?-1:Ce;if(No.current===Ve&&k.context.reportedItem===Re)return;if(No.current=Ve,k.context.reportedItem=Re,b)k.set("highlightedItem",Re);let{highlightReason:Nt,highlightEvent:Wt}=k.context;if(k.context.highlightReason=ha,k.context.highlightEvent=void 0,!s)return;io(Re,cp(Nt,Wt,{label:Re===void 0?void 0:k.context.itemLabels.current[Ve]??void 0}))});q(()=>{qt()},[K,qt]);let _t=st.useMemo(()=>{if(!b)return je.reference;if(!je.trigger)return _e;let{onFocus:Ce,...Re}=je.trigger;return Re},[b,je.reference,je.trigger]);k.useSyncedValue("inputProps",b?je.reference??_e:_e);let po=st.useMemo(()=>{let Ce=Ut(so.reference,_t,he.reference,{onMouseMove(){k.set("allowMouseEnter",!0)}},ue);return Ce["aria-haspopup"]="menu",Ce["aria-expanded"]=Y,Ce},[k,so.reference,_t,he.reference,ue,Y]),Io=st.useMemo(()=>{let Ce=Ut(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(()=>Ut(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 Re=k.select("keyboardEventRelay");if(Re&&!Ce.isPropagationStopped())Re(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:F,virtualFocus:b,parentVirtualFocus:B,syncHighlightedItem:qt}),[k,E,m,l,S,A,b,B,qt]),We=typeof o==="function"?o({payload:G}):o,Ot=cC(pa.Provider,{value:jr,children:[p&&Ya(Pi,{handle:p,store:k}),We]});if(_.type===void 0||_.type==="context-menu")Ot=Ya(mu,{externalTree:ne,children:Ot});return Ot});function F0(e){let t=st.useContext(ju);if(t===null)return Ya(lC,{...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=uC(t);return e.clientX>=o.left-pc&&e.clientX<=o.right+pc&&e.clientY>=o.top-pc&&e.clientY<=o.bottom+pc}function uC(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=mr,refs:s=mr,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&&br(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 mC}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=pC(),T=An(!0),M=to(),B=ro.useMemo(()=>M??new fn,[M]),E=Ba(B),N=xo(),{registerTrigger:A,isMountedByThisTrigger:R}=Mi(C,x,d,{payload:g,closeDelay:m,parent:v,floatingTreeRoot:B,floatingNodeId:E,floatingParentNodeId:N,keyboardEventRelay:T?.relayKeyboardEvent}),F=v.type==="menubar",X=d.useState("disabled"),P=s||X||F&&v.context.disabled,{getButtonProps:O,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:GI})});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=F&&v.context.hasSubmenuOpen,z=Au(h,{enabled:(u??H)&&!P&&(!F||H&&!R),handleClose:Du({blockPointerEvents:!F}),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=fC(S,d.select("lastOpenChangeReason")),we=Ua(h,{enabled:!P,event:S&&F?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?ae:!1}),ee=Ru(h,{enabled:!P&&H}),ce=_0({open:S,enabled:F,mouseDownAction:"open"}),_=ro.useMemo(()=>Ut(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,F?{role:"menuitem"}:{},ce,p,O],le=ke("button",t,{enabled:!F,stateAttributesMapping:Ml,state:pe,ref:Ee,props:Fe});if(F)return Ka(H0,{tag:"button",render:r,className:n,style:a,state:pe,refs:Ee,props:Fe,stateAttributesMapping:Ml});if(S)return mC(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 fC(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 pC(){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 jXe}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},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=_e)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},IC=gc.createContext(hC);function Zn(e=!0){let t=gc.useContext(IC);if(t.setValidityData===Ye&&!e)throw Error(Je(28));return t}import*as hc from"react";var bC=hc.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function tg(){return hc.useContext(bC)}import*as Ic from"react";var CC=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(CC)}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:N}=bc(),A=ng({id:a}),R=i!==void 0,F=i==null?void 0:String(i),X=re(()=>y.inputRef.current?.value);rg(y.inputRef,A,F,X,!M,s),q(()=>{let k=F??y.inputRef.current?.value;if(k!==void 0)h(k!=="")},[F,l,y.inputRef,h]),fc(F,()=>{if(F===void 0)return;x(B),C(F!==(b.initialValue??"")),y.change(F)});let P=Cc.useRef(null),O=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":N,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(){O(!0)},onBlur(k){if(d(!0),O(!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 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 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 yC=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(yC({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var RC=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(vt,{type:t,"data-size":r,variant:o,className:me(RC({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=TC(null),[I,d]=qn(null);vC(()=>{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(xs,{}),"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(hs,{})})]})]}),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 PC}from"react/jsx-runtime";var EC=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 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:Ut({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 T$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 k$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 Et from"react";var Rg=new Map([["bold",Et.createElement(Et.Fragment,null,Et.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",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Et.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",Et.createElement(Et.Fragment,null,Et.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",Et.createElement(Et.Fragment,null,Et.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",Et.createElement(Et.Fragment,null,Et.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",Et.createElement(Et.Fragment,null,Et.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 Pt from"react";var vg=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.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",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),Pt.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",Pt.createElement(Pt.Fragment,null,Pt.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",Pt.createElement(Pt.Fragment,null,Pt.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",Pt.createElement(Pt.Fragment,null,Pt.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",Pt.createElement(Pt.Fragment,null,Pt.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(_I,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 uYe=Pl,mYe=Al,fYe=DI,pYe=FI;var Dg="data-nested-dialog-open";var Fg={...ga,...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"),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(),Dr({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(N){if(ec.has(N.key))N.stopPropagation()},style:{[Lg]:d}},c],ref:[o,u.context.popupRef,M],stateAttributesMapping:Fg});return kC(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 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(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 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 Cr{constructor(e,t,o){let r=new Ga,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(Ai(this.state,e,t.trigger))}}function FC(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 OC(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 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: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 NC(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 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(vt,{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 VC=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:Ut({className:me(VC({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as _C}from"react/jsx-runtime";var UC=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:Ut({className:me(UC({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function n1({className:e,...t}){return _C("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(WC(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):zC(n)&&typeof s=="function"&&typeof a=="function"?t[n]=GC(a,s):t[n]=a}}return t}function WC(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 Q from"react";import{jsx as $n,jsxs as l1}from"react/jsx-runtime";var ZC=8,qC=64,XC=0,Lc=0.5,jC=180,$C=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),u1={start:!1,end:!1},YC=[],Dc={currentAnchorId:null,visibleMessageIds:YC};function KC({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 JC({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 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=m1(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 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 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=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 sS(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 iS(e){let t=e?.parentElement;return t?f1(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 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 lS(){return p1(Dc,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=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),N=Q.useRef(null),A=Q.useRef(null),R=Q.useRef(null),F=Q.useRef(null),X=Q.useRef(null),P=Q.useRef(new Set),O=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,uS)),X.current===null&&(X.current=lS()),a.current=e,u.current=o,S.current=r,C.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:N,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:F,visibilityStore:X.current,visibleMessageIdsRef:P,handledScrollAnchorsRef:O}}function d1(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function kc(e){e.defaultScrollPositionAppliedRef.current=!0,d1(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: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()},jC))},[t]),S=Q.useCallback((E)=>{let N=C.current;if(!N)return;let A=Math.max(0,Math.ceil(E));d.current!==A&&(d.current=A,N.hidden=A===0,N.style.height=`${A}px`,N.style.marginTop=A>0?`${-I.current}px`:"")},[]),y=Q.useCallback((E,{behavior:N="auto",autoscrolling:A=!1}={})=>{let R=b.current;if(!R)return;let F=Math.max(0,E);if(Math.abs(R.scrollTop-F)<=Lc){R.scrollTop=F,t();return}A&&h(!0),R.scrollTo({top:F,behavior:N}),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 N=b.current;return N?(S(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(sS(N),{autoscrolling:!0,behavior:E}),r(),!0):!1},[r,y,S]),T=Q.useCallback((E,{align:N="start",behavior:A="auto",scrollMargin:R=p.current}={},{keepPreviousPeek:F=!1}={})=>{let X=c.current,P=b.current;if(!X||!P||!X.contains(E))return!1;let O=nS({align:N,element:E,scrollMargin:F?R+w.current:R,spacer:C.current,viewport:P}),W=aS({content:X,scrollTop:O,spacer:C.current,viewport:P});return S(W),g.current={element:E,viewportTop:Mc(E,P)},m.current=F?"anchored-to-message":"settling-jump",n.current=F?E:null,y(O,{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,N)=>{let A=l.current.get(E);return A?(kc(e),T(A,N)?(f.current=null,!0):(f.current={messageId:E,options:N},!0)):u.current===0?(f.current={messageId:E,options:N},kc(e),!0):!1},[T]);return{flushPendingScrollToMessage:Q.useCallback(()=>{let E=f.current;if(!E)return!1;let N=l.current.get(E.messageId);return!N||!T(N,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 dS({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=ZC,scrollPreviousItemPeek:r=qC,scrollMargin:n=XC}){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: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:N,stateStore:A,viewportRef:R,visibilityFrameRef:F,visibilityObserverRef:X,visibilityStore:P,visibleMessageIdsRef:O,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=KC({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(()=>{N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,H()}))},[H]),z=Q.useCallback(()=>{P.hasListeners()&&F.current===null&&(F.current=window.requestAnimationFrame(()=>{F.current=null,P.hasListeners()&&P.setSnapshot(JC({content:l.current,scrollMargin:v.current,scrollPreviousItemPeek:T.current,spacer:E.current,viewport:R.current,visibleMessageIds:O.current}))}))},[P]),{flushPendingScrollToMessage:ae,reanchorToAnchoredMessage:we,scrollToElement:ee,scrollToEnd:ce,scrollToMessage:_,scrollToStart:K}=pS({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=rS({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?oS(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=QC(ge,he);if(ct){if(i.current&&I.current==="following-bottom"&&tS(ge,he)){ce({behavior:"auto"});return}ee(ct,{align:"start"},{keepPreviousPeek:!0}),W.current.add(ct);return}}if(ge.length===he){let ct=eS(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?O.current.add(Ae):O.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(()=>{F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null),X.current?.disconnect(),X.current=null,O.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),O.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=cS(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(()=>()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),F.current!==null&&(window.cancelAnimationFrame(F.current),F.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 gS(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 hS(){let e=Q.useContext(h1);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 $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 bS({children:e,...t}){let{setRootElement:o}=ts(),r=I1();return $n("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: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){$C.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 SS({"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 wS({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=hS(),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 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),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:IS,Root:bS,Viewport:CS,Content:SS,Item:wS,Button:xS};import*as Fc from"react";import*as At from"react";var b1=new Map([["bold",At.createElement(At.Fragment,null,At.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",At.createElement(At.Fragment,null,At.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),At.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",At.createElement(At.Fragment,null,At.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",At.createElement(At.Fragment,null,At.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",At.createElement(At.Fragment,null,At.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",At.createElement(At.Fragment,null,At.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 wr,jsxs as RS,Fragment as yS}from"react/jsx-runtime";function C1(e){return wr(Cn.Provider,{...e})}function S1({className:e,...t}){return wr(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 wr(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 wr(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 wr(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 wr(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??wr(vt,{variant:n,size:a}),...s,children:o??RS(yS,{children:[wr(Im,{}),wr("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 vS(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(vt,{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 TS({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"," ·"," ",vS(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(vt,{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(TS,{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(vt,{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 ES}from"react/jsx-runtime";function T1({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 Gr({className:e,...t}){return PS("div",{"data-slot":"skeleton",className:me("animate-pulse rounded-md bg-muted",e),...t})}import{jsx as Te,jsxs as Zt}from"react/jsx-runtime";function MS(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=AS("");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(""),[N,A]=zr(),[R,F]=zr("chat"),[X,P]=zr(),O=!!o,W=Nc(_o.visitorProfile,b&&O?{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:MS(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),F("chat")}catch{E("We couldn't save your email. Please try again.")}finally{M(!1)}}async function k(){if(!W){F("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),F("chat")}catch{E("We couldn't start a new conversation. Please try again.")}finally{M(!1)}}let ne=Nc(_o.customerMessages,S&&b&&O?{conversationId:S,visitorId:b,sessionToken:o}:"skip"),H=Nc(_o.visitorConversations,b&&O?{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"&&O&&S&&b&&Y?.sender==="merchant")C({conversationId:S,visitorId:b,sessionToken:o}).catch(()=>{})},[S,R,Y?._id,Y?.sender,C,o,O,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 Te(tm,{className:"w-full max-w-md",children:Zt(om,{children:[Te(rm,{children:"Chat unavailable"}),Te(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?Te("img",{src:f.agentImageUrl,alt:"",className:"size-7 rounded-full object-cover"}):Te(vn,{seed:"Coristen agent",size:28,className:"size-7 contrast-200 grayscale"}),_=Zt("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-8 py-10 text-center",children:[Te("div",{className:"flex size-12 items-center justify-center overflow-hidden rounded-full bg-muted",children:f.agentImageUrl?Te("img",{src:f.agentImageUrl,alt:"",className:"size-12 object-cover"}):Te(vn,{seed:"Coristen agent",size:48,className:"size-12 contrast-200 grayscale"})}),Zt("div",{className:"space-y-1.5",children:[Zt("p",{className:"text-base font-semibold",children:["Hi, I’m ",f.agentName]}),Te("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 Te("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:Zt(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:[Zt(om,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:ee}:void 0,children:[Te(rm,{className:"truncate",children:f.name}),Te(nm,{className:"text-current opacity-85",children:R==="history"?"Continue a previous conversation":"How can we help?"}),Zt(pg,{className:"flex gap-1",children:[Zt(vt,{variant:"ghost",size:"sm",onClick:()=>F(R==="chat"?"history":"chat"),children:[R==="chat"?Te(Ts,{"data-icon":"inline-start"}):Te(ds,{"data-icon":"inline-start"}),R==="chat"?"Messages":"Chat"]}),Te(vt,{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?Te(bs,{}):Te(Ss,{})}),Te(vt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:a,children:Te(Po,{})})]})]}),B&&W!==null&&Te("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:B}),Te(dg,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:R==="history"?Te("div",{className:"flex min-h-0 w-full flex-col",children:Zt("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)=>Zt("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[Te(Gr,{className:"h-4 w-4/5"}),Te(Gr,{className:"h-3 w-2/5"})]},G)),H?.map((U)=>Zt("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),F("chat")},children:[Te("span",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:f.agentImageUrl?Te("img",{src:f.agentImageUrl,alt:"",className:"size-9 object-cover"}):Te(vn,{seed:"Coristen agent",size:36,className:"size-9 contrast-200 grayscale"})}),Zt("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[Zt("span",{className:"flex items-center justify-between gap-2",children:[Te("span",{className:"text-sm font-medium",children:"Conversation"}),Te("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)})]}),Te("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:U.lastMessagePreview||"Attachment"}),!!U.customerUnreadCount&&Zt(Pc,{variant:"secondary",children:[U.customerUnreadCount," unread"]})]}),Te(Rs,{className:"size-4 shrink-0 text-muted-foreground"})]},U._id)),H?.length===0&&Te("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?Zt("div",{className:"flex w-full flex-col justify-center gap-4 p-6",children:[Te(Gr,{className:"h-5 w-28"}),Te(Gr,{className:"h-4 w-52"}),Te(Gr,{className:"h-8 w-full"}),Te(Gr,{className:"h-8 w-full"}),Te(Gr,{className:"h-8 w-full"})]}):W===null&&!S?Te("div",{className:"flex min-h-0 w-full flex-col",children:_}):S&&ne===void 0&&N?Te(bm,{messages:[{_id:"pending-first-message",_creationTime:N.createdAt,sender:"customer",body:N.body,attachments:N.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:Te(vn,{seed:b,size:28,className:"size-7"}),otherAvatar:ce}):!S||ne===void 0||ne.length===0?_:Te(bm,{messages:ne,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:Te(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"&&Te(wc,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:Zt(vt,{variant:"secondary",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:T||W===void 0,onClick:()=>void k(),children:[Te(Tn,{"data-icon":"inline-start"}),"Start a conversation"]})}),W===null&&!S&&R==="chat"&&Te(wc,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:Zt("form",{className:"flex w-full flex-col gap-3",onSubmit:(U)=>void J(U),children:[Zt("div",{className:"flex flex-col gap-2",children:[Te(T1,{htmlFor:"customer-email",children:"Email address"}),Te(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&&Te("p",{role:"alert",className:"text-xs text-destructive",children:B}),Te(vt,{type:"submit",size:"lg",className:"w-full rounded-(--widget-action-radius)",disabled:T||!X,children:T?"Continuing...":"Continue"})]})}),W&&R==="chat"&&O&&Te(wc,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:Te(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 Cr{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)||!Or(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 kS,jsxs as LS}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 Lr(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]),LS(Cm.Provider,{value:s,children:[kS(DS,{store:s,timeout:r,limit:n}),o]})};function DS(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 O=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)!==O)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ne(H){if(H.relatedTarget)return;let Y=Ze(H),z=nt(ye(P));if(Y===O||!fe(P,Y)||!Or(z))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return zt(ve(O,"keydown",J),ve(O,"blur",k,!0),ve(O,"focus",ne,!0),ve(W,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,g]);function S(P){l.current=!0;let O=P.relatedTarget===c.state.viewport?p.find((W)=>W.transitionStatus!=="ending"&&!W.limited):void 0;if(O)O.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((O)=>O.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(Or(nt(ye(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function N(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:N,onKeyDown:y,onClick:E,onPointerDown:M,onPointerUp:B,onPointerCancel:B,style:{[L1]:C?`${C}px`:void 0}},R={expanded:I},F=!g&&d&&Uc(zo,{onFocus:S}),X=ke("div",t,{ref:[o,c.setViewport],state:R,props:[A,i,{children:ym(Oo.Fragment,{children:[F,s,F]})}]});return ym(Oo.Fragment,{children:[F,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 BS}from"react/jsx-runtime";var HS={...Dn,swipeDirection(e){return e?{[U1]:e}:null}},_1=40,VS=10,W1=0.5,US=1,_S=`${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),N=tt.useRef(null),A=tt.useRef(void 0),R=tt.useRef({x:0,y:0}),F=tt.useRef({x:0,y:0,scale:1}),X=tt.useRef(void 0),P=tt.useRef(0),O=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");Dr({open:r.transitionStatus!=="ending",ref:N,onComplete(){if(r.transitionStatus==="ending")f.removeToast(r.id)}});let ce=re((ue=!1)=>{let Se=N.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:N,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=F.current;if(ue.type==="pointercancel"||O.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(gr(Se,`button,a,input,textarea,[role="button"],${_S}`))return;O.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);F.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)>=US){C(!0);let _t=l.includes("left")||l.includes("right"),po=l.includes("up")||l.includes("down");if(_t&&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,_t=Wc(qt,ge,de);if(_t>_1)O.current=!1,p(qt);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&P.current-_t>=VS)O.current=!0}let je=K(j,oe),ct=F.current.x,so=F.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(!N.current||!fe(N.current,nt(ye(N.current))))return;f.closeToast(r.id)}}tt.useEffect(()=>{let ue=N.current;if(!m||!ue)return;function Se(L){if(ne.current===null||!fe(ue,Ze(L)))return;L.preventDefault()}return ve(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,N],state:se,stateAttributesMapping:HS,props:[le,c]});return BS(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:or(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 WS}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 WS(jc.Fragment,{children:[l,u&&th.createPortal(r,u)]})});import{jsx as GS}from"react/jsx-runtime";var nh=rh.forwardRef(function(t,o){return GS(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 Mt from"react";var ih=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.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",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Mt.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",Mt.createElement(Mt.Fragment,null,Mt.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",Mt.createElement(Mt.Fragment,null,Mt.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",Mt.createElement(Mt.Fragment,null,Mt.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",Mt.createElement(Mt.Fragment,null,Mt.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 kt from"react";var ch=new Map([["bold",kt.createElement(kt.Fragment,null,kt.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",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:"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",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,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",kt.createElement(kt.Fragment,null,kt.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",kt.createElement(kt.Fragment,null,kt.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",kt.createElement(kt.Fragment,null,kt.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 Lt from"react";var lh=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.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",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:"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",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,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",Lt.createElement(Lt.Fragment,null,Lt.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",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,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",Lt.createElement(Lt.Fragment,null,Lt.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 Dt from"react";var uh=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.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",Dt.createElement(Dt.Fragment,null,Dt.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"}),Dt.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",Dt.createElement(Dt.Fragment,null,Dt.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",Dt.createElement(Dt.Fragment,null,Dt.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",Dt.createElement(Dt.Fragment,null,Dt.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",Dt.createElement(Dt.Fragment,null,Dt.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 Ft from"react";var mh=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.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",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ft.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",Ft.createElement(Ft.Fragment,null,Ft.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",Ft.createElement(Ft.Fragment,null,Ft.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",Ft.createElement(Ft.Fragment,null,Ft.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",Ft.createElement(Ft.Fragment,null,Ft.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 zS=Em();function ZS({...e}){return at(k1,{...e})}function qS({...e}){return at(nh,{"data-slot":"toast-portal",...e})}function XS({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 jS({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 bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--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 $S({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 YS({className:e,...t}){return at(K1,{"data-slot":"toast-title",className:me("text-sm font-medium",e),...t})}function KS({className:e,...t}){return at($1,{"data-slot":"toast-description",className:me("text-sm text-muted-foreground",e),...t})}function JS({className:e,render:t=at(vt,{variant:"outline",size:"sm"}),...o}){return at(eh,{"data-slot":"toast-action",render:t,className:me("shrink-0",e),...o})}function QS({className:e,children:t,render:o=at(vt,{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 ew({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 tw(){let{toasts:e}=Tm();return e.map((t)=>at(jS,{toast:t,children:Dm($S,{children:[at(ew,{type:t.type}),Dm("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[at(YS,{}),at(KS,{})]}),at(JS,{}),at(QS,{})]})},t.id))}function el({children:e,toastManager:t=zS,...o}){return Dm(ZS,{toastManager:t,...o,children:[e,at(qS,{children:at(XS,{children:at(tw,{})})})]})}var fh=Em,Vtt=Tm;import{jsx as xr,jsxs as ph,Fragment as uw}from"react/jsx-runtime";var iw="https://coristen-three.vercel.app",Kn=fh(),cw=["--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"],lw={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 dh extends ow{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=iw,defaultOpen:r=!1,fontSize:n,appearance:a,onReady:s,onError:i}){let c=o.replace(/\/$/,""),[u,l]=ir(),[m,f]=ir(""),[g,p]=ir(""),[w,I]=ir(),[d,C]=ir(r),[b,h]=ir(!1),[S,y]=ir(0),[x,v]=ir({}),[T,M]=ir(!1),[B,E]=ir(),N=rs(null),A=rs(void 0),R=rs(!1),F=rs(s),X=rs(i);F.current=s,X.current=i;let P=rw(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(""),F.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:0,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(!N.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(cw.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 O=nw(()=>u?new sw(u.convexUrl):void 0,[u?.convexUrl]),W={...w??u?.settings??lw,...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||!O))return xr(el,{toastManager:Kn});if(!u||!O)return xr(el,{toastManager:Kn});return ph(uw,{children:[xr(el,{toastManager:Kn}),ph("div",{ref:N,"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:[u&&O&&xr("div",{className:"coristen-panel",role:"dialog","aria-label":`${W.name} chat`,"aria-hidden":!d,inert:!d,style:ae,children:xr(dh,{onError:(_)=>{p("Chat ran into a problem. Please try again."),X.current?.(_)},children:xr(aw,{client:O,children:xr(E1,{workspaceId:u.workspaceId,initialSettings:W,sessionToken:u.token,expanded:b,onExpandedChange:h,onClose:()=>C(!1),onSettingsChange:I,theme:W.theme,assetBaseUrl:c})})},S)}),xr("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:xr("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};
|