@ai-matrx/coding-sessions 0.1.146 → 0.1.147

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.
@@ -13,7 +13,7 @@ Error generating stack: `+e.message+`
13
13
  `),n=[];{let e=0;for(let r of t)n.push(e),e+=r.length+1}let r=[],i=0,a=0;for(;i<t.length;){let e=t[i]??``;if(e.trim()===``){i+=1;continue}a=i;let n=Nr.exec(e);if(n!==null){let e=n[1]??"```",a=n[2]??``,o=[];i+=1;let s=!1;for(;i<t.length;){let n=t[i]??``;if(n.trimStart().startsWith(e[0]??"`")&&n.trim().length>=3){let t=Nr.exec(n);if(t!==null&&(t[1]??``).length>=e.length){s=!0,i+=1;break}}o.push(n),i+=1}r.push({type:`code`,language:a,body:o.join(`
14
14
  `),closed:s});continue}let o=Pr.exec(e);if(o!==null){r.push({type:`heading`,level:(o[1]??`#`).length,body:o[2]??``}),i+=1;continue}if(Rr.test(e)){r.push({type:`rule`}),i+=1;continue}if(Lr.test(e)){let e=[];for(;i<t.length;){let n=Lr.exec(t[i]??``);if(n===null)break;e.push(n[1]??``),i+=1}r.push({type:`quote`,body:e.join(`
15
15
  `)});continue}let s=Fr.exec(e),c=Ir.exec(e);if(s!==null||c!==null){let e=c!==null,n=[];for(;i<t.length;){let r=t[i]??``,a=e?Ir.exec(r):Fr.exec(r);if(a===null)break;n.push(a[1]??``),i+=1}r.push({type:`list`,ordered:e,items:n});continue}if(en(t,i)){let n=zr(e),a=tn(t,i);i+=2;let o=[];for(;i<a;){let e=zr(t[i]??``);o.push(n.map((t,n)=>e[n]??``)),i+=1}r.push({type:`table`,header:n,rows:o});continue}let l=[];for(;i<t.length;){let e=t[i]??``;if(e.trim()===``||Nr.test(e)||Pr.test(e)||Fr.test(e)||Ir.test(e)||Lr.test(e)||Rr.test(e))break;l.push(e),i+=1}r.push({type:`paragraph`,body:l.join(`
