@donkit-ai/design-system 1.4.96 → 1.4.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,4 +63,4 @@ import appearance from '@donkit-ai/design-system/appearance.json';
63
63
 
64
64
  ## Version
65
65
 
66
- `1.4.96` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
66
+ `1.4.98` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
package/dist/index.cjs.js CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Fe;function ft(){if(Fe)return ve;Fe=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(r,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:t,type:r,key:i,ref:a!==void 0?a:null,props:o}}return ve.Fragment=s,ve.jsx=n,ve.jsxs=n,ve}var be={};/**
9
+ */var Fe;function mt(){if(Fe)return ve;Fe=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(r,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:t,type:r,key:i,ref:a!==void 0?a:null,props:o}}return ve.Fragment=s,ve.jsx=n,ve.jsxs=n,ve}var be={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ze;function mt(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===y?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case k:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case g:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case N:return"Portal";case v:return p.displayName||"Context";case A:return(p._context.displayName||"Context")+".Consumer";case E:var _=p.render;return p=p.displayName,p||(p=_.displayName||_.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case L:return _=p.displayName||null,_!==null?_:t(p.type)||"Memo";case F:_=p._payload,p=p._init;try{return t(p(_))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var _=!1}catch{_=!0}if(_){_=console;var I=_.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return I.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),s(p)}}function r(p){if(p===k)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===F)return"<...>";try{var _=t(p);return _?"<"+_+">":"<...>"}catch{return"<...>"}}function a(){var p=O.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(P.call(p,"key")){var _=Object.getOwnPropertyDescriptor(p,"key").get;if(_&&_.isReactWarning)return!1}return p.key!==void 0}function l(p,_){function I(){S||(S=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",_))}I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}function d(){var p=t(this.type);return $[p]||($[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function f(p,_,I,W,Q,te){var Y=I.ref;return p={$$typeof:j,type:p,key:_,props:I,_owner:W},(Y!==void 0?Y:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:d}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,_,I,W,Q,te){var Y=_.children;if(Y!==void 0)if(W)if(V(Y)){for(W=0;W<Y.length;W++)h(Y[W]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(Y);if(P.call(_,"key")){Y=t(p);var J=Object.keys(_).filter(function(he){return he!=="key"});W=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",X[Y+W]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ze;function pt(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===E?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case T:return"Fragment";case y:return"Profiler";case w:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList";case z:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case g:return"Portal";case v:return p.displayName||"Context";case S:return(p._context.displayName||"Context")+".Consumer";case k:var _=p.render;return p=p.displayName,p||(p=_.displayName||_.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case D:return _=p.displayName||null,_!==null?_:t(p.type)||"Memo";case F:_=p._payload,p=p._init;try{return t(p(_))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var _=!1}catch{_=!0}if(_){_=console;var P=_.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return P.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),s(p)}}function r(p){if(p===T)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===F)return"<...>";try{var _=t(p);return _?"<"+_+">":"<...>"}catch{return"<...>"}}function a(){var p=O.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(L.call(p,"key")){var _=Object.getOwnPropertyDescriptor(p,"key").get;if(_&&_.isReactWarning)return!1}return p.key!==void 0}function l(p,_){function P(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",_))}P.isReactWarning=!0,Object.defineProperty(p,"key",{get:P,configurable:!0})}function d(){var p=t(this.type);return A[p]||(A[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function f(p,_,P,W,Q,te){var q=P.ref;return p={$$typeof:j,type:p,key:_,props:P,_owner:W},(q!==void 0?q:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:d}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,_,P,W,Q,te){var q=_.children;if(q!==void 0)if(W)if(V(q)){for(W=0;W<q.length;W++)h(q[W]);Object.freeze&&Object.freeze(q)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(q);if(L.call(_,"key")){q=t(p);var J=Object.keys(_).filter(function(he){return he!=="key"});W=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",X[q+W]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,W,Y,J,Y),X[Y+W]=!0)}if(Y=null,I!==void 0&&(n(I),Y=""+I),i(_)&&(n(_.key),Y=""+_.key),"key"in _){I={};for(var ie in _)ie!=="key"&&(I[ie]=_[ie])}else I=_;return Y&&l(I,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,Y,I,a(),Q,te)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===F&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===j}var m=c,j=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),v=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),O=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,b=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var S,$={},C=m.react_stack_bottom_frame.bind(m,o)(),H=b(r(o)),X={};be.Fragment=k,be.jsx=function(p,_,I){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,_,I,!1,W?Error("react-stack-top-frame"):C,W?b(r(p)):H)},be.jsxs=function(p,_,I){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,_,I,!0,W?Error("react-stack-top-frame"):C,W?b(r(p)):H)}}()),be}process.env.NODE_ENV==="production"?Se.exports=ft():Se.exports=mt();var e=Se.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment",closeTab:"Close {label}"};function Be(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,r)=>s[r]!==void 0&&s[r]!==null?String(s[r]):"")}const Ie=c.createContext({strings:_e,t:(t,s)=>Be(_e[t]??t,s)});function pt({strings:t,children:s}){const n=c.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(a,o)=>Be(r[a]??_e[a]??a,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return c.useContext(Ie)}function q(){return c.useContext(Ie).strings}function Je({size:t="m",color:s="default",className:n="","aria-label":r,...a}){const o=q();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":r??o.loading,...a})}const ht={xs:12,s:14,m:16,l:20};function re({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:a,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:f,type:u="button",href:h,"aria-label":x,"aria-pressed":m,className:j="",...N}){const k=a&&!t,w=i==="loading",T=i==="success",A=i==="error",v=w||T||A,E=!!(l||d),g=n==="xs"?"s":"m",D=s==="danger"?"on-accent":"default",L=ht[n]??16,F=w?e.jsx(Je,{size:g,color:D}):T?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.Check,{size:L,strokeWidth:2.5})}):A?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.X,{size:L,strokeWidth:2.5})}):null,z=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",k&&"ds-button--icon-only",j].filter(Boolean).join(" "),y=i!=="idle"?i:void 0,O=m!==void 0?m:E?!0:void 0,P=e.jsxs(e.Fragment,{children:[v?F:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(h){const V=b=>{if(o||w){b.preventDefault();return}b.metaKey||b.ctrlKey||b.button===1||(b.preventDefault(),f==null||f(b))};return e.jsx("a",{className:z,href:o||w?void 0:h,onClick:V,"aria-label":x,"aria-disabled":o||w?"true":void 0,"aria-busy":w?"true":void 0,"aria-pressed":O,"data-state":y,"data-active":E?"true":void 0,...N,children:P})}return e.jsx("button",{type:u,className:z,disabled:o,onClick:w?void 0:f,"aria-label":x,"aria-busy":w?"true":void 0,"aria-pressed":O,"data-state":y,"data-active":E?"true":void 0,...N,children:P})}function xt({label:t,error:s,hint:n,fullWidth:r=!0,icon:a,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=q(),m=f||`input-${c.useId()}`,j=n?`${m}-hint`:void 0,N=s?`${m}-error`:void 0,k=N||j;return e.jsxs("div",{className:`ds-input-wrapper ${r?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":k,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:j,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:N,className:"ds-input-error",role:"alert",children:s})})})]})}function vt({label:t,error:s,hint:n,fullWidth:r=!0,size:a="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${r?"ds-textarea-wrapper--full":""} ${o?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${a} ${s?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function bt({label:t,value:s,onChange:n,options:r=[],placeholder:a,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=q(),x=a??h.selectOption,[m,j]=c.useState(!1),[N,k]=c.useState(!1),[w,T]=c.useState({}),[A,v]=c.useState("down"),[E,g]=c.useState(-1),D=c.useRef(null),L=c.useRef(null),F=c.useRef(null),z=c.useRef(null),y=f||`select-${c.useId()}`,O=`${y}-label`,P=o?`${y}-error`:void 0,V=150,b=(_=!1)=>{N||(k(!0),g(-1),z.current=setTimeout(()=>{var I;j(!1),k(!1),_&&((I=F.current)==null||I.focus())},V))},S=_=>{clearTimeout(z.current),k(!1);const I=_!==void 0?_:Math.max(r.findIndex(W=>W.value===s),0);g(I),j(!0)};c.useEffect(()=>()=>clearTimeout(z.current),[]);const $=()=>{var J;const _=(J=D.current)==null?void 0:J.getBoundingClientRect();if(!_)return;const I=window.innerHeight,W=I-_.bottom,Q=_.top,Y=W<300&&Q>W;v(Y?"up":"down"),T(Y?{bottom:I-_.top+4,left:_.left,width:_.width}:{top:_.bottom+4,left:_.left,width:_.width})};c.useEffect(()=>{if(m)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[m]),c.useEffect(()=>{const _=I=>{D.current&&!D.current.contains(I.target)&&L.current&&!L.current.contains(I.target)&&b()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[N]),c.useEffect(()=>{var I;if(!m||E<0||!L.current)return;(I=L.current.querySelectorAll(".ds-select-option")[E])==null||I.scrollIntoView({block:"nearest"})},[E,m]);const C=_=>{switch(_.key){case"ArrowDown":_.preventDefault(),m?g(I=>Math.min(I+1,r.length-1)):S();break;case"ArrowUp":_.preventDefault(),m?g(I=>Math.max(I-1,0)):S(r.length-1);break;case"Home":m&&(_.preventDefault(),g(0));break;case"End":m&&(_.preventDefault(),g(r.length-1));break;case"Enter":case" ":_.preventDefault(),m?E>=0&&(n==null||n(r[E].value),b(!0)):S();break;case"Escape":m&&(_.preventDefault(),b(!0));break;case"Tab":m&&b(!1);break}},H=r.find(_=>_.value===s),X=l==="xs"?U[1]:l==="small"?U[2]:U[3],p=m&&e.jsx("div",{ref:L,"data-ds-portal":"",role:"listbox","aria-labelledby":t?O:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${A}`,N&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:w,children:r.map((_,I)=>e.jsx("button",{id:`${y}-opt-${I}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===_.value,className:["ds-select-option",`ds-select-option--${l}`,s===_.value&&"ds-select-option--selected",I===E&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(_.value),b(!0)},children:_.label},_.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:O,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:D,children:e.jsxs("button",{ref:F,type:"button",id:y,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&E>=0?`${y}-opt-${E}`:void 0,"aria-labelledby":t?O:void 0,"aria-invalid":o?"true":"false","aria-describedby":P,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?b():S())},onKeyDown:C,disabled:d,...u,children:[e.jsx("span",{className:H?"":"ds-select-placeholder",children:(H==null?void 0:H.label)||x}),e.jsx(B.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${m&&A==="down"?"ds-select-icon--open":""} ${m&&A==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:P,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ee.createPortal(p,document.body)]})}function _t({label:t,value:s=0,onChange:n,min:r=0,max:a=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=q(),j=()=>{if(l)return;const v=Math.min(Number(s)+o,a);n==null||n(v)},N=()=>{if(l)return;const v=Math.max(Number(s)-o,r);n==null||n(v)},k=v=>{if(l)return;const E=v.target.value;if(E===""){n==null||n(r);return}const g=Number(E);if(!isNaN(g)){const D=Math.min(Math.max(g,r),a);n==null||n(D)}},w=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),T=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),A=i==="xs"?U[1]:i==="small"?U[2]:U[3];return e.jsxs("div",{className:w,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:T,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:N,disabled:l||s<=r,"aria-label":u??m.decrease,children:e.jsx(B.Minus,{size:A,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:k,min:r,max:a,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:j,disabled:l||s>=a,"aria-label":h??m.increase,children:e.jsx(B.Plus,{size:A,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function jt({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:a,href:o,disabled:i=!1,className:l="",...d}){const u=(r?"interactive":n)==="interactive"||a||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const j=N=>{if(i){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),a==null||a(N))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:j,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&a?"button":"div",m=u&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!a?"article":void 0,...m,...d,children:t})}function Nt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function wt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function gt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function yt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function kt({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ze({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function De({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:r,...a}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=r||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:i,...a,children:t})}const Et={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle},Rt=c.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:i,...l},d){const f=q(),u=Et[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:U[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[r&&e.jsx("div",{className:"ds-alert__title",children:r}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),a&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:a,"aria-label":i??f.closeAlert,children:e.jsx(B.X,{size:U[3],strokeWidth:1.5})})]})}),Tt="data-ds-portal";function Le(t){var n;const s=((n=t.composedPath)==null?void 0:n.call(t)[0])??t.target;return s instanceof Element?s:s instanceof Node?s.parentElement:null}function Pe(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${Tt}]`);return!!(n&&n!==s)}const St=200;function $t({children:t,title:s,onClose:n,size:r="m",scrollable:a=!1,subHeader:o,closeLabel:i,...l}){const d=q(),f=c.useRef(null),u=c.useRef(null),h=c.useId(),[x,m]=c.useState(!1),j=c.useRef(null),N=()=>{!n||x||(m(!0),j.current=setTimeout(()=>{m(!1),n()},St))};c.useEffect(()=>()=>clearTimeout(j.current),[]),c.useEffect(()=>{const v=g=>{g.key==="Escape"&&N()},E=g=>{var L;const D=Le(g);D&&((L=u.current)!=null&&L.contains(D)||Pe(D,f.current)||N())};return document.addEventListener("keydown",v),document.addEventListener("mousedown",E),()=>{document.removeEventListener("keydown",v),document.removeEventListener("mousedown",E)}},[n,x]);const k=c.Children.toArray(t),w=k.find(v=>(v==null?void 0:v.type)===de),T=k.filter(v=>(v==null?void 0:v.type)!==de),A=e.jsx("div",{className:["ds-modal-overlay",x&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,ref:f,"data-ds-portal":"",children:e.jsxs("div",{className:[`ds-modal ds-modal--${r}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),"data-surface":"2",ref:u,role:"dialog","aria-modal":"true","aria-labelledby":s?h:void 0,children:[n&&e.jsx(re,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:N,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:h,className:"ds-modal__title",children:s}),o&&e.jsx("div",{className:"ds-modal__subheader",children:o})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:T}),w]})});return typeof document>"u"?A:ee.createPortal(A,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const At=320;function Bt({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const i=q(),l=c.useRef(null),d=c.useRef(null),f=c.useId(),[u,h]=c.useState(!1),x=c.useRef(null),m=()=>{!n||u||(h(!0),x.current=setTimeout(()=>{h(!1),n()},At))};c.useEffect(()=>()=>clearTimeout(x.current),[]),c.useEffect(()=>{const T=v=>{v.key==="Escape"&&m()},A=v=>{var g;const E=Le(v);E&&((g=d.current)!=null&&g.contains(E)||Pe(E,l.current)||m())};return document.addEventListener("keydown",T),document.addEventListener("mousedown",A),()=>{document.removeEventListener("keydown",T),document.removeEventListener("mousedown",A)}},[n,u]);const j=c.Children.toArray(t),N=j.find(T=>(T==null?void 0:T.type)===de),k=j.filter(T=>(T==null?void 0:T.type)!==de),w=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,ref:l,"data-ds-portal":"",children:e.jsxs("div",{ref:d,className:["ds-bottom-sheet",u&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),"data-surface":"2",role:"dialog","aria-modal":"true","aria-labelledby":s?f:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(re,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:m,"aria-label":a??i.close}),(s||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:f,className:"ds-bottom-sheet__title",children:s}),r&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:r})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:k}),N]})});return typeof document>"u"?w:ee.createPortal(w,document.body)}function Qe({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="s",className:i="",...l}){const d=q(),f=s??d.code,[u,h]=c.useState(n),x=r!==void 0,m=x?r:u,j=()=>{x?a==null||a(!r):h(k=>!k)},N=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:N,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:j,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(B.ChevronDown,{size:U[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function It({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:a=!1,...o}){const i=q(),l=r??i.code;return s?n?e.jsx(Qe,{title:l,defaultExpanded:a,...o,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...o,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...o,children:t})}function Dt({href:t,children:s,onClick:n,target:r,rel:a,...o}){const l=r==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:l,...o,children:s})}function Lt({children:t,size:s="m",variant:n="ghost",...r}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...r,children:c.Children.map(t,a=>c.isValidElement(a)?c.cloneElement(a,{size:s,variant:n}):a)})}function Pt({children:t,selected:s=!1,onClick:n,size:r="m",variant:a="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${a}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function Ct({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Mt({tabs:t,active:s,onChange:n,onClose:r,className:a="",...o}){const{t:i}=ue();return e.jsx("div",{className:["ds-browser-tabs",a].filter(Boolean).join(" "),role:"tablist",...o,children:t.map(l=>{const d=l.id===s,f=!!l.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:l.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(l.id),children:[l.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:l.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:l.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":i("closeTab",{label:l.label}),onClick:u=>{u.stopPropagation(),r==null||r(l.id)},children:e.jsx(B.X,{size:12,strokeWidth:2})}):null]},l.id)})})}function Ft({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function zt({icon:t,title:s,subtitle:n,meta:r,onClick:a,className:o="",...i}){const l=r==null?[]:Array.isArray(r)?r:[r],d=["ds-list-row",!t&&"ds-list-row--no-icon",a&&"ds-list-row--interactive",o].filter(Boolean).join(" "),f=e.jsxs(e.Fragment,{children:[t?e.jsx("span",{className:"ds-list-row__icon","aria-hidden":!0,children:t}):null,e.jsxs("span",{className:"ds-list-row__name",children:[e.jsx("span",{className:"ds-list-row__title",children:s}),n?e.jsx("span",{className:"ds-list-row__subtitle",children:n}):null]}),l.map((u,h)=>e.jsx("span",{className:"ds-list-row__meta",children:u},h))]});return a?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:a,...i,children:f}):e.jsx("div",{role:"listitem",className:d,...i,children:f})}function Ot({options:t,value:s,onChange:n,size:r="m",disabled:a=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const j=o.current.getBoundingClientRect(),N=m.getBoundingClientRect(),k=N.left-j.left,w=N.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=k+"px",i.current.style.width=w+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const T=o.current.querySelector(`[data-value="${s}"]`);if(!T)return;const A=o.current.getBoundingClientRect(),v=T.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=v.left-A.left+"px",i.current.style.width=v.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&n(m.value),"aria-pressed":s===m.value,disabled:a,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function ge({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="m",...i}){const[l,d]=c.useState(n),f=r!==void 0,u=f?r:l,h=()=>{f?a==null||a(!r):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(B.ChevronDown,{size:U[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const ae=8,fe=8;function Wt(t,s,n){const r=window.innerWidth;let a,o;switch(t){case"top":a=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":a=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":a=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":a=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:a=s.bottom+ae,o=s.left}const i=Math.max(fe,Math.min(r-n.width-fe,o)),l=o-i;return{top:a,left:i,arrowOffset:l}}function Ht(t,s,n){const r=window.innerWidth,a=window.innerHeight;if(t.top>=s+ae+fe)return"top";if(a-t.bottom>=s+ae+fe)return"bottom";if(r-t.right>=n+ae+fe)return"right";if(t.left>=n+ae+fe)return"left";const o=Math.max(t.top,a-t.bottom,t.left,r-t.right);return o===t.top?"top":o===a-t.bottom?"bottom":o===r-t.right?"right":"left"}function ye({children:t,content:s,position:n,...r}){const[a,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),m=()=>{if(!u.current||!h.current)return;const N=u.current.getBoundingClientRect(),k=h.current.getBoundingClientRect(),w=n||Ht(N,k.height,k.width),{top:T,left:A,arrowOffset:v}=Wt(w,N,k);f(w),l({position:"fixed",top:T,left:A,visibility:"visible","--arrow-offset":`${v}px`})};if(c.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const N=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(N),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[a,n]),c.useEffect(()=>{if(!a)return;const N=k=>{u.current&&!u.current.contains(k.target)&&o(!1)};return document.addEventListener("touchstart",N),()=>document.removeEventListener("touchstart",N)},[a]),!s)return t;const j=a&&e.jsx("div",{ref:h,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:i,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||o(!0)},onMouseLeave:()=>{x.current||o(!1)},onTouchStart:()=>{x.current=!0,o(N=>!N)},...r,children:[t,typeof document<"u"&&ee.createPortal(j,document.body)]})}const Oe=8,Ne=8,Ut=140;function We(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function Vt({label:t,children:s,mode:n="click",avatar:r,name:a,handle:o,description:i,actions:l,className:d="",popoverClassName:f="",...u}){const h=c.useId(),x=c.useRef(null),m=c.useRef(null),j=c.useRef(null),[N,k]=c.useState(!1),[w,T]=c.useState(null),A=s!=null,v=a||t||"",E=We(t||a),g=We(o),D=c.useCallback(()=>{j.current!=null&&(window.clearTimeout(j.current),j.current=null)},[]),L=c.useCallback(()=>{D(),k(!0)},[D]),F=c.useCallback(()=>{D(),j.current=window.setTimeout(()=>k(!1),Ut)},[D]),z=c.useCallback(()=>{const P=x.current,V=m.current;if(!P)return;const b=P.getBoundingClientRect(),S=(V==null?void 0:V.offsetHeight)??160,$=(V==null?void 0:V.offsetWidth)??260;let C=b.bottom+Oe;C+S>window.innerHeight-Ne&&(C=Math.max(Ne,b.top-S-Oe));const H=Math.max(Ne,Math.min(b.left,window.innerWidth-$-Ne));T({top:C,left:H})},[]);c.useLayoutEffect(()=>{N&&z()},[N,z]),c.useEffect(()=>{if(!N)return;const P=()=>z(),V=S=>{S.key==="Escape"&&k(!1)},b=S=>{var C,H;if(n==="hover")return;const $=S.target;(C=m.current)!=null&&C.contains($)||(H=x.current)!=null&&H.contains($)||k(!1)};return window.addEventListener("scroll",P,!0),window.addEventListener("resize",P),document.addEventListener("keydown",V),document.addEventListener("mousedown",b),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P),document.removeEventListener("keydown",V),document.removeEventListener("mousedown",b)}},[N,z,n]),c.useEffect(()=>()=>D(),[D]);const y=n==="hover"?{onMouseEnter:L,onMouseLeave:F}:{},O=N?ee.createPortal(e.jsxs("div",{ref:m,id:h,role:"dialog","aria-label":v||E||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:w?{top:w.top,left:w.left}:{top:-9999,left:-9999,visibility:"hidden"},...y,children:[(r||v||g)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(v||g)&&e.jsxs("div",{className:"ds-mention__meta",children:[v?e.jsx("span",{className:"ds-mention__name",children:v}):null,g?e.jsx("span",{className:"ds-mention__handle",children:g}):null]})]}),i?e.jsx("p",{className:"ds-mention__desc",children:i}):null,l?e.jsx("div",{className:"ds-mention__actions",onClick:()=>k(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",A&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":N,"aria-haspopup":"dialog","aria-label":A&&(E||v)||void 0,"aria-controls":N?h:void 0,onClick:P=>{var V;if((V=u.onClick)==null||V.call(u,P),!P.defaultPrevented){if(P.preventDefault(),P.stopPropagation(),n==="hover"){L();return}k(b=>!b)}},...y,children:A?s:E}),typeof document<"u"?O:null]})}function Xt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function Yt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`checkbox-${c.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,r&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(B.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function qt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,name:o,value:i,id:l,...d}){const f=l||`radio-${c.useId()}`,u=["ds-radio",`ds-radio--${n}`,r&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:h=>s==null?void 0:s(h.target.checked),disabled:r,name:o,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),a&&e.jsx("span",{className:"ds-radio__label",children:a})]})}function et({width:t,height:s,shape:n="rect",aspectRatio:r,className:a="",style:o={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,a].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:r,...o},"aria-hidden":"true",...i})}function Gt({lines:t=1,lastLineWidth:s="70%",gap:n,className:r="",style:a={},...o}){return e.jsx("span",{className:["ds-skeleton-text",r].filter(Boolean).join(" "),style:{gap:n,...a},"aria-hidden":"true",...o,children:Array.from({length:t},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}et.Text=Gt;function Kt(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function Jt(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function Zt({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...i}){const l=Kt(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Jt(t)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function Qt({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:a="",style:o={},...i}){const l={...r?{maxHeight:r}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",r?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,a].filter(Boolean).join(" "),...i,children:t})})}function es({children:t,...s}){return e.jsx("thead",{...s,children:t})}function ts({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function ss({children:t,interactive:s,selected:n,subheader:r,exiting:a,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function ns({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function rs({children:t,align:s="left",sortDir:n,onSort:r,width:a,className:o="",style:i={},...l}){const d=!!r||n!==void 0,f=n==="asc"?B.ChevronUp:n==="desc"?B.ChevronDown:B.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",o].filter(Boolean).join(" "),onClick:r,style:{width:a,...i},...l,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function as({children:t,align:s="left",secondary:n,muted:r,truncate:a,nowrap:o,className:i="",...l}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",r?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function os({icon:t,title:s,description:n,action:r,size:a="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,o].filter(Boolean).join(" "),...i,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),r&&e.jsx("div",{className:"ds-empty-state__action",children:r})]})}function is({label:t,hint:s,error:n,required:r=!1,disabled:a=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":n?"error":void 0,"data-required":r?"":void 0,"data-disabled":a?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function ls({label:t,value:s,delta:n,size:r="m",inline:a=!1,className:o="",style:i,...l}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${r}`,a&&"ds-stat--inline",o].filter(Boolean).join(" "),style:i,...l,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function cs({children:t,separator:s="/","aria-label":n,className:r="",style:a,...o}){const i=q(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??i.breadcrumb,style:a,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function ds({page:t,total:s,onChange:n,siblings:r=1,"aria-label":a,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=q(),{t:h}=ue(),x=us(t,s,r);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"aria-label":a??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":o??u.previousPage,children:e.jsx(B.ChevronLeft,{size:16})}),x.map((m,j)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${j}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":i??u.nextPage,children:e.jsx(B.ChevronRight,{size:16})})]})}function us(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const r=Math.max(2,t-n),a=Math.min(s-1,t+n),o=[1];r>2&&o.push("…");for(let i=r;i<=a;i++)o.push(i);return a<s-1&&o.push("…"),o.push(s),o}const fs=300;function ms({children:t,title:s,onClose:n,subHeader:r,side:a="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=q(),x=c.useRef(null),m=c.useId(),[j,N]=c.useState(!1),k=c.useRef(null),w=()=>{!n||j||(N(!0),k.current=setTimeout(()=>{N(!1),n()},fs))};c.useEffect(()=>()=>clearTimeout(k.current),[]),c.useEffect(()=>{const g=L=>{L.key==="Escape"&&w()},D=L=>{var z,y;const F=Le(L);F&&((z=d==null?void 0:d.current)!=null&&z.contains(F)||(y=x.current)!=null&&y.contains(F)||Pe(F,null)||w())};return document.addEventListener("keydown",g),document.addEventListener("mousedown",D),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",D)}},[n,j,d]);const T=c.Children.toArray(t),A=T.find(g=>(g==null?void 0:g.type)===$e||(g==null?void 0:g.type)===de),v=T.filter(g=>(g==null?void 0:g.type)!==$e&&(g==null?void 0:g.type)!==de),E=e.jsx("div",{className:["ds-side-page-overlay",j&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":a,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",j&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":a,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(re,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:w,"aria-label":f??h.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,className:"ds-side-page__title",children:s}),r&&e.jsx("div",{className:"ds-side-page__subheader",children:r})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:v}),A]})});return typeof document>"u"?E:ee.createPortal(E,document.body)}function $e({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ke=c.createContext(!1),ps=c.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:a,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&a){a();return}!n&&o&&o()}},[n,a,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:r},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&a?"":void 0,"data-collapsible":!n&&o?"":void 0,...l,children:s})})});function hs({icon:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),j=c.useContext(ke),w={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,"aria-label":x?s:void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...h},T=i!=null,A=m==="left"?"right":"left",v=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&T&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!T||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&T&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!T||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),E=a?e.jsx("a",{href:r?void 0:a,...w,children:v}):e.jsx("button",{type:"button",...w,children:v});return x&&!j?e.jsx(ye,{content:s,position:A,children:E}):E}function xs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function vs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function bs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function _s({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function js({children:t,label:s,defaultOpen:n=!0,className:r="",...a}){const{collapsed:o}=c.useContext(pe),i=q(),l=s??i.recents,[d,f]=c.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",r].filter(Boolean).join(" "),...a,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:l}),e.jsx(B.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||o)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const Ns=c.forwardRef(function({as:s="button",avatar:n,label:r,className:a="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ke),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",a].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?r:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(ye,{content:r,position:u,children:m}):m});function ws({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ke),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0},...l},j=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),N=f==="left"?"right":"left",k=a?e.jsx("a",{href:r?void 0:a,...m,children:j}):e.jsx("button",{type:"button",...m,children:j});return d&&!u?e.jsx(ye,{content:s,position:N,children:k}):k}const He=240,Ue=6,Ve=8;function gs({trigger:t,title:s,children:n,open:r,onOpenChange:a,defaultOpen:o=!1,closeLabel:i}){const l=q(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=r!==void 0,x=h?r:f,[m,j]=c.useState(!1),N=c.useRef(null),k=c.useRef(null),[w,T]=c.useState({}),A=c.useCallback(()=>{h?a==null||a(!0):u(!0)},[h,a]),v=c.useCallback(()=>{h?a==null||a(!1):u(!1)},[h,a]),E=c.useCallback(()=>x?v():A(),[x,A,v]),g=c.useCallback(()=>{var P;const L=N.current;if(!L)return;const F=L.getBoundingClientRect(),z=window.innerHeight,y=((P=k.current)==null?void 0:P.offsetHeight)??300,O=Math.max(Ve,Math.min(z-y-Ve,F.top));T(d==="right"?{position:"fixed",top:O,right:window.innerWidth-F.left+Ue,width:He}:{position:"fixed",top:O,left:F.right+Ue,width:He})},[d]);c.useEffect(()=>{if(!x){j(!1);return}return g(),requestAnimationFrame(()=>j(!0)),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[x,g]),c.useEffect(()=>{if(!x)return;const L=z=>{var y,O;!((y=k.current)!=null&&y.contains(z.target))&&!((O=N.current)!=null&&O.contains(z.target))&&v()},F=z=>{z.key==="Escape"&&v()};return document.addEventListener("mousedown",L),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",F)}},[x,v]);const D=x&&e.jsxs("div",{ref:k,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:w,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:v,"aria-label":i??l.close,children:e.jsx(B.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ke.Provider,{value:x,children:e.jsx("div",{ref:N,onClick:E,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(D,document.body)]})}const ys={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};function ks({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:i,...l}){const d=q(),f=ys[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:U[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:r,children:n}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":i??d.dismiss,children:e.jsx(B.X,{size:U[2],strokeWidth:1.5})})]})}function Es({trigger:t,items:s=[],open:n,onOpenChange:r,align:a="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,j=m?n:f,N=c.useRef(null),k=c.useRef(null),w=c.useRef(null),T=c.useRef(null),[A,v]=c.useState({}),E=c.useRef(null),g=150,D=()=>{if(m)r==null||r(!1);else{if(h)return;x(!0),E.current=setTimeout(()=>{u(!1),x(!1)},g)}},L=()=>{const b=!j;m?r==null||r(b):b?(clearTimeout(E.current),x(!1),u(!0)):D()},F=()=>{j||(m?r==null||r(!0):(clearTimeout(E.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(E.current),[]),c.useEffect(()=>{if(!j)return;const b=300,S=()=>{var X;const $=(X=N.current)==null?void 0:X.getBoundingClientRect();if(!$)return;const C=window.innerHeight-$.bottom,H=C<b+8&&$.top>C;v(a==="right"?H?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:H?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return S(),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[j,a]);const z=()=>{var S;const b=(S=w.current)==null?void 0:S.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};c.useEffect(()=>{if(!j)return;const b=$=>{var C,H;!((C=N.current)!=null&&C.contains($.target))&&!((H=k.current)!=null&&H.contains($.target))&&D()},S=$=>{$.key==="Escape"&&(D(),z())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",S)}},[j]),c.useEffect(()=>{if(!j||!T.current||!k.current)return;const b=y(),S=T.current==="last"?b[b.length-1]:b[0];S==null||S.focus(),T.current=null},[j]);const y=()=>k.current?[...k.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=b=>{var S,$;if(b.key==="ArrowDown")b.preventDefault(),j?(S=y()[0])==null||S.focus():(T.current="first",F());else if(b.key==="ArrowUp")if(b.preventDefault(),!j)T.current="last",F();else{const C=y();($=C[C.length-1])==null||$.focus()}},P=b=>{var C,H,X,p;const S=y(),$=S.findIndex(_=>_===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(C=S[Math.min($+1,S.length-1)])==null||C.focus();break;case"ArrowUp":b.preventDefault(),$<=0?z():(H=S[$-1])==null||H.focus();break;case"Home":b.preventDefault(),(X=S[0])==null||X.focus();break;case"End":b.preventDefault(),(p=S[S.length-1])==null||p.focus();break;case"Tab":D();break}},V=j&&e.jsx("div",{ref:k,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:A,onKeyDown:P,children:s.map((b,S)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},S);if(b.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[b.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:b.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:b.content})]},S);const $=!!b.href,C=$?"a":"button",H=$?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(C,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...H,onClick:()=>{var X;(X=b.onClick)==null||X.call(b),D()},children:[b.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:b.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:b.label}),b.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:b.shortcut})]},S)})});return e.jsxs("div",{ref:N,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:w,className:"ds-dropdown__trigger",onClick:L,onKeyDown:O,children:t}),typeof document<"u"&&ee.createPortal(V,document.body)]})}function Rs({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:a=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(a,i),d=n==="auto"?i>=70?"success":i>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!o&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${l}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Ts=t=>1-Math.pow(1-t,3),Ss=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function tt(t,{duration:s=600}={}){const[n,r]=c.useState(t),a=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(Ss()){r(t),a.current=t;return}const i=a.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);r(i+l*Ts(h)),h<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function $s({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const i=tt(t,{duration:s}).toFixed(n);return`${r}${i}${a}`}function st({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=c.useRef(null),[a,o]=c.useState(!1);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:r,inView:a}}function As({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=st({threshold:r,rootMargin:a,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const Xe={default:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};let me=[];const Ae=new Set;function nt(){Ae.forEach(t=>t([...me]))}function Bs(t){me=[...me,t],nt()}function Is(t){me=me.filter(s=>s.id!==t),nt()}function Ds(){const t=(s,n={})=>{Bs({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Ls({data:t,onDismiss:s}){const n=q(),[r,a]=c.useState(!1),o=c.useRef(null),i=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>a(!0)),t.duration>0&&(o.current=setTimeout(()=>l(),t.duration)),()=>{clearTimeout(o.current),clearTimeout(i.current)}),[]);function l(){a(!1),i.current=setTimeout(()=>s(t.id),250)}const d=Xe[t.type]??Xe.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(d,{size:U[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:l,"aria-label":n.close,children:e.jsx(B.X,{size:U[3],strokeWidth:1.5})})]})}function Ps({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...me]);return c.useEffect(()=>(Ae.add(n),()=>Ae.delete(n)),[]),!s.length||typeof document>"u"?null:ee.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Ls,{data:r,onDismiss:Is},r.id))}),document.body)}const Cs={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function rt({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:a=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),Cs[s],r]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ge,{title:h,padding:"s",defaultExpanded:a,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function at({text:t,size:s="xs",timeout:n=800,"aria-label":r,...a}){const o=q(),[i,l]=c.useState(!1),d=c.useRef(null),f=u=>{u.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),clearTimeout(d.current),d.current=setTimeout(()=>l(!1),n)})};return c.useEffect(()=>()=>clearTimeout(d.current),[]),e.jsx(re,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(B.Copy,{size:U[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:f,...a})}function Ms({content:t,streaming:s=!1,...n}){const[r,a]=c.useState(s);return c.useEffect(()=>{a(!!s)},[s]),e.jsx(ge,{expanded:r,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(B.Brain,{size:U[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ze,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(De,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Fs({count:t,current:s=0,done:n=[],onChange:r,showCounter:a=!0,className:o="","aria-label":i,...l}){const d=q(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,j=r&&(h<=s||n.includes(h)),N=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:N,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!j||h===s,onClick:()=>r==null?void 0:r(h),children:m?e.jsx(B.Check,{size:8,strokeWidth:3}):null},h)})}),a&&e.jsxs(De,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function zs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:a="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(r==null||r(t),i.current=t)},[t,r]),e.jsxs("span",{className:["ds-streaming-text",a].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Os({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:a=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,children:[r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__bubble",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...l,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Ws(t,{containerRef:s,smartPause:n=!0}={}){const r=c.useRef(!1),a=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<a.current&&(r.current=!0),l&&(r.current=!1),a.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&r.current||(o.scrollTop=o.scrollHeight))},t)}function ot({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:a=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),j=c.useRef(null),N=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const v=()=>{const E=Date.now();if(N.current>E){j.current=setTimeout(v,N.current-E);return}const g=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(g.slice(0,x.current)),x.current>=g.length?(h.current="holding",j.current=setTimeout(v,a)):j.current=setTimeout(v,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",j.current=setTimeout(v,r)):(x.current=Math.max(0,x.current-1),u(g.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),j.current=setTimeout(v,o)):j.current=setTimeout(v,r))};return j.current=setTimeout(v,260),()=>{j.current&&clearTimeout(j.current)}},[s,t,n,r,a,o]);const k=v=>{if(t.length===0)return;const E=(v%t.length+t.length)%t.length,g=t[E];m.current=E,x.current=g.length,h.current="holding",N.current=Date.now()+i,d(E),u(g)},w=()=>k(m.current+1),T=()=>k(m.current-1),A=t[l%t.length]??"";return{displayed:f,currentPrompt:A,index:l,next:w,prev:T}}let Hs=0;function Us({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:a,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:j,acceptImage:N,acceptFile:k,maxImages:w,maxImageSize:T,leftSlot:A,rightSlot:v,className:E="",...g}){const D=q(),{t:L}=ue(),F=c.useRef(null),z=c.useRef(null),y=c.useRef(0),[O,P]=c.useState(!1),[V,b]=c.useState([]),S=c.useRef(new Set),$=l??D.promptPlaceholder,C=R=>{const M=++Hs;b(K=>[...K,{id:M,msg:R}]);const G=setTimeout(()=>{S.current.delete(G),b(K=>K.filter(Z=>Z.id!==M))},6e3);S.current.add(G)};c.useEffect(()=>{const R=S.current;return()=>R.forEach(clearTimeout)},[]);const H=R=>b(M=>M.filter(G=>G.id!==R)),X=R=>R.type.startsWith("image/"),p=()=>!0,_=N??X,I=k??p,W=R=>{const M=[],G=[],K=[],Z=[];let se=0,le=w!=null?w-((u==null?void 0:u.length)??0):1/0;for(const ne of R)_(ne)?T&&ne.size>T?K.push(ne.name):le>0?(M.push(ne),le--):se++:I(ne)?G.push(ne):Z.push(ne.name);return{imageFiles:M,docFiles:G,tooLarge:K,skipped:Z,limitExceeded:se}},Q=R=>{const M=T?L("fileTooLargeMaxHint",{maxMb:T/1024/1024}):"";C(L("fileTooLarge",{maxHint:M,names:R.join(", ")}))},te=R=>{const{imageFiles:M,docFiles:G,tooLarge:K,skipped:Z,limitExceeded:se}=W(R);K.length&&Q(K),Z.length&&C(L("filesSkipped",{names:Z.join(", ")})),se&&C(L("maxImages",{n:w})),x&&M.length&&x(M);const le=G.concat(x?[]:M);h&&le.length&&h(le)};c.useEffect(()=>{const R=z.current;R&&(R.style.height="auto",R.style.height=`${Math.min(R.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const R=M=>{var K,Z,se;if(o||i)return;const G=(K=M.target)==null?void 0:K.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Z=M.target)!=null&&Z.isContentEditable||M.ctrlKey||M.metaKey||M.altKey||M.key.length!==1&&M.key!=="Backspace"&&M.key!=="Delete"||(se=z.current)==null||se.focus()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o,i]);const Y=R=>{R.preventDefault(),y.current++,R.dataTransfer.types.includes("Files")&&P(!0)},J=R=>{R.preventDefault(),y.current--,y.current===0&&P(!1)},ie=R=>R.preventDefault(),he=R=>{R.preventDefault(),y.current=0,P(!1);const M=Array.from(R.dataTransfer.files);M.length&&te(M)},Ee=R=>{const M=Array.from(R.target.files||[]);F.current&&(F.current.value=""),M.length&&te(M)},lt=R=>{var ne;if(!x)return;const M=(ne=R.clipboardData)==null?void 0:ne.items;if(!M)return;const G=[];for(const ut of M){const Me=ut.getAsFile();Me&&G.push(Me)}if(G.length===0)return;const{imageFiles:K,tooLarge:Z,skipped:se,limitExceeded:le}=W(G);Z.length&&Q(Z),se.length&&C(L("filesSkipped",{names:se.join(", ")})),le&&C(L("maxImages",{n:w})),K.length&&(R.preventDefault(),x(K))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=ot({prompts:d??[],enabled:xe}),ct=R=>{if(xe){if(R.key==="ArrowDown"||R.key==="ArrowRight"){R.preventDefault(),je.next();return}if(R.key==="ArrowUp"||R.key==="ArrowLeft"){R.preventDefault(),je.prev();return}if(R.key==="Tab"&&!R.shiftKey){R.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(R)},dt=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Ce=h||x;return e.jsxs("div",{className:["ds-prompt-input",E].filter(Boolean).join(" "),...g,children:[Ce&&e.jsx("input",{ref:F,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:Ee}),e.jsxs("div",{className:["ds-prompt-input__box",O&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:Y,onDragLeave:J,onDragOver:ie,onDrop:he,children:[O&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:D.dropFilesHere}),e.jsx("textarea",{ref:z,value:t,onChange:R=>s==null?void 0:s(R.target.value),onKeyDown:ct,onPaste:lt,placeholder:xe?"":$,disabled:o||i,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((R,M)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:R.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>j==null?void 0:j(M),"aria-label":D.removeImage,type:"button",children:e.jsx(B.X,{size:12,strokeWidth:2})})]},M))}),V.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:V.map(R=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:R.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>H(R.id),"aria-label":D.dismiss,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]},R.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((R,M)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[R.uploading?e.jsx(B.Loader,{size:U[1],strokeWidth:1.5,className:"spin"}):e.jsx(B.Paperclip,{size:U[1],strokeWidth:1.5}),R.filename,R.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:D.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(M),"aria-label":D.removeAttachment,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]})},M))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Ce&&e.jsx(re,{variant:"ghost",size:"xs",icon:e.jsx(B.Paperclip,{size:U[2],strokeWidth:1.5}),"aria-label":D.attachFiles,onClick:()=>{var R;return(R=F.current)==null?void 0:R.click()}}),A,v,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(B.Square,{size:U[2],strokeWidth:1.5}),onClick:r,"aria-label":D.stop}):e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(B.ArrowUp,{size:U[2],strokeWidth:1.5}),onClick:n,disabled:!dt,"aria-label":D.send})]})]})]})}const Ye={fast:0,standard:1,premium:2},qe={fast:"data-5",standard:"data-3",premium:"data-6"};function Vs({models:t=[],value:s,onChange:n,size:r="xs",minTier:a,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[j,N]=c.useState({}),k=r==="s"?"s":"xs",w=t.filter(y=>!a||y.name==="auto"?!0:(Ye[y.tier]??1)>=(Ye[a]??1)),T=w.find(y=>y.name==="auto"),A=w.filter(y=>y.name!=="auto"),v=t.find(y=>y.name===s),g=new Set(A.map(y=>y.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const y=320,O=()=>{var C;const b=(C=x.current)==null?void 0:C.getBoundingClientRect();if(!b)return;const S=window.innerHeight-b.bottom,$=S<y+8&&b.top>S;N({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:b.left,...$?{bottom:window.innerHeight-b.top+4,top:"auto"}:{top:b.bottom+4,bottom:"auto"}})};O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O);const P=b=>{var S,$;!((S=h.current)!=null&&S.contains(b.target))&&!(($=m.current)!=null&&$.contains(b.target))&&u(!1)},V=b=>{b.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",V),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),document.removeEventListener("mousedown",P),document.removeEventListener("keydown",V)}},[f]);const D=y=>{n==null||n(y),u(!1)},L=y=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",y.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>D(y.name),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:y.icon||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:y.displayName||y.name}),g&&y.tier&&e.jsx(ce,{size:"xs",variant:qe[y.tier]||"default",children:y.tier})]},y.name),F=()=>!i||!g?A.map(L):["fast","standard","premium"].flatMap(y=>{const O=A.filter(P=>P.tier===y);return O.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":y,children:y.charAt(0).toUpperCase()+y.slice(1)},`lbl-${y}`),...O.map(L)]:[]}),z=f&&e.jsxs("div",{ref:m,className:`ds-model-picker__menu ds-model-picker__menu--${k} ds-scrollable`,"data-ds-portal":"",style:j,children:[o&&T&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>D("auto"),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:e.jsx(B.Zap,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),A.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),F()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:`ds-model-picker__trigger ds-model-picker__trigger--${k}`,onClick:()=>u(y=>!y),"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"ds-model-picker__icon",children:(v==null?void 0:v.icon)||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(v==null?void 0:v.displayName)||(v==null?void 0:v.name)||s}),g&&(v==null?void 0:v.tier)&&e.jsx(ce,{size:"xs",variant:qe[v.tier]||"default",children:v.tier})]}),typeof document<"u"&&ee.createPortal(z,document.body)]})}const Xs=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function Ys(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function qs({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:a}){const o=q(),{t:i}=ue(),l=n??o.sources,[d,f]=c.useState(!1),u=Ys(t),h=u.length>r,x=d?u:u.slice(0,r),m=t.some(w=>w.snippet),j=w=>w!=null&&w.length?i("pageAbbrev",{pages:w.join(", ")}):null,N=i("moreSources",{n:u.length-r}),k=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:k,children:[x.map(w=>{const T=w.items.map(E=>E.page).filter(Boolean),A=j(T),v=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${v?" ds-sources-panel__compact-row--clickable":""}`,onClick:v?()=>a(w.items[0]):void 0,children:[e.jsx(B.FileText,{size:U[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:w.filename}),A&&e.jsx("span",{className:"ds-sources-panel__pages",children:A})]},w.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]}):e.jsxs("div",{className:k,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(w=>{const T=w.items.map(E=>E.page).filter(Boolean),A=j(T),v=!!a;return m?e.jsx(ge,{title:e.jsx(Xs,{filename:w.filename,pagesLabel:A}),padding:"s",children:w.items.map((E,g)=>e.jsx("div",{className:`ds-sources-panel__snippet${v?" ds-sources-panel__snippet--clickable":""}`,onClick:v?()=>a(E):void 0,children:E.snippet??i("pageAbbrev",{pages:E.page})},g))},w.filename):e.jsxs("div",{className:`ds-sources-panel__row${v?" ds-sources-panel__row--clickable":""}`,onClick:v?()=>a(w.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:w.filename}),A&&e.jsx("span",{className:"ds-sources-panel__pages",children:A})]},w.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]})}function Ge(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Gs({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:a=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=o?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(r||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[r&&e.jsxs("span",{children:[Ge(t)," / ",Ge(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Ke=5;function Ks(t){return t<.34?"low":t<.67?"medium":"high"}function Js({value:t=0,size:s="xs",showLabel:n="none",layout:r="inline"}){const a=Math.max(0,Math.min(1,t)),o=Math.round(a*Ke),i=Ks(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,r==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Ke},(l,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<o?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const Zs={add:"+",remove:"-",context:" "};function Re({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:Zs[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function Qs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:a,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=a?{maxHeight:a,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Re,{line:d,lineNumbers:r},f))})]})}function it({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:a,dislikeLabel:o,...i}){const l=q(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",r].filter(Boolean).join(" "),...i,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":a??l.like,"aria-pressed":t==="liked",children:e.jsx(B.ThumbsUp,{size:U[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":o??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(B.ThumbsDown,{size:U[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function en(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,r=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(a-864e5);if(s>=a)return r;if(s>=o)return`Yesterday ${r}`;const i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${r}`}function tn({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:a,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(a||o),f=!!s,u=n?en(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(it,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(at,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function sn({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function nn({variant:t="light",glow:s,mask:n=!0,style:r,...a}){const o=t==="dark",i=s??o,l=o?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=o?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...i&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...r},...a,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function rn({children:t,axis:s="y",style:n,className:r="",...a}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${r}`,style:{...o,...n},...a,children:t})}const Te=280,an=22,on=14,oe=8,we=6,ln=200;function cn(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function dn(t,s,n,r){const a=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+r+oe)return"bottom";if(t.top>=s+r+oe)return"top";if(a-t.right>=n+r+oe)return"right";if(t.left>=n+r+oe)return"left";const i=Math.max(t.top,o-t.bottom,a-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===a-t.right?"right":"left"}function un(t,s,n,r,a){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-a,d=s.left+s.width/2-r/2;break;case"bottom":l=s.bottom+a,d=s.left+s.width/2-r/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-r-a;break;default:l=s.top+s.height/2-n/2,d=s.right+a}const f=Math.max(oe,Math.min(o-r-oe,d)),u=Math.max(oe,Math.min(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function fn({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:a,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const j=q(),{t:N}=ue(),k=d??j.next,w=f??j.back,T=u??j.skipTour,A=h??j.done,v=c.useRef(null),E=c.useRef(t),g=c.useRef(s),D=c.useRef(l);E.current=t,g.current=s,D.current=l;const[L,F]=c.useState(!1),[z,y]=c.useState({position:"fixed",visibility:"hidden",width:Te}),[O,P]=c.useState("bottom"),[V,b]=c.useState(null),S=c.useRef(!1),$=t[s],C=s===t.length-1,H=c.useCallback(()=>{const X=E.current[g.current];if(!X||!v.current)return;const p=cn(X.target);if(!p)return;const _=p.getBoundingClientRect(),W=v.current.getBoundingClientRect().height||160,Q=Te,te=D.current?an:on,Y=X.position||dn(_,W,Q,te),{top:J,left:ie,arrowOffset:he,arrowOffsetY:Ee}=un(Y,_,W,Q,te);P(Y),y({position:"fixed",top:J,left:ie,width:Te,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Ee}px`}),b({top:_.top-we,left:_.left-we,width:_.width+we*2,height:_.height+we*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",H,!0),window.addEventListener("resize",H);const X=requestAnimationFrame(()=>{H(),F(!0),S.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[]),c.useEffect(()=>{if(!S.current)return;F(!1);const X=setTimeout(()=>{y(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{H(),F(!0)})},ln+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{L&&v.current&&v.current.focus({preventScroll:!0})},[L]),c.useEffect(()=>{const X=p=>{p.key==="Escape"&&a()};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),c.useEffect(()=>{if(!L)return;const X=p=>{if(p.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!_.length)return;const I=_[0],W=_[_.length-1];p.shiftKey&&document.activeElement===I?(p.preventDefault(),W.focus()):!p.shiftKey&&document.activeElement===W&&(p.preventDefault(),I.focus())};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[L]),!$||typeof document>"u"?null:ee.createPortal(e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",L&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:V,"aria-hidden":"true"}),e.jsxs("div",{ref:v,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??N("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${O}`,L&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:z,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:a,"aria-label":T,children:e.jsx(B.X,{size:16,strokeWidth:2})}),$.title&&e.jsx("div",{className:"ds-coachmark__title",children:$.title}),e.jsx("div",{className:"ds-coachmark__body",children:$.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(re,{variant:"secondary",size:"s",state:m,onClick:r,children:w}),e.jsx(re,{variant:"primary",size:"s",state:x,onClick:C?o:n,children:C?A:k})]})]})]})]}),document.body)}function mn(t,s={}){const{storageKey:n}=s,[r,a]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:o,start:()=>{l()||(a(0),i(!0))},next:()=>a(f=>Math.min(f+1,t.length-1)),back:()=>a(f=>Math.max(f-1,0)),skip:d,finish:d}}function pn(){const t=c.useRef(null),s=c.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const r=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",r)};n.addEventListener("animationend",r)},[]);return{ref:t,shake:s}}exports.Accordion=ge;exports.Alert=Rt;exports.AnimatedNumber=$s;exports.Avatar=Zt;exports.Badge=ce;exports.Banner=ks;exports.BottomSheet=Bt;exports.Breadcrumb=cs;exports.BrowserPane=Ct;exports.BrowserTabs=Mt;exports.Button=re;exports.Card=jt;exports.ChatMessage=Os;exports.Checkbox=Yt;exports.Coachmark=fn;exports.Code=It;exports.CodeAccordion=Qe;exports.ConfidenceBar=Js;exports.CopyButton=at;exports.DiffView=Qs;exports.Dropdown=Es;exports.EmptyState=os;exports.EngineerGrid=nn;exports.FormField=is;exports.H1=Nt;exports.H2=wt;exports.H3=gt;exports.H4=yt;exports.InView=As;exports.Input=xt;exports.Link=Dt;exports.List=Ft;exports.ListRow=zt;exports.LocaleProvider=pt;exports.Mention=Vt;exports.MessageFeedback=it;exports.MessageFooter=tn;exports.Modal=$t;exports.ModalFooter=de;exports.ModelPicker=Vs;exports.NavRail=ps;exports.NavRailAgent=ws;exports.NavRailBody=xs;exports.NavRailCustomItem=Ns;exports.NavRailDivider=_s;exports.NavRailFlyout=gs;exports.NavRailFooter=bs;exports.NavRailHeader=vs;exports.NavRailItem=hs;exports.NavRailRecents=js;exports.P1=kt;exports.P2=Ze;exports.P3=De;exports.Pagination=ds;exports.ProgressBar=Rs;exports.PromptInput=Us;exports.Radio=qt;exports.ReasoningBlock=Ms;exports.Scrollable=rn;exports.SegmentedControl=Ot;exports.Select=bt;exports.SidePage=ms;exports.SidePageFooter=$e;exports.Skeleton=et;exports.SourcesPanel=qs;exports.Spinner=Je;exports.Stat=ls;exports.StepIndicator=Fs;exports.Stepper=_t;exports.StreamingText=zs;exports.Tab=Pt;exports.Table=Qt;exports.TableBody=ts;exports.TableHead=es;exports.TableRow=ss;exports.TableSubheaderRow=ns;exports.Tabs=Lt;exports.Td=as;exports.Textarea=vt;exports.Th=rs;exports.ThinkingDot=sn;exports.ToastContainer=Ps;exports.Toggle=Xt;exports.TokenCounter=Gs;exports.ToolCallBubble=rt;exports.ToolCallCard=rt;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=U;exports.useAnimatedNumber=tt;exports.useAnimatedPlaceholder=ot;exports.useCoachmark=mn;exports.useInView=st;exports.useLocale=ue;exports.useShake=pn;exports.useStreamScroll=Ws;exports.useStrings=q;exports.useToast=Ds;
22
+ <%s key={someKey} {...props} />`,W,q,J,q),X[q+W]=!0)}if(q=null,P!==void 0&&(n(P),q=""+P),i(_)&&(n(_.key),q=""+_.key),"key"in _){P={};for(var ie in _)ie!=="key"&&(P[ie]=_[ie])}else P=_;return q&&l(P,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,q,P,a(),Q,te)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===F&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===j}var m=c,j=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),v=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),E=Symbol.for("react.client.reference"),O=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,V=Array.isArray,b=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var $,A={},C=m.react_stack_bottom_frame.bind(m,o)(),H=b(r(o)),X={};be.Fragment=T,be.jsx=function(p,_,P){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,_,P,!1,W?Error("react-stack-top-frame"):C,W?b(r(p)):H)},be.jsxs=function(p,_,P){var W=1e4>O.recentlyCreatedOwnerStacks++;return u(p,_,P,!0,W?Error("react-stack-top-frame"):C,W?b(r(p)):H)}}()),be}process.env.NODE_ENV==="production"?Se.exports=mt():Se.exports=pt();var e=Se.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment",closeTab:"Close {label}"};function Be(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,r)=>s[r]!==void 0&&s[r]!==null?String(s[r]):"")}const Ie=c.createContext({strings:_e,t:(t,s)=>Be(_e[t]??t,s)});function ht({strings:t,children:s}){const n=c.useMemo(()=>{const r={..._e,...t};return{strings:r,t:(a,o)=>Be(r[a]??_e[a]??a,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function ue(){return c.useContext(Ie)}function Y(){return c.useContext(Ie).strings}function Ze({size:t="m",color:s="default",className:n="","aria-label":r,...a}){const o=Y();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":r??o.loading,...a})}const xt={xs:12,s:14,m:16,l:20};function re({children:t,variant:s="primary",size:n="m",fullWidth:r=!1,icon:a,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:f,type:u="button",href:h,"aria-label":x,"aria-pressed":m,className:j="",...g}){const T=a&&!t,w=i==="loading",y=i==="success",S=i==="error",v=w||y||S,k=!!(l||d),N=n==="xs"?"s":"m",I=s==="danger"?"on-accent":"default",D=xt[n]??16,F=w?e.jsx(Ze,{size:N,color:I}):y?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.Check,{size:D,strokeWidth:2.5})}):S?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(B.X,{size:D,strokeWidth:2.5})}):null,z=["ds-button",`ds-button--${s}`,`ds-button--${n}`,r&&"ds-button--full",T&&"ds-button--icon-only",j].filter(Boolean).join(" "),E=i!=="idle"?i:void 0,O=m!==void 0?m:k?!0:void 0,L=e.jsxs(e.Fragment,{children:[v?F:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),t]});if(h){const V=b=>{if(o||w){b.preventDefault();return}b.metaKey||b.ctrlKey||b.button===1||(b.preventDefault(),f==null||f(b))};return e.jsx("a",{className:z,href:o||w?void 0:h,onClick:V,"aria-label":x,"aria-disabled":o||w?"true":void 0,"aria-busy":w?"true":void 0,"aria-pressed":O,"data-state":E,"data-active":k?"true":void 0,...g,children:L})}return e.jsx("button",{type:u,className:z,disabled:o,onClick:w?void 0:f,"aria-label":x,"aria-busy":w?"true":void 0,"aria-pressed":O,"data-state":E,"data-active":k?"true":void 0,...g,children:L})}function vt({label:t,error:s,hint:n,fullWidth:r=!0,icon:a,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=Y(),m=f||`input-${c.useId()}`,j=n?`${m}-hint`:void 0,g=s?`${m}-error`:void 0,T=g||j;return e.jsxs("div",{className:`ds-input-wrapper ${r?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":T,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:j,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:g,className:"ds-input-error",role:"alert",children:s})})})]})}function bt({label:t,error:s,hint:n,fullWidth:r=!0,size:a="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${r?"ds-textarea-wrapper--full":""} ${o?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${a} ${s?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function _t({label:t,value:s,onChange:n,options:r=[],placeholder:a,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=Y(),x=a??h.selectOption,[m,j]=c.useState(!1),[g,T]=c.useState(!1),[w,y]=c.useState({}),[S,v]=c.useState("down"),[k,N]=c.useState(-1),I=c.useRef(null),D=c.useRef(null),F=c.useRef(null),z=c.useRef(null),E=f||`select-${c.useId()}`,O=`${E}-label`,L=o?`${E}-error`:void 0,V=150,b=(_=!1)=>{g||(T(!0),N(-1),z.current=setTimeout(()=>{var P;j(!1),T(!1),_&&((P=F.current)==null||P.focus())},V))},$=_=>{clearTimeout(z.current),T(!1);const P=_!==void 0?_:Math.max(r.findIndex(W=>W.value===s),0);N(P),j(!0)};c.useEffect(()=>()=>clearTimeout(z.current),[]);const A=()=>{var J;const _=(J=I.current)==null?void 0:J.getBoundingClientRect();if(!_)return;const P=window.innerHeight,W=P-_.bottom,Q=_.top,q=W<300&&Q>W;v(q?"up":"down"),y(q?{bottom:P-_.top+4,left:_.left,width:_.width}:{top:_.bottom+4,left:_.left,width:_.width})};c.useEffect(()=>{if(m)return A(),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[m]),c.useEffect(()=>{const _=P=>{I.current&&!I.current.contains(P.target)&&D.current&&!D.current.contains(P.target)&&b()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[g]),c.useEffect(()=>{var P;if(!m||k<0||!D.current)return;(P=D.current.querySelectorAll(".ds-select-option")[k])==null||P.scrollIntoView({block:"nearest"})},[k,m]);const C=_=>{switch(_.key){case"ArrowDown":_.preventDefault(),m?N(P=>Math.min(P+1,r.length-1)):$();break;case"ArrowUp":_.preventDefault(),m?N(P=>Math.max(P-1,0)):$(r.length-1);break;case"Home":m&&(_.preventDefault(),N(0));break;case"End":m&&(_.preventDefault(),N(r.length-1));break;case"Enter":case" ":_.preventDefault(),m?k>=0&&(n==null||n(r[k].value),b(!0)):$();break;case"Escape":m&&(_.preventDefault(),b(!0));break;case"Tab":m&&b(!1);break}},H=r.find(_=>_.value===s),X=l==="xs"?U[1]:l==="small"?U[2]:U[3],p=m&&e.jsx("div",{ref:D,"data-ds-portal":"",role:"listbox","aria-labelledby":t?O:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${S}`,g&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:w,children:r.map((_,P)=>e.jsx("button",{id:`${E}-opt-${P}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===_.value,className:["ds-select-option",`ds-select-option--${l}`,s===_.value&&"ds-select-option--selected",P===k&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(_.value),b(!0)},children:_.label},_.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:O,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:I,children:e.jsxs("button",{ref:F,type:"button",id:E,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&k>=0?`${E}-opt-${k}`:void 0,"aria-labelledby":t?O:void 0,"aria-invalid":o?"true":"false","aria-describedby":L,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?b():$())},onKeyDown:C,disabled:d,...u,children:[e.jsx("span",{className:H?"":"ds-select-placeholder",children:(H==null?void 0:H.label)||x}),e.jsx(B.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${m&&S==="down"?"ds-select-icon--open":""} ${m&&S==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:L,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ee.createPortal(p,document.body)]})}function jt({label:t,value:s=0,onChange:n,min:r=0,max:a=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=Y(),j=()=>{if(l)return;const v=Math.min(Number(s)+o,a);n==null||n(v)},g=()=>{if(l)return;const v=Math.max(Number(s)-o,r);n==null||n(v)},T=v=>{if(l)return;const k=v.target.value;if(k===""){n==null||n(r);return}const N=Number(k);if(!isNaN(N)){const I=Math.min(Math.max(N,r),a);n==null||n(I)}},w=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),y=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),S=i==="xs"?U[1]:i==="small"?U[2]:U[3];return e.jsxs("div",{className:w,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:y,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:g,disabled:l||s<=r,"aria-label":u??m.decrease,children:e.jsx(B.Minus,{size:S,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:T,min:r,max:a,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:j,disabled:l||s>=a,"aria-label":h??m.increase,children:e.jsx(B.Plus,{size:S,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function wt({children:t,padding:s="m",variant:n="default",hover:r=!1,onClick:a,href:o,disabled:i=!1,className:l="",...d}){const u=(r?"interactive":n)==="interactive"||a||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const j=g=>{if(i){g.preventDefault();return}g.metaKey||g.ctrlKey||g.button===1||(g.preventDefault(),a==null||a(g))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:j,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&a?"button":"div",m=u&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!a?"article":void 0,...m,...d,children:t})}function Nt({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function gt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function yt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function kt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function Et({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Qe({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function Pe({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:r,...a}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=r||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:i,...a,children:t})}const Rt={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle},Tt=c.forwardRef(function({children:s,variant:n="info",title:r,onClose:a,role:o,closeLabel:i,...l},d){const f=Y(),u=Rt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${r?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:U[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[r&&e.jsx("div",{className:"ds-alert__title",children:r}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),a&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:a,"aria-label":i??f.closeAlert,children:e.jsx(B.X,{size:U[3],strokeWidth:1.5})})]})}),St="data-ds-portal";function De(t){var n;const s=((n=t.composedPath)==null?void 0:n.call(t)[0])??t.target;return s instanceof Element?s:s instanceof Node?s.parentElement:null}function Le(t,s){var r;const n=(r=t==null?void 0:t.closest)==null?void 0:r.call(t,`[${St}]`);return!!(n&&n!==s)}const $t=200;function At({children:t,title:s,onClose:n,size:r="m",scrollable:a=!1,subHeader:o,closeLabel:i,...l}){const d=Y(),f=c.useRef(null),u=c.useRef(null),h=c.useId(),[x,m]=c.useState(!1),j=c.useRef(null),g=()=>{!n||x||(m(!0),j.current=setTimeout(()=>{m(!1),n()},$t))};c.useEffect(()=>()=>clearTimeout(j.current),[]),c.useEffect(()=>{const v=N=>{N.key==="Escape"&&g()},k=N=>{var D;const I=De(N);I&&((D=u.current)!=null&&D.contains(I)||Le(I,f.current)||g())};return document.addEventListener("keydown",v),document.addEventListener("mousedown",k),()=>{document.removeEventListener("keydown",v),document.removeEventListener("mousedown",k)}},[n,x]);const T=c.Children.toArray(t),w=T.find(v=>(v==null?void 0:v.type)===de),y=T.filter(v=>(v==null?void 0:v.type)!==de),S=e.jsx("div",{className:["ds-modal-overlay",x&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,ref:f,"data-ds-portal":"",children:e.jsxs("div",{className:[`ds-modal ds-modal--${r}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),"data-surface":"2",ref:u,role:"dialog","aria-modal":"true","aria-labelledby":s?h:void 0,children:[n&&e.jsx(re,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:g,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:h,className:"ds-modal__title",children:s}),o&&e.jsx("div",{className:"ds-modal__subheader",children:o})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:y}),w]})});return typeof document>"u"?S:ee.createPortal(S,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const Bt=320;function It({children:t,title:s,onClose:n,subHeader:r,closeLabel:a,...o}){const i=Y(),l=c.useRef(null),d=c.useRef(null),f=c.useId(),[u,h]=c.useState(!1),x=c.useRef(null),m=()=>{!n||u||(h(!0),x.current=setTimeout(()=>{h(!1),n()},Bt))};c.useEffect(()=>()=>clearTimeout(x.current),[]),c.useEffect(()=>{const y=v=>{v.key==="Escape"&&m()},S=v=>{var N;const k=De(v);k&&((N=d.current)!=null&&N.contains(k)||Le(k,l.current)||m())};return document.addEventListener("keydown",y),document.addEventListener("mousedown",S),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",S)}},[n,u]);const j=c.Children.toArray(t),g=j.find(y=>(y==null?void 0:y.type)===de),T=j.filter(y=>(y==null?void 0:y.type)!==de),w=e.jsx("div",{className:["ds-bottom-sheet-overlay",u&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,ref:l,"data-ds-portal":"",children:e.jsxs("div",{ref:d,className:["ds-bottom-sheet",u&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),"data-surface":"2",role:"dialog","aria-modal":"true","aria-labelledby":s?f:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(re,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:m,"aria-label":a??i.close}),(s||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:f,className:"ds-bottom-sheet__title",children:s}),r&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:r})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:T}),g]})});return typeof document>"u"?w:ee.createPortal(w,document.body)}function et({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="s",className:i="",...l}){const d=Y(),f=s??d.code,[u,h]=c.useState(n),x=r!==void 0,m=x?r:u,j=()=>{x?a==null||a(!r):h(T=>!T)},g=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:g,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:j,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(B.ChevronDown,{size:U[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function Pt({children:t,block:s=!1,collapsible:n=!1,title:r,defaultExpanded:a=!1,...o}){const i=Y(),l=r??i.code;return s?n?e.jsx(et,{title:l,defaultExpanded:a,...o,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...o,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...o,children:t})}function Dt({href:t,children:s,onClick:n,target:r,rel:a,...o}){const l=r==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:r,rel:l,...o,children:s})}function Lt({children:t,size:s="m",variant:n="ghost",...r}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...r,children:c.Children.map(t,a=>c.isValidElement(a)?c.cloneElement(a,{size:s,variant:n}):a)})}function Ct({children:t,selected:s=!1,onClick:n,size:r="m",variant:a="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${r}`,`ds-tab--${a}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function Mt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-browser-pane",s].filter(Boolean).join(" "),...n,children:t})}function Ft({tabs:t,active:s,onChange:n,onClose:r,className:a="",...o}){const{t:i}=ue();return e.jsx("div",{className:["ds-browser-tabs",a].filter(Boolean).join(" "),role:"tablist",...o,children:t.map(l=>{const d=l.id===s,f=!!l.closable;return e.jsxs("div",{className:["ds-browser-tab",d&&"ds-browser-tab--active",f&&"ds-browser-tab--closable"].filter(Boolean).join(" "),title:l.label,children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":d,className:"ds-browser-tab__hit",onClick:()=>n==null?void 0:n(l.id),children:[l.icon?e.jsx("span",{className:"ds-browser-tab__icon","aria-hidden":!0,children:l.icon}):null,e.jsx("span",{className:"ds-browser-tab__label",children:l.label})]}),f?e.jsx("button",{type:"button",className:"ds-browser-tab__close","aria-label":i("closeTab",{label:l.label}),onClick:u=>{u.stopPropagation(),r==null||r(l.id)},children:e.jsx(B.X,{size:12,strokeWidth:2})}):null]},l.id)})})}function zt({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-list",s].filter(Boolean).join(" "),role:"list",...n,children:t})}function Ot({icon:t,title:s,subtitle:n,meta:r,onClick:a,className:o="",...i}){const l=r==null?[]:Array.isArray(r)?r:[r],d=["ds-list-row",!t&&"ds-list-row--no-icon",a&&"ds-list-row--interactive",o].filter(Boolean).join(" "),f=e.jsxs(e.Fragment,{children:[t?e.jsx("span",{className:"ds-list-row__icon","aria-hidden":!0,children:t}):null,e.jsxs("span",{className:"ds-list-row__name",children:[e.jsx("span",{className:"ds-list-row__title",children:s}),n?e.jsx("span",{className:"ds-list-row__subtitle",children:n}):null]}),l.map((u,h)=>e.jsx("span",{className:"ds-list-row__meta",children:u},h))]});return a?e.jsx("button",{type:"button",role:"listitem",className:d,onClick:a,...i,children:f}):e.jsx("div",{role:"listitem",className:d,...i,children:f})}function Wt({options:t,value:s,onChange:n,size:r="m",disabled:a=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const j=o.current.getBoundingClientRect(),g=m.getBoundingClientRect(),T=g.left-j.left,w=g.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=T+"px",i.current.style.width=w+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const y=o.current.querySelector(`[data-value="${s}"]`);if(!y)return;const S=o.current.getBoundingClientRect(),v=y.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=v.left-S.left+"px",i.current.style.width=v.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${r}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&n(m.value),"aria-pressed":s===m.value,disabled:a,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function ge({children:t,title:s,defaultExpanded:n=!1,expanded:r,onToggle:a,padding:o="m",...i}){const[l,d]=c.useState(n),f=r!==void 0,u=f?r:l,h=()=>{f?a==null||a(!r):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(B.ChevronDown,{size:U[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const ae=8,fe=8;function Ht(t,s,n){const r=window.innerWidth;let a,o;switch(t){case"top":a=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":a=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":a=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":a=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:a=s.bottom+ae,o=s.left}const i=Math.max(fe,Math.min(r-n.width-fe,o)),l=o-i;return{top:a,left:i,arrowOffset:l}}function Ut(t,s,n){const r=window.innerWidth,a=window.innerHeight;if(t.top>=s+ae+fe)return"top";if(a-t.bottom>=s+ae+fe)return"bottom";if(r-t.right>=n+ae+fe)return"right";if(t.left>=n+ae+fe)return"left";const o=Math.max(t.top,a-t.bottom,t.left,r-t.right);return o===t.top?"top":o===a-t.bottom?"bottom":o===r-t.right?"right":"left"}function Oe(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches}function Vt(t){return t?t.matches(":focus-visible")||!!t.querySelector(":focus-visible"):!1}function ye({children:t,content:s,position:n,...r}){const[a,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!u.current||!h.current)return;const y=u.current.getBoundingClientRect(),S=h.current.getBoundingClientRect(),v=n||Ut(y,S.height,S.width),{top:k,left:N,arrowOffset:I}=Ht(v,y,S);f(v),l({position:"fixed",top:k,left:N,visibility:"visible","--arrow-offset":`${I}px`})};c.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const y=requestAnimationFrame(x);return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{cancelAnimationFrame(y),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[a,n]);const m=()=>{Oe()&&o(!0)},j=()=>{Vt(u.current)||o(!1)},g=y=>{const S=y.target;S instanceof Element&&S.matches(":focus-visible")&&o(!0)},T=y=>{var v,k;const S=y.relatedTarget;S instanceof Node&&((v=u.current)!=null&&v.contains(S))||Oe()&&((k=u.current)!=null&&k.matches(":hover"))||o(!1)};if(!s)return t;const w=a&&e.jsx("div",{ref:h,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:i,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:m,onMouseLeave:j,onFocus:g,onBlur:T,...r,children:[t,typeof document<"u"&&ee.createPortal(w,document.body)]})}const We=8,we=8,Xt=140;function He(t){const s=String(t??"").replace(/^@/,"").trim();return s?`@${s}`:""}function qt({label:t,children:s,mode:n="click",avatar:r,name:a,handle:o,description:i,actions:l,className:d="",popoverClassName:f="",...u}){const h=c.useId(),x=c.useRef(null),m=c.useRef(null),j=c.useRef(null),[g,T]=c.useState(!1),[w,y]=c.useState(null),S=s!=null,v=a||t||"",k=He(t||a),N=He(o),I=c.useCallback(()=>{j.current!=null&&(window.clearTimeout(j.current),j.current=null)},[]),D=c.useCallback(()=>{I(),T(!0)},[I]),F=c.useCallback(()=>{I(),j.current=window.setTimeout(()=>T(!1),Xt)},[I]),z=c.useCallback(()=>{const L=x.current,V=m.current;if(!L)return;const b=L.getBoundingClientRect(),$=(V==null?void 0:V.offsetHeight)??160,A=(V==null?void 0:V.offsetWidth)??260;let C=b.bottom+We;C+$>window.innerHeight-we&&(C=Math.max(we,b.top-$-We));const H=Math.max(we,Math.min(b.left,window.innerWidth-A-we));y({top:C,left:H})},[]);c.useLayoutEffect(()=>{g&&z()},[g,z]),c.useEffect(()=>{if(!g)return;const L=()=>z(),V=$=>{$.key==="Escape"&&T(!1)},b=$=>{var C,H;if(n==="hover")return;const A=$.target;(C=m.current)!=null&&C.contains(A)||(H=x.current)!=null&&H.contains(A)||T(!1)};return window.addEventListener("scroll",L,!0),window.addEventListener("resize",L),document.addEventListener("keydown",V),document.addEventListener("mousedown",b),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L),document.removeEventListener("keydown",V),document.removeEventListener("mousedown",b)}},[g,z,n]),c.useEffect(()=>()=>I(),[I]);const E=n==="hover"?{onMouseEnter:D,onMouseLeave:F}:{},O=g?ee.createPortal(e.jsxs("div",{ref:m,id:h,role:"dialog","aria-label":v||k||"Mention","data-ds-portal":"",className:["ds-mention__popover",f].filter(Boolean).join(" "),style:w?{top:w.top,left:w.left}:{top:-9999,left:-9999,visibility:"hidden"},...E,children:[(r||v||N)&&e.jsxs("div",{className:"ds-mention__head",children:[r,(v||N)&&e.jsxs("div",{className:"ds-mention__meta",children:[v?e.jsx("span",{className:"ds-mention__name",children:v}):null,N?e.jsx("span",{className:"ds-mention__handle",children:N}):null]})]}),i?e.jsx("p",{className:"ds-mention__desc",children:i}):null,l?e.jsx("div",{className:"ds-mention__actions",onClick:()=>T(!1),children:l}):null]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("button",{...u,ref:x,type:"button",className:["ds-mention",S&&"ds-mention--custom",d].filter(Boolean).join(" "),"aria-expanded":g,"aria-haspopup":"dialog","aria-label":S&&(k||v)||void 0,"aria-controls":g?h:void 0,onClick:L=>{var V;if((V=u.onClick)==null||V.call(u,L),!L.defaultPrevented){if(L.preventDefault(),L.stopPropagation(),n==="hover"){D();return}T(b=>!b)}},...E,children:S?s:k}),typeof document<"u"?O:null]})}function Yt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,r&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function Gt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,id:o,...i}){const l=o||`checkbox-${c.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,r&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:r,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(B.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function Kt({checked:t=!1,onChange:s,size:n="m",disabled:r=!1,label:a,name:o,value:i,id:l,...d}){const f=l||`radio-${c.useId()}`,u=["ds-radio",`ds-radio--${n}`,r&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:h=>s==null?void 0:s(h.target.checked),disabled:r,name:o,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),a&&e.jsx("span",{className:"ds-radio__label",children:a})]})}function tt({width:t,height:s,shape:n="rect",aspectRatio:r,className:a="",style:o={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,a].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:r,...o},"aria-hidden":"true",...i})}function Jt({lines:t=1,lastLineWidth:s="70%",gap:n,className:r="",style:a={},...o}){return e.jsx("span",{className:["ds-skeleton-text",r].filter(Boolean).join(" "),style:{gap:n,...a},"aria-hidden":"true",...o,children:Array.from({length:t},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}tt.Text=Jt;function Zt(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function Qt(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function es({seed:t,icon:s,src:n,size:r=32,className:a="",style:o={},...i}){const l=Zt(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Qt(t)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:r,height:r,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function ts({children:t,size:s="compact",stickyTop:n,maxHeight:r,className:a="",style:o={},...i}){const l={...r?{maxHeight:r}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",r?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,a].filter(Boolean).join(" "),...i,children:t})})}function ss({children:t,...s}){return e.jsx("thead",{...s,children:t})}function ns({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function rs({children:t,interactive:s,selected:n,subheader:r,exiting:a,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",r?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function as({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function os({children:t,align:s="left",sortDir:n,onSort:r,width:a,className:o="",style:i={},...l}){const d=!!r||n!==void 0,f=n==="asc"?B.ChevronUp:n==="desc"?B.ChevronDown:B.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",o].filter(Boolean).join(" "),onClick:r,style:{width:a,...i},...l,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function is({children:t,align:s="left",secondary:n,muted:r,truncate:a,nowrap:o,className:i="",...l}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",r?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function ls({icon:t,title:s,description:n,action:r,size:a="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,o].filter(Boolean).join(" "),...i,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),r&&e.jsx("div",{className:"ds-empty-state__action",children:r})]})}function cs({label:t,hint:s,error:n,required:r=!1,disabled:a=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":n?"error":void 0,"data-required":r?"":void 0,"data-disabled":a?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function ds({label:t,value:s,delta:n,size:r="m",inline:a=!1,className:o="",style:i,...l}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${r}`,a&&"ds-stat--inline",o].filter(Boolean).join(" "),style:i,...l,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function us({children:t,separator:s="/","aria-label":n,className:r="",style:a,...o}){const i=Y(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${r?` ${r}`:""}`,"aria-label":n??i.breadcrumb,style:a,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function fs({page:t,total:s,onChange:n,siblings:r=1,"aria-label":a,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=Y(),{t:h}=ue(),x=ms(t,s,r);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"aria-label":a??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":o??u.previousPage,children:e.jsx(B.ChevronLeft,{size:16})}),x.map((m,j)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${j}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":i??u.nextPage,children:e.jsx(B.ChevronRight,{size:16})})]})}function ms(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const r=Math.max(2,t-n),a=Math.min(s-1,t+n),o=[1];r>2&&o.push("…");for(let i=r;i<=a;i++)o.push(i);return a<s-1&&o.push("…"),o.push(s),o}const ps=300;function hs({children:t,title:s,onClose:n,subHeader:r,side:a="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=Y(),x=c.useRef(null),m=c.useId(),[j,g]=c.useState(!1),T=c.useRef(null),w=()=>{!n||j||(g(!0),T.current=setTimeout(()=>{g(!1),n()},ps))};c.useEffect(()=>()=>clearTimeout(T.current),[]),c.useEffect(()=>{const N=D=>{D.key==="Escape"&&w()},I=D=>{var z,E;const F=De(D);F&&((z=d==null?void 0:d.current)!=null&&z.contains(F)||(E=x.current)!=null&&E.contains(F)||Le(F,null)||w())};return document.addEventListener("keydown",N),document.addEventListener("mousedown",I),()=>{document.removeEventListener("keydown",N),document.removeEventListener("mousedown",I)}},[n,j,d]);const y=c.Children.toArray(t),S=y.find(N=>(N==null?void 0:N.type)===$e||(N==null?void 0:N.type)===de),v=y.filter(N=>(N==null?void 0:N.type)!==$e&&(N==null?void 0:N.type)!==de),k=e.jsx("div",{className:["ds-side-page-overlay",j&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":a,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",j&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-surface":"2","data-side":a,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(re,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(B.X,{size:U[2],strokeWidth:1.5}),onClick:w,"aria-label":f??h.close}),(s||r)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,className:"ds-side-page__title",children:s}),r&&e.jsx("div",{className:"ds-side-page__subheader",children:r})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:v}),S]})});return typeof document>"u"?k:ee.createPortal(k,document.body)}function $e({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ke=c.createContext(!1),xs=c.forwardRef(function({children:s,collapsed:n=!1,side:r="left",onExpand:a,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${r}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&a){a();return}!n&&o&&o()}},[n,a,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:r},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&a?"":void 0,"data-collapsible":!n&&o?"":void 0,...l,children:s})})});function vs({icon:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),j=c.useContext(ke),w={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,"aria-label":x?s:void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...h},y=i!=null,S=m==="left"?"right":"left",v=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&y&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!y||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&y&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!y||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),k=a?e.jsx("a",{href:r?void 0:a,...w,children:v}):e.jsx("button",{type:"button",...w,children:v});return x&&!j?e.jsx(ye,{content:s,position:S,children:k}):k}function bs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function _s({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function js({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function ws({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function Ns({children:t,label:s,defaultOpen:n=!0,className:r="",...a}){const{collapsed:o}=c.useContext(pe),i=Y(),l=s??i.recents,[d,f]=c.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",r].filter(Boolean).join(" "),...a,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:l}),e.jsx(B.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||o)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const gs=c.forwardRef(function({as:s="button",avatar:n,label:r,className:a="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ke),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",a].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:r})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?r:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(ye,{content:r,position:u,children:m}):m});function ys({avatar:t,label:s,selected:n=!1,disabled:r=!1,href:a,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ke),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:r?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":r?"true":void 0,tabIndex:r?-1:void 0,...{"data-selected":n||void 0,"data-disabled":r||void 0},...l},j=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),g=f==="left"?"right":"left",T=a?e.jsx("a",{href:r?void 0:a,...m,children:j}):e.jsx("button",{type:"button",...m,children:j});return d&&!u?e.jsx(ye,{content:s,position:g,children:T}):T}const Ue=240,Ve=6,Xe=8;function ks({trigger:t,title:s,children:n,open:r,onOpenChange:a,defaultOpen:o=!1,closeLabel:i}){const l=Y(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=r!==void 0,x=h?r:f,[m,j]=c.useState(!1),g=c.useRef(null),T=c.useRef(null),[w,y]=c.useState({}),S=c.useCallback(()=>{h?a==null||a(!0):u(!0)},[h,a]),v=c.useCallback(()=>{h?a==null||a(!1):u(!1)},[h,a]),k=c.useCallback(()=>x?v():S(),[x,S,v]),N=c.useCallback(()=>{var L;const D=g.current;if(!D)return;const F=D.getBoundingClientRect(),z=window.innerHeight,E=((L=T.current)==null?void 0:L.offsetHeight)??300,O=Math.max(Xe,Math.min(z-E-Xe,F.top));y(d==="right"?{position:"fixed",top:O,right:window.innerWidth-F.left+Ve,width:Ue}:{position:"fixed",top:O,left:F.right+Ve,width:Ue})},[d]);c.useEffect(()=>{if(!x){j(!1);return}return N(),requestAnimationFrame(()=>j(!0)),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[x,N]),c.useEffect(()=>{if(!x)return;const D=z=>{var E,O;!((E=T.current)!=null&&E.contains(z.target))&&!((O=g.current)!=null&&O.contains(z.target))&&v()},F=z=>{z.key==="Escape"&&v()};return document.addEventListener("mousedown",D),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",D),document.removeEventListener("keydown",F)}},[x,v]);const I=x&&e.jsxs("div",{ref:T,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:w,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:v,"aria-label":i??l.close,children:e.jsx(B.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ke.Provider,{value:x,children:e.jsx("div",{ref:g,onClick:k,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ee.createPortal(I,document.body)]})}const Es={info:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};function Rs({children:t,variant:s="info",action:n,onAction:r,onDismiss:a,role:o,dismissLabel:i,...l}){const d=Y(),f=Es[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:U[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:r,children:n}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":i??d.dismiss,children:e.jsx(B.X,{size:U[2],strokeWidth:1.5})})]})}function Ts({trigger:t,items:s=[],open:n,onOpenChange:r,align:a="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,j=m?n:f,g=c.useRef(null),T=c.useRef(null),w=c.useRef(null),y=c.useRef(null),[S,v]=c.useState({}),k=c.useRef(null),N=150,I=()=>{if(m)r==null||r(!1);else{if(h)return;x(!0),k.current=setTimeout(()=>{u(!1),x(!1)},N)}},D=()=>{const b=!j;m?r==null||r(b):b?(clearTimeout(k.current),x(!1),u(!0)):I()},F=()=>{j||(m?r==null||r(!0):(clearTimeout(k.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(k.current),[]),c.useEffect(()=>{if(!j)return;const b=300,$=()=>{var X;const A=(X=g.current)==null?void 0:X.getBoundingClientRect();if(!A)return;const C=window.innerHeight-A.bottom,H=C<b+8&&A.top>C;v(a==="right"?H?{bottom:window.innerHeight-A.top+4,top:"auto",right:window.innerWidth-A.right}:{top:A.bottom+4,bottom:"auto",right:window.innerWidth-A.right}:H?{bottom:window.innerHeight-A.top+4,top:"auto",left:A.left}:{top:A.bottom+4,bottom:"auto",left:A.left})};return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[j,a]);const z=()=>{var $;const b=($=w.current)==null?void 0:$.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};c.useEffect(()=>{if(!j)return;const b=A=>{var C,H;!((C=g.current)!=null&&C.contains(A.target))&&!((H=T.current)!=null&&H.contains(A.target))&&I()},$=A=>{A.key==="Escape"&&(I(),z())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",$)}},[j]),c.useEffect(()=>{if(!j||!y.current||!T.current)return;const b=E(),$=y.current==="last"?b[b.length-1]:b[0];$==null||$.focus(),y.current=null},[j]);const E=()=>T.current?[...T.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=b=>{var $,A;if(b.key==="ArrowDown")b.preventDefault(),j?($=E()[0])==null||$.focus():(y.current="first",F());else if(b.key==="ArrowUp")if(b.preventDefault(),!j)y.current="last",F();else{const C=E();(A=C[C.length-1])==null||A.focus()}},L=b=>{var C,H,X,p;const $=E(),A=$.findIndex(_=>_===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(C=$[Math.min(A+1,$.length-1)])==null||C.focus();break;case"ArrowUp":b.preventDefault(),A<=0?z():(H=$[A-1])==null||H.focus();break;case"Home":b.preventDefault(),(X=$[0])==null||X.focus();break;case"End":b.preventDefault(),(p=$[$.length-1])==null||p.focus();break;case"Tab":I();break}},V=j&&e.jsx("div",{ref:T,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:S,onKeyDown:L,children:s.map((b,$)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},$);if(b.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[b.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:b.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:b.content})]},$);const A=!!b.href,C=A?"a":"button",H=A?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(C,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...H,onClick:()=>{var X;(X=b.onClick)==null||X.call(b),I()},children:[b.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:b.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:b.label}),b.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:b.shortcut})]},$)})});return e.jsxs("div",{ref:g,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:w,className:"ds-dropdown__trigger",onClick:D,onKeyDown:O,children:t}),typeof document<"u"&&ee.createPortal(V,document.body)]})}function Ss({value:t=0,size:s="m",variant:n="default",showValue:r=!1,min:a=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(a,i),d=n==="auto"?i>=70?"success":i>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!o&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${l}%`}})}),r&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const $s=t=>1-Math.pow(1-t,3),As=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function st(t,{duration:s=600}={}){const[n,r]=c.useState(t),a=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(As()){r(t),a.current=t;return}const i=a.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);r(i+l*$s(h)),h<1?o.current=requestAnimationFrame(f):a.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function Bs({value:t,duration:s=600,decimals:n=0,prefix:r="",suffix:a=""}){const i=st(t,{duration:s}).toFixed(n);return`${r}${i}${a}`}function nt({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const r=c.useRef(null),[a,o]=c.useState(!1);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:r,inView:a}}function Is({children:t,as:s="div",once:n=!1,threshold:r=.1,rootMargin:a="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=nt({threshold:r,rootMargin:a,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const qe={default:B.Info,success:B.CheckCircle,warning:B.AlertTriangle,error:B.XCircle};let me=[];const Ae=new Set;function rt(){Ae.forEach(t=>t([...me]))}function Ps(t){me=[...me,t],rt()}function Ds(t){me=me.filter(s=>s.id!==t),rt()}function Ls(){const t=(s,n={})=>{Ps({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Cs({data:t,onDismiss:s}){const n=Y(),[r,a]=c.useState(!1),o=c.useRef(null),i=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>a(!0)),t.duration>0&&(o.current=setTimeout(()=>l(),t.duration)),()=>{clearTimeout(o.current),clearTimeout(i.current)}),[]);function l(){a(!1),i.current=setTimeout(()=>s(t.id),250)}const d=qe[t.type]??qe.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(d,{size:U[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:l,"aria-label":n.close,children:e.jsx(B.X,{size:U[3],strokeWidth:1.5})})]})}function Ms({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...me]);return c.useEffect(()=>(Ae.add(n),()=>Ae.delete(n)),[]),!s.length||typeof document>"u"?null:ee.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(r=>e.jsx(Cs,{data:r,onDismiss:Ds},r.id))}),document.body)}const Fs={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function at({label:t,status:s="idle",icon:n,badge:r,defaultExpanded:a=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),Fs[s],r]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(ge,{title:h,padding:"s",defaultExpanded:a,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function ot({text:t,size:s="xs",timeout:n=800,"aria-label":r,...a}){const o=Y(),[i,l]=c.useState(!1),d=c.useRef(null),f=u=>{u.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),clearTimeout(d.current),d.current=setTimeout(()=>l(!1),n)})};return c.useEffect(()=>()=>clearTimeout(d.current),[]),e.jsx(re,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(B.Copy,{size:U[1],strokeWidth:1.5}),"aria-label":r??o.copyToClipboard,onClick:f,...a})}function zs({content:t,streaming:s=!1,...n}){const[r,a]=c.useState(s);return c.useEffect(()=>{a(!!s)},[s]),e.jsx(ge,{expanded:r,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(B.Brain,{size:U[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Qe,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(Pe,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Os({count:t,current:s=0,done:n=[],onChange:r,showCounter:a=!0,className:o="","aria-label":i,...l}){const d=Y(),{t:f}=ue();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,j=r&&(h<=s||n.includes(h)),g=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:g,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!j||h===s,onClick:()=>r==null?void 0:r(h),children:m?e.jsx(B.Check,{size:8,strokeWidth:3}):null},h)})}),a&&e.jsxs(Pe,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Ws({content:t,isStreaming:s=!1,cursor:n="line",onChunk:r,className:a="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(r==null||r(t),i.current=t)},[t,r]),e.jsxs("span",{className:["ds-streaming-text",a].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Hs({role:t="assistant",header:s,footer:n,attachments:r,isStreaming:a=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,children:[r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__bubble",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...l,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),r&&e.jsx("div",{className:"ds-chat-message__attachments",children:r}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Us(t,{containerRef:s,smartPause:n=!0}={}){const r=c.useRef(!1),a=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<a.current&&(r.current=!0),l&&(r.current=!1),a.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&r.current||(o.scrollTop=o.scrollHeight))},t)}function it({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:r=18,holdTime:a=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),j=c.useRef(null),g=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const v=()=>{const k=Date.now();if(g.current>k){j.current=setTimeout(v,g.current-k);return}const N=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(N.slice(0,x.current)),x.current>=N.length?(h.current="holding",j.current=setTimeout(v,a)):j.current=setTimeout(v,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",j.current=setTimeout(v,r)):(x.current=Math.max(0,x.current-1),u(N.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),j.current=setTimeout(v,o)):j.current=setTimeout(v,r))};return j.current=setTimeout(v,260),()=>{j.current&&clearTimeout(j.current)}},[s,t,n,r,a,o]);const T=v=>{if(t.length===0)return;const k=(v%t.length+t.length)%t.length,N=t[k];m.current=k,x.current=N.length,h.current="holding",g.current=Date.now()+i,d(k),u(N)},w=()=>T(m.current+1),y=()=>T(m.current-1),S=t[l%t.length]??"";return{displayed:f,currentPrompt:S,index:l,next:w,prev:y}}let Vs=0;function Xs({value:t="",onChange:s,onSubmit:n,onStop:r,onKeyDown:a,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:j,acceptImage:g,acceptFile:T,maxImages:w,maxImageSize:y,leftSlot:S,rightSlot:v,className:k="",...N}){const I=Y(),{t:D}=ue(),F=c.useRef(null),z=c.useRef(null),E=c.useRef(0),[O,L]=c.useState(!1),[V,b]=c.useState([]),$=c.useRef(new Set),A=l??I.promptPlaceholder,C=R=>{const M=++Vs;b(K=>[...K,{id:M,msg:R}]);const G=setTimeout(()=>{$.current.delete(G),b(K=>K.filter(Z=>Z.id!==M))},6e3);$.current.add(G)};c.useEffect(()=>{const R=$.current;return()=>R.forEach(clearTimeout)},[]);const H=R=>b(M=>M.filter(G=>G.id!==R)),X=R=>R.type.startsWith("image/"),p=()=>!0,_=g??X,P=T??p,W=R=>{const M=[],G=[],K=[],Z=[];let se=0,le=w!=null?w-((u==null?void 0:u.length)??0):1/0;for(const ne of R)_(ne)?y&&ne.size>y?K.push(ne.name):le>0?(M.push(ne),le--):se++:P(ne)?G.push(ne):Z.push(ne.name);return{imageFiles:M,docFiles:G,tooLarge:K,skipped:Z,limitExceeded:se}},Q=R=>{const M=y?D("fileTooLargeMaxHint",{maxMb:y/1024/1024}):"";C(D("fileTooLarge",{maxHint:M,names:R.join(", ")}))},te=R=>{const{imageFiles:M,docFiles:G,tooLarge:K,skipped:Z,limitExceeded:se}=W(R);K.length&&Q(K),Z.length&&C(D("filesSkipped",{names:Z.join(", ")})),se&&C(D("maxImages",{n:w})),x&&M.length&&x(M);const le=G.concat(x?[]:M);h&&le.length&&h(le)};c.useEffect(()=>{const R=z.current;R&&(R.style.height="auto",R.style.height=`${Math.min(R.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const R=M=>{var K,Z,se;if(o||i)return;const G=(K=M.target)==null?void 0:K.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Z=M.target)!=null&&Z.isContentEditable||M.ctrlKey||M.metaKey||M.altKey||M.key.length!==1&&M.key!=="Backspace"&&M.key!=="Delete"||(se=z.current)==null||se.focus()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o,i]);const q=R=>{R.preventDefault(),E.current++,R.dataTransfer.types.includes("Files")&&L(!0)},J=R=>{R.preventDefault(),E.current--,E.current===0&&L(!1)},ie=R=>R.preventDefault(),he=R=>{R.preventDefault(),E.current=0,L(!1);const M=Array.from(R.dataTransfer.files);M.length&&te(M)},Ee=R=>{const M=Array.from(R.target.files||[]);F.current&&(F.current.value=""),M.length&&te(M)},ct=R=>{var ne;if(!x)return;const M=(ne=R.clipboardData)==null?void 0:ne.items;if(!M)return;const G=[];for(const ft of M){const Me=ft.getAsFile();Me&&G.push(Me)}if(G.length===0)return;const{imageFiles:K,tooLarge:Z,skipped:se,limitExceeded:le}=W(G);Z.length&&Q(Z),se.length&&C(D("filesSkipped",{names:se.join(", ")})),le&&C(D("maxImages",{n:w})),K.length&&(R.preventDefault(),x(K))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=it({prompts:d??[],enabled:xe}),dt=R=>{if(xe){if(R.key==="ArrowDown"||R.key==="ArrowRight"){R.preventDefault(),je.next();return}if(R.key==="ArrowUp"||R.key==="ArrowLeft"){R.preventDefault(),je.prev();return}if(R.key==="Tab"&&!R.shiftKey){R.preventDefault(),s==null||s(je.currentPrompt);return}}a==null||a(R)},ut=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,Ce=h||x;return e.jsxs("div",{className:["ds-prompt-input",k].filter(Boolean).join(" "),...N,children:[Ce&&e.jsx("input",{ref:F,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:Ee}),e.jsxs("div",{className:["ds-prompt-input__box",O&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:q,onDragLeave:J,onDragOver:ie,onDrop:he,children:[O&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:I.dropFilesHere}),e.jsx("textarea",{ref:z,value:t,onChange:R=>s==null?void 0:s(R.target.value),onKeyDown:dt,onPaste:ct,placeholder:xe?"":A,disabled:o||i,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((R,M)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:R.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>j==null?void 0:j(M),"aria-label":I.removeImage,type:"button",children:e.jsx(B.X,{size:12,strokeWidth:2})})]},M))}),V.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:V.map(R=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:R.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>H(R.id),"aria-label":I.dismiss,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]},R.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((R,M)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[R.uploading?e.jsx(B.Loader,{size:U[1],strokeWidth:1.5,className:"spin"}):e.jsx(B.Paperclip,{size:U[1],strokeWidth:1.5}),R.filename,R.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:I.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(M),"aria-label":I.removeAttachment,children:e.jsx(B.X,{size:U[1],strokeWidth:1.5})})]})},M))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Ce&&e.jsx(re,{variant:"ghost",size:"xs",icon:e.jsx(B.Paperclip,{size:U[2],strokeWidth:1.5}),"aria-label":I.attachFiles,onClick:()=>{var R;return(R=F.current)==null?void 0:R.click()}}),S,v,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(B.Square,{size:U[2],strokeWidth:1.5}),onClick:r,"aria-label":I.stop}):e.jsx(re,{variant:"primary",size:"xs",icon:e.jsx(B.ArrowUp,{size:U[2],strokeWidth:1.5}),onClick:n,disabled:!ut,"aria-label":I.send})]})]})]})}const Ye={fast:0,standard:1,premium:2},Ge={fast:"data-5",standard:"data-3",premium:"data-6"};function qs({models:t=[],value:s,onChange:n,size:r="xs",minTier:a,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[j,g]=c.useState({}),T=r==="s"?"s":"xs",w=t.filter(E=>!a||E.name==="auto"?!0:(Ye[E.tier]??1)>=(Ye[a]??1)),y=w.find(E=>E.name==="auto"),S=w.filter(E=>E.name!=="auto"),v=t.find(E=>E.name===s),N=new Set(S.map(E=>E.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const E=320,O=()=>{var C;const b=(C=x.current)==null?void 0:C.getBoundingClientRect();if(!b)return;const $=window.innerHeight-b.bottom,A=$<E+8&&b.top>$;g({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:b.left,...A?{bottom:window.innerHeight-b.top+4,top:"auto"}:{top:b.bottom+4,bottom:"auto"}})};O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O);const L=b=>{var $,A;!(($=h.current)!=null&&$.contains(b.target))&&!((A=m.current)!=null&&A.contains(b.target))&&u(!1)},V=b=>{b.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",L),document.addEventListener("keydown",V),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),document.removeEventListener("mousedown",L),document.removeEventListener("keydown",V)}},[f]);const I=E=>{n==null||n(E),u(!1)},D=E=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",E.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(E.name),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:E.icon||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:E.displayName||E.name}),N&&E.tier&&e.jsx(ce,{size:"xs",variant:Ge[E.tier]||"default",children:E.tier})]},E.name),F=()=>!i||!N?S.map(D):["fast","standard","premium"].flatMap(E=>{const O=S.filter(L=>L.tier===E);return O.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":E,children:E.charAt(0).toUpperCase()+E.slice(1)},`lbl-${E}`),...O.map(D)]:[]}),z=f&&e.jsxs("div",{ref:m,className:`ds-model-picker__menu ds-model-picker__menu--${T} ds-scrollable`,"data-ds-portal":"",style:j,children:[o&&y&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx("span",{className:"ds-model-picker__item-icon",children:e.jsx(B.Zap,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),S.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),F()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:`ds-model-picker__trigger ds-model-picker__trigger--${T}`,onClick:()=>u(E=>!E),"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"ds-model-picker__icon",children:(v==null?void 0:v.icon)||e.jsx(B.Cpu,{strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(v==null?void 0:v.displayName)||(v==null?void 0:v.name)||s}),N&&(v==null?void 0:v.tier)&&e.jsx(ce,{size:"xs",variant:Ge[v.tier]||"default",children:v.tier})]}),typeof document<"u"&&ee.createPortal(z,document.body)]})}const Ys=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function Gs(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function Ks({sources:t=[],layout:s="list",title:n,maxVisible:r=5,onSourceClick:a}){const o=Y(),{t:i}=ue(),l=n??o.sources,[d,f]=c.useState(!1),u=Gs(t),h=u.length>r,x=d?u:u.slice(0,r),m=t.some(w=>w.snippet),j=w=>w!=null&&w.length?i("pageAbbrev",{pages:w.join(", ")}):null,g=i("moreSources",{n:u.length-r}),T=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:T,children:[x.map(w=>{const y=w.items.map(k=>k.page).filter(Boolean),S=j(y),v=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${v?" ds-sources-panel__compact-row--clickable":""}`,onClick:v?()=>a(w.items[0]):void 0,children:[e.jsx(B.FileText,{size:U[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:w.filename}),S&&e.jsx("span",{className:"ds-sources-panel__pages",children:S})]},w.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:g})]}):e.jsxs("div",{className:T,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(w=>{const y=w.items.map(k=>k.page).filter(Boolean),S=j(y),v=!!a;return m?e.jsx(ge,{title:e.jsx(Ys,{filename:w.filename,pagesLabel:S}),padding:"s",children:w.items.map((k,N)=>e.jsx("div",{className:`ds-sources-panel__snippet${v?" ds-sources-panel__snippet--clickable":""}`,onClick:v?()=>a(k):void 0,children:k.snippet??i("pageAbbrev",{pages:k.page})},N))},w.filename):e.jsxs("div",{className:`ds-sources-panel__row${v?" ds-sources-panel__row--clickable":""}`,onClick:v?()=>a(w.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:w.filename}),S&&e.jsx("span",{className:"ds-sources-panel__pages",children:S})]},w.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:g})]})}function Ke(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Js({used:t,limit:s,size:n="s",showCount:r=!0,showPercent:a=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=o?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(r||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[r&&e.jsxs("span",{children:[Ke(t)," / ",Ke(s)]}),a&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Je=5;function Zs(t){return t<.34?"low":t<.67?"medium":"high"}function Qs({value:t=0,size:s="xs",showLabel:n="none",layout:r="inline"}){const a=Math.max(0,Math.min(1,t)),o=Math.round(a*Je),i=Zs(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,r==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Je},(l,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<o?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const en={add:"+",remove:"-",context:" "};function Re({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:en[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function tn({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:r=!0,maxHeight:a,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=a?{maxHeight:a,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Re,{line:u,lineNumbers:r},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Re,{line:d,lineNumbers:r},f))})]})}function lt({value:t="idle",onLike:s,onDislike:n,className:r="",likeLabel:a,dislikeLabel:o,...i}){const l=Y(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",r].filter(Boolean).join(" "),...i,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":a??l.like,"aria-pressed":t==="liked",children:e.jsx(B.ThumbsUp,{size:U[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":o??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(B.ThumbsDown,{size:U[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function sn(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,r=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(a-864e5);if(s>=a)return r;if(s>=o)return`Yesterday ${r}`;const i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${r}`}function nn({role:t="assistant",text:s,timestamp:n,feedbackValue:r="idle",onLike:a,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(a||o),f=!!s,u=n?sn(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(lt,{className:"ds-message-action",value:r,onLike:a,onDislike:o}),f&&e.jsx(ot,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function rn({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function an({variant:t="light",glow:s,mask:n=!0,style:r,...a}){const o=t==="dark",i=s??o,l=o?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=o?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...i&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...r},...a,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function on({children:t,axis:s="y",style:n,className:r="",...a}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${r}`,style:{...o,...n},...a,children:t})}const Te=280,ln=22,cn=14,oe=8,Ne=6,dn=200;function un(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function fn(t,s,n,r){const a=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+r+oe)return"bottom";if(t.top>=s+r+oe)return"top";if(a-t.right>=n+r+oe)return"right";if(t.left>=n+r+oe)return"left";const i=Math.max(t.top,o-t.bottom,a-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===a-t.right?"right":"left"}function mn(t,s,n,r,a){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-a,d=s.left+s.width/2-r/2;break;case"bottom":l=s.bottom+a,d=s.left+s.width/2-r/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-r-a;break;default:l=s.top+s.height/2-n/2,d=s.right+a}const f=Math.max(oe,Math.min(o-r-oe,d)),u=Math.max(oe,Math.min(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function pn({steps:t,currentStep:s,onNext:n,onBack:r,onSkip:a,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const j=Y(),{t:g}=ue(),T=d??j.next,w=f??j.back,y=u??j.skipTour,S=h??j.done,v=c.useRef(null),k=c.useRef(t),N=c.useRef(s),I=c.useRef(l);k.current=t,N.current=s,I.current=l;const[D,F]=c.useState(!1),[z,E]=c.useState({position:"fixed",visibility:"hidden",width:Te}),[O,L]=c.useState("bottom"),[V,b]=c.useState(null),$=c.useRef(!1),A=t[s],C=s===t.length-1,H=c.useCallback(()=>{const X=k.current[N.current];if(!X||!v.current)return;const p=un(X.target);if(!p)return;const _=p.getBoundingClientRect(),W=v.current.getBoundingClientRect().height||160,Q=Te,te=I.current?ln:cn,q=X.position||fn(_,W,Q,te),{top:J,left:ie,arrowOffset:he,arrowOffsetY:Ee}=mn(q,_,W,Q,te);L(q),E({position:"fixed",top:J,left:ie,width:Te,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${Ee}px`}),b({top:_.top-Ne,left:_.left-Ne,width:_.width+Ne*2,height:_.height+Ne*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",H,!0),window.addEventListener("resize",H);const X=requestAnimationFrame(()=>{H(),F(!0),$.current=!0});return()=>{cancelAnimationFrame(X),window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[]),c.useEffect(()=>{if(!$.current)return;F(!1);const X=setTimeout(()=>{E(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{H(),F(!0)})},dn+20);return()=>clearTimeout(X)},[s]),c.useEffect(()=>{D&&v.current&&v.current.focus({preventScroll:!0})},[D]),c.useEffect(()=>{const X=p=>{p.key==="Escape"&&a()};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),c.useEffect(()=>{if(!D)return;const X=p=>{if(p.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!_.length)return;const P=_[0],W=_[_.length-1];p.shiftKey&&document.activeElement===P?(p.preventDefault(),W.focus()):!p.shiftKey&&document.activeElement===W&&(p.preventDefault(),P.focus())};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[D]),!A||typeof document>"u"?null:ee.createPortal(e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",D&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:V,"aria-hidden":"true"}),e.jsxs("div",{ref:v,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":A.title??g("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${O}`,D&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:z,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:a,"aria-label":y,children:e.jsx(B.X,{size:16,strokeWidth:2})}),A.title&&e.jsx("div",{className:"ds-coachmark__title",children:A.title}),e.jsx("div",{className:"ds-coachmark__body",children:A.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(re,{variant:"secondary",size:"s",state:m,onClick:r,children:w}),e.jsx(re,{variant:"primary",size:"s",state:x,onClick:C?o:n,children:C?S:T})]})]})]})]}),document.body)}function hn(t,s={}){const{storageKey:n}=s,[r,a]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:r,isActive:o,start:()=>{l()||(a(0),i(!0))},next:()=>a(f=>Math.min(f+1,t.length-1)),back:()=>a(f=>Math.max(f-1,0)),skip:d,finish:d}}function xn(){const t=c.useRef(null),s=c.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const r=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",r)};n.addEventListener("animationend",r)},[]);return{ref:t,shake:s}}exports.Accordion=ge;exports.Alert=Tt;exports.AnimatedNumber=Bs;exports.Avatar=es;exports.Badge=ce;exports.Banner=Rs;exports.BottomSheet=It;exports.Breadcrumb=us;exports.BrowserPane=Mt;exports.BrowserTabs=Ft;exports.Button=re;exports.Card=wt;exports.ChatMessage=Hs;exports.Checkbox=Gt;exports.Coachmark=pn;exports.Code=Pt;exports.CodeAccordion=et;exports.ConfidenceBar=Qs;exports.CopyButton=ot;exports.DiffView=tn;exports.Dropdown=Ts;exports.EmptyState=ls;exports.EngineerGrid=an;exports.FormField=cs;exports.H1=Nt;exports.H2=gt;exports.H3=yt;exports.H4=kt;exports.InView=Is;exports.Input=vt;exports.Link=Dt;exports.List=zt;exports.ListRow=Ot;exports.LocaleProvider=ht;exports.Mention=qt;exports.MessageFeedback=lt;exports.MessageFooter=nn;exports.Modal=At;exports.ModalFooter=de;exports.ModelPicker=qs;exports.NavRail=xs;exports.NavRailAgent=ys;exports.NavRailBody=bs;exports.NavRailCustomItem=gs;exports.NavRailDivider=ws;exports.NavRailFlyout=ks;exports.NavRailFooter=js;exports.NavRailHeader=_s;exports.NavRailItem=vs;exports.NavRailRecents=Ns;exports.P1=Et;exports.P2=Qe;exports.P3=Pe;exports.Pagination=fs;exports.ProgressBar=Ss;exports.PromptInput=Xs;exports.Radio=Kt;exports.ReasoningBlock=zs;exports.Scrollable=on;exports.SegmentedControl=Wt;exports.Select=_t;exports.SidePage=hs;exports.SidePageFooter=$e;exports.Skeleton=tt;exports.SourcesPanel=Ks;exports.Spinner=Ze;exports.Stat=ds;exports.StepIndicator=Os;exports.Stepper=jt;exports.StreamingText=Ws;exports.Tab=Ct;exports.Table=ts;exports.TableBody=ns;exports.TableHead=ss;exports.TableRow=rs;exports.TableSubheaderRow=as;exports.Tabs=Lt;exports.Td=is;exports.Textarea=bt;exports.Th=os;exports.ThinkingDot=rn;exports.ToastContainer=Ms;exports.Toggle=Yt;exports.TokenCounter=Js;exports.ToolCallBubble=at;exports.ToolCallCard=at;exports.Tooltip=ye;exports.defaultStrings=_e;exports.formatString=Be;exports.iconSizes=U;exports.useAnimatedNumber=st;exports.useAnimatedPlaceholder=it;exports.useCoachmark=hn;exports.useInView=nt;exports.useLocale=ue;exports.useShake=xn;exports.useStreamScroll=Us;exports.useStrings=Y;exports.useToast=Ls;