16
- `)})}return{blocks:r,openFrom:n[a]??0}}function Vr(){let e=new Map,t=0,n=(n,r)=>{t+=1;let i=Br(r);return e.set(n,{text:r,blocks:i.blocks,stable:i.blocks.slice(0,Math.max(0,i.blocks.length-1)),stableEnd:i.openFrom}),i.blocks};return{get parses(){return t},forget(t){e.delete(t)},parse(r,i){let a=e.get(r);if(a===void 0)return n(r,i);if(a.text===i)return a.blocks;if(!i.startsWith(a.text))return n(r,i);t+=1;let o=Br(i.slice(a.stableEnd)),s=[...a.stable,...o.blocks];return e.set(r,{text:i,blocks:s,stable:s.slice(0,Math.max(0,s.length-1)),stableEnd:a.stableEnd+o.openFrom}),s}}}function Hr(e,t){switch(e.type){case`code`:return(0,j.jsx)(`pre`,{className:`mx-chat-md__pre`,"data-language":e.language||void 0,children:(0,j.jsx)(`code`,{children:e.body})},t);case`heading`:{let n=Math.min(6,Math.max(1,e.level)),r=`h${n}`;return(0,j.jsx)(r,{className:`mx-chat-md__heading`,"data-level":n,children:Mr(e.body,`${t}-`)},t)}case`quote`:return(0,j.jsx)(`blockquote`,{className:`mx-chat-md__quote`,children:Mr(e.body,`${t}-`)},t);case`list`:return e.ordered?(0,j.jsx)(`ol`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:Mr(e,`${t}-${n}-`)},`${t}-${n}`))},t):(0,j.jsx)(`ul`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:Mr(e,`${t}-${n}-`)},`${t}-${n}`))},t);case`table`:return(0,j.jsx)(`div`,{className:`mx-chat-md__table-scroll`,children:(0,j.jsxs)(`table`,{className:`mx-chat-md__table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:e.header.map((e,n)=>(0,j.jsx)(`th`,{children:Mr(e,`${t}-h${n}-`)},`${t}-h${n}`))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,j.jsx)(`tr`,{children:e.map((e,r)=>(0,j.jsx)(`td`,{children:Mr(e,`${t}-r${n}c${r}-`)},`${t}-r${n}c${r}`))},`${t}-r${n}`))})]})},t);case`rule`:return(0,j.jsx)(`hr`,{className:`mx-chat-md__rule`},t);case`paragraph`:return(0,j.jsx)(`p`,{className:`mx-chat-md__paragraph`,children:Mr(e.body,`${t}-`)},t)}}function Ur(e){let t=e.cache.parse(e.cacheKey,e.text);return(0,j.jsx)(`div`,{className:`mx-chat-md`,children:t.map((e,t)=>Hr(e,`b${t}`))})}var Wr=`This answer contains a structured block, and it is shown as plain text here because this app has not connected the content renderer.`,Gr=`Mount <ContentIrRenderProvider host={…}> from @ai-matrx/content-ir-react above your chat to draw structured blocks properly.`;function Kr(e){let t=te(),n=e.announce;return(0,_.useEffect)(()=>{t===null&&n()},[t,n]),t===null?(0,j.jsxs)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block-standin`,children:[(0,j.jsx)(`span`,{className:`mx-chat-standin`,children:Wr}),(0,j.jsx)(Ur,{text:e.request.text,cacheKey:`${e.request.messageId}:${e.request.kind}`,cache:e.cache})]}):(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block`,"data-kind":e.request.kind,children:(0,j.jsx)(wr,{kind:e.request.kind,value:e.request.data??e.request.text,variant:`bare`})})}function qr(e={}){let t=e.notifier??D(),n=e.cache??Vr(),r=!1,i=()=>{r||(r=!0,t.notify({level:`warning`,message:Wr,remedy:Gr}))};return function(e){return e.kind!==`markdown`&&e.kind!==`text`?(0,j.jsx)(Kr,{request:e,cache:n,notifier:t,announce:i}):e.text===``?null:(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`markdown`,children:(0,j.jsx)(Ur,{text:e.text,cacheKey:e.messageId,cache:n})})}}function Jr(e){return!!(/[zZ]$/.test(e)||/[+-]\d{2}(:?\d{2})?$/.test(e)||/\b(GMT|UTC)\b/i.test(e))}function Yr(e){let t=e.trim();return!t||!/\d{1,2}:\d{2}/.test(t)||Jr(t)?t:`${t.replace(` `,`T`)}Z`}function Xr(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=Yr(e);if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var Zr={year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};function Qr(e,t=Zr,n=`—`){let r=Xr(e);return r?r.toLocaleString(void 0,t):n}var $r=[{limit:6e4,divisor:1e3,short:`s`,long:`second`},{limit:36e5,divisor:6e4,short:`m`,long:`minute`},{limit:864e5,divisor:36e5,short:`h`,long:`hour`},{limit:6048e5,divisor:864e5,short:`d`,long:`day`},{limit:2592e6,divisor:6048e5,short:`w`,long:`week`},{limit:31536e6,divisor:2592e6,short:`mo`,long:`month`}],ei=[{unit:`year`,ms:31536e6},{unit:`month`,ms:2592e6},{unit:`week`,ms:6048e5},{unit:`day`,ms:864e5},{unit:`hour`,ms:36e5},{unit:`minute`,ms:6e4}];function ti(e,t={}){let n=t.style??`short`,r=t.suffix===!1,i=t.now??Date.now(),a=Xr(e);if(!a)return t.fallbackToInput===!0&&typeof e==`string`?e:t.fallback??`—`;if(n===`intl`){let e=a.getTime()-i,t=Math.abs(e);if(t<6e4)return`just now`;let n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let{unit:r,ms:i}of ei)if(t>=i)return n.format(Math.trunc(e/i),r);return`just now`}let o=i-a.getTime(),s=o<0;if(s&&-o<6e4)return`just now`;let c=Math.abs(o);for(let e of $r)if(c<e.limit){let t=Math.max(1,Math.floor(c/e.divisor)),i=n===`long`?`${t} ${e.long}${t===1?``:`s`}`:`${t}${e.short}`;return r?i:s?`in ${i}`:`${i} ago`}return(t.absolute??(r?`date`:`datetime`))===`date`?a.toLocaleDateString():Qr(a)}var ni=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function ri(e,t={}){let n=t.fallback??`—`;if(e==null||!Number.isFinite(e)||e<0)return n;if(e<1024)return`${Math.round(e)} B`;let r=e,i=0;for(;r>=1024&&i<ni.length-1;)r/=1024,i+=1;return`${r>=10?String(Math.round(r)):r.toFixed(1)} ${ni[i]}`}function ii(e){return typeof e==`number`&&Number.isFinite(e)}function ai(e,t={}){let{digits:n=2,unknown:r=`—`}=t;if(!ii(e))return r;let i;if(n===`adaptive`||n===`trim`){let t=Math.abs(e);i=t===0||t>=1?2:t>=.01?4:6}else i=n;return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n===`trim`?Math.min(2,i):i,maximumFractionDigits:i})}`}var oi=[``,`k`,`M`,`B`,`T`];function si(e,t={}){let{unknown:n=`—`,style:r=`plain`,locale:i}=t;if(!ii(e))return n;if(r!==`compact`)return e.toLocaleString(i);let a=e<0?`-`:``,o=Math.abs(e);if(o<1e3)return`${a}${Math.round(o)}`;let s=0;for(;o>=1e3&&s<oi.length-1;)o/=1e3,s+=1;let c=o>=10?Math.round(o):Number(o.toFixed(1));return c>=1e3&&s<oi.length-1&&(o/=1e3,s+=1,c=o>=10?Math.round(o):Number(o.toFixed(1))),`${a}${o>=10?String(c):c.toFixed(1)}${oi[s]}`}var ci=`Attachments aren't set up here, so this file has not been sent.`,li="Give <ChatComposerProvider> a `files` port (your upload service) to attach files to a message.";function ui(e){let t=!1;return{available:!1,upload(){return t||(t=!0,e.notify({level:`warning`,message:ci,remedy:li})),Promise.reject(Error(ci))}}}function di(e,t){return`${e} is larger than the ${ri(t)} limit for this chat, so it has not been attached.`}function fi(e){return de(e)||`Working…`}function pi(e){let t=new Set;return{request(n){if(t.size===0)return e.notify({level:`warning`,message:`There is nowhere to put your message back, so it has not been restored for you.`,remedy:`Copy your message from the conversation above and send it again, or mount this transcript inside a chat that has a message box.`}),!1;for(let e of t)e(n);return!0},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var mi=(0,_.createContext)(null);function hi(e){let{thread:t,ports:n,slots:r,children:i}=e,[a]=(0,_.useState)(()=>{let e=D();return{notifier:e,prefs:k(e)}}),o=n?.notifier??a.notifier,s=(0,_.useRef)(null);(s.current===null||s.current.notifier!==o)&&(s.current={notifier:o,bus:pi(o),renderContent:qr({notifier:o}),files:ui(o)});let c=s.current.bus,l=s.current.renderContent,u=s.current.files,d=(0,_.useMemo)(()=>({thread:t,ports:{renderContent:n?.renderContent??l,notifier:o,prefs:n?.prefs??a.prefs,files:n?.files??u,voice:n?.voice??null,toolLabel:n?.toolLabel??fi,modelPicker:n?.modelPicker??null,quickset:n?.quickset??null},slots:r??{},retry:c}),[t,n?.renderContent,n?.prefs,n?.files,n?.voice,n?.toolLabel,n?.modelPicker,n?.quickset,o,r,c,l,u,a.prefs]),f=(0,_.useRef)(t);return(0,_.useEffect)(()=>{if(f.current===t)return;let e=f.current.getSnapshot().status;(e===`streaming`||e===`submitted`)&&o.notify({level:`warning`,message:`The previous answer was still arriving when this chat switched conversations.`,remedy:`Stop the answer before switching, or the run keeps going in the background.`}),f.current=t},[t,o]),(0,j.jsx)(mi.Provider,{value:d,children:i})}function gi(){let e=(0,_.useContext)(mi);if(e===null)throw Error(`[@ai-matrx/chat] This component must be rendered inside <ChatProvider thread={…}>. Wrap your chat surface in one, passing a thread from createChatThread() or createExternalThreadSource().`);return e}function _i(){let{thread:e}=gi(),t=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),n=(0,_.useCallback)((t,n)=>e.send(n===void 0?{text:t}:{text:t,fileIds:n}),[e]),r=(0,_.useCallback)(()=>e.cancel(),[e]);return(0,_.useMemo)(()=>({snapshot:t,messages:t.messages,status:t.status,isBusy:t.status===`submitted`||t.status===`streaming`,conversationId:t.conversationId,ephemeral:t.ephemeral,ephemeralReason:t.ephemeralReason,error:t.error,send:n,cancel:r}),[t,n,r])}function vi(e){let{thread:t}=gi(),n=(0,_.useCallback)(n=>t.subscribeToMessage(e,n),[t,e]),r=(0,_.useCallback)(()=>t.getMessageSnapshot(e),[t,e]);return(0,_.useSyncExternalStore)(n,r,r)}function yi(){return gi().thread.features}function bi(){return gi().ports}function xi(){return gi().slots}var Si=`ai-matrx.chat.draft.`;function Ci(){let{thread:e,ports:t,retry:n}=gi(),r=e.features,i=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),a=i.conversationId,o=i.status===`submitted`||i.status===`streaming`,s=`${Si}${a??`new`}`,[c,l]=(0,_.useState)(()=>r.retainDrafts?t.prefs.get(s)??``:``),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(s);(0,_.useEffect)(()=>{if(f.current===s)return;let e=f.current;if(f.current=s,!r.retainDrafts)return;let n=t.prefs.get(e);if(n!==null&&n!==``){t.prefs.set(s,n),t.prefs.remove(e),l(n);return}l(t.prefs.get(s)??``)},[s,r.retainDrafts,t.prefs]);let p=(0,_.useCallback)(e=>{l(e),d(!1),r.retainDrafts&&(e===``?t.prefs.remove(f.current):t.prefs.set(f.current,e))},[r.retainDrafts,t.prefs]);(0,_.useEffect)(()=>n.subscribe(e=>{l(e),d(!0),r.retainDrafts&&t.prefs.set(f.current,e)}),[n,r.retainDrafts,t.prefs]);let m=(0,_.useCallback)(async()=>{let n=c.trim();if(n===``||o&&!r.sendWhileBusy)return null;l(``),d(!1),r.retainDrafts&&t.prefs.remove(f.current);let i=await e.send({text:n});return i.accepted||(l(n),r.retainDrafts&&t.prefs.set(f.current,n)),i},[c,o,e,r.retainDrafts,r.sendWhileBusy,t.prefs]),h=(0,_.useCallback)(()=>e.cancel(),[e]),g=(0,_.useCallback)(t=>{if(t.key===`Escape`){if(!o)return;t.preventDefault(),e.cancel();return}if(t.key!==`Enter`)return;let n=t.metaKey||t.ctrlKey;(r.sendKey===`enter`?!t.shiftKey&&!n:n)&&(t.preventDefault(),m())},[r.sendKey,o,m,e]);return{text:c,setText:p,canSend:c.trim()!==``&&(!o||r.sendWhileBusy),isBusy:o,send:m,stop:h,onKeyDown:g,restoredFromFailure:u}}function wi(e,t){let n=e.findIndex(e=>e.id===t);if(n<=0)return``;for(let t=n-1;t>=0;--t){let n=e[t];if(n&&n.role===`user`)return C(n)}return``}function Ti(){return(0,j.jsx)(`svg`,{className:`mx-chat-chevron`,width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})}function Ei(){return(0,j.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})})}var Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return Oi(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Oi(V,`composeEventHandlers`);function Ai(e){if(!ki)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Oi(Ai,`getOwnerWindow`);function ji(e){if(!ki)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Oi(ji,`getOwnerDocument`);function Mi(e,t=!1){let{activeElement:n}=ji(e);if(!n?.nodeName)return null;if(Ni(n)&&n.contentDocument)return Mi(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ji(n).getElementById(e);if(t)return t}}return n}Oi(Mi,`getActiveElement`);function Ni(e){return e.tagName===`IFRAME`}Oi(Ni,`isFrame`);var Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fi(Ii,`setRef`);function Li(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ii(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ii(e[t],null)}}}}Fi(Li,`composeRefs`);function H(...e){return _.useCallback(Li(...e),e)}Fi(H,`useComposedRefs`);var Ri=Object.defineProperty,zi=(e,t)=>Ri(e,`name`,{value:t,configurable:!0});function Bi(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=zi(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,j.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return zi(i,`useContext`),[r,i]}zi(Bi,`createContext`);function Vi(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=zi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return zi(s,`useContext`),[o,s]}zi(r,`createContext`);let i=zi(()=>{let t=n.map(e=>_.createContext(e));return zi(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Hi(i,...t)]}zi(Vi,`createContextScope`);function Hi(...e){let t=e[0];if(e.length===1)return t;let n=zi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return zi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}zi(Hi,`composeContextScopes`);var Ui=Object.defineProperty,Wi=(e,t)=>Ui(e,`name`,{value:t,configurable:!0});function Gi(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ea(r)&&typeof ra==`function`&&(r=ra(r._payload)),_.Children.forEach(r,e=>{if(Qi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ea(n)&&typeof ra==`function`&&(n=ra(n._payload)),a=Yi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?Zi(a):void 0,l=H(n,c);if(!a){if(r||r===0)throw Error(o?na(e):U(e));return r}let u=Xi(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Wi(Gi,`createSlot`);var Ki=Gi(`Slot`),qi=Symbol.for(`radix.slottable`);function Ji(e){let t=Wi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qi,t}Wi(Ji,`createSlottable`);var Yi=Wi((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Xi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Wi(Xi,`mergeProps`);function Zi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Wi(Zi,`getElementRef`);function Qi(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qi}Wi(Qi,`isSlottable`);var $i=Symbol.for(`react.lazy`);function ea(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$i&&`_payload`in e&&ta(e._payload)}Wi(ea,`isLazyComponent`);function ta(e){return typeof e==`object`&&!!e&&`then`in e}Wi(ta,`isPromiseLike`);var U=Wi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),na=Wi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ra=_.use,ia=c(m(),1),aa=Object.defineProperty,oa=(e,t)=>aa(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Gi(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&ia.flushSync(()=>e.dispatchEvent(t))}oa(sa,`dispatchDiscreteCustomEvent`);var ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0});function ua(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}la(ua,`useCallbackRef`);var da=Object.defineProperty,fa=(e,t)=>da(e,`name`,{value:t,configurable:!0}),pa=`dismissableLayer.update`,ma=`dismissableLayer.pointerDownOutside`,ha=`dismissableLayer.focusOutside`,ga,_a=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),va=_.forwardRef(fa(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(_a),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=H(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=xa(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Sa(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=ua(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ga=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ca(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ga))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ca())},[d,u]),_.useEffect(()=>{let e=fa(()=>m({}),`handleUpdate`);return document.addEventListener(pa,e),()=>document.removeEventListener(pa,e)},[]),(0,j.jsx)(W.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ya(){let e=_.useContext(_a),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}fa(ya,`useDismissableLayerSurface`);var ba=fa(()=>!0,`IS_TRUE`);function xa(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ba}=t,s=ua(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}fa(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}fa(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}fa(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}fa(p,`handleInteractionBubble`);let m=fa(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||wa(ma,s,p,{discrete:!0})};if(fa(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:fa(()=>c.current=!0,`onPointerDownCapture`)}}fa(xa,`usePointerDownOutside`);function Sa(e,t=globalThis?.document){let n=ua(e),r=_.useRef(!1);return _.useEffect(()=>{let e=fa(e=>{e.target&&!r.current&&wa(ha,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:fa(()=>r.current=!0,`onFocusCapture`),onBlurCapture:fa(()=>r.current=!1,`onBlurCapture`)}}fa(Sa,`useFocusOutside`);function Ca(){let e=new CustomEvent(pa);document.dispatchEvent(e)}fa(Ca,`dispatchUpdate`);function wa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sa(i,a):i.dispatchEvent(a)}fa(wa,`handleAndDispatchCustomEvent`);var Ta=globalThis?.document?_.useLayoutEffect:()=>{},Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0}),Oa=_.useId||(()=>void 0),ka=0;function Aa(e){let[t,n]=_.useState(Oa());return Ta(()=>{e||n(e=>e??String(ka++))},[e]),e||(t?`radix-${t}`:``)}Da(Aa,`useId`);var ja=[`top`,`right`,`bottom`,`left`],Ma=Math.min,Na=Math.max,Pa=Math.round,Fa=Math.floor,Ia=e=>({x:e,y:e}),La={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ra(e,t,n){return Na(e,Ma(t,n))}function za(e,t){return typeof e==`function`?e(t):e}function Ba(e){return e.split(`-`)[0]}function Va(e){return e.split(`-`)[1]}function Ha(e){return e===`x`?`y`:`x`}function Ua(e){return e===`y`?`height`:`width`}function Wa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ga(e){return Ha(Wa(e))}function Ka(e,t,n){n===void 0&&(n=!1);let r=Va(e),i=Ga(e),a=Ua(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=to(o)),[o,to(o)]}function qa(e){let t=to(e);return[Ja(e),t,Ja(t)]}function Ja(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ya=[`left`,`right`],Xa=[`right`,`left`],Za=[`top`,`bottom`],Qa=[`bottom`,`top`];function $a(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xa:Ya:t?Ya:Xa;case`left`:case`right`:return t?Za:Qa;default:return[]}}function eo(e,t,n,r){let i=Va(e),a=$a(Ba(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ja)))),a}function to(e){let t=Ba(e);return La[t]+e.slice(t.length)}function no(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ro(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:no(e)}function io(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ao(e,t,n){let{reference:r,floating:i}=e,a=Wa(t),o=Ga(t),s=Ua(o),c=Ba(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Va(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function oo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=za(t,e),p=ro(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=io(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var so=50,co=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:oo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ao(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<so&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ao(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=za(e,t)||{};if(l==null)return{};let d=ro(u),f={x:n,y:r},p=Ga(i),m=Ua(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ma(d[_],T),D=Ma(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ra(E,k,O),j=!c.arrow&&Va(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),uo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=za(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ba(r),_=Wa(o),v=Ba(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[to(o)]:qa(o)),x=p!==`none`;!d&&x&&b.push(...eo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ka(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wa(t)||T.every(e=>Wa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function fo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function po(e){return ja.some(t=>e[t]>=0)}var mo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=za(e,t);switch(i){case`referenceHidden`:{let e=fo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:po(e)}}}case`escaped`:{let e=fo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:po(e)}}}default:return{}}}}},ho=new Set([`left`,`top`]);async function go(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ba(n),s=Va(n),c=Wa(n)===`y`,l=ho.has(o)?-1:1,u=a&&c?-1:1,d=za(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var _o=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await go(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},vo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=za(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wa(i),p=Ha(f),m=u[p],h=u[f],g=(e,t)=>Ra(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},yo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=za(e,t),u={x:n,y:r},d=Wa(i),f=Ha(d),p=u[f],m=u[d],h=za(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ho.has(Ba(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},bo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=za(e,t),c=await i.detectOverflow(t,s),l=Ba(n),u=Va(n),d=Wa(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ma(p-c[m],g),y=Ma(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Na(c.left,c.right):S=p-2*Na(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function xo(){return typeof window<`u`}function So(e){return To(e)?(e.nodeName||``).toLowerCase():`#document`}function Co(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wo(e){return((To(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function To(e){return xo()?e instanceof Node||e instanceof Co(e).Node:!1}function Eo(e){return xo()?e instanceof Element||e instanceof Co(e).Element:!1}function Do(e){return xo()?e instanceof HTMLElement||e instanceof Co(e).HTMLElement:!1}function Oo(e){return!xo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Co(e).ShadowRoot}function ko(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ao(e){return/^(table|td|th)$/.test(So(e))}function jo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Mo=/transform|translate|scale|rotate|perspective|filter/,No=/paint|layout|strict|content/,Po=e=>!!e&&e!==`none`,Fo;function Io(e){let t=Eo(e)?K(e):e;return Po(t.transform)||Po(t.translate)||Po(t.scale)||Po(t.rotate)||Po(t.perspective)||!Ro()&&(Po(t.backdropFilter)||Po(t.filter))||Mo.test(t.willChange||``)||No.test(t.contain||``)}function Lo(e){let t=Bo(e);for(;Do(t)&&!G(t);){if(Io(t))return t;if(jo(t))return null;t=Bo(t)}return null}function Ro(){return Fo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Fo}function G(e){return/^(html|body|#document)$/.test(So(e))}function K(e){return Co(e).getComputedStyle(e)}function zo(e){return Eo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bo(e){if(So(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Oo(e)&&e.host||wo(e);return Oo(t)?t.host:t}function Vo(e){let t=Bo(e);return G(t)?(e.ownerDocument||e).body:Do(t)&&ko(t)?t:Vo(t)}function Ho(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vo(e),i=r===e.ownerDocument?.body,a=Co(r);if(i){let e=Uo(a);return t.concat(a,a.visualViewport||[],ko(r)?r:[],e&&n?Ho(e):[])}return t.concat(r,Ho(r,[],n))}function Uo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wo(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Do(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pa(n)!==a||Pa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Go(e){return Eo(e)?e:e.contextElement}function Ko(e){let t=Go(e);if(!Do(t))return Ia(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Wo(t),o=(a?Pa(n.width):n.width)/r,s=(a?Pa(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qo=Ia(0);function Jo(e){let t=Co(e);return!Ro()||!t.visualViewport?qo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Co(e)}function Xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Go(e),o=Ia(1);t&&(r?Eo(r)&&(o=Ko(r)):o=Ko(e));let s=Yo(a,n,r)?Jo(a):Ia(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Co(a),t=Eo(r)?Co(r):r,n=e,i=Uo(n);for(;i&&t!==n;){let e=Ko(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Co(i),i=Uo(n)}}return io({width:u,height:d,x:c,y:l})}function Zo(e,t){let n=zo(e).scrollLeft;return t?t.left+n:Xo(wo(e)).left+n}function Qo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Zo(e,n),y:n.top+t.scrollTop}}function $o(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wo(r),s=t?jo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ia(1),u=Ia(0),d=Do(r);if((d||!a)&&((So(r)!==`body`||ko(o))&&(c=zo(r)),d)){let e=Xo(r);l=Ko(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qo(o,c):Ia(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function es(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ts(e){let t=zo(e),n=e.ownerDocument.body,r=Na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Zo(e),o=-t.scrollTop;return K(n).direction===`rtl`&&(a+=Na(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ns=25;function rs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Co(e),a=wo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ro()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Zo(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ns&&(s-=o)}return{width:s,height:c,x:l,y:u}}function is(e,t){let n=Xo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ko(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function as(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=rs(e,n,t);else if(t===`document`)r=ts(wo(e));else if(Eo(t))r=is(t,n);else{let n=Jo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return io(r)}function os(e,t){let n=t.get(e);if(n)return n;let r=Ho(e,[],!1).filter(e=>Eo(e)&&So(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?Bo(e):e;for(;Eo(o)&&!G(o);){let e=K(o),t=Io(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Bo(o)}return t.set(e,r),r}function ss(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?jo(t)?[]:os(t,this._c):[].concat(n),r],o=as(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=as(t,a[e],i);s=Na(n.top,s),c=Ma(n.right,c),l=Ma(n.bottom,l),u=Na(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function cs(e){let{width:t,height:n}=Wo(e);return{width:t,height:n}}function ls(e,t,n){let r=Do(t),i=wo(t),a=n===`fixed`,o=Xo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ia(0);if((r||!a)&&((So(t)!==`body`||ko(i))&&(s=zo(t)),r)){let e=Xo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Zo(i));let l=i&&!r&&!a?Qo(i,s):Ia(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function us(e){return K(e).position===`static`}function ds(e,t){if(!Do(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wo(e)===n&&(n=n.ownerDocument.body),n}function fs(e,t){let n=Co(e);if(jo(e))return n;if(!Do(e)){let t=Bo(e);for(;t&&!G(t);){if(Eo(t)&&!us(t))return t;t=Bo(t)}return n}let r=ds(e,t);for(;r&&Ao(r)&&us(r);)r=ds(r,t);return r&&G(r)&&us(r)&&!Io(r)?n:r||Lo(e)||n}var ps=async function(e){let t=this.getOffsetParent||fs,n=this.getDimensions,r=await n(e.floating);return{reference:ls(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ms(e){return K(e).direction===`rtl`}var hs={convertOffsetParentRelativeRectToViewportRelativeRect:$o,getDocumentElement:wo,getClippingRect:ss,getOffsetParent:fs,getElementRects:ps,getClientRects:es,getDimensions:cs,getScale:Ko,isElement:Eo,isRTL:ms};function gs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _s(e,t,n){let r=null,i,a=wo(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fa(d),h=Fa(a.clientWidth-(u+f)),g=Fa(a.clientHeight-(d+p)),_=Fa(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Na(0,Ma(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Co(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Go(e),u=i||a?[...l?Ho(l):[],...t?Ho(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_s(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Xo(e):null;c&&g();function g(){let t=Xo(e);h&&!gs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ys=_o,bs=vo,xs=uo,Ss=bo,Cs=mo,ws=lo,Ts=yo,Es=(e,t,n)=>{let r=new Map,i=n??{},a={...hs,...i.platform,_c:r};return co(e,t,{...i,platform:a})},Ds=typeof document<`u`?_.useLayoutEffect:function(){};function Os(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Os(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Os(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){let n=ks(e);return Math.round(t*n)/n}function js(e){let t=_.useRef(e);return Ds(()=>{t.current=e}),t}function Ms(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Os(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=js(c),O=js(i),k=js(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Es(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Os(T.current,t)&&(T.current=t,ia.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ds(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Ds(()=>(j.current=!0,()=>{j.current=!1}),[]),Ds(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=As(N.floating,u.x),r=As(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ks(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Ns=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ws({element:r.current,padding:i}).fn(n):r?ws({element:r,padding:i}).fn(n):{}}}},Ps=(e,t)=>{let n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fs=(e,t)=>{let n=bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Is=(e,t)=>({fn:Ts(e).fn,options:[e,t]}),Ls=(e,t)=>{let n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bs=(e,t)=>{let n=Ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=Object.defineProperty,Hs=(e,t)=>Vs(e,`name`,{value:t,configurable:!0});function Us(e){let[t,n]=_.useState(void 0);return Ta(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Hs(Us,`useSize`);var Ws=Object.defineProperty,Gs=(e,t)=>Ws(e,`name`,{value:t,configurable:!0}),Ks=`Popper`,[qs,Js]=Vi(Ks),[Ys,Xs]=qs(Ks),Zs=Gs(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,j.jsx)(Ys,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Qs=`PopperAnchor`,$s=_.forwardRef(Gs(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Xs(Qs,n),o=_.useRef(null),s=a.onAnchorChange,c=H(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&oc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,j.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),ec=`PopperContent`,[tc,nc]=qs(ec),rc=_.forwardRef(Gs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Xs(ec,n),[v,y]=_.useState(null),b=H(t,y),[x,S]=_.useState(null),C=Us(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(ic),altBoundary:k},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=Ms({strategy:`fixed`,placement:E,whileElementsMounted:Gs((...e)=>vs(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ps({mainAxis:i+T,alignmentAxis:o}),c&&Fs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Is():void 0,...A}),c&&Ls({...A}),Rs({...A,apply:Gs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Bs({element:x,padding:s}),ac({arrowWidth:w,arrowHeight:T}),f&&zs({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),L=g.setPlacementState;Ta(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=oc(P),ne=ua(m);Ta(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=_.useState();return Ta(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,j.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,j.jsx)(tc,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,j.jsx)(W.div,{"data-side":ee,"data-align":te,...h,ref:b,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function ic(e){return e!==null}Gs(ic,`isNotNull`);var ac=Gs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=oc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function oc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Gs(oc,`getSideAndAlignFromPlacement`);var sc=Zs,cc=$s,lc=rc,uc=Object.defineProperty,dc=_.forwardRef(((e,t)=>uc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);Ta(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ia.createPortal((0,j.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),fc=Object.defineProperty,pc=(e,t)=>fc(e,`name`,{value:t,configurable:!0});function mc(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}pc(mc,`useStateMachine`);var hc=pc(e=>{let{present:t,children:n}=e,r=gc(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=vc(r.ref,bc(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function gc(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=mc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??yc(r.current),o.current=void 0):a.current=`none`},[s]),Ta(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=yc(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ta(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=pc(a=>{let o=yc(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=pc(e=>{e.target===t&&(a.current=yc(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=yc(t)}else r.current=null;n(e)},[])}}pc(gc,`usePresence`);function _c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}pc(_c,`setRef`);function vc(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=_c(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():_c(n[e],null)}}},[])}pc(vc,`useStableComposedRefs`);function yc(e){return e?.animationName||`none`}pc(yc,`getAnimationName`);function bc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}pc(bc,`getElementRef`);var xc=Object.defineProperty,Sc=(e,t)=>xc(e,`name`,{value:t,configurable:!0}),Cc=_.useEffectEvent,wc=_.useInsertionEffect;function Tc(e){if(typeof Cc==`function`)return Cc(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof wc==`function`?wc(()=>{t.current=e}):Ta(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Sc(Tc,`useEffectEvent`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=_.useInsertionEffect||Ta;function kc({prop:e,defaultProp:t,onChange:n=Dc(()=>{},`onChange`),caller:r}){let[i,a,o]=Ac({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=jc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Dc(kc,`useControllableState`);function Ac({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Oc(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Dc(Ac,`useUncontrolledState`);function jc(e){return typeof e==`function`}Dc(jc,`isFunction`);var Mc=Symbol(`RADIX:SYNC_STATE`);function Nc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Tc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===Mc)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Mc,state:i})},[i,d.state,c]),[h,f]}Dc(Nc,`useControllableStateReducer`);var Pc=Object.defineProperty,Fc=(e,t)=>Pc(e,`name`,{value:t,configurable:!0}),Ic=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Lc=_.forwardRef(Fc(function(e,t){return(0,j.jsx)(W.span,{...e,ref:t,style:{...Ic,...e.style}})},`VisuallyHidden`)),Rc=Object.defineProperty,zc=(e,t)=>Rc(e,`name`,{value:t,configurable:!0}),[Bc,Vc]=Vi(`Tooltip`,[Js]),Hc=Js(),Uc=`TooltipProvider`,Wc=700,Gc=`tooltip.open`,[Kc,qc]=Bc(Uc),Jc=zc(e=>{let{__scopeTooltip:t,delayDuration:n=Wc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(Kc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Yc=`Tooltip`,[Xc,Zc]=Bc(Yc),Qc=zc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=qc(Yc,e.__scopeTooltip),l=Hc(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Aa(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=kc({prop:r,defaultProp:i??!1,onChange:zc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Gc))):c.onClose(),a?.(e)},`onChange`),caller:Yc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,j.jsx)(sc,{...l,children:(0,j.jsx)(Xc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),$c=`TooltipTrigger`,el=_.forwardRef(zc(function(e,t){let{__scopeTooltip:n,...r}=e,i=Zc($c,n),a=qc($c,n),o=Hc(n),s=H(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,j.jsx)(cc,{asChild:!0,...o,children:(0,j.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:V(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:V(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:V(e.onBlur,i.onClose),onClick:V(e.onClick,i.onClose)})})},`TooltipTrigger`)),tl=`TooltipPortal`,[nl,rl]=Bc(tl,{forceMount:void 0}),il=zc(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Zc(tl,t);return(0,j.jsx)(nl,{scope:t,forceMount:n,children:(0,j.jsx)(hc,{present:n||a.open,children:(0,j.jsx)(dc,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),al=`TooltipContent`,ol=_.forwardRef(zc(function(e,t){let n=rl(al,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Zc(al,e.__scopeTooltip);return(0,j.jsx)(hc,{present:r||o.open,children:o.disableHoverableContent?(0,j.jsx)(ll,{side:i,...a,ref:t}):(0,j.jsx)(sl,{side:i,...a,ref:t})})},`TooltipContent`)),sl=_.forwardRef(zc(function(e,t){let n=Zc(al,e.__scopeTooltip),r=qc(al,e.__scopeTooltip),i=_.useRef(null),a=H(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=dl(r,ul(r,n.getBoundingClientRect())),a=fl(t.getBoundingClientRect()),o=ml([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=zc(e=>p(e,u),`handleTriggerLeave`),t=zc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=zc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!pl(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,j.jsx)(ll,{...e,ref:a})},`TooltipContentHoverable`)),cl=Ji(`TooltipContent`),ll=_.forwardRef(zc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Zc(al,n),u=Hc(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(Gc,d),()=>document.removeEventListener(Gc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=zc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ta(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,j.jsx)(va,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,j.jsxs)(lc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,j.jsx)(cl,{children:r}),i?(0,j.jsx)(Lc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function ul(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}zc(ul,`getExitSideFromRect`);function dl(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}zc(dl,`getPaddedExitPoints`);function fl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}zc(fl,`getPointsFromRect`);function pl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}zc(pl,`isPointInPolygon`);function ml(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),hl(t)}zc(ml,`getHull`);function hl(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}zc(hl,`getHullPresorted`);var gl=Jc,_l=Qc,vl=el,yl=il,bl=ol;function xl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xl(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Sl(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xl(e))&&(r&&(r+=` `),r+=t);return r}var Cl=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wl=(e,t)=>({classGroupId:e,validator:t}),Tl=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),El=`-`,Dl=[],Ol=`arbitrary..`,kl=e=>{let t=Ml(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return jl(e);let n=e.split(El);return Al(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Cl(i,t):t:i||Dl}return n[e]||Dl}}},Al=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Al(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(El):e.slice(t).join(El),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},jl=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ol+r:void 0})(),Ml=e=>{let{theme:t,classGroups:n}=e;return Nl(n,t)},Nl=(e,t)=>{let n=Tl();for(let r in e){let i=e[r];Pl(i,n,r,t)}return n},Pl=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fl(i,t,n,r)}},Fl=(e,t,n,r)=>{if(typeof e==`string`){Il(e,t,n);return}if(typeof e==`function`){Ll(e,t,n,r);return}Rl(e,t,n,r)},Il=(e,t,n)=>{let r=e===``?t:zl(t,e);r.classGroupId=n},Ll=(e,t,n,r)=>{if(Bl(e)){Pl(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wl(n,e))},Rl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Pl(o,zl(t,a),n,r)}},zl=(e,t)=>{let n=e,r=t.split(El),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Tl(),n.nextPart.set(t,i)),n=i}return n},Bl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Vl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hl=`!`,Ul=`:`,Wl=[],Gl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ul){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hl)?(c=s.slice(0,-1),l=!0):s.startsWith(Hl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Gl(t,l,c,u)};if(t){let e=t+Ul,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Gl(Wl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ql=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Jl=e=>({cache:Vl(e.cacheSize),parseClassName:Kl(e),sortModifiers:ql(e),postfixLookupClassGroupIds:Yl(e),...kl(e)}),Yl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Xl=/\s+/,Zl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Xl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Hl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ql=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=$l(n))&&(i&&(i+=` `),i+=r);return i},$l=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=$l(e[r]))&&(n&&(n+=` `),n+=t);return n},eu=(e,...t)=>{let n,r,i,a,o=o=>(n=Jl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Zl(e,n);return i(e,a),a};return a=o,(...e)=>a(Ql(...e))},tu=[],q=e=>{let t=t=>t[e]||tu;return t.isThemeGetter=!0,t.themeKey=e,t},nu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ru=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iu=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,au=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ou=/\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$/,su=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,cu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uu=e=>iu.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),du=e=>!!e&&Number.isInteger(Number(e)),fu=e=>e.endsWith(`%`)&&J(e.slice(0,-1)),pu=e=>au.test(e),mu=()=>!0,hu=e=>ou.test(e)&&!su.test(e),gu=()=>!1,_u=e=>cu.test(e),vu=e=>lu.test(e),yu=e=>!Y(e)&&!X(e),bu=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),xu=e=>Iu(e,Bu,gu),Y=e=>nu.test(e),Su=e=>Iu(e,Vu,hu),Cu=e=>Iu(e,Hu,J),wu=e=>Iu(e,Wu,mu),Tu=e=>Iu(e,Uu,gu),Eu=e=>Iu(e,Ru,gu),Du=e=>Iu(e,zu,vu),Ou=e=>Iu(e,Gu,_u),X=e=>ru.test(e),ku=e=>Lu(e,Vu),Au=e=>Lu(e,Uu),ju=e=>Lu(e,Ru),Mu=e=>Lu(e,Bu),Nu=e=>Lu(e,zu),Pu=e=>Lu(e,Gu,!0),Fu=e=>Lu(e,Wu,!0),Iu=(e,t,n)=>{let r=nu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lu=(e,t,n=!1)=>{let r=ru.exec(e);return r?r[1]?t(r[1]):n:!1},Ru=e=>e===`position`||e===`percentage`,zu=e=>e===`image`||e===`url`,Bu=e=>e===`length`||e===`size`||e===`bg-size`,Vu=e=>e===`length`,Hu=e=>e===`number`,Uu=e=>e===`family-name`,Wu=e=>e===`number`||e===`weight`,Gu=e=>e===`shadow`,Ku=eu(()=>{let e=q(`color`),t=q(`font`),n=q(`text`),r=q(`font-weight`),i=q(`tracking`),a=q(`leading`),o=q(`breakpoint`),s=q(`container`),c=q(`spacing`),l=q(`radius`),u=q(`shadow`),d=q(`inset-shadow`),f=q(`text-shadow`),p=q(`drop-shadow`),m=q(`blur`),h=q(`perspective`),g=q(`aspect`),_=q(`ease`),v=q(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,Y],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,Y,c],T=()=>[uu,`full`,`auto`,...w()],E=()=>[du,`none`,`subgrid`,X,Y],D=()=>[`auto`,{span:[`full`,du,X,Y]},du,X,Y],O=()=>[du,`auto`,X,Y],k=()=>[`auto`,`min`,`max`,`fr`,X,Y],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[uu,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,uu,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[uu,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,X,Y],L=()=>[...b(),ju,Eu,{position:[X,Y]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,Mu,xu,{size:[X,Y]}],ne=()=>[fu,ku,Su],re=()=>[``,`none`,`full`,l,X,Y],ie=()=>[``,J,ku,Su],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[J,fu,ju,Eu],ce=()=>[``,`none`,m,X,Y],le=()=>[`none`,J,X,Y],ue=()=>[`none`,J,X,Y],R=()=>[J,X,Y],de=()=>[uu,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[pu],breakpoint:[pu],color:[mu],container:[pu],"drop-shadow":[pu],ease:[`in`,`out`,`in-out`],font:[yu],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[pu],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[pu],shadow:[pu],spacing:[`px`,J],text:[pu],"text-shadow":[pu],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,uu,Y,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[bu],columns:[{columns:[J,`auto`,Y,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[du,`auto`,X,Y]}],basis:[{basis:[uu,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[J,uu,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,J,X,Y]}],shrink:[{shrink:[``,J,X,Y]}],order:[{order:[du,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,ku,Su]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fu,wu]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,fu,Y]}],"font-family":[{font:[Au,Tu,t]}],"font-features":[{"font-features":[Y]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,Y]}],"line-clamp":[{"line-clamp":[J,`none`,X,Cu]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[J,`from-font`,`auto`,X,Su]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[J,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[du,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},du,X,Y],radial:[``,X,Y],conic:[``,du,X,Y]},Nu,Du]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[J,X,Y]}],"outline-w":[{outline:[``,J,ku,Su]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,Pu,Ou]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Pu,Ou]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[J,Su]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Pu,Ou]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[J,X,Y]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[J]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[J]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:ce()}],brightness:[{brightness:[J,X,Y]}],contrast:[{contrast:[J,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Pu,Ou]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,J,X,Y]}],"hue-rotate":[{"hue-rotate":[J,X,Y]}],invert:[{invert:[``,J,X,Y]}],saturate:[{saturate:[J,X,Y]}],sepia:[{sepia:[``,J,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[J,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[J,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,J,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[J,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,J,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[J,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[J,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,J,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[J,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,_,X,Y]}],delay:[{delay:[J,X,Y]}],animate:[{animate:[`none`,v,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,Y]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[du,X,Y]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,Y]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[J,ku,Su,Cu]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Z(...e){return Ku(Sl(e))}var qu=`matrx-motion-overlay`,Ju=`matrx-motion-popper`,Yu={top:`matrx-motion-sheet-top`,bottom:`matrx-motion-sheet-bottom`,left:`matrx-motion-sheet-left`,right:`matrx-motion-sheet-right`,center:`matrx-motion-sheet-center`},Q=`matrx-spin`;[...Object.values(Yu)];var Xu=Symbol.for(`ai-matrx.design-system.portal-container-context`),Zu=globalThis,Qu=Zu[Xu]??=_.createContext(void 0);function $u({container:e,children:t}){return(0,j.jsx)(Qu.Provider,{value:e??void 0,children:t})}function ed(e){let t=_.useContext(Qu);return e===void 0?t??void 0:e??void 0}var td=`data-matrx-title`,nd=`data-matrx-tooltip-trigger`,rd=350,id=500,ad=6,od=8,sd=`matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,cd=Symbol.for(`@ai-matrx/design-system/title-tooltips`),ld={get:e=>e[cd],set:(e,t)=>{e[cd]=t},delete:e=>{delete e[cd]}};function ud(e=typeof document>`u`?void 0:document){if(!e)return()=>{};let t=ld.get(e);t?t.count+=1:ld.set(e,{count:1,uninstall:dd(e)});let n=!1;return()=>{if(n)return;n=!0;let t=ld.get(e);t&&(--t.count,t.count<=0&&(t.uninstall(),ld.delete(e)))}}function dd(e){let t=e.defaultView,n=null,r=null,i,a=0,o=t?.HTMLElement,s=e=>{if(!o||!(e instanceof t.Node))return null;let n=e instanceof o?e:e.parentElement;if(!n)return null;let r=n.closest(`[title], [${td}]`);return!r||!(r instanceof o)||r.closest(`[data-native-title]`)?null:r},c=e=>(e.getAttribute(`data-matrx-title`)??e.getAttribute(`title`)??``).trim(),l=e=>{let t=e.getAttribute(`title`);t!==null&&(e.setAttribute(td,t),e.removeAttribute(`title`))},u=e=>{let t=e.getAttribute(td);t!==null&&(e.hasAttribute(`title`)||e.setAttribute(`title`,t),e.removeAttribute(td))},d=()=>r&&r.isConnected?r:(r=e.createElement(`div`),r.setAttribute(`role`,`tooltip`),r.setAttribute(`data-slot`,`title-tooltip`),r.className=sd,r.style.visibility=`hidden`,e.body.appendChild(r),r),f=e=>{let t=e.closest(`[data-title-side]`)?.getAttribute(`data-title-side`);return t===`bottom`||t===`left`||t===`right`?t:`top`},p=(e,n)=>{let r=t?.innerWidth??0,i=t?.innerHeight??0,a=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s={top:a.top-ad-o.height>=od,bottom:a.bottom+ad+o.height<=i-od,left:a.left-ad-o.width>=od,right:a.right+ad+o.width<=r-od},c={top:`bottom`,bottom:`top`,left:`right`,right:`left`},l=f(e),u=s[l]?l:s[c[l]]?c[l]:l,d,p;u===`top`||u===`bottom`?(d=a.left+a.width/2-o.width/2,p=u===`top`?a.top-ad-o.height:a.bottom+ad):(p=a.top+a.height/2-o.height/2,d=u===`left`?a.left-ad-o.width:a.right+ad),d=Math.min(Math.max(d,od),Math.max(od,r-od-o.width)),p=Math.min(Math.max(p,od),Math.max(od,i-od-o.height)),n.style.transform=`translate(${Math.round(d)}px, ${Math.round(p)}px)`,n.setAttribute(`data-side`,u)},m=(e,n)=>{let r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;for(let r=e;r;r=r===n?null:r.parentElement){let e=t?.getComputedStyle(r);if(!e||e.display===`none`||e.visibility===`hidden`||Number(e.opacity)===0)return!1}return!0},h=(n,r)=>{let i=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),a=i(r);if(!a||!t)return!1;let o=e.createTreeWalker(n,t.NodeFilter.SHOW_TEXT);for(let e=o.nextNode();e;e=o.nextNode()){if(i(e.textContent??``)!==a)continue;let t=e.parentElement;if(t&&m(t,n)&&!(t.scrollWidth>t.clientWidth+1))return!0}return!1},g=(e,t)=>{if(n!==e||e.closest(`[data-matrx-tooltip-trigger]`))return;let r=c(e);if(!r||!e.isConnected||h(e,r))return;let i=d();i.textContent=r,i.style.visibility=`hidden`,i.setAttribute(`data-state`,t?`instant-open`:`delayed-open`),p(e,i),i.style.visibility=`visible`,e.id&&(i.id=`${e.id}-title-tooltip`)},_=()=>{i!==void 0&&clearTimeout(i),i=void 0,r&&r.style.visibility===`visible`&&(a=Date.now()),r&&(r.style.visibility=`hidden`,r.removeAttribute(`data-state`))},v=e=>{n!==e&&(y(),n=e,l(e),Date.now()-a<id?g(e,!0):i=setTimeout(()=>g(e,!1),rd))},y=()=>{_(),n&&u(n),n=null},b=e=>{if(e.pointerType===`touch`)return;let t=s(e.target);t?v(t):n&&y()},x=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},S=e=>{let t=s(e.target);if(!t)return;let n=!0;try{n=e.target.matches(`:focus-visible`)}catch{n=!0}n&&v(t)},C=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||y()},w=()=>y(),T=e=>{e.key===`Escape`&&y()};return e.addEventListener(`pointerover`,b,!0),e.addEventListener(`pointerout`,x,!0),e.addEventListener(`focusin`,S,!0),e.addEventListener(`focusout`,C,!0),e.addEventListener(`pointerdown`,w,!0),e.addEventListener(`keydown`,T,!0),e.addEventListener(`scroll`,w,!0),t?.addEventListener(`blur`,w),()=>{y(),e.removeEventListener(`pointerover`,b,!0),e.removeEventListener(`pointerout`,x,!0),e.removeEventListener(`focusin`,S,!0),e.removeEventListener(`focusout`,C,!0),e.removeEventListener(`pointerdown`,w,!0),e.removeEventListener(`keydown`,T,!0),e.removeEventListener(`scroll`,w,!0),t?.removeEventListener(`blur`,w),r?.remove(),r=null}}function fd({titleTooltips:e=!0,...t}){return _.useEffect(()=>{if(e)return ud()},[e]),(0,j.jsx)(gl,{...t})}var pd=_l,md=_.forwardRef((e,t)=>(0,j.jsx)(vl,{ref:t,[nd]:``,...e}));md.displayName=vl.displayName;var hd=_.forwardRef(({className:e,sideOffset:t=4,container:n,animated:r=!0,...i},a)=>{let o=ed(n);return(0,j.jsx)(yl,{container:o??null,children:(0,j.jsx)(bl,{ref:a,"data-slot":`tooltip-content`,sideOffset:t,className:Z(`matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,r&&`matrx-motion-popper`,e),...i})})});hd.displayName=bl.displayName;function gd(...e){return e.filter(Boolean).join(` `).trim()}function _d(e){for(let t=e;t;t=t.parentElement){let e=t.offsetWidth;if(!e)continue;let n=t.getBoundingClientRect().width;if(!(n>0))continue;let r=n/e;return!Number.isFinite(r)||r<=0||Math.abs(r-1)<.02?1:r}return 1}var vd=Symbol.for(`@ai-matrx/tap-target:guard`);function yd(){return globalThis[vd]===!0}var bd=[`--matrx-tap-box`,`--matrx-tap-gap`,`--matrx-tap-pill-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-wide-size`,`--matrx-tap-icon-size`,`--matrx-tap-touch-min`,`--matrx-tap-target-size`],xd=[{scope:`[data-matrx-table][data-matrx-table-density]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-icon-size`])},{scope:`[data-alchemy-trigger]`,tokens:new Set([`--matrx-tap-icon-size`])},{scope:`[data-matrx-controls]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-pill-sm-size`])}],Sd=xd[0].scope,Cd=xd[2].scope,wd=`.matrx-tap-target, .matrx-tap-group`,Td=/^(?:[^\s:]+:)*!?-?(?:\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\[)/;function Ed(e){if(!yd()||!e)return null;let t=e.split(/\s+/).filter(e=>e&&Td.test(e));return t.length?`className is the glyph colour only — remove "${t.join(` `)}"`:null}function Dd(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Od(e){let t=typeof e.className==`string`?e.className.trim().split(/\s+/).slice(0,4).join(`.`):``;return`<${e.tagName.toLowerCase()}${t?`.${t}`:``}>`}function kd(e,t){let n=t.getComputedStyle(e);return n.position===`absolute`||n.position===`fixed`||n.display===`none`}function Ad(e){return e.matches(wd)?1:e.querySelectorAll(wd).length}function jd(e,t,n){let r=``,i=e=>{e!==t&&(e.nodeType===3?r+=e.textContent??``:e.nodeType===1&&!kd(e,n)&&e.childNodes.forEach(i))};return e.childNodes.forEach(i),r.trim()}function Md(e,t){if(e.matches(wd))return!0;if(Ad(e)!==1)return!1;let n=e.querySelector(wd);return!Array.from(e.querySelectorAll(`input, select, textarea, button, a, [role='button']`)).some(e=>e!==n&&!n.contains(e))&&jd(e,n,t)===``}var Nd=null;function Pd(e){let t=e.defaultView,n=t.getComputedStyle(e.documentElement),r=bd.map(e=>n.getPropertyValue(e)).join(`|`);if(Nd?.key===r)return Nd;let i=e.createElement(`div`);i.setAttribute(`aria-hidden`,`true`),i.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0`,i.innerHTML=`<button class="matrx-tap-target"><div class="matrx-tap-pill"><svg class="matrx-tap-icon"></svg></div></button><button class="matrx-tap-target matrx-tap-target-sm"><div class="matrx-tap-pill matrx-tap-pill-sm"></div></button><button class="matrx-tap-target matrx-tap-target-inline"><div class="matrx-tap-pill matrx-tap-pill-inline"></div></button>`,e.body.appendChild(i);let[a,o,s]=Array.from(i.children);return Nd={key:r,target:a.offsetHeight,pill:a.firstElementChild.offsetHeight,icon:Dd(t.getComputedStyle(a.querySelector(`svg`)).height),sm:o.offsetHeight,smPill:o.firstElementChild.offsetHeight,wide:s.firstElementChild.offsetHeight},i.remove(),Nd}function Fd(e){let t=e.ownerDocument,n=t.defaultView;if(!n||!e.isConnected)return null;let r=n.getComputedStyle(e);if(r.display===`none`)return null;let i=n.getComputedStyle(t.documentElement),a=e.closest(Sd)!==null||e.closest(Cd)!==null,o=new Set;for(let t of bd){let n=r.getPropertyValue(t).trim();if(n!==i.getPropertyValue(t).trim()){if(!xd.some(n=>n.tokens.has(t)&&e.closest(n.scope)))return`${t} overridden to "${n}" — tap geometry is not configurable`;o.add(t)}}let s=e.classList.contains(`matrx-tap-target-sm`),c=/matrx-tap-target-(?:inline|mobile-icon-only)/.test(e.className),l=e.querySelector(`:scope > .matrx-tap-pill`),u=l?.querySelector(`.matrx-tap-icon`)??null,d=Dd(r.minHeight)>=e.offsetHeight-.5||Dd(r.minWidth)>=e.offsetWidth-.5;if(!a&&l&&!d){let r=Pd(t),i=s?r.sm:r.target,a=s?[r.smPill]:c?[r.pill,r.wide]:[r.pill];if(Math.abs(e.offsetHeight-i)>.5)return`button is ${e.offsetHeight}px tall, canon is ${i}px`;if(!c&&Math.abs(e.offsetWidth-i)>.5)return`button is ${e.offsetWidth}px wide, canon is ${i}px`;if(!a.some(e=>Math.abs(l.offsetHeight-e)<=.5))return`pill is ${l.offsetHeight}px, canon is ${a.join(` or `)}px`;if(u&&!o.has(`--matrx-tap-icon-size`)){let e=Dd(n.getComputedStyle(u).height);if(Math.abs(e-r.icon)>.5)return`glyph is ${e}px, canon is ${r.icon}px`}}let f=e;if(e.parentElement?.matches(`.matrx-tap-group-row, .matrx-tap-search-measure`)){let t=e.closest(`.matrx-tap-group`);if(t&&Ad(e.parentElement)>1)return null;f=t??e}for(let e=0;e<2;e+=1){let e=f.parentElement;if(!e||e===t.body||Array.from(e.children).filter(e=>e!==f&&!kd(e,n)).length>0||jd(e,f,n)!==``)break;let r=n.getComputedStyle(e),i=Dd(r.marginLeft)+Dd(r.marginRight)+Dd(r.paddingLeft)+Dd(r.paddingRight);if(i>.5)return`${Od(e)} adds ${i}px around a tap button — tap buttons space themselves`;f=e}let p=f.parentElement;if(p){let e=n.getComputedStyle(p),t=/flex|grid/.test(e.display),r=Array.from(p.children).filter(e=>e!==f&&Md(e,n));if(t&&r.length>0){let t=Dd(e.display.includes(`grid`)||!e.flexDirection.startsWith(`column`)?e.columnGap:e.rowGap);if(t>.5)return`${Od(p)} adds a ${t}px gap between tap buttons — remove it; tap buttons space themselves`}}return null}var Id=`.matrx-glass-thin-border, .matrx-glass-interactive`;function Ld(e){if(e.hasAttribute(`data-matrx-glass`))return!0;if(e.matches(`.matrx-tap-group`))return e.querySelector(`:scope > .matrx-tap-group-capsule.matrx-glass-thin-border`)!==null;if(e.matches(`.matrx-tap-target`))return e.querySelector(`:scope > .matrx-tap-pill:is(${Id})`)!==null;let t=e.ownerDocument.defaultView;return t&&Md(e,t)?Ld(e.querySelector(wd)):!1}var Rd=/^(auto|scroll|overlay)$/;function zd(e,t){for(let n=e;n&&n!==e.ownerDocument.body;n=n.parentElement){if(n.hasAttribute(`data-matrx-glass-plane`))return!0;let r=t.getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`)return!0;if(n!==e&&(Rd.test(r.overflowY)||Rd.test(r.overflowX)))return!1}return!1}function Bd(e,t,n){for(let r=e;r;){if(Md(r,n))return!0;let e=Array.from(r.children).filter(e=>!kd(e,n));r=(t===`after`?e[0]:e[e.length-1])??null}return!1}function Vd(e,t){if(e.getAttribute(`aria-hidden`)===`true`||kd(e,t))return!1;let n=e.getBoundingClientRect();return n.width>1&&n.height>1}function Hd(e){let t=e.ownerDocument.defaultView;if(!t||!e.isConnected)return null;let n=e.closest(`.matrx-tap-group`)??e,r=Ld(n);if(r&&!zd(n,t))return`glass on a solid surface — glass only floats over moving content; use variant="transparent" (or a solid group)`;let i=n.parentElement;if(!i)return null;if(r){let e=Array.from(i.children).find(e=>e!==n&&Vd(e,t)&&!Ld(e));if(e)return`glass beside non-glass ${Od(e)} — make the row all glass or none`}let a=e.querySelector(`:scope > .matrx-tap-pill`)??n.querySelector(`.matrx-tap-group-capsule`);if(!a)return null;let o=Dd(t.getComputedStyle(e).getPropertyValue(`--matrx-tap-gap`))||6,s=a.getBoundingClientRect();if(s.width===0)return null;let c=_d(a);for(let[e,r]of[[`after`,n.nextElementSibling],[`before`,n.previousElementSibling]]){if(!r||!Vd(r,t)||Md(r,t)||Ld(r)||Bd(r,e,t))continue;let n=r.getBoundingClientRect();if(Math.abs(n.top+n.height/2-(s.top+s.height/2))>s.height)continue;let i=t.getComputedStyle(r),a=(e===`after`?n.left-s.right:s.left-n.right)/c+Dd(e===`after`?i.paddingLeft:i.paddingRight);if(a<o-.5)return`${Od(r)} sits ${Math.round(a)}px from the pill — anything beside a tap button adds its own ${o/2}px (the box only carries ${o/2}px)`}return null}var Ud=new Set;function Wd(e,t){e.setAttribute(`data-matrx-tap-violation`,t);let n=`${t}@${e.getAttribute(`aria-label`)??e.textContent??``}`;Ud.has(n)||(Ud.add(n),console.error(`[tap-target] ${t}`,e))}var Gd=new Set,Kd=null,qd=!1;function Jd(e){let t=Fd(e);if(t){Wd(e,t);return}e.removeAttribute(`data-matrx-tap-violation`);let n=Hd(e);if(n){e.setAttribute(`data-matrx-tap-warning`,n);let t=`w:${n}@${e.getAttribute(`aria-label`)??``}`;Ud.has(t)||(Ud.add(t),console.error(`[tap-target] ${n}`,e))}else e.removeAttribute(`data-matrx-tap-warning`)}function Yd(e){qd||(qd=!0,e.addEventListener(`resize`,()=>{Kd&&clearTimeout(Kd),Kd=setTimeout(()=>Gd.forEach(e=>e.isConnected?Jd(e):Gd.delete(e)),200)}))}function Xd(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function Zd(e,t){let n=(0,_.useRef)(null);return(0,_.useCallback)(r=>{if(Xd(e,r),n.current&&n.current!==r&&Gd.delete(n.current),n.current=r,!yd()||!r)return;if(t){Wd(r,t);return}let i=r.ownerDocument.defaultView;i&&(Gd.add(r),Yd(i),i.requestAnimationFrame(()=>Jd(r)))},[e,t])}var Qd={default:`text-foreground`,muted:`text-muted-foreground group-hover/tap:text-foreground`,primary:`text-primary`,destructive:`text-destructive`,success:`text-success`,warning:`text-warning`,info:`text-info`},$d={primary:{fill:`bg-primary group-hover/tap:bg-primary/85`,glyph:`text-primary-foreground`},destructive:{fill:`bg-destructive group-hover/tap:bg-destructive/85`,glyph:`text-destructive-foreground`},success:{fill:`bg-success group-hover/tap:bg-success/85`,glyph:`text-success-foreground`},warning:{fill:`bg-warning group-hover/tap:bg-warning/85`,glyph:`text-warning-foreground`},neutral:{fill:`bg-foreground group-hover/tap:bg-foreground/85`,glyph:`text-background`}},ef=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function tf(e){let t=e.toLowerCase().split(`+`),n=t.pop()??``;return{mod:t.includes(`mod`),shift:t.includes(`shift`),alt:t.includes(`alt`),key:n}}function nf(e){let t=tf(e),n=t.key.length===1?t.key.toUpperCase():t.key[0].toUpperCase()+t.key.slice(1);return ef?`${t.alt?`⌥`:``}${t.shift?`⇧`:``}${t.mod?`⌘`:``}${n}`:[t.mod&&`Ctrl`,t.alt&&`Alt`,t.shift&&`Shift`,n].filter(Boolean).join(`+`)}function rf(e){let t=e;return!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function af(e,t){let n=tf(t);return(e.metaKey||e.ctrlKey)!==n.mod||e.altKey!==n.alt||/^[a-z0-9]$|^[a-z]{2,}$/.test(n.key)&&e.shiftKey!==n.shift||!n.mod&&rf(e.target)?!1:e.key.toLowerCase()===n.key}function of(e,t,n){(0,_.useEffect)(()=>{if(!e||!n)return;let r=n=>{if(!af(n,e))return;let r=t();r&&r.isConnected&&(n.preventDefault(),r.click())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,n,t])}function sf({badge:e}){return e===`dot`?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,"data-dot":``}):e<=0?null:(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,children:e>99?`99+`:e})}function cf({className:e}){return(0,j.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,j.jsx)(`circle`,{className:Q,cx:`12`,cy:`12`,r:`9`,strokeDasharray:`28.27`,strokeDashoffset:`9`,strokeLinecap:`round`,style:{transformOrigin:`12px 12px`}})})}function lf(){return(0,j.jsx)(`svg`,{className:`matrx-tap-chevron`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function uf(e,t){return t?(0,j.jsxs)(`span`,{className:`matrx-tap-tooltip`,children:[e,(0,j.jsx)(`kbd`,{className:`matrx-tap-kbd`,children:nf(t)})]}):e}var df=Symbol.for(`@ai-matrx/tap-target:link-component`);function ff(){return globalThis[df]??null}var pf=/^(https?:|mailto:|tel:)/i,mf=`matrx-tap-target group group/tap`,hf=`matrx-tap-target matrx-tap-target-sm group group/tap`;function gf({icon:e,children:t,strokeWidth:n=2,className:r}){return e?(0,_.isValidElement)(e)?(0,_.cloneElement)(e,{className:gd(r,e.props.className)}):(0,j.jsx)(`span`,{className:r,children:e}):(0,j.jsx)(`svg`,{className:r,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function _f(e,t,n){let r=!!e;return t===`sm`?{outerClassName:r&&n?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap`:r?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap`:hf,inlineModifier:n?`matrx-tap-pill-mobile-icon-only-sm`:`matrx-tap-pill-inline-sm`}:{outerClassName:r&&n?`${mf} matrx-tap-target-mobile-icon-only`:r?`${mf} matrx-tap-target-inline`:mf,inlineModifier:n?`matrx-tap-pill-mobile-icon-only`:`matrx-tap-pill-inline`}}function vf({label:e,pillClassName:t,iconClassName:n,labelClassName:r,inlineModifier:i,icon:a,children:o,strokeWidth:s=2,loading:c,chevron:l}){let u=c?(0,j.jsx)(cf,{className:n}):(0,j.jsx)(gf,{icon:a,strokeWidth:s,className:n,children:o}),d=e?`${t} ${i}`.trim():t;return e?(0,j.jsxs)(`div`,{className:d,children:[u,(0,j.jsx)(`span`,{className:r??`matrx-tap-label`,children:e}),l?(0,j.jsx)(lf,{}):null]}):(0,j.jsx)(`div`,{className:d,children:u})}function yf({size:e=`default`,colorClassName:t,pillClassName:n,iconClassName:r,labelClassName:i,icon:a,children:o,strokeWidth:s,label:c,mobileIconOnly:l=!1,onClick:u,as:d,htmlFor:f,ariaLabel:p,disabled:m,href:h,target:g,rel:v,prefetch:y,linkComponent:b,tooltip:x,tooltipSide:S,tooltipAlign:C,rest:w,buttonRef:T}){let{tone:E,badge:D,pressed:O,loading:k,disabledReason:A,shortcut:M,chevron:N,...P}=w??{},F=!!(m||A),I=A||(typeof x==`string`&&x?x:void 0)||p||c,L=x===!1,ee=Zd(T,(I?null:`every tap button needs a tooltip — pass ariaLabel`)??Ed(t??P.className)??(P.style?`style is not supported on a tap button`:null)),te=(0,_.useRef)(null),ne=(0,_.useCallback)(e=>{te.current=e,ee(e)},[ee]);of(M,(0,_.useCallback)(()=>te.current,[]),!F&&!k);let re=E?Qd[E]:O&&!t?Qd.primary:null;re&&(r=`matrx-tap-icon ${re}`,i=`matrx-tap-label ${re}`),O&&(n=`${n} matrx-tap-pressed`);let{outerClassName:ie,inlineModifier:ae}=_f(c,e,l),oe=l?`${i??`matrx-tap-label`} matrx-tap-label-mobile-icon-only`:i,se=vf({label:c,pillClassName:n,iconClassName:r,labelClassName:oe,inlineModifier:c?ae:``,icon:a,children:o,strokeWidth:s,loading:k,chevron:N}),ce=bf({href:h,target:g,rel:v,prefetch:y,linkComponent:b,as:d,htmlFor:f,onClick:k?void 0:u,ariaLabel:c&&!l?void 0:p??c,disabled:F,outerClassName:ie,title:L&&I?M?`${I} (${nf(M)})`:I:void 0,children:(0,j.jsxs)(j.Fragment,{children:[se,D===void 0?null:(0,j.jsx)(sf,{badge:D})]}),rest:{...P,...O===void 0?{}:{"aria-pressed":O},...k?{"aria-busy":!0}:{},...M?{"aria-keyshortcuts":M.replace(/mod/i,`Meta`)}:{}},triggerRef:ne});return L||!I?ce:xf(ce,{tooltip:I,ariaLabel:I,disabled:F,tooltipSide:S,tooltipAlign:C,shortcut:M})}function bf({href:e,target:t,rel:n,prefetch:r,linkComponent:i,as:a,htmlFor:o,onClick:s,ariaLabel:c,disabled:l,outerClassName:u,children:d,rest:f,triggerRef:p,title:m}){let{style:h,...g}=f??{};if(l&&e)return(0,j.jsx)(`span`,{ref:p,"aria-disabled":`true`,"aria-label":c,title:m,className:`${u} opacity-40`,children:d});if(e){if(pf.test(e))return(0,j.jsx)(`a`,{ref:p,href:e,target:t??`_blank`,rel:n??`noopener noreferrer`,"aria-label":c,title:m,className:u,children:d});let a=i??ff();return a?(0,j.jsx)(a,{ref:p,href:e,target:t,rel:n,prefetch:r,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`a`,{ref:p,href:e,target:t,rel:n,"aria-label":c,title:m,className:u,children:d})}return a===`label`?(0,j.jsx)(`label`,{ref:p,htmlFor:o,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`button`,{ref:p,type:`button`,onClick:s,"aria-label":c,title:m,disabled:l,...g,className:u,children:d})}function xf(e,{tooltip:t,ariaLabel:n,disabled:r,tooltipSide:i=`top`,tooltipAlign:a=`center`,shortcut:o}){if(t===!1)return e;let s=typeof t==`string`&&t.length>0?t:n;return s?(0,j.jsxs)(pd,{children:[(0,j.jsx)(md,{asChild:!0,children:r?(0,j.jsx)(`span`,{className:`inline-flex`,children:e}):e}),(0,j.jsx)(hd,{side:i,align:a,children:uf(s,o)})]}):e}var Sf=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-glass-thin-border`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})});(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-muted-foreground group-hover/tap:text-foreground`;return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});var Cf=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tone:p,bgColor:m,iconColor:h,hoverBgColor:g,activeBgColor:_,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...C},w){return yf({icon:e,children:t,strokeWidth:n,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...wf(p,m,h,g,_),rest:C,buttonRef:w})});function wf(e,t,n,r,i){if(!(!e&&(t||n||r||i))){let t=$d[e??`primary`];return{pillClassName:`matrx-tap-pill ${t.fill} ${t.glyph} group-active/tap:brightness-90`,iconClassName:`matrx-tap-icon ${t.glyph}`,labelClassName:`matrx-tap-label ${t.glyph}`}}let a=n??`text-primary-foreground`;return{pillClassName:`matrx-tap-pill ${t??`bg-primary`} ${a} ${r??`group-hover/tap:bg-primary/80`} ${i??`group-active/tap:brightness-90`}`,iconClassName:`matrx-tap-icon ${a}`,labelClassName:`matrx-tap-label ${a}`}}(0,_.forwardRef)(function({tone:e=`destructive`,...t},n){return(0,j.jsx)(Cf,{ref:n,tone:e,...t})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-foreground`;return yf({colorClassName:i,size:`sm`,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});function Tf(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0),r=(0,_.useRef)(!1),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=48,[]),l=(0,_.useCallback)(e=>{r.current=!0,e.scrollTop=e.scrollHeight},[]),u=(0,_.useCallback)(()=>{let e=t.current;if(e===null)return;if(r.current){r.current=!1;return}let i=c(e);n.current=i,a(i),i&&s(!1)},[c]),d=(0,_.useCallback)(e=>{let n=t.current;n!==null&&n.removeEventListener(`scroll`,u),t.current=e,e!==null&&e.addEventListener(`scroll`,u,{passive:!0})},[u]);(0,_.useEffect)(()=>()=>{let e=t.current;e!==null&&e.removeEventListener(`scroll`,u)},[u]);let f=(0,_.useCallback)(()=>{let r=t.current;if(r!==null&&e){if(n.current){l(r);return}s(!0)}},[e,l]);return{ref:d,pinned:i,hasUnseenBelow:o,jumpToLatest:(0,_.useCallback)(()=>{let e=t.current;e!==null&&(l(e),n.current=!0,a(!0),s(!1))},[l]),onContentChange:f}}function Ef(e){let t=[],n=``,r=0;for(let i of St(e)){if(i.start<r)continue;n+=e.slice(r,i.start);let a=e.slice(i.start,i.end);t.push(i.kind===`fence`?` code block `:Df(a)),n+=`\uE300${t.length-1}\uE301`,r=i.end}return n+=e.slice(r),n.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}([*+-]|\d+\.)\s+/gm,``).replace(/(\*\*\*|___)(.+?)\1/g,`$2`).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(\*|_)(.+?)\1/g,`$2`).replace(/~~(.+?)~~/g,`$1`).replace(/^\s{0,3}([-*_]\s?){3,}$/gm,``).replace(/\uE300(\d+)\uE301/g,(e,n)=>t[Number(n)]??``).replace(/[ \t]{2,}/g,` `)}function Df(e){let t=/^`+/.exec(e)?.[0].length??0,n=e.slice(t,e.length-t);return/^ .* $/s.test(n)&&n.trim()?n.slice(1,-1):n}var Of=`Your message could not be copied.`,kf=`Select the text and copy it with your keyboard — this browser did not allow the page to use the clipboard.`,Af=2e3;function jf(e){let{message:t}=e,{notifier:n}=bi(),r=xi(),{thread:i,retry:a}=gi(),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=(0,_.useCallback)((e,t)=>{let r=globalThis.navigator?.clipboard,i=r?.writeText?.bind(r);if(i===void 0){n.notify({level:`warning`,message:Of,remedy:kf});return}i(e).then(()=>{s(t),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>s(null),Af)},()=>{n.notify({level:`warning`,message:Of,remedy:kf})})},[n]);if(t.status===`streaming`||t.status===`pending`)return null;let u=C(t),d=r.messageActions?.(t),f=t.role===`user`,p=f?``:wi(i.getSnapshot().messages,t.id);return u===``&&d===void 0?null:(0,j.jsxs)(`div`,{className:`mx-chat-actions`,role:`group`,"aria-label":f?`Actions for your message`:`Actions for this answer`,"data-message-id":t.id,children:[u===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-text`,onClick:()=>l(Ef(u),`text`),children:o===`text`?`Copied`:`Copy`}),u===``||f?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-markdown`,onClick:()=>l(u,`markdown`),children:o===`markdown`?`Copied`:`Copy as markdown`}),p===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`retry`,onClick:()=>void i.send({text:p}),children:`Ask again`}),f&&u!==``?(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`edit`,onClick:()=>a.request(u),children:`Edit and send again`}):null,d,o===null?null:(0,j.jsx)(`span`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:`Copied to the clipboard`})]})}var Mf=Object.defineProperty,Nf=(e,t)=>Mf(e,`name`,{value:t,configurable:!0});function Pf(e){let t=e+`CollectionProvider`,[n,r]=Vi(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Nf(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,j.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Gi(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=H(t,a(s,n).collectionRef);return(0,j.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Gi(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=H(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,j.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Nf(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Nf(Pf,`createCollection`);var Ff=new WeakMap,If=class e extends Map{static{Nf(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ff.set(this,!0)}set(e,t){return Ff.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=zf(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Lf(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Lf(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Lf(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Lf(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Rf(e,t);return n===-1?void 0:e[n]}Nf(Lf,`at`);function Rf(e,t){let n=e.length,r=zf(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Nf(Rf,`toSafeIndex`);function zf(e){return e!==e||e===0?0:Math.trunc(e)}Nf(zf,`toSafeInteger`);function Bf(e){let t=e+`CollectionProvider`,[n,r]=Vi(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new If,setItemMap:Nf(()=>void 0,`setItemMap`)}),o=Nf(({state:e,...t})=>e?(0,j.jsx)(c,{...t,state:e}):(0,j.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Nf(e=>{let t=h();return(0,j.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Nf(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=H(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=Uf(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,j.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Gi(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=H(t,a(l,n).collectionRef);return(0,j.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Gi(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=H(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);$(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Hf):(t.set(s,{...e,element:s}),t.toSorted(Hf)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new If(e)))}},[s,m,u]),(0,j.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new If)}Nf(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Nf(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Nf(Bf,`createCollection`);function $(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Nf($,`shallowEqual`);function Vf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Nf(Vf,`isElementPreceding`);function Hf(e,t){return!e[1].element||!t[1].element?0:Vf(e[1].element,t[1].element)?-1:1}Nf(Hf,`sortByDocumentPosition`);function Uf(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Nf(Uf,`getChildListObserver`);var Wf=Object.defineProperty,Gf=(e,t)=>Wf(e,`name`,{value:t,configurable:!0}),Kf=_.createContext(void 0);function qf(e){let t=_.useContext(Kf);return e||t||`ltr`}Gf(qf,`useDirection`);function Jf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...e}}function Yf(e){return(0,j.jsxs)(`svg`,{...Jf(e),children:[(0,j.jsx)(`path`,{d:`M18 6 6 18`}),(0,j.jsx)(`path`,{d:`m6 6 12 12`})]})}function Xf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 15 15`,width:15,height:15,fill:`none`,"aria-hidden":!0,...e}}function Zf(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function Qf(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:`currentColor`})})}function $f(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function ep(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function tp(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var np=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,rp=Sl,ip=(e,t)=>n=>{if(t?.variants==null)return rp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=np(t)||np(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return rp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ap=Object.defineProperty,op=(e,t)=>ap(e,`name`,{value:t,configurable:!0}),sp=`focusScope.autoFocusOnMount`,cp=`focusScope.autoFocusOnUnmount`,lp={bubbles:!1,cancelable:!0},up=_.forwardRef(op(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=ua(i),u=ua(a),d=_.useRef(null),f=H(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:_p(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_p(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_p(s)};op(e,`handleFocusIn`),op(t,`handleFocusOut`),op(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){vp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(sp,lp);s.addEventListener(sp,l),s.dispatchEvent(t),t.defaultPrevented||(dp(xp(pp(s)),{select:!0}),document.activeElement===e&&_p(s))}return()=>{s.removeEventListener(sp,l),setTimeout(()=>{let t=new CustomEvent(cp,lp);s.addEventListener(cp,u),s.dispatchEvent(t),t.defaultPrevented||_p(e??document.body,{select:!0}),s.removeEventListener(cp,u),vp.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_p(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_p(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(W.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function dp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_p(r,{select:t}),document.activeElement!==n)return}op(dp,`focusFirst`);function fp(e){let t=pp(e);return[mp(t,e),mp(t.reverse(),e)]}op(fp,`getTabbableEdges`);function pp(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:op(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}op(pp,`getTabbableCandidates`);function mp(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):hp(r,{upTo:t})))return r}op(mp,`findVisible`);function hp(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}op(hp,`isHidden`);function gp(e){return e instanceof HTMLInputElement&&`select`in e}op(gp,`isSelectableInput`);function _p(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gp(e)&&t&&e.select()}}op(_p,`focus`);var vp=yp();function yp(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bp(e,t),e.unshift(t)},remove(t){e=bp(e,t),e[0]?.resume()}}}op(yp,`createFocusScopesStack`);function bp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}op(bp,`arrayRemove`);function xp(e){return e.filter(e=>e.tagName!==`A`)}op(xp,`removeLinks`);var Sp=Object.defineProperty,Cp=(e,t)=>Sp(e,`name`,{value:t,configurable:!0}),wp=0,Tp=null;function Ep(e){return Dp(),e.children}Cp(Ep,`FocusGuards`);function Dp(){_.useEffect(()=>{Tp||={start:Op(),end:Op()};let{start:e,end:t}=Tp;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),wp++,()=>{wp===1&&(Tp?.start.remove(),Tp?.end.remove(),Tp=null),wp=Math.max(0,wp-1)}},[])}Cp(Dp,`useFocusGuards`);function Op(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Cp(Op,`createFocusGuard`);var kp=function(){return kp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},kp.apply(this,arguments)};function Ap(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function jp(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Mp=`right-scroll-bar-position`,Np=`width-before-scroll-bar`,Pp=`with-scroll-bars-hidden`,Fp=`--removed-body-scroll-bar-size`;function Ip(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lp(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Rp=typeof window<`u`?_.useLayoutEffect:_.useEffect,zp=new WeakMap;function Bp(e,t){var n=Lp(t||null,function(t){return e.forEach(function(e){return Ip(e,t)})});return Rp(function(){var t=zp.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ip(e,null)}),i.forEach(function(e){r.has(e)||Ip(e,a)})}zp.set(n,e)},[e]),n}function Vp(e){return e}function Hp(e,t){t===void 0&&(t=Vp);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Up(e){e===void 0&&(e={});var t=Hp(null);return t.options=kp({async:!0,ssr:!1},e),t}var Wp=function(e){var t=e.sideCar,n=Ap(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,kp({},n))};Wp.isSideCarExport=!0;function Gp(e,t){return e.useMedium(t),Wp}var Kp=Up(),qp=function(){},Jp=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:qp,onWheelCapture:qp,onTouchMoveCapture:qp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ap(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Bp([n,t]),w=kp(kp({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Kp,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),kp(kp({},w),{ref:C})):_.createElement(y,kp({},w,{className:c,ref:C}),s))});Jp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jp.classNames={fullWidth:Np,zeroRight:Mp};var Yp=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Yp();return t&&e.setAttribute(`nonce`,t),e}function Zp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qp(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $p=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xp())&&(Zp(t,n),Qp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},em=function(){var e=$p();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tm=function(){var e=em();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nm={left:0,top:0,right:0,gap:0},rm=function(e){return parseInt(e||``,10)||0},im=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[rm(n),rm(r),rm(i)]},am=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nm;var t=im(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},om=tm(),sm=`data-scroll-locked`,cm=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
16
+ `)})}return{blocks:r,openFrom:n[a]??0}}function Vr(){let e=new Map,t=0,n=(n,r)=>{t+=1;let i=Br(r);return e.set(n,{text:r,blocks:i.blocks,stable:i.blocks.slice(0,Math.max(0,i.blocks.length-1)),stableEnd:i.openFrom}),i.blocks};return{get parses(){return t},forget(t){e.delete(t)},parse(r,i){let a=e.get(r);if(a===void 0)return n(r,i);if(a.text===i)return a.blocks;if(!i.startsWith(a.text))return n(r,i);t+=1;let o=Br(i.slice(a.stableEnd)),s=[...a.stable,...o.blocks];return e.set(r,{text:i,blocks:s,stable:s.slice(0,Math.max(0,s.length-1)),stableEnd:a.stableEnd+o.openFrom}),s}}}function Hr(e,t){switch(e.type){case`code`:return(0,j.jsx)(`pre`,{className:`mx-chat-md__pre`,"data-language":e.language||void 0,children:(0,j.jsx)(`code`,{children:e.body})},t);case`heading`:{let n=Math.min(6,Math.max(1,e.level)),r=`h${n}`;return(0,j.jsx)(r,{className:`mx-chat-md__heading`,"data-level":n,children:Mr(e.body,`${t}-`)},t)}case`quote`:return(0,j.jsx)(`blockquote`,{className:`mx-chat-md__quote`,children:Mr(e.body,`${t}-`)},t);case`list`:return e.ordered?(0,j.jsx)(`ol`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:Mr(e,`${t}-${n}-`)},`${t}-${n}`))},t):(0,j.jsx)(`ul`,{className:`mx-chat-md__list`,children:e.items.map((e,n)=>(0,j.jsx)(`li`,{children:Mr(e,`${t}-${n}-`)},`${t}-${n}`))},t);case`table`:return(0,j.jsx)(`div`,{className:`mx-chat-md__table-scroll`,children:(0,j.jsxs)(`table`,{className:`mx-chat-md__table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:e.header.map((e,n)=>(0,j.jsx)(`th`,{children:Mr(e,`${t}-h${n}-`)},`${t}-h${n}`))})}),(0,j.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,j.jsx)(`tr`,{children:e.map((e,r)=>(0,j.jsx)(`td`,{children:Mr(e,`${t}-r${n}c${r}-`)},`${t}-r${n}c${r}`))},`${t}-r${n}`))})]})},t);case`rule`:return(0,j.jsx)(`hr`,{className:`mx-chat-md__rule`},t);case`paragraph`:return(0,j.jsx)(`p`,{className:`mx-chat-md__paragraph`,children:Mr(e.body,`${t}-`)},t)}}function Ur(e){let t=e.cache.parse(e.cacheKey,e.text);return(0,j.jsx)(`div`,{className:`mx-chat-md`,children:t.map((e,t)=>Hr(e,`b${t}`))})}var Wr=`This answer contains a structured block, and it is shown as plain text here because this app has not connected the content renderer.`,Gr=`Mount <ContentIrRenderProvider host={…}> from @ai-matrx/content-ir-react above your chat to draw structured blocks properly.`;function Kr(e){let t=te(),n=e.announce;return(0,_.useEffect)(()=>{t===null&&n()},[t,n]),t===null?(0,j.jsxs)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block-standin`,children:[(0,j.jsx)(`span`,{className:`mx-chat-standin`,children:Wr}),(0,j.jsx)(Ur,{text:e.request.text,cacheKey:`${e.request.messageId}:${e.request.kind}`,cache:e.cache})]}):(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`block`,"data-kind":e.request.kind,children:(0,j.jsx)(wr,{kind:e.request.kind,value:e.request.data??e.request.text,variant:`bare`})})}function qr(e={}){let t=e.notifier??D(),n=e.cache??Vr(),r=!1,i=()=>{r||(r=!0,t.notify({level:`warning`,message:Wr,remedy:Gr}))};return function(e){return e.kind!==`markdown`&&e.kind!==`text`?(0,j.jsx)(Kr,{request:e,cache:n,notifier:t,announce:i}):e.text===``?null:(0,j.jsx)(`div`,{className:`mx-chat-content`,"data-mx-chat-content":`markdown`,children:(0,j.jsx)(Ur,{text:e.text,cacheKey:e.messageId,cache:n})})}}function Jr(e){return!!(/[zZ]$/.test(e)||/[+-]\d{2}(:?\d{2})?$/.test(e)||/\b(GMT|UTC)\b/i.test(e))}function Yr(e){let t=e.trim();return!t||!/\d{1,2}:\d{2}/.test(t)||Jr(t)?t:`${t.replace(` `,`T`)}Z`}function Xr(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=Yr(e);if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var Zr={year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};function Qr(e,t=Zr,n=`—`){let r=Xr(e);return r?r.toLocaleString(void 0,t):n}var $r=[{limit:6e4,divisor:1e3,short:`s`,long:`second`},{limit:36e5,divisor:6e4,short:`m`,long:`minute`},{limit:864e5,divisor:36e5,short:`h`,long:`hour`},{limit:6048e5,divisor:864e5,short:`d`,long:`day`},{limit:2592e6,divisor:6048e5,short:`w`,long:`week`},{limit:31536e6,divisor:2592e6,short:`mo`,long:`month`}],ei=[{unit:`year`,ms:31536e6},{unit:`month`,ms:2592e6},{unit:`week`,ms:6048e5},{unit:`day`,ms:864e5},{unit:`hour`,ms:36e5},{unit:`minute`,ms:6e4}];function ti(e,t={}){let n=t.style??`short`,r=t.suffix===!1,i=t.now??Date.now(),a=Xr(e);if(!a)return t.fallbackToInput===!0&&typeof e==`string`?e:t.fallback??`—`;if(n===`intl`){let e=a.getTime()-i,t=Math.abs(e);if(t<6e4)return`just now`;let n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let{unit:r,ms:i}of ei)if(t>=i)return n.format(Math.trunc(e/i),r);return`just now`}let o=i-a.getTime(),s=o<0;if(s&&-o<6e4)return`just now`;let c=Math.abs(o);for(let e of $r)if(c<e.limit){let t=Math.max(1,Math.floor(c/e.divisor)),i=n===`long`?`${t} ${e.long}${t===1?``:`s`}`:`${t}${e.short}`;return r?i:s?`in ${i}`:`${i} ago`}return(t.absolute??(r?`date`:`datetime`))===`date`?a.toLocaleDateString():Qr(a)}var ni=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function ri(e,t={}){let n=t.fallback??`—`;if(e==null||!Number.isFinite(e)||e<0)return n;if(e<1024)return`${Math.round(e)} B`;let r=e,i=0;for(;r>=1024&&i<ni.length-1;)r/=1024,i+=1;return`${r>=10?String(Math.round(r)):r.toFixed(1)} ${ni[i]}`}function ii(e){return typeof e==`number`&&Number.isFinite(e)}function ai(e,t={}){let{digits:n=2,unknown:r=`—`}=t;if(!ii(e))return r;let i;if(n===`adaptive`||n===`trim`){let t=Math.abs(e);i=t===0||t>=1?2:t>=.01?4:6}else i=n;return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n===`trim`?Math.min(2,i):i,maximumFractionDigits:i})}`}var oi=[``,`k`,`M`,`B`,`T`];function si(e,t={}){let{unknown:n=`—`,style:r=`plain`,locale:i}=t;if(!ii(e))return n;if(r!==`compact`)return e.toLocaleString(i);let a=e<0?`-`:``,o=Math.abs(e);if(o<1e3)return`${a}${Math.round(o)}`;let s=0;for(;o>=1e3&&s<oi.length-1;)o/=1e3,s+=1;let c=o>=10?Math.round(o):Number(o.toFixed(1));return c>=1e3&&s<oi.length-1&&(o/=1e3,s+=1,c=o>=10?Math.round(o):Number(o.toFixed(1))),`${a}${o>=10?String(c):c.toFixed(1)}${oi[s]}`}var ci=`Attachments aren't set up here, so this file has not been sent.`,li="Give <ChatComposerProvider> a `files` port (your upload service) to attach files to a message.";function ui(e){let t=!1;return{available:!1,upload(){return t||(t=!0,e.notify({level:`warning`,message:ci,remedy:li})),Promise.reject(Error(ci))}}}function di(e,t){return`${e} is larger than the ${ri(t)} limit for this chat, so it has not been attached.`}function fi(e){return de(e)||`Working…`}function pi(e){let t=new Set;return{request(n){if(t.size===0)return e.notify({level:`warning`,message:`There is nowhere to put your message back, so it has not been restored for you.`,remedy:`Copy your message from the conversation above and send it again, or mount this transcript inside a chat that has a message box.`}),!1;for(let e of t)e(n);return!0},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var mi=(0,_.createContext)(null);function hi(e){let{thread:t,ports:n,slots:r,children:i}=e,[a]=(0,_.useState)(()=>{let e=D();return{notifier:e,prefs:k(e)}}),o=n?.notifier??a.notifier,s=(0,_.useRef)(null);(s.current===null||s.current.notifier!==o)&&(s.current={notifier:o,bus:pi(o),renderContent:qr({notifier:o}),files:ui(o)});let c=s.current.bus,l=s.current.renderContent,u=s.current.files,d=(0,_.useMemo)(()=>({thread:t,ports:{renderContent:n?.renderContent??l,notifier:o,prefs:n?.prefs??a.prefs,files:n?.files??u,voice:n?.voice??null,toolLabel:n?.toolLabel??fi,modelPicker:n?.modelPicker??null,quickset:n?.quickset??null},slots:r??{},retry:c}),[t,n?.renderContent,n?.prefs,n?.files,n?.voice,n?.toolLabel,n?.modelPicker,n?.quickset,o,r,c,l,u,a.prefs]),f=(0,_.useRef)(t);return(0,_.useEffect)(()=>{if(f.current===t)return;let e=f.current.getSnapshot().status;(e===`streaming`||e===`submitted`)&&o.notify({level:`warning`,message:`The previous answer was still arriving when this chat switched conversations.`,remedy:`Stop the answer before switching, or the run keeps going in the background.`}),f.current=t},[t,o]),(0,j.jsx)(mi.Provider,{value:d,children:i})}function gi(){let e=(0,_.useContext)(mi);if(e===null)throw Error(`[@ai-matrx/chat] This component must be rendered inside <ChatProvider thread={…}>. Wrap your chat surface in one, passing a thread from createChatThread() or createExternalThreadSource().`);return e}function _i(){let{thread:e}=gi(),t=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),n=(0,_.useCallback)((t,n)=>e.send(n===void 0?{text:t}:{text:t,fileIds:n}),[e]),r=(0,_.useCallback)(()=>e.cancel(),[e]);return(0,_.useMemo)(()=>({snapshot:t,messages:t.messages,status:t.status,isBusy:t.status===`submitted`||t.status===`streaming`,conversationId:t.conversationId,ephemeral:t.ephemeral,ephemeralReason:t.ephemeralReason,error:t.error,send:n,cancel:r}),[t,n,r])}function vi(e){let{thread:t}=gi(),n=(0,_.useCallback)(n=>t.subscribeToMessage(e,n),[t,e]),r=(0,_.useCallback)(()=>t.getMessageSnapshot(e),[t,e]);return(0,_.useSyncExternalStore)(n,r,r)}function yi(){return gi().thread.features}function bi(){return gi().ports}function xi(){return gi().slots}var Si=`ai-matrx.chat.draft.`;function Ci(){let{thread:e,ports:t,retry:n}=gi(),r=e.features,i=(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),a=i.conversationId,o=i.status===`submitted`||i.status===`streaming`,s=`${Si}${a??`new`}`,[c,l]=(0,_.useState)(()=>r.retainDrafts?t.prefs.get(s)??``:``),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(s);(0,_.useEffect)(()=>{if(f.current===s)return;let e=f.current;if(f.current=s,!r.retainDrafts)return;let n=t.prefs.get(e);if(n!==null&&n!==``){t.prefs.set(s,n),t.prefs.remove(e),l(n);return}l(t.prefs.get(s)??``)},[s,r.retainDrafts,t.prefs]);let p=(0,_.useCallback)(e=>{l(e),d(!1),r.retainDrafts&&(e===``?t.prefs.remove(f.current):t.prefs.set(f.current,e))},[r.retainDrafts,t.prefs]);(0,_.useEffect)(()=>n.subscribe(e=>{l(e),d(!0),r.retainDrafts&&t.prefs.set(f.current,e)}),[n,r.retainDrafts,t.prefs]);let m=(0,_.useCallback)(async()=>{let n=c.trim();if(n===``||o&&!r.sendWhileBusy)return null;l(``),d(!1),r.retainDrafts&&t.prefs.remove(f.current);let i=await e.send({text:n});return i.accepted||(l(n),r.retainDrafts&&t.prefs.set(f.current,n)),i},[c,o,e,r.retainDrafts,r.sendWhileBusy,t.prefs]),h=(0,_.useCallback)(()=>e.cancel(),[e]),g=(0,_.useCallback)(t=>{if(t.key===`Escape`){if(!o)return;t.preventDefault(),e.cancel();return}if(t.key!==`Enter`)return;let n=t.metaKey||t.ctrlKey;(r.sendKey===`enter`?!t.shiftKey&&!n:n)&&(t.preventDefault(),m())},[r.sendKey,o,m,e]);return{text:c,setText:p,canSend:c.trim()!==``&&(!o||r.sendWhileBusy),isBusy:o,send:m,stop:h,onKeyDown:g,restoredFromFailure:u}}function wi(e,t){let n=e.findIndex(e=>e.id===t);if(n<=0)return``;for(let t=n-1;t>=0;--t){let n=e[t];if(n&&n.role===`user`)return C(n)}return``}function Ti(){return(0,j.jsx)(`svg`,{className:`mx-chat-chevron`,width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})}function Ei(){return(0,j.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})})}var Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return Oi(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Oi(V,`composeEventHandlers`);function Ai(e){if(!ki)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Oi(Ai,`getOwnerWindow`);function ji(e){if(!ki)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Oi(ji,`getOwnerDocument`);function Mi(e,t=!1){let{activeElement:n}=ji(e);if(!n?.nodeName)return null;if(Ni(n)&&n.contentDocument)return Mi(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ji(n).getElementById(e);if(t)return t}}return n}Oi(Mi,`getActiveElement`);function Ni(e){return e.tagName===`IFRAME`}Oi(Ni,`isFrame`);var Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fi(Ii,`setRef`);function Li(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ii(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ii(e[t],null)}}}}Fi(Li,`composeRefs`);function H(...e){return _.useCallback(Li(...e),e)}Fi(H,`useComposedRefs`);var Ri=Object.defineProperty,zi=(e,t)=>Ri(e,`name`,{value:t,configurable:!0});function Bi(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=zi(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,j.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return zi(i,`useContext`),[r,i]}zi(Bi,`createContext`);function Vi(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=zi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return zi(s,`useContext`),[o,s]}zi(r,`createContext`);let i=zi(()=>{let t=n.map(e=>_.createContext(e));return zi(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Hi(i,...t)]}zi(Vi,`createContextScope`);function Hi(...e){let t=e[0];if(e.length===1)return t;let n=zi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return zi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}zi(Hi,`composeContextScopes`);var Ui=Object.defineProperty,Wi=(e,t)=>Ui(e,`name`,{value:t,configurable:!0});function Gi(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ea(r)&&typeof ra==`function`&&(r=ra(r._payload)),_.Children.forEach(r,e=>{if(Qi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ea(n)&&typeof ra==`function`&&(n=ra(n._payload)),a=Yi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?Zi(a):void 0,l=H(n,c);if(!a){if(r||r===0)throw Error(o?na(e):U(e));return r}let u=Xi(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Wi(Gi,`createSlot`);var Ki=Gi(`Slot`),qi=Symbol.for(`radix.slottable`);function Ji(e){let t=Wi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qi,t}Wi(Ji,`createSlottable`);var Yi=Wi((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Xi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Wi(Xi,`mergeProps`);function Zi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Wi(Zi,`getElementRef`);function Qi(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qi}Wi(Qi,`isSlottable`);var $i=Symbol.for(`react.lazy`);function ea(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$i&&`_payload`in e&&ta(e._payload)}Wi(ea,`isLazyComponent`);function ta(e){return typeof e==`object`&&!!e&&`then`in e}Wi(ta,`isPromiseLike`);var U=Wi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),na=Wi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ra=_.use,ia=c(m(),1),aa=Object.defineProperty,oa=(e,t)=>aa(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Gi(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&ia.flushSync(()=>e.dispatchEvent(t))}oa(sa,`dispatchDiscreteCustomEvent`);var ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0});function ua(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}la(ua,`useCallbackRef`);var da=Object.defineProperty,fa=(e,t)=>da(e,`name`,{value:t,configurable:!0}),pa=`dismissableLayer.update`,ma=`dismissableLayer.pointerDownOutside`,ha=`dismissableLayer.focusOutside`,ga,_a=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),va=_.forwardRef(fa(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(_a),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=H(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=xa(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Sa(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=ua(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ga=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ca(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ga))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ca())},[d,u]),_.useEffect(()=>{let e=fa(()=>m({}),`handleUpdate`);return document.addEventListener(pa,e),()=>document.removeEventListener(pa,e)},[]),(0,j.jsx)(W.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function ya(){let e=_.useContext(_a),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}fa(ya,`useDismissableLayerSurface`);var ba=fa(()=>!0,`IS_TRUE`);function xa(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ba}=t,s=ua(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}fa(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}fa(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}fa(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}fa(p,`handleInteractionBubble`);let m=fa(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||wa(ma,s,p,{discrete:!0})};if(fa(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:fa(()=>c.current=!0,`onPointerDownCapture`)}}fa(xa,`usePointerDownOutside`);function Sa(e,t=globalThis?.document){let n=ua(e),r=_.useRef(!1);return _.useEffect(()=>{let e=fa(e=>{e.target&&!r.current&&wa(ha,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:fa(()=>r.current=!0,`onFocusCapture`),onBlurCapture:fa(()=>r.current=!1,`onBlurCapture`)}}fa(Sa,`useFocusOutside`);function Ca(){let e=new CustomEvent(pa);document.dispatchEvent(e)}fa(Ca,`dispatchUpdate`);function wa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sa(i,a):i.dispatchEvent(a)}fa(wa,`handleAndDispatchCustomEvent`);var Ta=globalThis?.document?_.useLayoutEffect:()=>{},Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0}),Oa=_.useId||(()=>void 0),ka=0;function Aa(e){let[t,n]=_.useState(Oa());return Ta(()=>{e||n(e=>e??String(ka++))},[e]),e||(t?`radix-${t}`:``)}Da(Aa,`useId`);var ja=[`top`,`right`,`bottom`,`left`],Ma=Math.min,Na=Math.max,Pa=Math.round,Fa=Math.floor,Ia=e=>({x:e,y:e}),La={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ra(e,t,n){return Na(e,Ma(t,n))}function za(e,t){return typeof e==`function`?e(t):e}function Ba(e){return e.split(`-`)[0]}function Va(e){return e.split(`-`)[1]}function Ha(e){return e===`x`?`y`:`x`}function Ua(e){return e===`y`?`height`:`width`}function Wa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ga(e){return Ha(Wa(e))}function Ka(e,t,n){n===void 0&&(n=!1);let r=Va(e),i=Ga(e),a=Ua(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=to(o)),[o,to(o)]}function qa(e){let t=to(e);return[Ja(e),t,Ja(t)]}function Ja(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ya=[`left`,`right`],Xa=[`right`,`left`],Za=[`top`,`bottom`],Qa=[`bottom`,`top`];function $a(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xa:Ya:t?Ya:Xa;case`left`:case`right`:return t?Za:Qa;default:return[]}}function eo(e,t,n,r){let i=Va(e),a=$a(Ba(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ja)))),a}function to(e){let t=Ba(e);return La[t]+e.slice(t.length)}function no(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ro(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:no(e)}function io(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ao(e,t,n){let{reference:r,floating:i}=e,a=Wa(t),o=Ga(t),s=Ua(o),c=Ba(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Va(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function oo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=za(t,e),p=ro(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=io(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var so=50,co=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:oo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ao(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<so&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ao(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=za(e,t)||{};if(l==null)return{};let d=ro(u),f={x:n,y:r},p=Ga(i),m=Ua(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ma(d[_],T),D=Ma(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ra(E,k,O),j=!c.arrow&&Va(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),uo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=za(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ba(r),_=Wa(o),v=Ba(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[to(o)]:qa(o)),x=p!==`none`;!d&&x&&b.push(...eo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ka(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wa(t)||T.every(e=>Wa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function fo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function po(e){return ja.some(t=>e[t]>=0)}var mo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=za(e,t);switch(i){case`referenceHidden`:{let e=fo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:po(e)}}}case`escaped`:{let e=fo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:po(e)}}}default:return{}}}}},ho=new Set([`left`,`top`]);async function go(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ba(n),s=Va(n),c=Wa(n)===`y`,l=ho.has(o)?-1:1,u=a&&c?-1:1,d=za(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var _o=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await go(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},vo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=za(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wa(i),p=Ha(f),m=u[p],h=u[f],g=(e,t)=>Ra(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},yo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=za(e,t),u={x:n,y:r},d=Wa(i),f=Ha(d),p=u[f],m=u[d],h=za(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ho.has(Ba(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},bo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=za(e,t),c=await i.detectOverflow(t,s),l=Ba(n),u=Va(n),d=Wa(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ma(p-c[m],g),y=Ma(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Na(c.left,c.right):S=p-2*Na(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function xo(){return typeof window<`u`}function So(e){return To(e)?(e.nodeName||``).toLowerCase():`#document`}function Co(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wo(e){return((To(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function To(e){return xo()?e instanceof Node||e instanceof Co(e).Node:!1}function Eo(e){return xo()?e instanceof Element||e instanceof Co(e).Element:!1}function Do(e){return xo()?e instanceof HTMLElement||e instanceof Co(e).HTMLElement:!1}function Oo(e){return!xo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Co(e).ShadowRoot}function ko(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ao(e){return/^(table|td|th)$/.test(So(e))}function jo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Mo=/transform|translate|scale|rotate|perspective|filter/,No=/paint|layout|strict|content/,Po=e=>!!e&&e!==`none`,Fo;function Io(e){let t=Eo(e)?K(e):e;return Po(t.transform)||Po(t.translate)||Po(t.scale)||Po(t.rotate)||Po(t.perspective)||!Ro()&&(Po(t.backdropFilter)||Po(t.filter))||Mo.test(t.willChange||``)||No.test(t.contain||``)}function Lo(e){let t=Bo(e);for(;Do(t)&&!G(t);){if(Io(t))return t;if(jo(t))return null;t=Bo(t)}return null}function Ro(){return Fo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Fo}function G(e){return/^(html|body|#document)$/.test(So(e))}function K(e){return Co(e).getComputedStyle(e)}function zo(e){return Eo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bo(e){if(So(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Oo(e)&&e.host||wo(e);return Oo(t)?t.host:t}function Vo(e){let t=Bo(e);return G(t)?(e.ownerDocument||e).body:Do(t)&&ko(t)?t:Vo(t)}function Ho(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vo(e),i=r===e.ownerDocument?.body,a=Co(r);if(i){let e=Uo(a);return t.concat(a,a.visualViewport||[],ko(r)?r:[],e&&n?Ho(e):[])}return t.concat(r,Ho(r,[],n))}function Uo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wo(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Do(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pa(n)!==a||Pa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Go(e){return Eo(e)?e:e.contextElement}function Ko(e){let t=Go(e);if(!Do(t))return Ia(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Wo(t),o=(a?Pa(n.width):n.width)/r,s=(a?Pa(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qo=Ia(0);function Jo(e){let t=Co(e);return!Ro()||!t.visualViewport?qo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Co(e)}function Xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Go(e),o=Ia(1);t&&(r?Eo(r)&&(o=Ko(r)):o=Ko(e));let s=Yo(a,n,r)?Jo(a):Ia(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Co(a),t=Eo(r)?Co(r):r,n=e,i=Uo(n);for(;i&&t!==n;){let e=Ko(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Co(i),i=Uo(n)}}return io({width:u,height:d,x:c,y:l})}function Zo(e,t){let n=zo(e).scrollLeft;return t?t.left+n:Xo(wo(e)).left+n}function Qo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Zo(e,n),y:n.top+t.scrollTop}}function $o(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wo(r),s=t?jo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ia(1),u=Ia(0),d=Do(r);if((d||!a)&&((So(r)!==`body`||ko(o))&&(c=zo(r)),d)){let e=Xo(r);l=Ko(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qo(o,c):Ia(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function es(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ts(e){let t=zo(e),n=e.ownerDocument.body,r=Na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Zo(e),o=-t.scrollTop;return K(n).direction===`rtl`&&(a+=Na(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ns=25;function rs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Co(e),a=wo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ro()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Zo(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ns&&(s-=o)}return{width:s,height:c,x:l,y:u}}function is(e,t){let n=Xo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ko(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function as(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=rs(e,n,t);else if(t===`document`)r=ts(wo(e));else if(Eo(t))r=is(t,n);else{let n=Jo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return io(r)}function os(e,t){let n=t.get(e);if(n)return n;let r=Ho(e,[],!1).filter(e=>Eo(e)&&So(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?Bo(e):e;for(;Eo(o)&&!G(o);){let e=K(o),t=Io(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Bo(o)}return t.set(e,r),r}function ss(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?jo(t)?[]:os(t,this._c):[].concat(n),r],o=as(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=as(t,a[e],i);s=Na(n.top,s),c=Ma(n.right,c),l=Ma(n.bottom,l),u=Na(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function cs(e){let{width:t,height:n}=Wo(e);return{width:t,height:n}}function ls(e,t,n){let r=Do(t),i=wo(t),a=n===`fixed`,o=Xo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ia(0);if((r||!a)&&((So(t)!==`body`||ko(i))&&(s=zo(t)),r)){let e=Xo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Zo(i));let l=i&&!r&&!a?Qo(i,s):Ia(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function us(e){return K(e).position===`static`}function ds(e,t){if(!Do(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wo(e)===n&&(n=n.ownerDocument.body),n}function fs(e,t){let n=Co(e);if(jo(e))return n;if(!Do(e)){let t=Bo(e);for(;t&&!G(t);){if(Eo(t)&&!us(t))return t;t=Bo(t)}return n}let r=ds(e,t);for(;r&&Ao(r)&&us(r);)r=ds(r,t);return r&&G(r)&&us(r)&&!Io(r)?n:r||Lo(e)||n}var ps=async function(e){let t=this.getOffsetParent||fs,n=this.getDimensions,r=await n(e.floating);return{reference:ls(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ms(e){return K(e).direction===`rtl`}var hs={convertOffsetParentRelativeRectToViewportRelativeRect:$o,getDocumentElement:wo,getClippingRect:ss,getOffsetParent:fs,getElementRects:ps,getClientRects:es,getDimensions:cs,getScale:Ko,isElement:Eo,isRTL:ms};function gs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _s(e,t,n){let r=null,i,a=wo(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fa(d),h=Fa(a.clientWidth-(u+f)),g=Fa(a.clientHeight-(d+p)),_=Fa(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Na(0,Ma(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Co(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Go(e),u=i||a?[...l?Ho(l):[],...t?Ho(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_s(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Xo(e):null;c&&g();function g(){let t=Xo(e);h&&!gs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ys=_o,bs=vo,xs=uo,Ss=bo,Cs=mo,ws=lo,Ts=yo,Es=(e,t,n)=>{let r=new Map,i=n??{},a={...hs,...i.platform,_c:r};return co(e,t,{...i,platform:a})},Ds=typeof document<`u`?_.useLayoutEffect:function(){};function Os(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Os(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Os(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){let n=ks(e);return Math.round(t*n)/n}function js(e){let t=_.useRef(e);return Ds(()=>{t.current=e}),t}function Ms(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Os(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=js(c),O=js(i),k=js(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Es(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Os(T.current,t)&&(T.current=t,ia.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ds(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Ds(()=>(j.current=!0,()=>{j.current=!1}),[]),Ds(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=As(N.floating,u.x),r=As(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ks(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Ns=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ws({element:r.current,padding:i}).fn(n):r?ws({element:r,padding:i}).fn(n):{}}}},Ps=(e,t)=>{let n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fs=(e,t)=>{let n=bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Is=(e,t)=>({fn:Ts(e).fn,options:[e,t]}),Ls=(e,t)=>{let n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bs=(e,t)=>{let n=Ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=Object.defineProperty,Hs=(e,t)=>Vs(e,`name`,{value:t,configurable:!0});function Us(e){let[t,n]=_.useState(void 0);return Ta(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Hs(Us,`useSize`);var Ws=Object.defineProperty,Gs=(e,t)=>Ws(e,`name`,{value:t,configurable:!0}),Ks=`Popper`,[qs,Js]=Vi(Ks),[Ys,Xs]=qs(Ks),Zs=Gs(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,j.jsx)(Ys,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Qs=`PopperAnchor`,$s=_.forwardRef(Gs(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Xs(Qs,n),o=_.useRef(null),s=a.onAnchorChange,c=H(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&oc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,j.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),ec=`PopperContent`,[tc,nc]=qs(ec),rc=_.forwardRef(Gs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Xs(ec,n),[v,y]=_.useState(null),b=H(t,y),[x,S]=_.useState(null),C=Us(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(ic),altBoundary:k},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=Ms({strategy:`fixed`,placement:E,whileElementsMounted:Gs((...e)=>vs(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ps({mainAxis:i+T,alignmentAxis:o}),c&&Fs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Is():void 0,...A}),c&&Ls({...A}),Rs({...A,apply:Gs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Bs({element:x,padding:s}),ac({arrowWidth:w,arrowHeight:T}),f&&zs({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),L=g.setPlacementState;Ta(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=oc(P),ne=ua(m);Ta(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=_.useState();return Ta(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,j.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,j.jsx)(tc,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,j.jsx)(W.div,{"data-side":ee,"data-align":te,...h,ref:b,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function ic(e){return e!==null}Gs(ic,`isNotNull`);var ac=Gs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=oc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function oc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Gs(oc,`getSideAndAlignFromPlacement`);var sc=Zs,cc=$s,lc=rc,uc=Object.defineProperty,dc=_.forwardRef(((e,t)=>uc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);Ta(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ia.createPortal((0,j.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),fc=Object.defineProperty,pc=(e,t)=>fc(e,`name`,{value:t,configurable:!0});function mc(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}pc(mc,`useStateMachine`);var hc=pc(e=>{let{present:t,children:n}=e,r=gc(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=vc(r.ref,bc(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function gc(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=mc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??yc(r.current),o.current=void 0):a.current=`none`},[s]),Ta(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=yc(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ta(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=pc(a=>{let o=yc(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=pc(e=>{e.target===t&&(a.current=yc(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=yc(t)}else r.current=null;n(e)},[])}}pc(gc,`usePresence`);function _c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}pc(_c,`setRef`);function vc(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=_c(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():_c(n[e],null)}}},[])}pc(vc,`useStableComposedRefs`);function yc(e){return e?.animationName||`none`}pc(yc,`getAnimationName`);function bc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}pc(bc,`getElementRef`);var xc=Object.defineProperty,Sc=(e,t)=>xc(e,`name`,{value:t,configurable:!0}),Cc=_.useEffectEvent,wc=_.useInsertionEffect;function Tc(e){if(typeof Cc==`function`)return Cc(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof wc==`function`?wc(()=>{t.current=e}):Ta(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Sc(Tc,`useEffectEvent`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=_.useInsertionEffect||Ta;function kc({prop:e,defaultProp:t,onChange:n=Dc(()=>{},`onChange`),caller:r}){let[i,a,o]=Ac({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=jc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Dc(kc,`useControllableState`);function Ac({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Oc(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Dc(Ac,`useUncontrolledState`);function jc(e){return typeof e==`function`}Dc(jc,`isFunction`);var Mc=Symbol(`RADIX:SYNC_STATE`);function Nc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Tc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===Mc)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Mc,state:i})},[i,d.state,c]),[h,f]}Dc(Nc,`useControllableStateReducer`);var Pc=Object.defineProperty,Fc=(e,t)=>Pc(e,`name`,{value:t,configurable:!0}),Ic=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Lc=_.forwardRef(Fc(function(e,t){return(0,j.jsx)(W.span,{...e,ref:t,style:{...Ic,...e.style}})},`VisuallyHidden`)),Rc=Object.defineProperty,zc=(e,t)=>Rc(e,`name`,{value:t,configurable:!0}),[Bc,Vc]=Vi(`Tooltip`,[Js]),Hc=Js(),Uc=`TooltipProvider`,Wc=700,Gc=`tooltip.open`,[Kc,qc]=Bc(Uc),Jc=zc(e=>{let{__scopeTooltip:t,delayDuration:n=Wc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(Kc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Yc=`Tooltip`,[Xc,Zc]=Bc(Yc),Qc=zc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=qc(Yc,e.__scopeTooltip),l=Hc(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Aa(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=kc({prop:r,defaultProp:i??!1,onChange:zc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Gc))):c.onClose(),a?.(e)},`onChange`),caller:Yc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,j.jsx)(sc,{...l,children:(0,j.jsx)(Xc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),$c=`TooltipTrigger`,el=_.forwardRef(zc(function(e,t){let{__scopeTooltip:n,...r}=e,i=Zc($c,n),a=qc($c,n),o=Hc(n),s=H(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,j.jsx)(cc,{asChild:!0,...o,children:(0,j.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:V(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:V(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:V(e.onBlur,i.onClose),onClick:V(e.onClick,i.onClose)})})},`TooltipTrigger`)),tl=`TooltipPortal`,[nl,rl]=Bc(tl,{forceMount:void 0}),il=zc(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Zc(tl,t);return(0,j.jsx)(nl,{scope:t,forceMount:n,children:(0,j.jsx)(hc,{present:n||a.open,children:(0,j.jsx)(dc,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),al=`TooltipContent`,ol=_.forwardRef(zc(function(e,t){let n=rl(al,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Zc(al,e.__scopeTooltip);return(0,j.jsx)(hc,{present:r||o.open,children:o.disableHoverableContent?(0,j.jsx)(ll,{side:i,...a,ref:t}):(0,j.jsx)(sl,{side:i,...a,ref:t})})},`TooltipContent`)),sl=_.forwardRef(zc(function(e,t){let n=Zc(al,e.__scopeTooltip),r=qc(al,e.__scopeTooltip),i=_.useRef(null),a=H(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=dl(r,ul(r,n.getBoundingClientRect())),a=fl(t.getBoundingClientRect()),o=ml([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=zc(e=>p(e,u),`handleTriggerLeave`),t=zc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=zc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!pl(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,j.jsx)(ll,{...e,ref:a})},`TooltipContentHoverable`)),cl=Ji(`TooltipContent`),ll=_.forwardRef(zc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Zc(al,n),u=Hc(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(Gc,d),()=>document.removeEventListener(Gc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=zc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ta(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,j.jsx)(va,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,j.jsxs)(lc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,j.jsx)(cl,{children:r}),i?(0,j.jsx)(Lc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function ul(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}zc(ul,`getExitSideFromRect`);function dl(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}zc(dl,`getPaddedExitPoints`);function fl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}zc(fl,`getPointsFromRect`);function pl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}zc(pl,`isPointInPolygon`);function ml(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),hl(t)}zc(ml,`getHull`);function hl(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}zc(hl,`getHullPresorted`);var gl=Jc,_l=Qc,vl=el,yl=il,bl=ol;function xl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xl(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Sl(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xl(e))&&(r&&(r+=` `),r+=t);return r}var Cl=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wl=(e,t)=>({classGroupId:e,validator:t}),Tl=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),El=`-`,Dl=[],Ol=`arbitrary..`,kl=e=>{let t=Ml(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return jl(e);let n=e.split(El);return Al(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Cl(i,t):t:i||Dl}return n[e]||Dl}}},Al=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Al(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(El):e.slice(t).join(El),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},jl=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ol+r:void 0})(),Ml=e=>{let{theme:t,classGroups:n}=e;return Nl(n,t)},Nl=(e,t)=>{let n=Tl();for(let r in e){let i=e[r];Pl(i,n,r,t)}return n},Pl=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fl(i,t,n,r)}},Fl=(e,t,n,r)=>{if(typeof e==`string`){Il(e,t,n);return}if(typeof e==`function`){Ll(e,t,n,r);return}Rl(e,t,n,r)},Il=(e,t,n)=>{let r=e===``?t:zl(t,e);r.classGroupId=n},Ll=(e,t,n,r)=>{if(Bl(e)){Pl(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wl(n,e))},Rl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Pl(o,zl(t,a),n,r)}},zl=(e,t)=>{let n=e,r=t.split(El),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Tl(),n.nextPart.set(t,i)),n=i}return n},Bl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Vl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hl=`!`,Ul=`:`,Wl=[],Gl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ul){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hl)?(c=s.slice(0,-1),l=!0):s.startsWith(Hl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Gl(t,l,c,u)};if(t){let e=t+Ul,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Gl(Wl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ql=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Jl=e=>({cache:Vl(e.cacheSize),parseClassName:Kl(e),sortModifiers:ql(e),postfixLookupClassGroupIds:Yl(e),...kl(e)}),Yl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Xl=/\s+/,Zl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Xl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Hl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ql=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=$l(n))&&(i&&(i+=` `),i+=r);return i},$l=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=$l(e[r]))&&(n&&(n+=` `),n+=t);return n},eu=(e,...t)=>{let n,r,i,a,o=o=>(n=Jl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Zl(e,n);return i(e,a),a};return a=o,(...e)=>a(Ql(...e))},tu=[],q=e=>{let t=t=>t[e]||tu;return t.isThemeGetter=!0,t.themeKey=e,t},nu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ru=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iu=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,au=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ou=/\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$/,su=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,cu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uu=e=>iu.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),du=e=>!!e&&Number.isInteger(Number(e)),fu=e=>e.endsWith(`%`)&&J(e.slice(0,-1)),pu=e=>au.test(e),mu=()=>!0,hu=e=>ou.test(e)&&!su.test(e),gu=()=>!1,_u=e=>cu.test(e),vu=e=>lu.test(e),yu=e=>!Y(e)&&!X(e),bu=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),xu=e=>Iu(e,Bu,gu),Y=e=>nu.test(e),Su=e=>Iu(e,Vu,hu),Cu=e=>Iu(e,Hu,J),wu=e=>Iu(e,Wu,mu),Tu=e=>Iu(e,Uu,gu),Eu=e=>Iu(e,Ru,gu),Du=e=>Iu(e,zu,vu),Ou=e=>Iu(e,Gu,_u),X=e=>ru.test(e),ku=e=>Lu(e,Vu),Au=e=>Lu(e,Uu),ju=e=>Lu(e,Ru),Mu=e=>Lu(e,Bu),Nu=e=>Lu(e,zu),Pu=e=>Lu(e,Gu,!0),Fu=e=>Lu(e,Wu,!0),Iu=(e,t,n)=>{let r=nu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lu=(e,t,n=!1)=>{let r=ru.exec(e);return r?r[1]?t(r[1]):n:!1},Ru=e=>e===`position`||e===`percentage`,zu=e=>e===`image`||e===`url`,Bu=e=>e===`length`||e===`size`||e===`bg-size`,Vu=e=>e===`length`,Hu=e=>e===`number`,Uu=e=>e===`family-name`,Wu=e=>e===`number`||e===`weight`,Gu=e=>e===`shadow`,Ku=eu(()=>{let e=q(`color`),t=q(`font`),n=q(`text`),r=q(`font-weight`),i=q(`tracking`),a=q(`leading`),o=q(`breakpoint`),s=q(`container`),c=q(`spacing`),l=q(`radius`),u=q(`shadow`),d=q(`inset-shadow`),f=q(`text-shadow`),p=q(`drop-shadow`),m=q(`blur`),h=q(`perspective`),g=q(`aspect`),_=q(`ease`),v=q(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,Y],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,Y,c],T=()=>[uu,`full`,`auto`,...w()],E=()=>[du,`none`,`subgrid`,X,Y],D=()=>[`auto`,{span:[`full`,du,X,Y]},du,X,Y],O=()=>[du,`auto`,X,Y],k=()=>[`auto`,`min`,`max`,`fr`,X,Y],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[uu,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,uu,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[uu,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,X,Y],L=()=>[...b(),ju,Eu,{position:[X,Y]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,Mu,xu,{size:[X,Y]}],ne=()=>[fu,ku,Su],re=()=>[``,`none`,`full`,l,X,Y],ie=()=>[``,J,ku,Su],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[J,fu,ju,Eu],ce=()=>[``,`none`,m,X,Y],le=()=>[`none`,J,X,Y],ue=()=>[`none`,J,X,Y],R=()=>[J,X,Y],de=()=>[uu,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[pu],breakpoint:[pu],color:[mu],container:[pu],"drop-shadow":[pu],ease:[`in`,`out`,`in-out`],font:[yu],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[pu],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[pu],shadow:[pu],spacing:[`px`,J],text:[pu],"text-shadow":[pu],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,uu,Y,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[bu],columns:[{columns:[J,`auto`,Y,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[du,`auto`,X,Y]}],basis:[{basis:[uu,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[J,uu,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,J,X,Y]}],shrink:[{shrink:[``,J,X,Y]}],order:[{order:[du,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,ku,Su]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fu,wu]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,fu,Y]}],"font-family":[{font:[Au,Tu,t]}],"font-features":[{"font-features":[Y]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,Y]}],"line-clamp":[{"line-clamp":[J,`none`,X,Cu]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[J,`from-font`,`auto`,X,Su]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[J,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[du,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},du,X,Y],radial:[``,X,Y],conic:[``,du,X,Y]},Nu,Du]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[J,X,Y]}],"outline-w":[{outline:[``,J,ku,Su]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,Pu,Ou]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Pu,Ou]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[J,Su]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Pu,Ou]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[J,X,Y]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[J]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[J]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:ce()}],brightness:[{brightness:[J,X,Y]}],contrast:[{contrast:[J,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Pu,Ou]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,J,X,Y]}],"hue-rotate":[{"hue-rotate":[J,X,Y]}],invert:[{invert:[``,J,X,Y]}],saturate:[{saturate:[J,X,Y]}],sepia:[{sepia:[``,J,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[J,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[J,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,J,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[J,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,J,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[J,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[J,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,J,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[J,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,_,X,Y]}],delay:[{delay:[J,X,Y]}],animate:[{animate:[`none`,v,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,Y]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[du,X,Y]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,Y]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[J,ku,Su,Cu]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Z(...e){return Ku(Sl(e))}var qu=`matrx-motion-overlay`,Ju=`matrx-motion-popper`,Yu={top:`matrx-motion-sheet-top`,bottom:`matrx-motion-sheet-bottom`,left:`matrx-motion-sheet-left`,right:`matrx-motion-sheet-right`,center:`matrx-motion-sheet-center`},Q=`matrx-spin`;[...Object.values(Yu)];var Xu=Symbol.for(`ai-matrx.design-system.portal-container-context`),Zu=globalThis,Qu=Zu[Xu]??=_.createContext(void 0);function $u({container:e,children:t}){return(0,j.jsx)(Qu.Provider,{value:e??void 0,children:t})}function ed(e){let t=_.useContext(Qu);return e===void 0?t??void 0:e??void 0}var td=`data-matrx-title`,nd=`data-matrx-tooltip-trigger`,rd=350,id=500,ad=6,od=8,sd=`matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,cd=Symbol.for(`@ai-matrx/design-system/title-tooltips`),ld={get:e=>e[cd],set:(e,t)=>{e[cd]=t},delete:e=>{delete e[cd]}};function ud(e=typeof document>`u`?void 0:document){if(!e)return()=>{};let t=ld.get(e);t?t.count+=1:ld.set(e,{count:1,uninstall:dd(e)});let n=!1;return()=>{if(n)return;n=!0;let t=ld.get(e);t&&(--t.count,t.count<=0&&(t.uninstall(),ld.delete(e)))}}function dd(e){let t=e.defaultView,n=null,r=null,i,a=0,o=t?.HTMLElement,s=e=>{if(!o||!(e instanceof t.Node))return null;let n=e instanceof o?e:e.parentElement;if(!n)return null;let r=n.closest(`[title], [${td}]`);return!r||!(r instanceof o)||r.closest(`[data-native-title]`)?null:r},c=e=>(e.getAttribute(`data-matrx-title`)??e.getAttribute(`title`)??``).trim(),l=e=>{let t=e.getAttribute(`title`);t!==null&&(e.setAttribute(td,t),e.removeAttribute(`title`))},u=e=>{let t=e.getAttribute(td);t!==null&&(e.hasAttribute(`title`)||e.setAttribute(`title`,t),e.removeAttribute(td))},d=()=>r&&r.isConnected?r:(r=e.createElement(`div`),r.setAttribute(`role`,`tooltip`),r.setAttribute(`data-slot`,`title-tooltip`),r.className=sd,r.style.visibility=`hidden`,e.body.appendChild(r),r),f=e=>{let t=e.closest(`[data-title-side]`)?.getAttribute(`data-title-side`);return t===`bottom`||t===`left`||t===`right`?t:`top`},p=(e,n)=>{let r=t?.innerWidth??0,i=t?.innerHeight??0,a=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s={top:a.top-ad-o.height>=od,bottom:a.bottom+ad+o.height<=i-od,left:a.left-ad-o.width>=od,right:a.right+ad+o.width<=r-od},c={top:`bottom`,bottom:`top`,left:`right`,right:`left`},l=f(e),u=s[l]?l:s[c[l]]?c[l]:l,d,p;u===`top`||u===`bottom`?(d=a.left+a.width/2-o.width/2,p=u===`top`?a.top-ad-o.height:a.bottom+ad):(p=a.top+a.height/2-o.height/2,d=u===`left`?a.left-ad-o.width:a.right+ad),d=Math.min(Math.max(d,od),Math.max(od,r-od-o.width)),p=Math.min(Math.max(p,od),Math.max(od,i-od-o.height)),n.style.transform=`translate(${Math.round(d)}px, ${Math.round(p)}px)`,n.setAttribute(`data-side`,u)},m=(e,n)=>{let r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;for(let r=e;r;r=r===n?null:r.parentElement){let e=t?.getComputedStyle(r);if(!e||e.display===`none`||e.visibility===`hidden`||Number(e.opacity)===0)return!1}return!0},h=(e,t)=>{for(let n=e;n;n=n.parentElement){if(n.scrollWidth>n.clientWidth+1&&n.clientWidth>0||n.scrollHeight>n.clientHeight+1&&n.clientHeight>0)return!0;if(n===t)break}return!1},g=(n,r)=>{let i=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),a=i(r);if(!a||!t)return!1;let o=e.createTreeWalker(n,t.NodeFilter.SHOW_TEXT);for(let e=o.nextNode();e;e=o.nextNode()){if(i(e.textContent??``)!==a)continue;let t=e.parentElement;if(t&&m(t,n)&&!h(t,n))return!0}return!1},_=(e,t)=>{if(n!==e||e.closest(`[data-matrx-tooltip-trigger]`))return;let r=c(e);if(!r||!e.isConnected||g(e,r))return;let i=d();i.textContent=r,i.style.visibility=`hidden`,i.setAttribute(`data-state`,t?`instant-open`:`delayed-open`),p(e,i),i.style.visibility=`visible`,e.id&&(i.id=`${e.id}-title-tooltip`)},v=()=>{i!==void 0&&clearTimeout(i),i=void 0,r&&r.style.visibility===`visible`&&(a=Date.now()),r&&(r.style.visibility=`hidden`,r.removeAttribute(`data-state`))},y=e=>{n!==e&&(b(),n=e,l(e),Date.now()-a<id?_(e,!0):i=setTimeout(()=>_(e,!1),rd))},b=()=>{v(),n&&u(n),n=null},x=e=>{if(e.pointerType===`touch`)return;let t=s(e.target);t?y(t):n&&b()},S=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||b()},C=e=>{let t=s(e.target);if(!t)return;let n=!0;try{n=e.target.matches(`:focus-visible`)}catch{n=!0}n&&y(t)},w=e=>{if(!n)return;let r=e.relatedTarget;r instanceof t.Node&&n.contains(r)||b()},T=()=>b(),E=e=>{e.key===`Escape`&&b()};return e.addEventListener(`pointerover`,x,!0),e.addEventListener(`pointerout`,S,!0),e.addEventListener(`focusin`,C,!0),e.addEventListener(`focusout`,w,!0),e.addEventListener(`pointerdown`,T,!0),e.addEventListener(`keydown`,E,!0),e.addEventListener(`scroll`,T,!0),t?.addEventListener(`blur`,T),()=>{b(),e.removeEventListener(`pointerover`,x,!0),e.removeEventListener(`pointerout`,S,!0),e.removeEventListener(`focusin`,C,!0),e.removeEventListener(`focusout`,w,!0),e.removeEventListener(`pointerdown`,T,!0),e.removeEventListener(`keydown`,E,!0),e.removeEventListener(`scroll`,T,!0),t?.removeEventListener(`blur`,T),r?.remove(),r=null}}function fd({titleTooltips:e=!0,...t}){return _.useEffect(()=>{if(e)return ud()},[e]),(0,j.jsx)(gl,{...t})}var pd=_l,md=_.forwardRef((e,t)=>(0,j.jsx)(vl,{ref:t,[nd]:``,...e}));md.displayName=vl.displayName;var hd=_.forwardRef(({className:e,sideOffset:t=4,container:n,animated:r=!0,...i},a)=>{let o=ed(n);return(0,j.jsx)(yl,{container:o??null,children:(0,j.jsx)(bl,{ref:a,"data-slot":`tooltip-content`,sideOffset:t,className:Z(`matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground`,r&&`matrx-motion-popper`,e),...i})})});hd.displayName=bl.displayName;function gd(...e){return e.filter(Boolean).join(` `).trim()}function _d(e){for(let t=e;t;t=t.parentElement){let e=t.offsetWidth;if(!e)continue;let n=t.getBoundingClientRect().width;if(!(n>0))continue;let r=n/e;return!Number.isFinite(r)||r<=0||Math.abs(r-1)<.02?1:r}return 1}var vd=Symbol.for(`@ai-matrx/tap-target:guard`);function yd(){return globalThis[vd]===!0}var bd=[`--matrx-tap-box`,`--matrx-tap-gap`,`--matrx-tap-pill-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-wide-size`,`--matrx-tap-icon-size`,`--matrx-tap-touch-min`,`--matrx-tap-target-size`],xd=[{scope:`[data-matrx-table][data-matrx-table-density]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-pill-sm-size`,`--matrx-tap-icon-size`])},{scope:`[data-alchemy-trigger]`,tokens:new Set([`--matrx-tap-icon-size`])},{scope:`[data-matrx-controls]`,tokens:new Set([`--matrx-tap-target-size`,`--matrx-tap-pill-size`,`--matrx-tap-wide-size`,`--matrx-tap-pill-sm-size`])}],Sd=xd[0].scope,Cd=xd[2].scope,wd=`.matrx-tap-target, .matrx-tap-group`,Td=/^(?:[^\s:]+:)*!?-?(?:\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\[)/;function Ed(e){if(!yd()||!e)return null;let t=e.split(/\s+/).filter(e=>e&&Td.test(e));return t.length?`className is the glyph colour only — remove "${t.join(` `)}"`:null}function Dd(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Od(e){let t=typeof e.className==`string`?e.className.trim().split(/\s+/).slice(0,4).join(`.`):``;return`<${e.tagName.toLowerCase()}${t?`.${t}`:``}>`}function kd(e,t){let n=t.getComputedStyle(e);return n.position===`absolute`||n.position===`fixed`||n.display===`none`}function Ad(e){return e.matches(wd)?1:e.querySelectorAll(wd).length}function jd(e,t,n){let r=``,i=e=>{e!==t&&(e.nodeType===3?r+=e.textContent??``:e.nodeType===1&&!kd(e,n)&&e.childNodes.forEach(i))};return e.childNodes.forEach(i),r.trim()}function Md(e,t){if(e.matches(wd))return!0;if(Ad(e)!==1)return!1;let n=e.querySelector(wd);return!Array.from(e.querySelectorAll(`input, select, textarea, button, a, [role='button']`)).some(e=>e!==n&&!n.contains(e))&&jd(e,n,t)===``}var Nd=null;function Pd(e){let t=e.defaultView,n=t.getComputedStyle(e.documentElement),r=bd.map(e=>n.getPropertyValue(e)).join(`|`);if(Nd?.key===r)return Nd;let i=e.createElement(`div`);i.setAttribute(`aria-hidden`,`true`),i.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0`,i.innerHTML=`<button class="matrx-tap-target"><div class="matrx-tap-pill"><svg class="matrx-tap-icon"></svg></div></button><button class="matrx-tap-target matrx-tap-target-sm"><div class="matrx-tap-pill matrx-tap-pill-sm"></div></button><button class="matrx-tap-target matrx-tap-target-inline"><div class="matrx-tap-pill matrx-tap-pill-inline"></div></button>`,e.body.appendChild(i);let[a,o,s]=Array.from(i.children);return Nd={key:r,target:a.offsetHeight,pill:a.firstElementChild.offsetHeight,icon:Dd(t.getComputedStyle(a.querySelector(`svg`)).height),sm:o.offsetHeight,smPill:o.firstElementChild.offsetHeight,wide:s.firstElementChild.offsetHeight},i.remove(),Nd}function Fd(e){let t=e.ownerDocument,n=t.defaultView;if(!n||!e.isConnected)return null;let r=n.getComputedStyle(e);if(r.display===`none`)return null;let i=n.getComputedStyle(t.documentElement),a=e.closest(Sd)!==null||e.closest(Cd)!==null,o=new Set;for(let t of bd){let n=r.getPropertyValue(t).trim();if(n!==i.getPropertyValue(t).trim()){if(!xd.some(n=>n.tokens.has(t)&&e.closest(n.scope)))return`${t} overridden to "${n}" — tap geometry is not configurable`;o.add(t)}}let s=e.classList.contains(`matrx-tap-target-sm`),c=/matrx-tap-target-(?:inline|mobile-icon-only)/.test(e.className),l=e.querySelector(`:scope > .matrx-tap-pill`),u=l?.querySelector(`.matrx-tap-icon`)??null,d=Dd(r.minHeight)>=e.offsetHeight-.5||Dd(r.minWidth)>=e.offsetWidth-.5;if(!a&&l&&!d){let r=Pd(t),i=s?r.sm:r.target,a=s?[r.smPill]:c?[r.pill,r.wide]:[r.pill];if(Math.abs(e.offsetHeight-i)>.5)return`button is ${e.offsetHeight}px tall, canon is ${i}px`;if(!c&&Math.abs(e.offsetWidth-i)>.5)return`button is ${e.offsetWidth}px wide, canon is ${i}px`;if(!a.some(e=>Math.abs(l.offsetHeight-e)<=.5))return`pill is ${l.offsetHeight}px, canon is ${a.join(` or `)}px`;if(u&&!o.has(`--matrx-tap-icon-size`)){let e=Dd(n.getComputedStyle(u).height);if(Math.abs(e-r.icon)>.5)return`glyph is ${e}px, canon is ${r.icon}px`}}let f=e;if(e.parentElement?.matches(`.matrx-tap-group-row, .matrx-tap-search-measure`)){let t=e.closest(`.matrx-tap-group`);if(t&&Ad(e.parentElement)>1)return null;f=t??e}for(let e=0;e<2;e+=1){let e=f.parentElement;if(!e||e===t.body||Array.from(e.children).filter(e=>e!==f&&!kd(e,n)).length>0||jd(e,f,n)!==``)break;let r=n.getComputedStyle(e),i=Dd(r.marginLeft)+Dd(r.marginRight)+Dd(r.paddingLeft)+Dd(r.paddingRight);if(i>.5)return`${Od(e)} adds ${i}px around a tap button — tap buttons space themselves`;f=e}let p=f.parentElement;if(p){let e=n.getComputedStyle(p),t=/flex|grid/.test(e.display),r=Array.from(p.children).filter(e=>e!==f&&Md(e,n));if(t&&r.length>0){let t=Dd(e.display.includes(`grid`)||!e.flexDirection.startsWith(`column`)?e.columnGap:e.rowGap);if(t>.5)return`${Od(p)} adds a ${t}px gap between tap buttons — remove it; tap buttons space themselves`}}return null}var Id=`.matrx-glass-thin-border, .matrx-glass-interactive`;function Ld(e){if(e.hasAttribute(`data-matrx-glass`))return!0;if(e.matches(`.matrx-tap-group`))return e.querySelector(`:scope > .matrx-tap-group-capsule.matrx-glass-thin-border`)!==null;if(e.matches(`.matrx-tap-target`))return e.querySelector(`:scope > .matrx-tap-pill:is(${Id})`)!==null;let t=e.ownerDocument.defaultView;return t&&Md(e,t)?Ld(e.querySelector(wd)):!1}var Rd=/^(auto|scroll|overlay)$/;function zd(e,t){for(let n=e;n&&n!==e.ownerDocument.body;n=n.parentElement){if(n.hasAttribute(`data-matrx-glass-plane`))return!0;let r=t.getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`)return!0;if(n!==e&&(Rd.test(r.overflowY)||Rd.test(r.overflowX)))return!1}return!1}function Bd(e,t,n){for(let r=e;r;){if(Md(r,n))return!0;let e=Array.from(r.children).filter(e=>!kd(e,n));r=(t===`after`?e[0]:e[e.length-1])??null}return!1}function Vd(e,t){if(e.getAttribute(`aria-hidden`)===`true`||kd(e,t))return!1;let n=e.getBoundingClientRect();return n.width>1&&n.height>1}function Hd(e){let t=e.ownerDocument.defaultView;if(!t||!e.isConnected)return null;let n=e.closest(`.matrx-tap-group`)??e,r=Ld(n);if(r&&!zd(n,t))return`glass on a solid surface — glass only floats over moving content; use variant="transparent" (or a solid group)`;let i=n.parentElement;if(!i)return null;if(r){let e=Array.from(i.children).find(e=>e!==n&&Vd(e,t)&&!Ld(e));if(e)return`glass beside non-glass ${Od(e)} — make the row all glass or none`}let a=e.querySelector(`:scope > .matrx-tap-pill`)??n.querySelector(`.matrx-tap-group-capsule`);if(!a)return null;let o=Dd(t.getComputedStyle(e).getPropertyValue(`--matrx-tap-gap`))||6,s=a.getBoundingClientRect();if(s.width===0)return null;let c=_d(a);for(let[e,r]of[[`after`,n.nextElementSibling],[`before`,n.previousElementSibling]]){if(!r||!Vd(r,t)||Md(r,t)||Ld(r)||Bd(r,e,t))continue;let n=r.getBoundingClientRect();if(Math.abs(n.top+n.height/2-(s.top+s.height/2))>s.height)continue;let i=t.getComputedStyle(r),a=(e===`after`?n.left-s.right:s.left-n.right)/c+Dd(e===`after`?i.paddingLeft:i.paddingRight);if(a<o-.5)return`${Od(r)} sits ${Math.round(a)}px from the pill — anything beside a tap button adds its own ${o/2}px (the box only carries ${o/2}px)`}return null}var Ud=new Set;function Wd(e,t){e.setAttribute(`data-matrx-tap-violation`,t);let n=`${t}@${e.getAttribute(`aria-label`)??e.textContent??``}`;Ud.has(n)||(Ud.add(n),console.error(`[tap-target] ${t}`,e))}var Gd=new Set,Kd=null,qd=!1;function Jd(e){let t=Fd(e);if(t){Wd(e,t);return}e.removeAttribute(`data-matrx-tap-violation`);let n=Hd(e);if(n){e.setAttribute(`data-matrx-tap-warning`,n);let t=`w:${n}@${e.getAttribute(`aria-label`)??``}`;Ud.has(t)||(Ud.add(t),console.error(`[tap-target] ${n}`,e))}else e.removeAttribute(`data-matrx-tap-warning`)}function Yd(e){qd||(qd=!0,e.addEventListener(`resize`,()=>{Kd&&clearTimeout(Kd),Kd=setTimeout(()=>Gd.forEach(e=>e.isConnected?Jd(e):Gd.delete(e)),200)}))}function Xd(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function Zd(e,t){let n=(0,_.useRef)(null);return(0,_.useCallback)(r=>{if(Xd(e,r),n.current&&n.current!==r&&Gd.delete(n.current),n.current=r,!yd()||!r)return;if(t){Wd(r,t);return}let i=r.ownerDocument.defaultView;i&&(Gd.add(r),Yd(i),i.requestAnimationFrame(()=>Jd(r)))},[e,t])}var Qd={default:`text-foreground`,muted:`text-muted-foreground group-hover/tap:text-foreground`,primary:`text-primary`,destructive:`text-destructive`,success:`text-success`,warning:`text-warning`,info:`text-info`},$d={primary:{fill:`bg-primary group-hover/tap:bg-primary/85`,glyph:`text-primary-foreground`},destructive:{fill:`bg-destructive group-hover/tap:bg-destructive/85`,glyph:`text-destructive-foreground`},success:{fill:`bg-success group-hover/tap:bg-success/85`,glyph:`text-success-foreground`},warning:{fill:`bg-warning group-hover/tap:bg-warning/85`,glyph:`text-warning-foreground`},neutral:{fill:`bg-foreground group-hover/tap:bg-foreground/85`,glyph:`text-background`}},ef=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function tf(e){let t=e.toLowerCase().split(`+`),n=t.pop()??``;return{mod:t.includes(`mod`),shift:t.includes(`shift`),alt:t.includes(`alt`),key:n}}function nf(e){let t=tf(e),n=t.key.length===1?t.key.toUpperCase():t.key[0].toUpperCase()+t.key.slice(1);return ef?`${t.alt?`⌥`:``}${t.shift?`⇧`:``}${t.mod?`⌘`:``}${n}`:[t.mod&&`Ctrl`,t.alt&&`Alt`,t.shift&&`Shift`,n].filter(Boolean).join(`+`)}function rf(e){let t=e;return!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function af(e,t){let n=tf(t);return(e.metaKey||e.ctrlKey)!==n.mod||e.altKey!==n.alt||/^[a-z0-9]$|^[a-z]{2,}$/.test(n.key)&&e.shiftKey!==n.shift||!n.mod&&rf(e.target)?!1:e.key.toLowerCase()===n.key}function of(e,t,n){(0,_.useEffect)(()=>{if(!e||!n)return;let r=n=>{if(!af(n,e))return;let r=t();r&&r.isConnected&&(n.preventDefault(),r.click())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,n,t])}function sf({badge:e}){return e===`dot`?(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,"data-dot":``}):e<=0?null:(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`matrx-tap-badge`,children:e>99?`99+`:e})}function cf({className:e}){return(0,j.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,j.jsx)(`circle`,{className:Q,cx:`12`,cy:`12`,r:`9`,strokeDasharray:`28.27`,strokeDashoffset:`9`,strokeLinecap:`round`,style:{transformOrigin:`12px 12px`}})})}function lf(){return(0,j.jsx)(`svg`,{className:`matrx-tap-chevron`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function uf(e,t){return t?(0,j.jsxs)(`span`,{className:`matrx-tap-tooltip`,children:[e,(0,j.jsx)(`kbd`,{className:`matrx-tap-kbd`,children:nf(t)})]}):e}var df=Symbol.for(`@ai-matrx/tap-target:link-component`);function ff(){return globalThis[df]??null}var pf=/^(https?:|mailto:|tel:)/i,mf=`matrx-tap-target group group/tap`,hf=`matrx-tap-target matrx-tap-target-sm group group/tap`;function gf({icon:e,children:t,strokeWidth:n=2,className:r}){return e?(0,_.isValidElement)(e)?(0,_.cloneElement)(e,{className:gd(r,e.props.className)}):(0,j.jsx)(`span`,{className:r,children:e}):(0,j.jsx)(`svg`,{className:r,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:t})}function _f(e,t,n){let r=!!e;return t===`sm`?{outerClassName:r&&n?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap`:r?`matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap`:hf,inlineModifier:n?`matrx-tap-pill-mobile-icon-only-sm`:`matrx-tap-pill-inline-sm`}:{outerClassName:r&&n?`${mf} matrx-tap-target-mobile-icon-only`:r?`${mf} matrx-tap-target-inline`:mf,inlineModifier:n?`matrx-tap-pill-mobile-icon-only`:`matrx-tap-pill-inline`}}function vf({label:e,pillClassName:t,iconClassName:n,labelClassName:r,inlineModifier:i,icon:a,children:o,strokeWidth:s=2,loading:c,chevron:l}){let u=c?(0,j.jsx)(cf,{className:n}):(0,j.jsx)(gf,{icon:a,strokeWidth:s,className:n,children:o}),d=e?`${t} ${i}`.trim():t;return e?(0,j.jsxs)(`div`,{className:d,children:[u,(0,j.jsx)(`span`,{className:r??`matrx-tap-label`,children:e}),l?(0,j.jsx)(lf,{}):null]}):(0,j.jsx)(`div`,{className:d,children:u})}function yf({size:e=`default`,colorClassName:t,pillClassName:n,iconClassName:r,labelClassName:i,icon:a,children:o,strokeWidth:s,label:c,mobileIconOnly:l=!1,onClick:u,as:d,htmlFor:f,ariaLabel:p,disabled:m,href:h,target:g,rel:v,prefetch:y,linkComponent:b,tooltip:x,tooltipSide:S,tooltipAlign:C,rest:w,buttonRef:T}){let{tone:E,badge:D,pressed:O,loading:k,disabledReason:A,shortcut:M,chevron:N,...P}=w??{},F=!!(m||A),I=A||(typeof x==`string`&&x?x:void 0)||p||c,L=x===!1,ee=Zd(T,(I?null:`every tap button needs a tooltip — pass ariaLabel`)??Ed(t??P.className)??(P.style?`style is not supported on a tap button`:null)),te=(0,_.useRef)(null),ne=(0,_.useCallback)(e=>{te.current=e,ee(e)},[ee]);of(M,(0,_.useCallback)(()=>te.current,[]),!F&&!k);let re=E?Qd[E]:O&&!t?Qd.primary:null;re&&(r=`matrx-tap-icon ${re}`,i=`matrx-tap-label ${re}`),O&&(n=`${n} matrx-tap-pressed`);let{outerClassName:ie,inlineModifier:ae}=_f(c,e,l),oe=l?`${i??`matrx-tap-label`} matrx-tap-label-mobile-icon-only`:i,se=vf({label:c,pillClassName:n,iconClassName:r,labelClassName:oe,inlineModifier:c?ae:``,icon:a,children:o,strokeWidth:s,loading:k,chevron:N}),ce=bf({href:h,target:g,rel:v,prefetch:y,linkComponent:b,as:d,htmlFor:f,onClick:k?void 0:u,ariaLabel:c&&!l?void 0:p??c,disabled:F,outerClassName:ie,title:L&&I?M?`${I} (${nf(M)})`:I:void 0,children:(0,j.jsxs)(j.Fragment,{children:[se,D===void 0?null:(0,j.jsx)(sf,{badge:D})]}),rest:{...P,...O===void 0?{}:{"aria-pressed":O},...k?{"aria-busy":!0}:{},...M?{"aria-keyshortcuts":M.replace(/mod/i,`Meta`)}:{}},triggerRef:ne});return L||!I?ce:xf(ce,{tooltip:I,ariaLabel:I,disabled:F,tooltipSide:S,tooltipAlign:C,shortcut:M})}function bf({href:e,target:t,rel:n,prefetch:r,linkComponent:i,as:a,htmlFor:o,onClick:s,ariaLabel:c,disabled:l,outerClassName:u,children:d,rest:f,triggerRef:p,title:m}){let{style:h,...g}=f??{};if(l&&e)return(0,j.jsx)(`span`,{ref:p,"aria-disabled":`true`,"aria-label":c,title:m,className:`${u} opacity-40`,children:d});if(e){if(pf.test(e))return(0,j.jsx)(`a`,{ref:p,href:e,target:t??`_blank`,rel:n??`noopener noreferrer`,"aria-label":c,title:m,className:u,children:d});let a=i??ff();return a?(0,j.jsx)(a,{ref:p,href:e,target:t,rel:n,prefetch:r,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`a`,{ref:p,href:e,target:t,rel:n,"aria-label":c,title:m,className:u,children:d})}return a===`label`?(0,j.jsx)(`label`,{ref:p,htmlFor:o,"aria-label":c,title:m,className:u,children:d}):(0,j.jsx)(`button`,{ref:p,type:`button`,onClick:s,"aria-label":c,title:m,disabled:l,...g,className:u,children:d})}function xf(e,{tooltip:t,ariaLabel:n,disabled:r,tooltipSide:i=`top`,tooltipAlign:a=`center`,shortcut:o}){if(t===!1)return e;let s=typeof t==`string`&&t.length>0?t:n;return s?(0,j.jsxs)(pd,{children:[(0,j.jsx)(md,{asChild:!0,children:r?(0,j.jsx)(`span`,{className:`inline-flex`,children:e}):e}),(0,j.jsx)(hd,{side:i,align:a,children:uf(s,o)})]}):e}var Sf=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-glass-thin-border`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})});(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15`,iconClassName:`matrx-tap-icon ${i??`text-foreground`}`,rest:y,buttonRef:b})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-muted-foreground group-hover/tap:text-foreground`;return yf({colorClassName:i,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});var Cf=(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tone:p,bgColor:m,iconColor:h,hoverBgColor:g,activeBgColor:_,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...C},w){return yf({icon:e,children:t,strokeWidth:n,onClick:r,as:i,htmlFor:a,ariaLabel:o,disabled:s,href:c,target:l,rel:u,prefetch:d,linkComponent:f,tooltip:v,tooltipSide:y,tooltipAlign:b,label:x,mobileIconOnly:S,...wf(p,m,h,g,_),rest:C,buttonRef:w})});function wf(e,t,n,r,i){if(!(!e&&(t||n||r||i))){let t=$d[e??`primary`];return{pillClassName:`matrx-tap-pill ${t.fill} ${t.glyph} group-active/tap:brightness-90`,iconClassName:`matrx-tap-icon ${t.glyph}`,labelClassName:`matrx-tap-label ${t.glyph}`}}let a=n??`text-primary-foreground`;return{pillClassName:`matrx-tap-pill ${t??`bg-primary`} ${a} ${r??`group-hover/tap:bg-primary/80`} ${i??`group-active/tap:brightness-90`}`,iconClassName:`matrx-tap-icon ${a}`,labelClassName:`matrx-tap-label ${a}`}}(0,_.forwardRef)(function({tone:e=`destructive`,...t},n){return(0,j.jsx)(Cf,{ref:n,tone:e,...t})}),(0,_.forwardRef)(function({icon:e,children:t,strokeWidth:n=2,onClick:r,className:i,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,...y},b){let x=i??`text-foreground`;return yf({colorClassName:i,size:`sm`,icon:e,children:t,strokeWidth:n,onClick:r,as:a,htmlFor:o,ariaLabel:s,disabled:c,href:l,target:u,rel:d,prefetch:f,linkComponent:p,tooltip:m,tooltipSide:h,tooltipAlign:g,label:_,mobileIconOnly:v,pillClassName:`matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive`,iconClassName:`matrx-tap-icon ${x}`,labelClassName:`matrx-tap-label ${x}`,rest:y,buttonRef:b})});function Tf(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0),r=(0,_.useRef)(!1),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=48,[]),l=(0,_.useCallback)(e=>{r.current=!0,e.scrollTop=e.scrollHeight},[]),u=(0,_.useCallback)(()=>{let e=t.current;if(e===null)return;if(r.current){r.current=!1;return}let i=c(e);n.current=i,a(i),i&&s(!1)},[c]),d=(0,_.useCallback)(e=>{let n=t.current;n!==null&&n.removeEventListener(`scroll`,u),t.current=e,e!==null&&e.addEventListener(`scroll`,u,{passive:!0})},[u]);(0,_.useEffect)(()=>()=>{let e=t.current;e!==null&&e.removeEventListener(`scroll`,u)},[u]);let f=(0,_.useCallback)(()=>{let r=t.current;if(r!==null&&e){if(n.current){l(r);return}s(!0)}},[e,l]);return{ref:d,pinned:i,hasUnseenBelow:o,jumpToLatest:(0,_.useCallback)(()=>{let e=t.current;e!==null&&(l(e),n.current=!0,a(!0),s(!1))},[l]),onContentChange:f}}function Ef(e){let t=[],n=``,r=0;for(let i of St(e)){if(i.start<r)continue;n+=e.slice(r,i.start);let a=e.slice(i.start,i.end);t.push(i.kind===`fence`?` code block `:Df(a)),n+=`\uE300${t.length-1}\uE301`,r=i.end}return n+=e.slice(r),n.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}([*+-]|\d+\.)\s+/gm,``).replace(/(\*\*\*|___)(.+?)\1/g,`$2`).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(\*|_)(.+?)\1/g,`$2`).replace(/~~(.+?)~~/g,`$1`).replace(/^\s{0,3}([-*_]\s?){3,}$/gm,``).replace(/\uE300(\d+)\uE301/g,(e,n)=>t[Number(n)]??``).replace(/[ \t]{2,}/g,` `)}function Df(e){let t=/^`+/.exec(e)?.[0].length??0,n=e.slice(t,e.length-t);return/^ .* $/s.test(n)&&n.trim()?n.slice(1,-1):n}var Of=`Your message could not be copied.`,kf=`Select the text and copy it with your keyboard — this browser did not allow the page to use the clipboard.`,Af=2e3;function jf(e){let{message:t}=e,{notifier:n}=bi(),r=xi(),{thread:i,retry:a}=gi(),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=(0,_.useCallback)((e,t)=>{let r=globalThis.navigator?.clipboard,i=r?.writeText?.bind(r);if(i===void 0){n.notify({level:`warning`,message:Of,remedy:kf});return}i(e).then(()=>{s(t),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>s(null),Af)},()=>{n.notify({level:`warning`,message:Of,remedy:kf})})},[n]);if(t.status===`streaming`||t.status===`pending`)return null;let u=C(t),d=r.messageActions?.(t),f=t.role===`user`,p=f?``:wi(i.getSnapshot().messages,t.id);return u===``&&d===void 0?null:(0,j.jsxs)(`div`,{className:`mx-chat-actions`,role:`group`,"aria-label":f?`Actions for your message`:`Actions for this answer`,"data-message-id":t.id,children:[u===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-text`,onClick:()=>l(Ef(u),`text`),children:o===`text`?`Copied`:`Copy`}),u===``||f?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`copy-markdown`,onClick:()=>l(u,`markdown`),children:o===`markdown`?`Copied`:`Copy as markdown`}),p===``?null:(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`retry`,onClick:()=>void i.send({text:p}),children:`Ask again`}),f&&u!==``?(0,j.jsx)(`button`,{type:`button`,className:`mx-chat-quiet-button mx-chat-focusable`,"data-action":`edit`,onClick:()=>a.request(u),children:`Edit and send again`}):null,d,o===null?null:(0,j.jsx)(`span`,{className:`mx-chat__sr-only`,role:`status`,"aria-live":`polite`,children:`Copied to the clipboard`})]})}var Mf=Object.defineProperty,Nf=(e,t)=>Mf(e,`name`,{value:t,configurable:!0});function Pf(e){let t=e+`CollectionProvider`,[n,r]=Vi(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Nf(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,j.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Gi(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=H(t,a(s,n).collectionRef);return(0,j.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Gi(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=H(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,j.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Nf(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Nf(Pf,`createCollection`);var Ff=new WeakMap,If=class e extends Map{static{Nf(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ff.set(this,!0)}set(e,t){return Ff.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=zf(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Lf(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Lf(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Lf(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Lf(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Rf(e,t);return n===-1?void 0:e[n]}Nf(Lf,`at`);function Rf(e,t){let n=e.length,r=zf(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Nf(Rf,`toSafeIndex`);function zf(e){return e!==e||e===0?0:Math.trunc(e)}Nf(zf,`toSafeInteger`);function Bf(e){let t=e+`CollectionProvider`,[n,r]=Vi(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new If,setItemMap:Nf(()=>void 0,`setItemMap`)}),o=Nf(({state:e,...t})=>e?(0,j.jsx)(c,{...t,state:e}):(0,j.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Nf(e=>{let t=h();return(0,j.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Nf(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=H(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=Uf(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,j.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Gi(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=H(t,a(l,n).collectionRef);return(0,j.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Gi(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=H(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);$(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Hf):(t.set(s,{...e,element:s}),t.toSorted(Hf)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new If(e)))}},[s,m,u]),(0,j.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new If)}Nf(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Nf(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Nf(Bf,`createCollection`);function $(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Nf($,`shallowEqual`);function Vf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Nf(Vf,`isElementPreceding`);function Hf(e,t){return!e[1].element||!t[1].element?0:Vf(e[1].element,t[1].element)?-1:1}Nf(Hf,`sortByDocumentPosition`);function Uf(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Nf(Uf,`getChildListObserver`);var Wf=Object.defineProperty,Gf=(e,t)=>Wf(e,`name`,{value:t,configurable:!0}),Kf=_.createContext(void 0);function qf(e){let t=_.useContext(Kf);return e||t||`ltr`}Gf(qf,`useDirection`);function Jf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,...e}}function Yf(e){return(0,j.jsxs)(`svg`,{...Jf(e),children:[(0,j.jsx)(`path`,{d:`M18 6 6 18`}),(0,j.jsx)(`path`,{d:`m6 6 12 12`})]})}function Xf(e){return{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 15 15`,width:15,height:15,fill:`none`,"aria-hidden":!0,...e}}function Zf(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function Qf(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:`currentColor`})})}function $f(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function ep(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function tp(e){return(0,j.jsx)(`svg`,{...Xf(e),children:(0,j.jsx)(`path`,{d:`M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var np=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,rp=Sl,ip=(e,t)=>n=>{if(t?.variants==null)return rp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=np(t)||np(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return rp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ap=Object.defineProperty,op=(e,t)=>ap(e,`name`,{value:t,configurable:!0}),sp=`focusScope.autoFocusOnMount`,cp=`focusScope.autoFocusOnUnmount`,lp={bubbles:!1,cancelable:!0},up=_.forwardRef(op(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=ua(i),u=ua(a),d=_.useRef(null),f=H(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:_p(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_p(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_p(s)};op(e,`handleFocusIn`),op(t,`handleFocusOut`),op(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){vp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(sp,lp);s.addEventListener(sp,l),s.dispatchEvent(t),t.defaultPrevented||(dp(xp(pp(s)),{select:!0}),document.activeElement===e&&_p(s))}return()=>{s.removeEventListener(sp,l),setTimeout(()=>{let t=new CustomEvent(cp,lp);s.addEventListener(cp,u),s.dispatchEvent(t),t.defaultPrevented||_p(e??document.body,{select:!0}),s.removeEventListener(cp,u),vp.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_p(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_p(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(W.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function dp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_p(r,{select:t}),document.activeElement!==n)return}op(dp,`focusFirst`);function fp(e){let t=pp(e);return[mp(t,e),mp(t.reverse(),e)]}op(fp,`getTabbableEdges`);function pp(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:op(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}op(pp,`getTabbableCandidates`);function mp(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):hp(r,{upTo:t})))return r}op(mp,`findVisible`);function hp(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}op(hp,`isHidden`);function gp(e){return e instanceof HTMLInputElement&&`select`in e}op(gp,`isSelectableInput`);function _p(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gp(e)&&t&&e.select()}}op(_p,`focus`);var vp=yp();function yp(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bp(e,t),e.unshift(t)},remove(t){e=bp(e,t),e[0]?.resume()}}}op(yp,`createFocusScopesStack`);function bp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}op(bp,`arrayRemove`);function xp(e){return e.filter(e=>e.tagName!==`A`)}op(xp,`removeLinks`);var Sp=Object.defineProperty,Cp=(e,t)=>Sp(e,`name`,{value:t,configurable:!0}),wp=0,Tp=null;function Ep(e){return Dp(),e.children}Cp(Ep,`FocusGuards`);function Dp(){_.useEffect(()=>{Tp||={start:Op(),end:Op()};let{start:e,end:t}=Tp;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),wp++,()=>{wp===1&&(Tp?.start.remove(),Tp?.end.remove(),Tp=null),wp=Math.max(0,wp-1)}},[])}Cp(Dp,`useFocusGuards`);function Op(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Cp(Op,`createFocusGuard`);var kp=function(){return kp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},kp.apply(this,arguments)};function Ap(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function jp(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Mp=`right-scroll-bar-position`,Np=`width-before-scroll-bar`,Pp=`with-scroll-bars-hidden`,Fp=`--removed-body-scroll-bar-size`;function Ip(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lp(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Rp=typeof window<`u`?_.useLayoutEffect:_.useEffect,zp=new WeakMap;function Bp(e,t){var n=Lp(t||null,function(t){return e.forEach(function(e){return Ip(e,t)})});return Rp(function(){var t=zp.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ip(e,null)}),i.forEach(function(e){r.has(e)||Ip(e,a)})}zp.set(n,e)},[e]),n}function Vp(e){return e}function Hp(e,t){t===void 0&&(t=Vp);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Up(e){e===void 0&&(e={});var t=Hp(null);return t.options=kp({async:!0,ssr:!1},e),t}var Wp=function(e){var t=e.sideCar,n=Ap(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,kp({},n))};Wp.isSideCarExport=!0;function Gp(e,t){return e.useMedium(t),Wp}var Kp=Up(),qp=function(){},Jp=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:qp,onWheelCapture:qp,onTouchMoveCapture:qp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ap(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Bp([n,t]),w=kp(kp({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Kp,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),kp(kp({},w),{ref:C})):_.createElement(y,kp({},w,{className:c,ref:C}),s))});Jp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jp.classNames={fullWidth:Np,zeroRight:Mp};var Yp=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Yp();return t&&e.setAttribute(`nonce`,t),e}function Zp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qp(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $p=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xp())&&(Zp(t,n),Qp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},em=function(){var e=$p();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tm=function(){var e=em();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nm={left:0,top:0,right:0,gap:0},rm=function(e){return parseInt(e||``,10)||0},im=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[rm(n),rm(r),rm(i)]},am=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nm;var t=im(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},om=tm(),sm=`data-scroll-locked`,cm=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
17
17
  .${Pp} {
18
18
  overflow: hidden ${r};
19
19
  padding-right: ${s}px ${r};