@donkit-ai/design-system 1.4.46 → 1.4.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -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 ye;function Ve(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&function(){function s(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===O?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case S:return"Fragment";case B:return"Profiler";case $:return"StrictMode";case I:return"Suspense";case V:return"SuspenseList";case w:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case _:return"Portal";case R:return c.displayName||"Context";case E:return(c._context.displayName||"Context")+".Consumer";case L:var y=c.render;return c=c.displayName,c||(c=y.displayName||y.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Y:return y=c.displayName||null,y!==null?y:s(c.type)||"Memo";case z:y=c._payload,c=c._init;try{return s(c(y))}catch{}}return null}function t(c){return""+c}function r(c){try{t(c);var y=!1}catch{y=!0}if(y){y=console;var M=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return M.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(c)}}function o(c){if(c===S)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===z)return"<...>";try{var y=s(c);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var c=H.A;return c===null?null:c.getOwner()}function n(){return Error("react-stack-top-frame")}function i(c){if(W.call(c,"key")){var y=Object.getOwnPropertyDescriptor(c,"key").get;if(y&&y.isReactWarning)return!1}return c.key!==void 0}function l(c,y){function M(){T||(T=!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)",y))}M.isReactWarning=!0,Object.defineProperty(c,"key",{get:M,configurable:!0})}function p(){var c=s(this.type);return P[c]||(P[c]=!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.")),c=this.props.ref,c!==void 0?c:null}function d(c,y,M,C,ee,te){var F=M.ref;return c={$$typeof:j,type:c,key:y,props:M,_owner:C},(F!==void 0?F:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function m(c,y,M,C,ee,te){var F=y.children;if(F!==void 0)if(C)if(b(F)){for(C=0;C<F.length;C++)h(F[C]);Object.freeze&&Object.freeze(F)}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(F);if(W.call(y,"key")){F=s(c);var J=Object.keys(y).filter(function(pe){return pe!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",k[F+C]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ye;function Ve(){return ye||(ye=1,process.env.NODE_ENV!=="production"&&function(){function s(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===O?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case S:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case V:return"SuspenseList";case w:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case _:return"Portal";case R:return c.displayName||"Context";case E:return(c._context.displayName||"Context")+".Consumer";case L:var y=c.render;return c=c.displayName,c||(c=y.displayName||y.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Y:return y=c.displayName||null,y!==null?y:s(c.type)||"Memo";case z:y=c._payload,c=c._init;try{return s(c(y))}catch{}}return null}function t(c){return""+c}function r(c){try{t(c);var y=!1}catch{y=!0}if(y){y=console;var M=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return M.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(c)}}function o(c){if(c===S)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===z)return"<...>";try{var y=s(c);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var c=H.A;return c===null?null:c.getOwner()}function n(){return Error("react-stack-top-frame")}function i(c){if(W.call(c,"key")){var y=Object.getOwnPropertyDescriptor(c,"key").get;if(y&&y.isReactWarning)return!1}return c.key!==void 0}function l(c,y){function M(){$||($=!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)",y))}M.isReactWarning=!0,Object.defineProperty(c,"key",{get:M,configurable:!0})}function p(){var c=s(this.type);return P[c]||(P[c]=!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.")),c=this.props.ref,c!==void 0?c:null}function d(c,y,M,C,ee,te){var F=M.ref;return c={$$typeof:j,type:c,key:y,props:M,_owner:C},(F!==void 0?F:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function m(c,y,M,C,ee,te){var F=y.children;if(F!==void 0)if(C)if(b(F)){for(C=0;C<F.length;C++)h(F[C]);Object.freeze&&Object.freeze(F)}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(F);if(W.call(y,"key")){F=s(c);var J=Object.keys(y).filter(function(pe){return pe!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",k[F+C]||(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} />`,C,F,J,F),k[F+C]=!0)}if(F=null,M!==void 0&&(r(M),F=""+M),i(y)&&(r(y.key),F=""+y.key),"key"in y){M={};for(var re in y)re!=="key"&&(M[re]=y[re])}else M=y;return F&&l(M,typeof c=="function"?c.displayName||c.name||"Unknown":c),d(c,F,M,a(),ee,te)}function h(c){x(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===z&&(c._payload.status==="fulfilled"?x(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function x(c){return typeof c=="object"&&c!==null&&c.$$typeof===j}var f=u,j=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),H=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,b=Array.isArray,N=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(c){return c()}};var T,P={},X=f.react_stack_bottom_frame.bind(f,n)(),q=N(o(n)),k={};de.Fragment=S,de.jsx=function(c,y,M){var C=1e4>H.recentlyCreatedOwnerStacks++;return m(c,y,M,!1,C?Error("react-stack-top-frame"):X,C?N(o(c)):q)},de.jsxs=function(c,y,M){var C=1e4>H.recentlyCreatedOwnerStacks++;return m(c,y,M,!0,C?Error("react-stack-top-frame"):X,C?N(o(c)):q)}}()),de}process.env.NODE_ENV==="production"?xe.exports=Ue():xe.exports=Ve();var e=xe.exports;function Se({size:s="m",color:t="default",className:r="",...o}){return e.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${t}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}const Ye={xs:12,s:14,m:16,l:20};function ae({children:s,variant:t="primary",size:r="m",fullWidth:o=!1,icon:a,disabled:n=!1,state:i="idle",onClick:l,type:p="button",href:d,"aria-label":m,className:h="",...x}){const f=a&&!s,j=i==="loading",_=i==="success",S=i==="error",$=j||_||S,B=r==="xs"?"s":"m",E=t==="danger"?"on-accent":"default",R=Ye[r]??16,L=j?e.jsx(Se,{size:B,color:E}):_?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(g.Check,{size:R,strokeWidth:2.5})}):S?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(g.X,{size:R,strokeWidth:2.5})}):null,I=["ds-button",`ds-button--${t}`,`ds-button--${r}`,o&&"ds-button--full",f&&"ds-button--icon-only",h].filter(Boolean).join(" "),V=i!=="idle"?i:void 0,Y=e.jsxs(e.Fragment,{children:[$?L:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(d){const z=w=>{if(n||j){w.preventDefault();return}w.metaKey||w.ctrlKey||w.button===1||(w.preventDefault(),l==null||l(w))};return e.jsx("a",{className:I,href:n||j?void 0:d,onClick:z,"aria-label":m,"aria-disabled":n||j?"true":void 0,"aria-busy":j?"true":void 0,"data-state":V,...x,children:Y})}return e.jsx("button",{type:p,className:I,disabled:n,onClick:j?void 0:l,"aria-label":m,"aria-busy":j?"true":void 0,"data-state":V,...x,children:Y})}function Xe({label:s,error:t,hint:r,fullWidth:o=!0,icon:a,iconRight:n,onIconRightClick:i,size:l="m",disabled:p,id:d,...m}){const h=d||`input-${u.useId()}`,x=r?`${h}-hint`:void 0,f=t?`${h}-error`:void 0,j=f||x;return e.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${t?"ds-input-wrapper--error":""}`,children:[s&&e.jsx("label",{className:"ds-input-label",htmlFor:h,children:s}),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:h,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${t?"ds-input--error":""}`,disabled:p,"aria-invalid":t?"true":"false","aria-describedby":j,...m}),n&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:n})]}),r&&!t&&e.jsx("span",{id:x,className:"ds-input-hint",children:r}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:t&&e.jsx("span",{id:f,className:"ds-input-error",role:"alert",children:t})})})]})}function He({label:s,error:t,hint:r,fullWidth:o=!0,size:a="m",disabled:n,id:i,resize:l=!0,rows:p=3,...d}){const m=i||`textarea-${u.useId()}`,h=r?`${m}-hint`:void 0,x=t?`${m}-error`:void 0,f=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${n?"ds-textarea-wrapper--disabled":""}`,children:[s&&e.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:s}),e.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${a} ${t?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":t?"true":"false","aria-describedby":f,rows:p,...d}),r&&!t&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:r}),t&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:t})]})}function qe({label:s,value:t,onChange:r,options:o=[],placeholder:a="Select option",error:n,fullWidth:i=!0,size:l="m",disabled:p=!1,id:d,...m}){const[h,x]=u.useState(!1),[f,j]=u.useState(!1),[_,S]=u.useState({}),[$,B]=u.useState("down"),[E,R]=u.useState(-1),L=u.useRef(null),I=u.useRef(null),V=u.useRef(null),Y=u.useRef(null),z=d||`select-${u.useId()}`,w=`${z}-label`,O=n?`${z}-error`:void 0,H=150,W=(k=!1)=>{f||(j(!0),R(-1),Y.current=setTimeout(()=>{var c;x(!1),j(!1),k&&((c=V.current)==null||c.focus())},H))},b=k=>{clearTimeout(Y.current),j(!1);const c=k!==void 0?k:Math.max(o.findIndex(y=>y.value===t),0);R(c),x(!0)};u.useEffect(()=>()=>clearTimeout(Y.current),[]);const N=()=>{var te;const k=(te=L.current)==null?void 0:te.getBoundingClientRect();if(!k)return;const c=window.innerHeight,y=c-k.bottom,M=k.top,ee=y<300&&M>y;B(ee?"up":"down"),S(ee?{bottom:c-k.top+4,left:k.left,width:k.width}:{top:k.bottom+4,left:k.left,width:k.width})};u.useEffect(()=>{if(h)return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[h]),u.useEffect(()=>{const k=c=>{L.current&&!L.current.contains(c.target)&&I.current&&!I.current.contains(c.target)&&W()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]),u.useEffect(()=>{var c;if(!h||E<0||!I.current)return;(c=I.current.querySelectorAll(".ds-select-option")[E])==null||c.scrollIntoView({block:"nearest"})},[E,h]);const T=k=>{switch(k.key){case"ArrowDown":k.preventDefault(),h?R(c=>Math.min(c+1,o.length-1)):b();break;case"ArrowUp":k.preventDefault(),h?R(c=>Math.max(c-1,0)):b(o.length-1);break;case"Home":h&&(k.preventDefault(),R(0));break;case"End":h&&(k.preventDefault(),R(o.length-1));break;case"Enter":case" ":k.preventDefault(),h?E>=0&&(r==null||r(o[E].value),W(!0)):b();break;case"Escape":h&&(k.preventDefault(),W(!0));break;case"Tab":h&&W(!1);break}},P=o.find(k=>k.value===t),X=l==="xs"?D[1]:l==="small"?D[2]:D[3],q=h&&e.jsx("div",{ref:I,role:"listbox","aria-labelledby":s?w:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${$}`,f&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:_,children:o.map((k,c)=>e.jsx("button",{id:`${z}-opt-${c}`,type:"button",role:"option",tabIndex:-1,"aria-selected":t===k.value,className:["ds-select-option",`ds-select-option--${l}`,t===k.value&&"ds-select-option--selected",c===E&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(k.value),W(!0)},children:k.label},k.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[s&&e.jsx("label",{id:w,className:"ds-select-label",children:s}),e.jsx("div",{className:"ds-select-container",ref:L,children:e.jsxs("button",{ref:V,type:"button",id:z,role:"combobox","aria-haspopup":"listbox","aria-expanded":h,"aria-activedescendant":h&&E>=0?`${z}-opt-${E}`:void 0,"aria-labelledby":s?w:void 0,"aria-invalid":n?"true":"false","aria-describedby":O,className:`ds-select-trigger ds-select-trigger--${l} ${n?"ds-select-trigger--error":""}`,onClick:()=>{p||(h?W():b())},onKeyDown:T,disabled:p,...m,children:[e.jsx("span",{className:P?"":"ds-select-placeholder",children:(P==null?void 0:P.label)||a}),e.jsx(g.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${h&&$==="down"?"ds-select-icon--open":""} ${h&&$==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&e.jsx("span",{id:O,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&fe.createPortal(q,document.body)]})}function Ke({label:s,value:t=0,onChange:r,min:o=0,max:a=100,step:n=1,size:i="m",disabled:l=!1,hint:p,error:d,...m}){const h=()=>{if(l)return;const $=Math.min(Number(t)+n,a);r==null||r($)},x=()=>{if(l)return;const $=Math.max(Number(t)-n,o);r==null||r($)},f=$=>{if(l)return;const B=$.target.value;if(B===""){r==null||r(o);return}const E=Number(B);if(!isNaN(E)){const R=Math.min(Math.max(E,o),a);r==null||r(R)}},j=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",d&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),_=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),S=i==="xs"?D[1]:i==="small"?D[2]:D[3];return e.jsxs("div",{className:j,children:[s&&e.jsx("label",{className:"ds-stepper-label",children:s}),e.jsxs("div",{className:_,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:l||t<=o,"aria-label":"Decrease",children:e.jsx(g.Minus,{size:S,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:t,onChange:f,min:o,max:a,step:n,disabled:l,...m}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:h,disabled:l||t>=a,"aria-label":"Increase",children:e.jsx(g.Plus,{size:S,strokeWidth:1.5})})]}),p&&!d&&e.jsx("div",{className:"ds-stepper-hint",children:p}),d&&e.jsx("div",{className:"ds-stepper-error",children:d})]})}function Ge({children:s,padding:t="m",variant:r="info",hover:o=!1,onClick:a,href:n,disabled:i=!1,...l}){const d=(o?"interactive":r)==="interactive"||a||n,m=["ds-card",`ds-card--${t}`,d&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const f=j=>{if(i){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),a==null||a(j))};return e.jsx("a",{className:m,href:i?void 0:n,onClick:f,"aria-disabled":i?"true":void 0,...l,children:s})}const h=d&&a?"button":"div",x=d&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(h,{className:m,role:d&&!a?"article":void 0,...x,...l,children:s})}function Je({children:s,...t}){return e.jsx("h1",{className:"ds-h1",...t,children:s})}function Ze({children:s,...t}){return e.jsx("h2",{className:"ds-h2",...t,children:s})}function Qe({children:s,...t}){return e.jsx("h3",{className:"ds-h3",...t,children:s})}function es({children:s,...t}){return e.jsx("h4",{className:"ds-h4",...t,children:s})}function ss({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p1 ${t?"ds-p1--secondary":""}`,...r,children:s})}function Ae({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p2 ${t?"ds-p2--secondary":""}`,...r,children:s})}function ve({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p3 ${t?"ds-p3--secondary":""}`,...r,children:s})}function oe({children:s,variant:t="default",size:r="m",role:o,...a}){const n=["ds-badge",`ds-badge--${t}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=o||(["info","success","warning","error"].includes(t)?"status":void 0);return e.jsx("span",{className:n,role:i,...a,children:s})}const ts={info:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};function rs({children:s,variant:t="info",title:r,onClose:o,role:a,...n}){const i=ts[t],l=a||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-alert ds-alert--${t} ${r?"":"ds-alert--no-title"}`,role:l,...n,children:[i&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(i,{size:D[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})]}),o&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:e.jsx(g.X,{size:D[3],strokeWidth:1.5})})]})}const ns=200;function as({children:s,title:t,onClose:r,size:o="m",scrollable:a=!1,subHeader:n,...i}){const l=u.useRef(null),p=u.useId(),[d,m]=u.useState(!1),h=()=>{!r||d||(m(!0),setTimeout(()=>{m(!1),r()},ns))};u.useEffect(()=>{const _=$=>{$.key==="Escape"&&h()},S=$=>{l.current&&!l.current.contains($.target)&&h()};return document.addEventListener("keydown",_),document.addEventListener("mousedown",S),()=>{document.removeEventListener("keydown",_),document.removeEventListener("mousedown",S)}},[r,d]);const x=u.Children.toArray(s),f=x.find(_=>(_==null?void 0:_.type)===ue),j=x.filter(_=>(_==null?void 0:_.type)!==ue);return e.jsx("div",{className:["ds-modal-overlay",d&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...i,children:e.jsxs("div",{className:[`ds-modal ds-modal--${o}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:l,role:"dialog","aria-modal":"true","aria-labelledby":t?p:void 0,children:[(t||r||n)&&e.jsxs("div",{className:"ds-modal__header",children:[(t||r)&&e.jsxs("div",{className:"ds-modal__header-row",children:[t&&e.jsx("h3",{id:p,className:"ds-modal__title",children:t}),r&&e.jsx(ae,{variant:"ghost",size:"small",icon:e.jsx(g.X,{size:D[2],strokeWidth:1.5}),onClick:h,"aria-label":"Close modal"})]}),n&&e.jsx("div",{className:"ds-modal__subheader",children:n})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:j}),f]})})}function ue({children:s}){return!s||u.Children.count(s)===0?null:e.jsx("div",{className:"ds-modal__footer",children:s})}const os=320;function is({children:s,title:t,onClose:r,subHeader:o,...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),d=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},os))};u.useEffect(()=>{const f=_=>{_.key==="Escape"&&d()},j=_=>{n.current&&!n.current.contains(_.target)&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[r,l]);const m=u.Children.toArray(s),h=m.find(f=>(f==null?void 0:f.type)===ue),x=m.filter(f=>(f==null?void 0:f.type)!==ue);return e.jsx("div",{className:["ds-bottom-sheet-overlay",l&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("div",{ref:n,className:["ds-bottom-sheet",l&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":t?i:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),(t||r||o)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[(t||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header-row",children:[t&&e.jsx("h3",{id:i,className:"ds-bottom-sheet__title",children:t}),r&&e.jsx(ae,{variant:"ghost",size:"small",icon:e.jsx(g.X,{size:D[2],strokeWidth:1.5}),onClick:d,"aria-label":"Close"})]}),o&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:o})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:x}),h]})})}function De({children:s,title:t="Code",defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="s",className:i="",...l}){const[p,d]=u.useState(r),m=o!==void 0,h=m?o:p,x=()=>{m?a==null||a(!o):d(j=>!j)},f=["ds-code-accordion",`ds-code-accordion--${n}`,h&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:f,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":h,children:[e.jsx("span",{className:"ds-code-accordion__title",children:t}),e.jsx(g.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${h?"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:s})})})})]})}function ls({children:s,block:t=!1,collapsible:r=!1,title:o="Code",defaultExpanded:a=!1,...n}){return t?r?e.jsx(De,{title:o,defaultExpanded:a,...n,children:s}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...n,children:e.jsx("code",{children:s})}):e.jsx("code",{className:"ds-code-inline",...n,children:s})}function cs({href:s,children:t,onClick:r,target:o,rel:a,...n}){const l=o==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:s,className:"ds-link",onClick:r,target:o,rel:l,...n,children:t})}function ds({children:s,size:t="m",variant:r="ghost",...o}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(s,a=>u.isValidElement(a)?u.cloneElement(a,{size:t,variant:r}):a)})}function us({children:s,selected:t=!1,onClick:r,size:o="m",variant:a="ghost",disabled:n=!1,icon:i,href:l,...p}){const d=i&&!s,m=["ds-tab",`ds-tab--${o}`,`ds-tab--${a}`,t&&"ds-tab--selected",d&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),s]});if(l){const x=f=>{if(n){f.preventDefault();return}f.metaKey||f.ctrlKey||f.button===1||(f.preventDefault(),r==null||r(f))};return e.jsx("a",{role:"tab","aria-current":t?"page":void 0,"aria-disabled":n?"true":void 0,className:m,href:n?void 0:l,onClick:x,...p,children:h})}return e.jsx("button",{role:"tab","aria-selected":t,className:m,onClick:r,disabled:n,...p,children:h})}function fs({options:s,value:t,onChange:r,size:o="m",disabled:a=!1}){const n=u.useRef(null),i=u.useRef(null),[l,p]=u.useState(!1),d=u.useRef(!1),m=u.useRef(null),h=u.useRef(null),x=()=>{if(!n.current)return;const f=n.current.querySelector(`[data-value="${t}"]`);if(!f)return;const j=n.current.getBoundingClientRect(),_=f.getBoundingClientRect(),S=_.left-j.left,$=_.width;i.current?(i.current.style.transition=d.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=S+"px",i.current.style.width=$+"px",d.current=!1):(p(!0),requestAnimationFrame(()=>{if(!i.current||!n.current)return;const B=n.current.querySelector(`[data-value="${t}"]`);if(!B)return;const E=n.current.getBoundingClientRect(),R=B.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=R.left-E.left+"px",i.current.style.width=R.width+"px"}))};return h.current=x,u.useLayoutEffect(()=>{const f=m.current!==t;m.current=t,d.current=l&&f,x()}),u.useEffect(()=>{if(!n.current)return;const f=new ResizeObserver(()=>{d.current=!1,h.current()});return f.observe(n.current),()=>f.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),s.map(f=>e.jsxs("button",{type:"button","data-value":f.value,className:["ds-seg__btn",t===f.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(f.value),"aria-pressed":t===f.value,disabled:a,children:[f.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:f.icon}),f.label]},f.value))]})}function me({children:s,title:t,defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="m",...i}){const[l,p]=u.useState(r),d=o!==void 0,m=d?o:l,h=()=>{d?a==null||a(!o):p(f=>!f)},x=["ds-accordion",`ds-accordion--${n}`,m&&"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":m,children:[e.jsx("span",{className:"ds-accordion__title",children:t}),e.jsx(g.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"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:s})})})]})}const se=8,ie=8;function ms(s,t,r){const o=window.innerWidth;let a,n;switch(s){case"top":a=t.top-r.height-se,n=t.left+t.width/2-r.width/2;break;case"bottom":a=t.bottom+se,n=t.left+t.width/2-r.width/2;break;case"left":a=t.top+t.height/2-r.height/2,n=t.left-r.width-se;break;case"right":a=t.top+t.height/2-r.height/2,n=t.right+se;break;default:a=t.bottom+se,n=t.left}const i=Math.max(ie,Math.min(o-r.width-ie,n)),l=n-i;return{top:a,left:i,arrowOffset:l}}function ps(s,t,r){const o=window.innerWidth,a=window.innerHeight;if(s.top>=t+se+ie)return"top";if(a-s.bottom>=t+se+ie)return"bottom";if(o-s.right>=r+se+ie)return"right";if(s.left>=r+se+ie)return"left";const n=Math.max(s.top,a-s.bottom,s.left,o-s.right);return n===s.top?"top":n===a-s.bottom?"bottom":n===o-s.right?"right":"left"}function hs({children:s,content:t,position:r,...o}){const[a,n]=u.useState(!1),[i,l]=u.useState({visibility:"hidden"}),[p,d]=u.useState(r||"top"),m=u.useRef(null),h=u.useRef(null),x=u.useRef(!1),f=()=>{if(!m.current||!h.current)return;const _=m.current.getBoundingClientRect(),S=h.current.getBoundingClientRect(),$=r||ps(_,S.height,S.width),{top:B,left:E,arrowOffset:R}=ms($,_,S);d($),l({position:"fixed",top:B,left:E,visibility:"visible","--arrow-offset":`${R}px`})};if(u.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const _=requestAnimationFrame(f);return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{cancelAnimationFrame(_),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[a,r]),u.useEffect(()=>{if(!a)return;const _=S=>{m.current&&!m.current.contains(S.target)&&n(!1)};return document.addEventListener("touchstart",_),()=>document.removeEventListener("touchstart",_)},[a]),!t)return s;const j=a&&e.jsx("div",{ref:h,className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:i,children:t});return e.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||n(!0)},onMouseLeave:()=>{x.current||n(!1)},onTouchStart:()=>{x.current=!0,n(_=>!_)},...o,children:[s,typeof document<"u"&&fe.createPortal(j,document.body)]})}function xs({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:s,onChange:d=>t==null?void 0:t(d.target.checked),disabled:o,...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 bs({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),d=r==="xs"?10:r==="small"?14:r==="large"?20:16;return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:s,onChange:m=>t==null?void 0:t(m.target.checked),disabled:o,...i}),e.jsx("span",{className:"ds-checkbox__box",children:s&&e.jsx(g.Check,{size:d,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function js({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,name:n,value:i,id:l,...p}){const d=l||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:m,htmlFor:d,children:[e.jsx("input",{type:"radio",id:d,className:"ds-radio__input",checked:s,onChange:h=>t==null?void 0:t(h.target.checked),disabled:o,name:n,value:i,...p}),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 Ie({width:s,height:t,shape:r="rect",aspectRatio:o,className:a="",style:n={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,a].filter(Boolean).join(" "),style:{width:s,height:t,aspectRatio:o,...n},"aria-hidden":"true",...i})}function _s({lines:s=1,lastLineWidth:t="70%",gap:r,className:o="",style:a={},...n}){return e.jsx("span",{className:["ds-skeleton-text",o].filter(Boolean).join(" "),style:{gap:r,...a},"aria-hidden":"true",...n,children:Array.from({length:s},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===s-1&&s>1?{width:t}:void 0},l))})}Ie.Text=_s;function vs(s){let t=2166136261;for(let r=0;r<s.length;r++)t^=s.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t%360}function ws(s){if(!s)return"";const t=s.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():s[0].toUpperCase()}function Ns({seed:s,icon:t,src:r,size:o=32,className:a="",style:n={},...i}){const l=vs(s??""),[p,d]=u.useState(!1),m=t??e.jsx("span",{className:"ds-avatar__initials",children:ws(s)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...n},"aria-hidden":"true",...i,children:r&&!p?e.jsx("img",{src:r,alt:"",onError:()=>d(!0)}):m})}function gs({children:s,size:t="compact",stickyTop:r,maxHeight:o,className:a="",style:n={},...i}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...n};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${t}`,a].filter(Boolean).join(" "),...i,children:s})})}function ys({children:s,...t}){return e.jsx("thead",{...t,children:s})}function ks({children:s,...t}){return e.jsx("tbody",{...t,children:s})}function Es({children:s,interactive:t,selected:r,subheader:o,exiting:a,updated:n,className:i="",onClick:l,...p}){return e.jsx("tr",{className:["ds-table-row",t||l?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",n?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...p,children:s})}function Ts({children:s,colSpan:t=999,...r}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:e.jsx("td",{colSpan:t,children:s})})}function $s({children:s,align:t="left",sortDir:r,onSort:o,width:a,className:n="",style:i={},...l}){const p=!!o||r!==void 0,d=r==="asc"?g.ChevronUp:r==="desc"?g.ChevronDown:g.ChevronsUpDown;return e.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",t!=="left"?`ds-table-cell--${t}`:"",n].filter(Boolean).join(" "),onClick:o,style:{width:a,...i},...l,children:p?e.jsxs("span",{className:"ds-th__inner",children:[s,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(d,{size:11,strokeWidth:2.5})})]}):s})}function Rs({children:s,align:t="left",secondary:r,muted:o,truncate:a,nowrap:n,className:i="",...l}){return e.jsx("td",{className:["ds-td",t!=="left"?`ds-table-cell--${t}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",n?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:s})}function Ss({icon:s,title:t,description:r,action:o,size:a="m",className:n="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,n].filter(Boolean).join(" "),...i,children:[s&&e.jsx("div",{className:"ds-empty-state__icon",children:s}),e.jsx("div",{className:"ds-empty-state__title",children:t}),r&&e.jsx("div",{className:"ds-empty-state__description",children:r}),o&&e.jsx("div",{className:"ds-empty-state__action",children:o})]})}function As({label:s,hint:t,error:r,required:o=!1,disabled:a=!1,htmlFor:n,children:i,className:l="",style:p,...d}){const m=u.useId(),h=n??m,x=`${h}-hint`,f=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":r?"error":void 0,"data-required":o?"":void 0,"data-disabled":a?"":void 0,style:p,...d,children:[s&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:s}),e.jsx("div",{className:"ds-field-control",children:i}),t&&!r&&e.jsx("p",{className:"ds-field-hint",id:x,children:t}),r&&e.jsx("p",{className:"ds-field-error",id:f,role:"alert",children:r})]})}function Ds({label:s,value:t,delta:r,size:o="m",inline:a=!1,className:n="",style:i,...l}){const p=r!=null&&r.startsWith("+")?"up":r!=null&&r.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${o}`,a&&"ds-stat--inline",n].filter(Boolean).join(" "),style:i,...l,children:[s&&e.jsx("span",{className:"ds-stat-label",children:s}),t!=null&&e.jsx("span",{className:"ds-stat-value",children:t}),r!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${p}`,children:r})]})}function Is({children:s,separator:t="/","aria-label":r="Breadcrumb",className:o="",style:a,...n}){const i=u.Children.toArray(s).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${o?` ${o}`:""}`,"aria-label":r,style:a,...n,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:i.map((l,p)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[l,p<i.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:t})]},p))})})}function Bs({page:s,total:t,onChange:r,siblings:o=1,"aria-label":a="Pagination",className:n="",style:i,...l}){const p=Ps(s,t,o);return e.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:i,...l,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s-1),disabled:s<=1,"aria-label":"Previous page",children:e.jsx(g.ChevronLeft,{size:16})}),p.map((d,m)=>d==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${m}`):e.jsx("button",{className:`ds-pagination-page${d===s?" ds-pagination-page--current":""}`,onClick:()=>d!==s&&(r==null?void 0:r(d)),"aria-current":d===s?"page":void 0,"aria-label":`Page ${d}`,children:d},d)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s+1),disabled:s>=t,"aria-label":"Next page",children:e.jsx(g.ChevronRight,{size:16})})]})}function Ps(s,t,r){if(t<=7)return Array.from({length:t},(i,l)=>l+1);const o=Math.max(2,s-r),a=Math.min(t-1,s+r),n=[1];o>2&&n.push("…");for(let i=o;i<=a;i++)n.push(i);return a<t-1&&n.push("…"),n.push(t),n}const Ms=200;function Ls({children:s,title:t,onClose:r,side:o="right",...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),d=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},Ms))};u.useEffect(()=>{const f=_=>{_.key==="Escape"&&d()},j=_=>{n.current&&!n.current.contains(_.target)&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[r,l]);const m=u.Children.toArray(s),h=m.find(f=>(f==null?void 0:f.type)===be),x=m.filter(f=>(f==null?void 0:f.type)!==be);return e.jsx("div",{className:["ds-drawer-overlay",l&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("aside",{className:["ds-drawer",l&&"ds-drawer--closing"].filter(Boolean).join(" "),"data-side":o,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?i:void 0,children:[e.jsxs("header",{className:"ds-drawer-header",children:[t&&e.jsx("h3",{id:i,className:"ds-drawer-title",children:t}),r&&e.jsx("button",{className:"ds-drawer-close",onClick:d,"aria-label":"Close drawer",children:e.jsx(g.X,{size:D[2],strokeWidth:1.5})})]}),e.jsx("div",{className:"ds-drawer-body ds-scrollable",children:x}),h]})})}function be({children:s}){return e.jsx("footer",{className:"ds-drawer-footer",children:s})}const Cs={info:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};function zs({children:s,variant:t="info",action:r,onAction:o,onDismiss:a,role:n,...i}){const l=Cs[t],p=n||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${t}`,role:p,...i,children:[l&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(l,{size:D[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:s}),r&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:o,children:r}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":"Dismiss",children:e.jsx(g.X,{size:D[2],strokeWidth:1.5})})]})}function Fs({trigger:s,items:t=[],open:r,onOpenChange:o,align:a="left",className:n="",style:i,...l}){const[p,d]=u.useState(!1),[m,h]=u.useState(!1),x=r!==void 0,f=x?r:p,j=u.useRef(null),_=u.useRef(null),S=u.useRef(null),$=u.useRef(null),[B,E]=u.useState({}),R=u.useRef(null),L=150,I=()=>{if(x)o==null||o(!1);else{if(m)return;h(!0),R.current=setTimeout(()=>{d(!1),h(!1)},L)}},V=()=>{const b=!f;x?o==null||o(b):b?(clearTimeout(R.current),h(!1),d(!0)):I()},Y=()=>{f||(x?o==null||o(!0):(clearTimeout(R.current),h(!1),d(!0)))};u.useEffect(()=>()=>clearTimeout(R.current),[]),u.useEffect(()=>{if(!f)return;const b=300,N=()=>{var q;const T=(q=j.current)==null?void 0:q.getBoundingClientRect();if(!T)return;const P=window.innerHeight-T.bottom,X=P<b+8&&T.top>P;E(a==="right"?X?{bottom:window.innerHeight-T.top+4,top:"auto",right:window.innerWidth-T.right}:{top:T.bottom+4,bottom:"auto",right:window.innerWidth-T.right}:X?{bottom:window.innerHeight-T.top+4,top:"auto",left:T.left}:{top:T.bottom+4,bottom:"auto",left:T.left})};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[f,a]);const z=()=>{var N;const b=(N=S.current)==null?void 0:N.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};u.useEffect(()=>{if(!f)return;const b=T=>{var P,X;!((P=j.current)!=null&&P.contains(T.target))&&!((X=_.current)!=null&&X.contains(T.target))&&I()},N=T=>{T.key==="Escape"&&(I(),z())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[f]),u.useEffect(()=>{if(!f||!$.current||!_.current)return;const b=w(),N=$.current==="last"?b[b.length-1]:b[0];N==null||N.focus(),$.current=null},[f]);const w=()=>_.current?[..._.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=b=>{var N,T;if(b.key==="ArrowDown")b.preventDefault(),f?(N=w()[0])==null||N.focus():($.current="first",Y());else if(b.key==="ArrowUp")if(b.preventDefault(),!f)$.current="last",Y();else{const P=w();(T=P[P.length-1])==null||T.focus()}},H=b=>{var P,X,q,k;const N=w(),T=N.findIndex(c=>c===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(P=N[Math.min(T+1,N.length-1)])==null||P.focus();break;case"ArrowUp":b.preventDefault(),T<=0?z():(X=N[T-1])==null||X.focus();break;case"Home":b.preventDefault(),(q=N[0])==null||q.focus();break;case"End":b.preventDefault(),(k=N[N.length-1])==null||k.focus();break;case"Tab":I();break}},W=f&&e.jsx("div",{ref:_,role:"menu",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:B,onKeyDown:H,children:t.map((b,N)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},N);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})]},N);const T=!!b.href,P=T?"a":"button",X=T?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(P,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...X,onClick:()=>{var q;(q=b.onClick)==null||q.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})]},N)})});return e.jsxs("div",{ref:j,className:["ds-dropdown",n].filter(Boolean).join(" "),style:i,...l,children:[e.jsx("div",{ref:S,className:"ds-dropdown__trigger",onClick:V,onKeyDown:O,children:s}),typeof document<"u"&&fe.createPortal(W,document.body)]})}function Os({value:s=0,size:t="m",variant:r="default",showValue:o=!1,min:a=2,animate:n=!0}){const i=Math.min(100,Math.max(0,s)),l=Math.max(a,i),p=r==="auto"?i>=70?"success":i>=50?"warning":"danger":r;return e.jsxs("div",{className:["ds-progress",`ds-progress--${t}`,!n&&"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--${p}`,style:{width:`${l}%`}})}),o&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Ws=s=>1-Math.pow(1-s,3),Us=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Be(s,{duration:t=600}={}){const[r,o]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(Us()){o(s),a.current=s;return}const i=a.current,l=s-i;if(l===0)return;let p=null;const d=m=>{p||(p=m);const h=Math.min((m-p)/t,1);o(i+l*Ws(h)),h<1?n.current=requestAnimationFrame(d):a.current=s};return n.current=requestAnimationFrame(d),()=>cancelAnimationFrame(n.current)},[s,t]),r}function Vs({value:s,duration:t=600,decimals:r=0,prefix:o="",suffix:a=""}){const i=Be(s,{duration:t}).toFixed(r);return`${o}${i}${a}`}function Pe({threshold:s=.1,rootMargin:t="0px",once:r=!1}={}){const o=u.useRef(null),[a,n]=u.useState(!1);return u.useEffect(()=>{const i=o.current;if(!i)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(n(!0),r&&l.disconnect()):r||n(!1)},{threshold:s,rootMargin:t});return l.observe(i),()=>l.disconnect()},[s,t,r]),{ref:o,inView:a}}function Ys({children:s,as:t="div",once:r=!1,threshold:o=.1,rootMargin:a="0px",onEnter:n,onLeave:i,...l}){const{ref:p,inView:d}=Pe({threshold:o,rootMargin:a,once:r}),m=u.useRef(!1);return u.useEffect(()=>{d&&!m.current&&(n==null||n()),!d&&m.current&&(i==null||i()),m.current=d},[d]),e.jsx(t,{ref:p,...l,children:typeof s=="function"?s(d):s})}const ke={default:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};let le=[];const je=new Set;function Me(){je.forEach(s=>s([...le]))}function Xs(s){le=[...le,s],Me()}function Hs(s){le=le.filter(t=>t.id!==s),Me()}function qs(){const s=(t,r={})=>{Xs({id:`${Date.now()}-${Math.random()}`,message:t,type:"default",duration:4e3,...r})};return s.success=(t,r)=>s(t,{...r,type:"success"}),s.error=(t,r)=>s(t,{...r,type:"error"}),s.warning=(t,r)=>s(t,{...r,type:"warning"}),{toast:s}}function Ks({data:s,onDismiss:t}){const[r,o]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),s.duration>0&&(a.current=setTimeout(()=>n(),s.duration)),()=>clearTimeout(a.current)),[]);function n(){o(!1),setTimeout(()=>t(s.id),250)}const i=ke[s.type]??ke.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${s.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:s.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(i,{size:D[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:s.message}),e.jsx("button",{className:"ds-toast__close",onClick:n,"aria-label":"Закрыть",children:e.jsx(g.X,{size:D[3],strokeWidth:1.5})})]})}function Gs({position:s="bottom-right"}){const[t,r]=u.useState(()=>[...le]);return u.useEffect(()=>(je.add(r),()=>je.delete(r)),[]),!t.length||typeof document>"u"?null:fe.createPortal(e.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:t.map(o=>e.jsx(Ks,{data:o,onDismiss:Hs},o.id))}),document.body)}const Js={running:e.jsx(oe,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(oe,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(oe,{size:"xs",variant:"error",children:"Error"})};function Le({label:s,status:t="idle",icon:r,badge:o,defaultExpanded:a=!1,expanded:n,onToggle:i,children:l,className:p="",...d}){const m=t==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[r&&e.jsx("span",{className:"ds-tool-card__icon",children:r}),e.jsx("span",{className:"ds-tool-card__label",children:s}),Js[t],o]});return l?e.jsx("div",{className:["ds-tool-card",m&&"ds-tool-card--running",p].filter(Boolean).join(" "),...d,children:e.jsx(me,{title:h,padding:"s",defaultExpanded:a,expanded:m?!1:n,onToggle:m?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",p].filter(Boolean).join(" "),...d,children:h})}function Ce({text:s,size:t="xs",timeout:r=800,"aria-label":o="Copy to clipboard",...a}){const[n,i]=u.useState(!1),l=p=>{p.currentTarget.blur(),navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),r)})};return e.jsx(ae,{variant:"ghost",size:t,state:n?"success":"idle",icon:e.jsx(g.Copy,{size:D[1],strokeWidth:1.5}),"aria-label":o,onClick:l,...a})}function Zs({content:s,streaming:t=!1,...r}){const[o,a]=u.useState(t);return u.useEffect(()=>{a(!!t)},[t]),e.jsx(me,{expanded:o,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(g.Brain,{size:D[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ae,{secondary:!0,children:"Thinking"})]}),...r,children:e.jsxs(ve,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[s,t&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Qs({count:s,current:t=0,done:r=[],onChange:o,showCounter:a=!0,className:n="","aria-label":i="Steps",...l}){return e.jsxs("div",{className:["ds-step-indicator",n].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i,children:Array.from({length:s},(p,d)=>{const m=d===t,h=r.includes(d)&&!m,x=o&&(d<=t||r.includes(d)),f=["ds-step-indicator__dot",m&&"ds-step-indicator__dot--active",h&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:f,role:"tab","aria-selected":m,"aria-label":`Step ${d+1}`,disabled:!x||d===t,onClick:()=>o==null?void 0:o(d),children:h?e.jsx(g.Check,{size:8,strokeWidth:3}):null},d)})}),a&&e.jsxs(ve,{secondary:!0,className:"ds-step-indicator__counter",children:[t+1," / ",s]})]})}function et({content:s,isStreaming:t=!1,cursor:r="line",onChunk:o,className:a="",...n}){const i=u.useRef(s);return u.useEffect(()=>{s!==i.current&&(o==null||o(s),i.current=s)},[s,o]),e.jsxs("span",{className:["ds-streaming-text",a].filter(Boolean).join(" "),...n,children:[s,t&&r!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${r}`,"aria-hidden":"true"})]})}function st({role:s="assistant",header:t,footer:r,attachments:o,isStreaming:a=!1,children:n,className:i="",...l}){const p=["ds-chat-message",`ds-chat-message--${s}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return s==="system"?e.jsx("div",{className:p,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:n})}):s==="user"?e.jsxs("div",{className:p,...l,children:[o&&e.jsx("div",{className:"ds-chat-message__attachments",children:o}),e.jsx("div",{className:"ds-chat-message__bubble",children:n}),r&&e.jsx("div",{className:"ds-chat-message__footer",children:r})]}):e.jsxs("div",{className:p,...l,children:[t&&e.jsx("div",{className:"ds-chat-message__header",children:t}),o&&e.jsx("div",{className:"ds-chat-message__attachments",children:o}),e.jsx("div",{className:"ds-chat-message__body",children:n}),r&&e.jsx("div",{className:"ds-chat-message__footer",children:r})]})}function tt(s,{containerRef:t,smartPause:r=!0}={}){const o=u.useRef(!1),a=u.useRef(0);u.useEffect(()=>{const n=t==null?void 0:t.current;if(!n)return;const i=()=>{const l=n.scrollHeight-n.scrollTop-n.clientHeight<64;!l&&n.scrollTop<a.current&&(o.current=!0),l&&(o.current=!1),a.current=n.scrollTop};return n.addEventListener("scroll",i,{passive:!0}),()=>n.removeEventListener("scroll",i)},[t]),u.useEffect(()=>{const n=t==null?void 0:t.current;n&&(r&&o.current||(n.scrollTop=n.scrollHeight))},s)}function ze({prompts:s,enabled:t,typingSpeed:r=38,erasingSpeed:o=18,holdTime:a=2200,betweenTime:n=380,manualPauseMs:i=5e3}){const[l,p]=u.useState(0),[d,m]=u.useState(""),h=u.useRef("typing"),x=u.useRef(0),f=u.useRef(0),j=u.useRef(null),_=u.useRef(0);u.useEffect(()=>{f.current=l},[l]),u.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!t||s.length===0){m(""),x.current=0,h.current="typing";return}const R=()=>{const L=Date.now();if(_.current>L){j.current=setTimeout(R,_.current-L);return}const I=s[f.current%s.length]??"";h.current==="typing"?(x.current+=1,m(I.slice(0,x.current)),x.current>=I.length?(h.current="holding",j.current=setTimeout(R,a)):j.current=setTimeout(R,r+Math.random()*28)):h.current==="holding"?(h.current="erasing",j.current=setTimeout(R,o)):(x.current=Math.max(0,x.current-1),m(I.slice(0,x.current)),x.current<=0?(h.current="typing",f.current=(f.current+1)%s.length,p(f.current),j.current=setTimeout(R,n)):j.current=setTimeout(R,o))};return j.current=setTimeout(R,260),()=>{j.current&&clearTimeout(j.current)}},[t,s,r,o,a,n]);const S=R=>{if(s.length===0)return;const L=(R%s.length+s.length)%s.length,I=s[L];f.current=L,x.current=I.length,h.current="holding",_.current=Date.now()+i,p(L),m(I)},$=()=>S(f.current+1),B=()=>S(f.current-1),E=s[l%s.length]??"";return{displayed:d,currentPrompt:E,index:l,next:$,prev:B}}let rt=0;function nt({value:s="",onChange:t,onSubmit:r,onStop:o,onKeyDown:a,loading:n=!1,disabled:i=!1,placeholder:l="Let's get things done...",animatedPlaceholders:p,attachments:d,images:m,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:f,onRemoveImage:j,acceptImage:_,acceptFile:S,maxImages:$,maxImageSize:B,leftSlot:E,rightSlot:R,className:L="",...I}){const V=u.useRef(null),Y=u.useRef(null),z=u.useRef(0),[w,O]=u.useState(!1),[H,W]=u.useState([]),b=v=>{const A=++rt;W(U=>[...U,{id:A,msg:v}]),setTimeout(()=>W(U=>U.filter(K=>K.id!==A)),6e3)},N=v=>W(A=>A.filter(U=>U.id!==v)),T=v=>v.type.startsWith("image/"),P=()=>!0,X=_??T,q=S??P,k=v=>{const A=[],U=[],K=[],G=[];let Z=0,ne=$!=null?$-((m==null?void 0:m.length)??0):1/0;for(const Q of v)X(Q)?B&&Q.size>B?K.push(Q.name):ne>0?(A.push(Q),ne--):Z++:q(Q)?U.push(Q):G.push(Q.name);return{imageFiles:A,docFiles:U,tooLarge:K,skipped:G,limitExceeded:Z}},c=v=>{const{imageFiles:A,docFiles:U,tooLarge:K,skipped:G,limitExceeded:Z}=k(v);K.length&&b(`File${K.length>1?"s":""} too large${B?` (max ${B/1024/1024}MB)`:""}: ${K.join(", ")}`),G.length&&b(`Skipped unsupported file${G.length>1?"s":""}: ${G.join(", ")}`),Z&&b(`Max ${$} images per message`),x&&A.length&&x(A);const ne=U.concat(x?[]:A);h&&ne.length&&h(ne)};u.useEffect(()=>{const v=Y.current;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,200)}px`)},[s]),u.useEffect(()=>{const v=A=>{var K,G,Z;if(n||i)return;const U=(K=A.target)==null?void 0:K.tagName;U==="INPUT"||U==="TEXTAREA"||U==="SELECT"||(G=A.target)!=null&&G.isContentEditable||A.ctrlKey||A.metaKey||A.altKey||A.key.length!==1&&A.key!=="Backspace"&&A.key!=="Delete"||(Z=Y.current)==null||Z.focus()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n,i]);const y=v=>{v.preventDefault(),z.current++,v.dataTransfer.types.includes("Files")&&O(!0)},M=v=>{v.preventDefault(),z.current--,z.current===0&&O(!1)},C=v=>v.preventDefault(),ee=v=>{v.preventDefault(),z.current=0,O(!1);const A=Array.from(v.dataTransfer.files);A.length&&c(A)},te=v=>{const A=Array.from(v.target.files||[]);V.current&&(V.current.value=""),A.length&&c(A)},F=v=>{var Q;if(!x)return;const A=(Q=v.clipboardData)==null?void 0:Q.items;if(!A)return;const U=[];for(const We of A){const Ne=We.getAsFile();Ne&&U.push(Ne)}if(U.length===0)return;const{imageFiles:K,tooLarge:G,skipped:Z,limitExceeded:ne}=k(U);G.length&&b(`File${G.length>1?"s":""} too large: ${G.join(", ")}`),Z.length&&b(`Skipped unsupported file${Z.length>1?"s":""}: ${Z.join(", ")}`),ne&&b(`Max ${$} images per message`),K.length&&(v.preventDefault(),x(K))},J=!n&&!i&&!!(p!=null&&p.length)&&s.length===0,re=ze({prompts:p??[],enabled:J}),pe=v=>{if(J){if(v.key==="ArrowDown"||v.key==="ArrowRight"){v.preventDefault(),re.next();return}if(v.key==="ArrowUp"||v.key==="ArrowLeft"){v.preventDefault(),re.prev();return}if(v.key==="Tab"&&!v.shiftKey){v.preventDefault(),t==null||t(re.currentPrompt);return}}a==null||a(v)},Oe=(s.trim()||(m==null?void 0:m.length)>0||(d==null?void 0:d.length)>0)&&!i,we=h||x;return e.jsxs("div",{className:["ds-prompt-input",L].filter(Boolean).join(" "),...I,children:[we&&e.jsx("input",{ref:V,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:te}),e.jsxs("div",{className:["ds-prompt-input__box",w&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:y,onDragLeave:M,onDragOver:C,onDrop:ee,children:[w&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:"Drop files here"}),e.jsx("textarea",{ref:Y,value:s,onChange:v=>t==null?void 0:t(v.target.value),onKeyDown:pe,onPaste:F,placeholder:J?"":l,disabled:n||i,rows:1,className:["ds-prompt-input__textarea",J&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),J&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:re.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),m&&m.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:m.map((v,A)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:v.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>j==null?void 0:j(A),"aria-label":"Remove image",type:"button",children:e.jsx(g.X,{size:12,strokeWidth:2})})]},A))}),H.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:H.map(v=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:v.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>N(v.id),"aria-label":"Dismiss",children:e.jsx(g.X,{size:D[1],strokeWidth:1.5})})]},v.id))}),d&&d.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:d.map((v,A)=>e.jsx(oe,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[v.uploading?e.jsx(g.Loader,{size:D[1],strokeWidth:1.5,className:"spin"}):e.jsx(g.Paperclip,{size:D[1],strokeWidth:1.5}),v.filename,v.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:"Uploading..."}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>f==null?void 0:f(A),children:e.jsx(g.X,{size:D[1],strokeWidth:1.5})})]})},A))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[we&&e.jsx(ae,{variant:"ghost",size:"xs",icon:e.jsx(g.Paperclip,{size:D[2],strokeWidth:1.5}),"aria-label":"Attach files",onClick:()=>{var v;return(v=V.current)==null?void 0:v.click()}}),E,R,e.jsx("div",{className:"ds-prompt-input__spacer"}),n?e.jsx(ae,{variant:"primary",size:"xs",icon:e.jsx(g.Square,{size:D[2],strokeWidth:1.5}),onClick:o,"aria-label":"Stop"}):e.jsx(ae,{variant:"primary",size:"xs",icon:e.jsx(g.ArrowUp,{size:D[2],strokeWidth:1.5}),onClick:r,disabled:!Oe,"aria-label":"Send"})]})]})]})}const Ee={fast:0,standard:1,premium:2},Te={fast:"data-5",standard:"data-3",premium:"data-6"};function at({models:s=[],value:t,onChange:r,size:o="xs",minTier:a,showAutoOption:n=!1,groupByTier:i=!0,className:l="",...p}){const[d,m]=u.useState(!1),h=u.useRef(null),x=u.useRef(null),f=u.useRef(null),[j,_]=u.useState({}),S=s.filter(w=>!a||w.name==="auto"?!0:(Ee[w.tier]??1)>=(Ee[a]??1)),$=S.find(w=>w.name==="auto"),B=S.filter(w=>w.name!=="auto"),E=s.find(w=>w.name===t),L=new Set(B.map(w=>w.tier).filter(Boolean)).size>1;u.useEffect(()=>{if(!d)return;const w=320,O=()=>{var P;const b=(P=x.current)==null?void 0:P.getBoundingClientRect();if(!b)return;const N=window.innerHeight-b.bottom,T=N<w+8&&b.top>N;_({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:b.left,...T?{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 H=b=>{var N,T;!((N=h.current)!=null&&N.contains(b.target))&&!((T=f.current)!=null&&T.contains(b.target))&&m(!1)},W=b=>{b.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",H),document.addEventListener("keydown",W),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),document.removeEventListener("mousedown",H),document.removeEventListener("keydown",W)}},[d]);const I=w=>{r==null||r(w),m(!1)},V=w=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",w.name===t&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(w.name),children:[w.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:w.icon}):e.jsx(g.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:w.displayName||w.name}),L&&w.tier&&e.jsx(oe,{size:"xs",variant:Te[w.tier]||"default",children:w.tier})]},w.name),Y=()=>!i||!L?B.map(V):["fast","standard","premium"].flatMap(w=>{const O=B.filter(H=>H.tier===w);return O.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":w,children:w.charAt(0).toUpperCase()+w.slice(1)},`lbl-${w}`),...O.map(V)]:[]}),z=d&&e.jsxs("div",{ref:f,className:"ds-model-picker__menu ds-scrollable",style:j,children:[n&&$&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",t==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx(g.Zap,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),B.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),Y()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...p,children:[e.jsxs("button",{ref:x,type:"button",className:"ds-model-picker__trigger",onClick:()=>m(w=>!w),"aria-haspopup":"listbox","aria-expanded":d,children:[E!=null&&E.icon?e.jsx("span",{children:E.icon}):e.jsx(g.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(E==null?void 0:E.displayName)||(E==null?void 0:E.name)||t}),L&&(E==null?void 0:E.tier)&&e.jsx(oe,{size:"xs",variant:Te[E.tier]||"default",children:E.tier})]}),typeof document<"u"&&fe.createPortal(z,document.body)]})}const ot=({filename:s,pages:t})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:s}),t.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(t)})]});function _e(s){return s!=null&&s.length?"p. "+s.join(", "):null}function it(s){const t=new Map;for(const r of s)t.has(r.filename)||t.set(r.filename,{filename:r.filename,url:r.url,items:[]}),t.get(r.filename).items.push(r);return[...t.values()]}function lt({sources:s=[],layout:t="list",title:r="Sources",maxVisible:o=5,onSourceClick:a}){const[n,i]=u.useState(!1),l=it(s),p=l.length>o,d=n?l:l.slice(0,o),m=s.some(x=>x.snippet),h=["ds-sources-panel",t==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return t==="compact"?e.jsxs("div",{className:h,children:[d.map(x=>{const f=x.items.map(_=>_.page).filter(Boolean),j=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${j?" ds-sources-panel__compact-row--clickable":""}`,onClick:j?()=>a(x.items[0]):void 0,children:[e.jsx(g.FileText,{size:D[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),f.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(f)})]},x.filename)}),p&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>i(!0),children:["+",l.length-o," more sources"]})]}):e.jsxs("div",{className:h,children:[r&&e.jsx("div",{className:"ds-sources-panel__title",children:r}),d.map(x=>{const f=x.items.map(_=>_.page).filter(Boolean),j=!!a;return m?e.jsx(me,{title:e.jsx(ot,{filename:x.filename,pages:f}),padding:"s",children:x.items.map((_,S)=>e.jsx("div",{className:`ds-sources-panel__snippet${j?" ds-sources-panel__snippet--clickable":""}`,onClick:j?()=>a(_):void 0,children:_.snippet??`p. ${_.page}`},S))},x.filename):e.jsxs("div",{className:`ds-sources-panel__row${j?" ds-sources-panel__row--clickable":""}`,onClick:j?()=>a(x.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),f.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(f)})]},x.filename)}),p&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>i(!0),children:["+",l.length-o," more sources"]})]})}function $e(s){return s>=1e6?(s/1e6).toFixed(1).replace(/\.0$/,"")+"M":s>=1e3?(s/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(s)}function ct({used:s,limit:t,size:r="s",showCount:o=!0,showPercent:a=!1,warningThreshold:n=.8,errorThreshold:i=1}){const l=t>0?s/t:0,p=Math.min(l*100,100),d=l>=i?"error":l>=n?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${r}`,role:"meter","aria-valuenow":s,"aria-valuemax":t,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${d}`,style:{width:`${p}%`}})}),(o||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${d}`,children:[o&&e.jsxs("span",{children:[$e(s)," / ",$e(t)," tokens"]}),a&&e.jsxs("span",{children:[Math.round(l*100),"%"]})]})]})}const Re=5;function dt(s){return s<.34?"low":s<.67?"medium":"high"}function ut({value:s=0,size:t="xs",showLabel:r="none",layout:o="inline"}){const a=Math.max(0,Math.min(1,s)),n=Math.round(a*Re),i=dt(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${t}`,`ds-confidence-bar--${i}`,o==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Re},(l,p)=>e.jsx("div",{className:`ds-confidence-bar__seg${p<n?" ds-confidence-bar__seg--filled":""}`},p))}),r==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const ft={add:"+",remove:"-",context:" "};function he({line:s,lineNumbers:t}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${s.type}`,children:[t&&s.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:s.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:ft[s.type]}),e.jsx("span",{className:"ds-diff-view__text",children:s.text})]})}function mt({lines:s=[],layout:t="inline",wordWrap:r=!1,lineNumbers:o=!0,maxHeight:a,title:n}){const i=["ds-diff-view",`ds-diff-view--${t}`,r&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=a?{maxHeight:a,overflowY:"auto"}:void 0;if(t==="split"){const p=s.filter(m=>m.type==="remove"||m.type==="context"),d=s.filter(m=>m.type==="add"||m.type==="context");return e.jsxs("div",{className:i,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),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:p.map((m,h)=>e.jsx(he,{line:m,lineNumbers:o},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((m,h)=>e.jsx(he,{line:m,lineNumbers:o},h))})]})]})}return e.jsxs("div",{className:i,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:s.map((p,d)=>e.jsx(he,{line:p,lineNumbers:o},d))})]})}function Fe({value:s="idle",onLike:t,onDislike:r,className:o="",...a}){const n=s!=="idle";return e.jsxs("div",{className:["ds-message-feedback",n&&"ds-message-feedback--voted",o].filter(Boolean).join(" "),...a,children:[(!n||s==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",s==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:t,disabled:n,"aria-label":"Like","aria-pressed":s==="liked",children:e.jsx(g.ThumbsUp,{size:D[1],strokeWidth:1.5,fill:s==="liked"?"currentColor":"none"})}),(!n||s==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",s==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:r,disabled:n,"aria-label":"Dislike","aria-pressed":s==="disliked",children:e.jsx(g.ThumbsDown,{size:D[1],strokeWidth:1.5,fill:s==="disliked"?"currentColor":"none"})})]})}function pt(s){const t=s instanceof Date?s:new Date(s);if(isNaN(t))return null;const r=new Date,o=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=new Date(a-864e5);if(t>=a)return o;if(t>=n)return`Yesterday ${o}`;const i=t.getDate(),l=t.toLocaleString([],{month:"short"});return`${i} ${l} ${o}`}function ht({role:s="assistant",text:t,timestamp:r,feedbackValue:o="idle",onLike:a,onDislike:n,className:i="",...l}){const p=s==="assistant"&&(a||n),d=!!t,m=r?pt(r):null;return!p&&!d&&!m?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${s}`,i].filter(Boolean).join(" "),...l,children:[s==="user"&&m&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:m}),p&&e.jsx(Fe,{className:"ds-message-action",value:o,onLike:a,onDislike:n}),d&&e.jsx(Ce,{className:"ds-message-action",text:t}),s==="assistant"&&m&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:m})]})}function xt({label:s,className:t="",...r}){return e.jsxs("span",{className:["ds-thinking-dot",t].filter(Boolean).join(" "),...r,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),s&&e.jsx("span",{className:"ds-thinking-dot__label",children:s})]})}function bt({variant:s="light",glow:t,mask:r=!0,style:o,...a}){const n=s==="dark",i=t??n,l=n?"rgba(255,250,250,0.05)":"var(--color-border-light)",p=n?"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%)"},...o},...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(${p} 1px, transparent 1px)`,`linear-gradient(90deg, ${p} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...r&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function jt({children:s,axis:t="y",style:r,className:o="",...a}){const n=t==="x"?{overflowX:"auto",overflowY:"hidden"}:t==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${o}`,style:{...n,...r},...a,children:s})}exports.Accordion=me;exports.Alert=rs;exports.AnimatedNumber=Vs;exports.Avatar=Ns;exports.Badge=oe;exports.Banner=zs;exports.BottomSheet=is;exports.Breadcrumb=Is;exports.Button=ae;exports.Card=Ge;exports.ChatMessage=st;exports.Checkbox=bs;exports.Code=ls;exports.CodeAccordion=De;exports.ConfidenceBar=ut;exports.CopyButton=Ce;exports.DiffView=mt;exports.Drawer=Ls;exports.DrawerFooter=be;exports.Dropdown=Fs;exports.EmptyState=Ss;exports.EngineerGrid=bt;exports.FormField=As;exports.H1=Je;exports.H2=Ze;exports.H3=Qe;exports.H4=es;exports.InView=Ys;exports.Input=Xe;exports.Link=cs;exports.MessageFeedback=Fe;exports.MessageFooter=ht;exports.Modal=as;exports.ModalFooter=ue;exports.ModelPicker=at;exports.P1=ss;exports.P2=Ae;exports.P3=ve;exports.Pagination=Bs;exports.ProgressBar=Os;exports.PromptInput=nt;exports.Radio=js;exports.ReasoningBlock=Zs;exports.Scrollable=jt;exports.SegmentedControl=fs;exports.Select=qe;exports.Skeleton=Ie;exports.SourcesPanel=lt;exports.Spinner=Se;exports.Stat=Ds;exports.StepIndicator=Qs;exports.Stepper=Ke;exports.StreamingText=et;exports.Tab=us;exports.Table=gs;exports.TableBody=ks;exports.TableHead=ys;exports.TableRow=Es;exports.TableSubheaderRow=Ts;exports.Tabs=ds;exports.Td=Rs;exports.Textarea=He;exports.Th=$s;exports.ThinkingDot=xt;exports.ToastContainer=Gs;exports.Toggle=xs;exports.TokenCounter=ct;exports.ToolCallBubble=Le;exports.ToolCallCard=Le;exports.Tooltip=hs;exports.iconSizes=D;exports.useAnimatedNumber=Be;exports.useAnimatedPlaceholder=ze;exports.useInView=Pe;exports.useStreamScroll=tt;exports.useToast=qs;
22
+ <%s key={someKey} {...props} />`,C,F,J,F),k[F+C]=!0)}if(F=null,M!==void 0&&(r(M),F=""+M),i(y)&&(r(y.key),F=""+y.key),"key"in y){M={};for(var re in y)re!=="key"&&(M[re]=y[re])}else M=y;return F&&l(M,typeof c=="function"?c.displayName||c.name||"Unknown":c),d(c,F,M,a(),ee,te)}function h(c){x(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===z&&(c._payload.status==="fulfilled"?x(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function x(c){return typeof c=="object"&&c!==null&&c.$$typeof===j}var f=u,j=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),H=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,b=Array.isArray,N=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(c){return c()}};var $,P={},X=f.react_stack_bottom_frame.bind(f,n)(),q=N(o(n)),k={};de.Fragment=S,de.jsx=function(c,y,M){var C=1e4>H.recentlyCreatedOwnerStacks++;return m(c,y,M,!1,C?Error("react-stack-top-frame"):X,C?N(o(c)):q)},de.jsxs=function(c,y,M){var C=1e4>H.recentlyCreatedOwnerStacks++;return m(c,y,M,!0,C?Error("react-stack-top-frame"):X,C?N(o(c)):q)}}()),de}process.env.NODE_ENV==="production"?xe.exports=Ue():xe.exports=Ve();var e=xe.exports;function Se({size:s="m",color:t="default",className:r="",...o}){return e.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${t}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}const Ye={xs:12,s:14,m:16,l:20};function ae({children:s,variant:t="primary",size:r="m",fullWidth:o=!1,icon:a,disabled:n=!1,state:i="idle",onClick:l,type:p="button",href:d,"aria-label":m,className:h="",...x}){const f=a&&!s,j=i==="loading",_=i==="success",S=i==="error",T=j||_||S,B=r==="xs"?"s":"m",E=t==="danger"?"on-accent":"default",R=Ye[r]??16,L=j?e.jsx(Se,{size:B,color:E}):_?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(g.Check,{size:R,strokeWidth:2.5})}):S?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(g.X,{size:R,strokeWidth:2.5})}):null,I=["ds-button",`ds-button--${t}`,`ds-button--${r}`,o&&"ds-button--full",f&&"ds-button--icon-only",h].filter(Boolean).join(" "),V=i!=="idle"?i:void 0,Y=e.jsxs(e.Fragment,{children:[T?L:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(d){const z=w=>{if(n||j){w.preventDefault();return}w.metaKey||w.ctrlKey||w.button===1||(w.preventDefault(),l==null||l(w))};return e.jsx("a",{className:I,href:n||j?void 0:d,onClick:z,"aria-label":m,"aria-disabled":n||j?"true":void 0,"aria-busy":j?"true":void 0,"data-state":V,...x,children:Y})}return e.jsx("button",{type:p,className:I,disabled:n,onClick:j?void 0:l,"aria-label":m,"aria-busy":j?"true":void 0,"data-state":V,...x,children:Y})}function Xe({label:s,error:t,hint:r,fullWidth:o=!0,icon:a,iconRight:n,onIconRightClick:i,size:l="m",disabled:p,id:d,...m}){const h=d||`input-${u.useId()}`,x=r?`${h}-hint`:void 0,f=t?`${h}-error`:void 0,j=f||x;return e.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${t?"ds-input-wrapper--error":""}`,children:[s&&e.jsx("label",{className:"ds-input-label",htmlFor:h,children:s}),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:h,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${t?"ds-input--error":""}`,disabled:p,"aria-invalid":t?"true":"false","aria-describedby":j,...m}),n&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:n})]}),r&&!t&&e.jsx("span",{id:x,className:"ds-input-hint",children:r}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:t&&e.jsx("span",{id:f,className:"ds-input-error",role:"alert",children:t})})})]})}function He({label:s,error:t,hint:r,fullWidth:o=!0,size:a="m",disabled:n,id:i,resize:l=!0,rows:p=3,...d}){const m=i||`textarea-${u.useId()}`,h=r?`${m}-hint`:void 0,x=t?`${m}-error`:void 0,f=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${n?"ds-textarea-wrapper--disabled":""}`,children:[s&&e.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:s}),e.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${a} ${t?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":t?"true":"false","aria-describedby":f,rows:p,...d}),r&&!t&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:r}),t&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:t})]})}function qe({label:s,value:t,onChange:r,options:o=[],placeholder:a="Select option",error:n,fullWidth:i=!0,size:l="m",disabled:p=!1,id:d,...m}){const[h,x]=u.useState(!1),[f,j]=u.useState(!1),[_,S]=u.useState({}),[T,B]=u.useState("down"),[E,R]=u.useState(-1),L=u.useRef(null),I=u.useRef(null),V=u.useRef(null),Y=u.useRef(null),z=d||`select-${u.useId()}`,w=`${z}-label`,O=n?`${z}-error`:void 0,H=150,W=(k=!1)=>{f||(j(!0),R(-1),Y.current=setTimeout(()=>{var c;x(!1),j(!1),k&&((c=V.current)==null||c.focus())},H))},b=k=>{clearTimeout(Y.current),j(!1);const c=k!==void 0?k:Math.max(o.findIndex(y=>y.value===t),0);R(c),x(!0)};u.useEffect(()=>()=>clearTimeout(Y.current),[]);const N=()=>{var te;const k=(te=L.current)==null?void 0:te.getBoundingClientRect();if(!k)return;const c=window.innerHeight,y=c-k.bottom,M=k.top,ee=y<300&&M>y;B(ee?"up":"down"),S(ee?{bottom:c-k.top+4,left:k.left,width:k.width}:{top:k.bottom+4,left:k.left,width:k.width})};u.useEffect(()=>{if(h)return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[h]),u.useEffect(()=>{const k=c=>{L.current&&!L.current.contains(c.target)&&I.current&&!I.current.contains(c.target)&&W()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]),u.useEffect(()=>{var c;if(!h||E<0||!I.current)return;(c=I.current.querySelectorAll(".ds-select-option")[E])==null||c.scrollIntoView({block:"nearest"})},[E,h]);const $=k=>{switch(k.key){case"ArrowDown":k.preventDefault(),h?R(c=>Math.min(c+1,o.length-1)):b();break;case"ArrowUp":k.preventDefault(),h?R(c=>Math.max(c-1,0)):b(o.length-1);break;case"Home":h&&(k.preventDefault(),R(0));break;case"End":h&&(k.preventDefault(),R(o.length-1));break;case"Enter":case" ":k.preventDefault(),h?E>=0&&(r==null||r(o[E].value),W(!0)):b();break;case"Escape":h&&(k.preventDefault(),W(!0));break;case"Tab":h&&W(!1);break}},P=o.find(k=>k.value===t),X=l==="xs"?D[1]:l==="small"?D[2]:D[3],q=h&&e.jsx("div",{ref:I,"data-ds-portal":"",role:"listbox","aria-labelledby":s?w:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${T}`,f&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:_,children:o.map((k,c)=>e.jsx("button",{id:`${z}-opt-${c}`,type:"button",role:"option",tabIndex:-1,"aria-selected":t===k.value,className:["ds-select-option",`ds-select-option--${l}`,t===k.value&&"ds-select-option--selected",c===E&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(k.value),W(!0)},children:k.label},k.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[s&&e.jsx("label",{id:w,className:"ds-select-label",children:s}),e.jsx("div",{className:"ds-select-container",ref:L,children:e.jsxs("button",{ref:V,type:"button",id:z,role:"combobox","aria-haspopup":"listbox","aria-expanded":h,"aria-activedescendant":h&&E>=0?`${z}-opt-${E}`:void 0,"aria-labelledby":s?w:void 0,"aria-invalid":n?"true":"false","aria-describedby":O,className:`ds-select-trigger ds-select-trigger--${l} ${n?"ds-select-trigger--error":""}`,onClick:()=>{p||(h?W():b())},onKeyDown:$,disabled:p,...m,children:[e.jsx("span",{className:P?"":"ds-select-placeholder",children:(P==null?void 0:P.label)||a}),e.jsx(g.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${h&&T==="down"?"ds-select-icon--open":""} ${h&&T==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&e.jsx("span",{id:O,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&fe.createPortal(q,document.body)]})}function Ke({label:s,value:t=0,onChange:r,min:o=0,max:a=100,step:n=1,size:i="m",disabled:l=!1,hint:p,error:d,...m}){const h=()=>{if(l)return;const T=Math.min(Number(t)+n,a);r==null||r(T)},x=()=>{if(l)return;const T=Math.max(Number(t)-n,o);r==null||r(T)},f=T=>{if(l)return;const B=T.target.value;if(B===""){r==null||r(o);return}const E=Number(B);if(!isNaN(E)){const R=Math.min(Math.max(E,o),a);r==null||r(R)}},j=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",d&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),_=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),S=i==="xs"?D[1]:i==="small"?D[2]:D[3];return e.jsxs("div",{className:j,children:[s&&e.jsx("label",{className:"ds-stepper-label",children:s}),e.jsxs("div",{className:_,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:l||t<=o,"aria-label":"Decrease",children:e.jsx(g.Minus,{size:S,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:t,onChange:f,min:o,max:a,step:n,disabled:l,...m}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:h,disabled:l||t>=a,"aria-label":"Increase",children:e.jsx(g.Plus,{size:S,strokeWidth:1.5})})]}),p&&!d&&e.jsx("div",{className:"ds-stepper-hint",children:p}),d&&e.jsx("div",{className:"ds-stepper-error",children:d})]})}function Ge({children:s,padding:t="m",variant:r="info",hover:o=!1,onClick:a,href:n,disabled:i=!1,...l}){const d=(o?"interactive":r)==="interactive"||a||n,m=["ds-card",`ds-card--${t}`,d&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const f=j=>{if(i){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),a==null||a(j))};return e.jsx("a",{className:m,href:i?void 0:n,onClick:f,"aria-disabled":i?"true":void 0,...l,children:s})}const h=d&&a?"button":"div",x=d&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(h,{className:m,role:d&&!a?"article":void 0,...x,...l,children:s})}function Je({children:s,...t}){return e.jsx("h1",{className:"ds-h1",...t,children:s})}function Ze({children:s,...t}){return e.jsx("h2",{className:"ds-h2",...t,children:s})}function Qe({children:s,...t}){return e.jsx("h3",{className:"ds-h3",...t,children:s})}function es({children:s,...t}){return e.jsx("h4",{className:"ds-h4",...t,children:s})}function ss({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p1 ${t?"ds-p1--secondary":""}`,...r,children:s})}function Ae({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p2 ${t?"ds-p2--secondary":""}`,...r,children:s})}function ve({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p3 ${t?"ds-p3--secondary":""}`,...r,children:s})}function oe({children:s,variant:t="default",size:r="m",role:o,...a}){const n=["ds-badge",`ds-badge--${t}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=o||(["info","success","warning","error"].includes(t)?"status":void 0);return e.jsx("span",{className:n,role:i,...a,children:s})}const ts={info:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};function rs({children:s,variant:t="info",title:r,onClose:o,role:a,...n}){const i=ts[t],l=a||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-alert ds-alert--${t} ${r?"":"ds-alert--no-title"}`,role:l,...n,children:[i&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(i,{size:D[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})]}),o&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:e.jsx(g.X,{size:D[3],strokeWidth:1.5})})]})}const ns=200;function as({children:s,title:t,onClose:r,size:o="m",scrollable:a=!1,subHeader:n,...i}){const l=u.useRef(null),p=u.useId(),[d,m]=u.useState(!1),h=()=>{!r||d||(m(!0),setTimeout(()=>{m(!1),r()},ns))};u.useEffect(()=>{const _=T=>{T.key==="Escape"&&h()},S=T=>{l.current&&!l.current.contains(T.target)&&!T.target.closest("[data-ds-portal]")&&h()};return document.addEventListener("keydown",_),document.addEventListener("mousedown",S),()=>{document.removeEventListener("keydown",_),document.removeEventListener("mousedown",S)}},[r,d]);const x=u.Children.toArray(s),f=x.find(_=>(_==null?void 0:_.type)===ue),j=x.filter(_=>(_==null?void 0:_.type)!==ue);return e.jsx("div",{className:["ds-modal-overlay",d&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...i,children:e.jsxs("div",{className:[`ds-modal ds-modal--${o}`,a&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:l,role:"dialog","aria-modal":"true","aria-labelledby":t?p:void 0,children:[(t||r||n)&&e.jsxs("div",{className:"ds-modal__header",children:[(t||r)&&e.jsxs("div",{className:"ds-modal__header-row",children:[t&&e.jsx("h3",{id:p,className:"ds-modal__title",children:t}),r&&e.jsx(ae,{variant:"ghost",size:"small",icon:e.jsx(g.X,{size:D[2],strokeWidth:1.5}),onClick:h,"aria-label":"Close modal"})]}),n&&e.jsx("div",{className:"ds-modal__subheader",children:n})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:j}),f]})})}function ue({children:s}){return!s||u.Children.count(s)===0?null:e.jsx("div",{className:"ds-modal__footer",children:s})}const os=320;function is({children:s,title:t,onClose:r,subHeader:o,...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),d=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},os))};u.useEffect(()=>{const f=_=>{_.key==="Escape"&&d()},j=_=>{n.current&&!n.current.contains(_.target)&&!_.target.closest("[data-ds-portal]")&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[r,l]);const m=u.Children.toArray(s),h=m.find(f=>(f==null?void 0:f.type)===ue),x=m.filter(f=>(f==null?void 0:f.type)!==ue);return e.jsx("div",{className:["ds-bottom-sheet-overlay",l&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("div",{ref:n,className:["ds-bottom-sheet",l&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":t?i:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),(t||r||o)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[(t||r)&&e.jsxs("div",{className:"ds-bottom-sheet__header-row",children:[t&&e.jsx("h3",{id:i,className:"ds-bottom-sheet__title",children:t}),r&&e.jsx(ae,{variant:"ghost",size:"small",icon:e.jsx(g.X,{size:D[2],strokeWidth:1.5}),onClick:d,"aria-label":"Close"})]}),o&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:o})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:x}),h]})})}function De({children:s,title:t="Code",defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="s",className:i="",...l}){const[p,d]=u.useState(r),m=o!==void 0,h=m?o:p,x=()=>{m?a==null||a(!o):d(j=>!j)},f=["ds-code-accordion",`ds-code-accordion--${n}`,h&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:f,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":h,children:[e.jsx("span",{className:"ds-code-accordion__title",children:t}),e.jsx(g.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${h?"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:s})})})})]})}function ls({children:s,block:t=!1,collapsible:r=!1,title:o="Code",defaultExpanded:a=!1,...n}){return t?r?e.jsx(De,{title:o,defaultExpanded:a,...n,children:s}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...n,children:e.jsx("code",{children:s})}):e.jsx("code",{className:"ds-code-inline",...n,children:s})}function cs({href:s,children:t,onClick:r,target:o,rel:a,...n}){const l=o==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:s,className:"ds-link",onClick:r,target:o,rel:l,...n,children:t})}function ds({children:s,size:t="m",variant:r="ghost",...o}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(s,a=>u.isValidElement(a)?u.cloneElement(a,{size:t,variant:r}):a)})}function us({children:s,selected:t=!1,onClick:r,size:o="m",variant:a="ghost",disabled:n=!1,icon:i,href:l,...p}){const d=i&&!s,m=["ds-tab",`ds-tab--${o}`,`ds-tab--${a}`,t&&"ds-tab--selected",d&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),s]});if(l){const x=f=>{if(n){f.preventDefault();return}f.metaKey||f.ctrlKey||f.button===1||(f.preventDefault(),r==null||r(f))};return e.jsx("a",{role:"tab","aria-current":t?"page":void 0,"aria-disabled":n?"true":void 0,className:m,href:n?void 0:l,onClick:x,...p,children:h})}return e.jsx("button",{role:"tab","aria-selected":t,className:m,onClick:r,disabled:n,...p,children:h})}function fs({options:s,value:t,onChange:r,size:o="m",disabled:a=!1}){const n=u.useRef(null),i=u.useRef(null),[l,p]=u.useState(!1),d=u.useRef(!1),m=u.useRef(null),h=u.useRef(null),x=()=>{if(!n.current)return;const f=n.current.querySelector(`[data-value="${t}"]`);if(!f)return;const j=n.current.getBoundingClientRect(),_=f.getBoundingClientRect(),S=_.left-j.left,T=_.width;i.current?(i.current.style.transition=d.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=S+"px",i.current.style.width=T+"px",d.current=!1):(p(!0),requestAnimationFrame(()=>{if(!i.current||!n.current)return;const B=n.current.querySelector(`[data-value="${t}"]`);if(!B)return;const E=n.current.getBoundingClientRect(),R=B.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=R.left-E.left+"px",i.current.style.width=R.width+"px"}))};return h.current=x,u.useLayoutEffect(()=>{const f=m.current!==t;m.current=t,d.current=l&&f,x()}),u.useEffect(()=>{if(!n.current)return;const f=new ResizeObserver(()=>{d.current=!1,h.current()});return f.observe(n.current),()=>f.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),s.map(f=>e.jsxs("button",{type:"button","data-value":f.value,className:["ds-seg__btn",t===f.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(f.value),"aria-pressed":t===f.value,disabled:a,children:[f.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:f.icon}),f.label]},f.value))]})}function me({children:s,title:t,defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="m",...i}){const[l,p]=u.useState(r),d=o!==void 0,m=d?o:l,h=()=>{d?a==null||a(!o):p(f=>!f)},x=["ds-accordion",`ds-accordion--${n}`,m&&"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":m,children:[e.jsx("span",{className:"ds-accordion__title",children:t}),e.jsx(g.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"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:s})})})]})}const se=8,ie=8;function ms(s,t,r){const o=window.innerWidth;let a,n;switch(s){case"top":a=t.top-r.height-se,n=t.left+t.width/2-r.width/2;break;case"bottom":a=t.bottom+se,n=t.left+t.width/2-r.width/2;break;case"left":a=t.top+t.height/2-r.height/2,n=t.left-r.width-se;break;case"right":a=t.top+t.height/2-r.height/2,n=t.right+se;break;default:a=t.bottom+se,n=t.left}const i=Math.max(ie,Math.min(o-r.width-ie,n)),l=n-i;return{top:a,left:i,arrowOffset:l}}function ps(s,t,r){const o=window.innerWidth,a=window.innerHeight;if(s.top>=t+se+ie)return"top";if(a-s.bottom>=t+se+ie)return"bottom";if(o-s.right>=r+se+ie)return"right";if(s.left>=r+se+ie)return"left";const n=Math.max(s.top,a-s.bottom,s.left,o-s.right);return n===s.top?"top":n===a-s.bottom?"bottom":n===o-s.right?"right":"left"}function hs({children:s,content:t,position:r,...o}){const[a,n]=u.useState(!1),[i,l]=u.useState({visibility:"hidden"}),[p,d]=u.useState(r||"top"),m=u.useRef(null),h=u.useRef(null),x=u.useRef(!1),f=()=>{if(!m.current||!h.current)return;const _=m.current.getBoundingClientRect(),S=h.current.getBoundingClientRect(),T=r||ps(_,S.height,S.width),{top:B,left:E,arrowOffset:R}=ms(T,_,S);d(T),l({position:"fixed",top:B,left:E,visibility:"visible","--arrow-offset":`${R}px`})};if(u.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const _=requestAnimationFrame(f);return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{cancelAnimationFrame(_),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[a,r]),u.useEffect(()=>{if(!a)return;const _=S=>{m.current&&!m.current.contains(S.target)&&n(!1)};return document.addEventListener("touchstart",_),()=>document.removeEventListener("touchstart",_)},[a]),!t)return s;const j=a&&e.jsx("div",{ref:h,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:i,children:t});return e.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||n(!0)},onMouseLeave:()=>{x.current||n(!1)},onTouchStart:()=>{x.current=!0,n(_=>!_)},...o,children:[s,typeof document<"u"&&fe.createPortal(j,document.body)]})}function xs({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:s,onChange:d=>t==null?void 0:t(d.target.checked),disabled:o,...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 bs({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),d=r==="xs"?10:r==="small"?14:r==="large"?20:16;return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:s,onChange:m=>t==null?void 0:t(m.target.checked),disabled:o,...i}),e.jsx("span",{className:"ds-checkbox__box",children:s&&e.jsx(g.Check,{size:d,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function js({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,name:n,value:i,id:l,...p}){const d=l||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:m,htmlFor:d,children:[e.jsx("input",{type:"radio",id:d,className:"ds-radio__input",checked:s,onChange:h=>t==null?void 0:t(h.target.checked),disabled:o,name:n,value:i,...p}),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 Ie({width:s,height:t,shape:r="rect",aspectRatio:o,className:a="",style:n={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,a].filter(Boolean).join(" "),style:{width:s,height:t,aspectRatio:o,...n},"aria-hidden":"true",...i})}function _s({lines:s=1,lastLineWidth:t="70%",gap:r,className:o="",style:a={},...n}){return e.jsx("span",{className:["ds-skeleton-text",o].filter(Boolean).join(" "),style:{gap:r,...a},"aria-hidden":"true",...n,children:Array.from({length:s},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===s-1&&s>1?{width:t}:void 0},l))})}Ie.Text=_s;function vs(s){let t=2166136261;for(let r=0;r<s.length;r++)t^=s.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t%360}function ws(s){if(!s)return"";const t=s.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():s[0].toUpperCase()}function Ns({seed:s,icon:t,src:r,size:o=32,className:a="",style:n={},...i}){const l=vs(s??""),[p,d]=u.useState(!1),m=t??e.jsx("span",{className:"ds-avatar__initials",children:ws(s)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...n},"aria-hidden":"true",...i,children:r&&!p?e.jsx("img",{src:r,alt:"",onError:()=>d(!0)}):m})}function gs({children:s,size:t="compact",stickyTop:r,maxHeight:o,className:a="",style:n={},...i}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...n};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${t}`,a].filter(Boolean).join(" "),...i,children:s})})}function ys({children:s,...t}){return e.jsx("thead",{...t,children:s})}function ks({children:s,...t}){return e.jsx("tbody",{...t,children:s})}function Es({children:s,interactive:t,selected:r,subheader:o,exiting:a,updated:n,className:i="",onClick:l,...p}){return e.jsx("tr",{className:["ds-table-row",t||l?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",a?"ds-table-row--exiting":"",n?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...p,children:s})}function Ts({children:s,colSpan:t=999,...r}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:e.jsx("td",{colSpan:t,children:s})})}function $s({children:s,align:t="left",sortDir:r,onSort:o,width:a,className:n="",style:i={},...l}){const p=!!o||r!==void 0,d=r==="asc"?g.ChevronUp:r==="desc"?g.ChevronDown:g.ChevronsUpDown;return e.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",t!=="left"?`ds-table-cell--${t}`:"",n].filter(Boolean).join(" "),onClick:o,style:{width:a,...i},...l,children:p?e.jsxs("span",{className:"ds-th__inner",children:[s,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(d,{size:11,strokeWidth:2.5})})]}):s})}function Rs({children:s,align:t="left",secondary:r,muted:o,truncate:a,nowrap:n,className:i="",...l}){return e.jsx("td",{className:["ds-td",t!=="left"?`ds-table-cell--${t}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",n?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:s})}function Ss({icon:s,title:t,description:r,action:o,size:a="m",className:n="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,n].filter(Boolean).join(" "),...i,children:[s&&e.jsx("div",{className:"ds-empty-state__icon",children:s}),e.jsx("div",{className:"ds-empty-state__title",children:t}),r&&e.jsx("div",{className:"ds-empty-state__description",children:r}),o&&e.jsx("div",{className:"ds-empty-state__action",children:o})]})}function As({label:s,hint:t,error:r,required:o=!1,disabled:a=!1,htmlFor:n,children:i,className:l="",style:p,...d}){const m=u.useId(),h=n??m,x=`${h}-hint`,f=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":r?"error":void 0,"data-required":o?"":void 0,"data-disabled":a?"":void 0,style:p,...d,children:[s&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:s}),e.jsx("div",{className:"ds-field-control",children:i}),t&&!r&&e.jsx("p",{className:"ds-field-hint",id:x,children:t}),r&&e.jsx("p",{className:"ds-field-error",id:f,role:"alert",children:r})]})}function Ds({label:s,value:t,delta:r,size:o="m",inline:a=!1,className:n="",style:i,...l}){const p=r!=null&&r.startsWith("+")?"up":r!=null&&r.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${o}`,a&&"ds-stat--inline",n].filter(Boolean).join(" "),style:i,...l,children:[s&&e.jsx("span",{className:"ds-stat-label",children:s}),t!=null&&e.jsx("span",{className:"ds-stat-value",children:t}),r!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${p}`,children:r})]})}function Is({children:s,separator:t="/","aria-label":r="Breadcrumb",className:o="",style:a,...n}){const i=u.Children.toArray(s).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${o?` ${o}`:""}`,"aria-label":r,style:a,...n,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:i.map((l,p)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[l,p<i.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:t})]},p))})})}function Bs({page:s,total:t,onChange:r,siblings:o=1,"aria-label":a="Pagination",className:n="",style:i,...l}){const p=Ps(s,t,o);return e.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:i,...l,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s-1),disabled:s<=1,"aria-label":"Previous page",children:e.jsx(g.ChevronLeft,{size:16})}),p.map((d,m)=>d==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${m}`):e.jsx("button",{className:`ds-pagination-page${d===s?" ds-pagination-page--current":""}`,onClick:()=>d!==s&&(r==null?void 0:r(d)),"aria-current":d===s?"page":void 0,"aria-label":`Page ${d}`,children:d},d)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s+1),disabled:s>=t,"aria-label":"Next page",children:e.jsx(g.ChevronRight,{size:16})})]})}function Ps(s,t,r){if(t<=7)return Array.from({length:t},(i,l)=>l+1);const o=Math.max(2,s-r),a=Math.min(t-1,s+r),n=[1];o>2&&n.push("…");for(let i=o;i<=a;i++)n.push(i);return a<t-1&&n.push("…"),n.push(t),n}const Ms=200;function Ls({children:s,title:t,onClose:r,side:o="right",...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),d=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},Ms))};u.useEffect(()=>{const f=_=>{_.key==="Escape"&&d()},j=_=>{n.current&&!n.current.contains(_.target)&&!_.target.closest("[data-ds-portal]")&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[r,l]);const m=u.Children.toArray(s),h=m.find(f=>(f==null?void 0:f.type)===be),x=m.filter(f=>(f==null?void 0:f.type)!==be);return e.jsx("div",{className:["ds-drawer-overlay",l&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("aside",{className:["ds-drawer",l&&"ds-drawer--closing"].filter(Boolean).join(" "),"data-side":o,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?i:void 0,children:[e.jsxs("header",{className:"ds-drawer-header",children:[t&&e.jsx("h3",{id:i,className:"ds-drawer-title",children:t}),r&&e.jsx("button",{className:"ds-drawer-close",onClick:d,"aria-label":"Close drawer",children:e.jsx(g.X,{size:D[2],strokeWidth:1.5})})]}),e.jsx("div",{className:"ds-drawer-body ds-scrollable",children:x}),h]})})}function be({children:s}){return e.jsx("footer",{className:"ds-drawer-footer",children:s})}const Cs={info:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};function zs({children:s,variant:t="info",action:r,onAction:o,onDismiss:a,role:n,...i}){const l=Cs[t],p=n||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${t}`,role:p,...i,children:[l&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(l,{size:D[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:s}),r&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:o,children:r}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":"Dismiss",children:e.jsx(g.X,{size:D[2],strokeWidth:1.5})})]})}function Fs({trigger:s,items:t=[],open:r,onOpenChange:o,align:a="left",className:n="",style:i,...l}){const[p,d]=u.useState(!1),[m,h]=u.useState(!1),x=r!==void 0,f=x?r:p,j=u.useRef(null),_=u.useRef(null),S=u.useRef(null),T=u.useRef(null),[B,E]=u.useState({}),R=u.useRef(null),L=150,I=()=>{if(x)o==null||o(!1);else{if(m)return;h(!0),R.current=setTimeout(()=>{d(!1),h(!1)},L)}},V=()=>{const b=!f;x?o==null||o(b):b?(clearTimeout(R.current),h(!1),d(!0)):I()},Y=()=>{f||(x?o==null||o(!0):(clearTimeout(R.current),h(!1),d(!0)))};u.useEffect(()=>()=>clearTimeout(R.current),[]),u.useEffect(()=>{if(!f)return;const b=300,N=()=>{var q;const $=(q=j.current)==null?void 0:q.getBoundingClientRect();if(!$)return;const P=window.innerHeight-$.bottom,X=P<b+8&&$.top>P;E(a==="right"?X?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:X?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[f,a]);const z=()=>{var N;const b=(N=S.current)==null?void 0:N.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};u.useEffect(()=>{if(!f)return;const b=$=>{var P,X;!((P=j.current)!=null&&P.contains($.target))&&!((X=_.current)!=null&&X.contains($.target))&&I()},N=$=>{$.key==="Escape"&&(I(),z())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",N)}},[f]),u.useEffect(()=>{if(!f||!T.current||!_.current)return;const b=w(),N=T.current==="last"?b[b.length-1]:b[0];N==null||N.focus(),T.current=null},[f]);const w=()=>_.current?[..._.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=b=>{var N,$;if(b.key==="ArrowDown")b.preventDefault(),f?(N=w()[0])==null||N.focus():(T.current="first",Y());else if(b.key==="ArrowUp")if(b.preventDefault(),!f)T.current="last",Y();else{const P=w();($=P[P.length-1])==null||$.focus()}},H=b=>{var P,X,q,k;const N=w(),$=N.findIndex(c=>c===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(P=N[Math.min($+1,N.length-1)])==null||P.focus();break;case"ArrowUp":b.preventDefault(),$<=0?z():(X=N[$-1])==null||X.focus();break;case"Home":b.preventDefault(),(q=N[0])==null||q.focus();break;case"End":b.preventDefault(),(k=N[N.length-1])==null||k.focus();break;case"Tab":I();break}},W=f&&e.jsx("div",{ref:_,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:B,onKeyDown:H,children:t.map((b,N)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},N);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})]},N);const $=!!b.href,P=$?"a":"button",X=$?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(P,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...X,onClick:()=>{var q;(q=b.onClick)==null||q.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})]},N)})});return e.jsxs("div",{ref:j,className:["ds-dropdown",n].filter(Boolean).join(" "),style:i,...l,children:[e.jsx("div",{ref:S,className:"ds-dropdown__trigger",onClick:V,onKeyDown:O,children:s}),typeof document<"u"&&fe.createPortal(W,document.body)]})}function Os({value:s=0,size:t="m",variant:r="default",showValue:o=!1,min:a=2,animate:n=!0}){const i=Math.min(100,Math.max(0,s)),l=Math.max(a,i),p=r==="auto"?i>=70?"success":i>=50?"warning":"danger":r;return e.jsxs("div",{className:["ds-progress",`ds-progress--${t}`,!n&&"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--${p}`,style:{width:`${l}%`}})}),o&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const Ws=s=>1-Math.pow(1-s,3),Us=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Be(s,{duration:t=600}={}){const[r,o]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(Us()){o(s),a.current=s;return}const i=a.current,l=s-i;if(l===0)return;let p=null;const d=m=>{p||(p=m);const h=Math.min((m-p)/t,1);o(i+l*Ws(h)),h<1?n.current=requestAnimationFrame(d):a.current=s};return n.current=requestAnimationFrame(d),()=>cancelAnimationFrame(n.current)},[s,t]),r}function Vs({value:s,duration:t=600,decimals:r=0,prefix:o="",suffix:a=""}){const i=Be(s,{duration:t}).toFixed(r);return`${o}${i}${a}`}function Pe({threshold:s=.1,rootMargin:t="0px",once:r=!1}={}){const o=u.useRef(null),[a,n]=u.useState(!1);return u.useEffect(()=>{const i=o.current;if(!i)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(n(!0),r&&l.disconnect()):r||n(!1)},{threshold:s,rootMargin:t});return l.observe(i),()=>l.disconnect()},[s,t,r]),{ref:o,inView:a}}function Ys({children:s,as:t="div",once:r=!1,threshold:o=.1,rootMargin:a="0px",onEnter:n,onLeave:i,...l}){const{ref:p,inView:d}=Pe({threshold:o,rootMargin:a,once:r}),m=u.useRef(!1);return u.useEffect(()=>{d&&!m.current&&(n==null||n()),!d&&m.current&&(i==null||i()),m.current=d},[d]),e.jsx(t,{ref:p,...l,children:typeof s=="function"?s(d):s})}const ke={default:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};let le=[];const je=new Set;function Me(){je.forEach(s=>s([...le]))}function Xs(s){le=[...le,s],Me()}function Hs(s){le=le.filter(t=>t.id!==s),Me()}function qs(){const s=(t,r={})=>{Xs({id:`${Date.now()}-${Math.random()}`,message:t,type:"default",duration:4e3,...r})};return s.success=(t,r)=>s(t,{...r,type:"success"}),s.error=(t,r)=>s(t,{...r,type:"error"}),s.warning=(t,r)=>s(t,{...r,type:"warning"}),{toast:s}}function Ks({data:s,onDismiss:t}){const[r,o]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),s.duration>0&&(a.current=setTimeout(()=>n(),s.duration)),()=>clearTimeout(a.current)),[]);function n(){o(!1),setTimeout(()=>t(s.id),250)}const i=ke[s.type]??ke.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${s.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:s.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(i,{size:D[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:s.message}),e.jsx("button",{className:"ds-toast__close",onClick:n,"aria-label":"Закрыть",children:e.jsx(g.X,{size:D[3],strokeWidth:1.5})})]})}function Gs({position:s="bottom-right"}){const[t,r]=u.useState(()=>[...le]);return u.useEffect(()=>(je.add(r),()=>je.delete(r)),[]),!t.length||typeof document>"u"?null:fe.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:t.map(o=>e.jsx(Ks,{data:o,onDismiss:Hs},o.id))}),document.body)}const Js={running:e.jsx(oe,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(oe,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(oe,{size:"xs",variant:"error",children:"Error"})};function Le({label:s,status:t="idle",icon:r,badge:o,defaultExpanded:a=!1,expanded:n,onToggle:i,children:l,className:p="",...d}){const m=t==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[r&&e.jsx("span",{className:"ds-tool-card__icon",children:r}),e.jsx("span",{className:"ds-tool-card__label",children:s}),Js[t],o]});return l?e.jsx("div",{className:["ds-tool-card",m&&"ds-tool-card--running",p].filter(Boolean).join(" "),...d,children:e.jsx(me,{title:h,padding:"s",defaultExpanded:a,expanded:m?!1:n,onToggle:m?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",p].filter(Boolean).join(" "),...d,children:h})}function Ce({text:s,size:t="xs",timeout:r=800,"aria-label":o="Copy to clipboard",...a}){const[n,i]=u.useState(!1),l=p=>{p.currentTarget.blur(),navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),r)})};return e.jsx(ae,{variant:"ghost",size:t,state:n?"success":"idle",icon:e.jsx(g.Copy,{size:D[1],strokeWidth:1.5}),"aria-label":o,onClick:l,...a})}function Zs({content:s,streaming:t=!1,...r}){const[o,a]=u.useState(t);return u.useEffect(()=>{a(!!t)},[t]),e.jsx(me,{expanded:o,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(g.Brain,{size:D[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ae,{secondary:!0,children:"Thinking"})]}),...r,children:e.jsxs(ve,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[s,t&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Qs({count:s,current:t=0,done:r=[],onChange:o,showCounter:a=!0,className:n="","aria-label":i="Steps",...l}){return e.jsxs("div",{className:["ds-step-indicator",n].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i,children:Array.from({length:s},(p,d)=>{const m=d===t,h=r.includes(d)&&!m,x=o&&(d<=t||r.includes(d)),f=["ds-step-indicator__dot",m&&"ds-step-indicator__dot--active",h&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:f,role:"tab","aria-selected":m,"aria-label":`Step ${d+1}`,disabled:!x||d===t,onClick:()=>o==null?void 0:o(d),children:h?e.jsx(g.Check,{size:8,strokeWidth:3}):null},d)})}),a&&e.jsxs(ve,{secondary:!0,className:"ds-step-indicator__counter",children:[t+1," / ",s]})]})}function et({content:s,isStreaming:t=!1,cursor:r="line",onChunk:o,className:a="",...n}){const i=u.useRef(s);return u.useEffect(()=>{s!==i.current&&(o==null||o(s),i.current=s)},[s,o]),e.jsxs("span",{className:["ds-streaming-text",a].filter(Boolean).join(" "),...n,children:[s,t&&r!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${r}`,"aria-hidden":"true"})]})}function st({role:s="assistant",header:t,footer:r,attachments:o,isStreaming:a=!1,children:n,className:i="",...l}){const p=["ds-chat-message",`ds-chat-message--${s}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return s==="system"?e.jsx("div",{className:p,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:n})}):s==="user"?e.jsxs("div",{className:p,...l,children:[o&&e.jsx("div",{className:"ds-chat-message__attachments",children:o}),e.jsx("div",{className:"ds-chat-message__bubble",children:n}),r&&e.jsx("div",{className:"ds-chat-message__footer",children:r})]}):e.jsxs("div",{className:p,...l,children:[t&&e.jsx("div",{className:"ds-chat-message__header",children:t}),o&&e.jsx("div",{className:"ds-chat-message__attachments",children:o}),e.jsx("div",{className:"ds-chat-message__body",children:n}),r&&e.jsx("div",{className:"ds-chat-message__footer",children:r})]})}function tt(s,{containerRef:t,smartPause:r=!0}={}){const o=u.useRef(!1),a=u.useRef(0);u.useEffect(()=>{const n=t==null?void 0:t.current;if(!n)return;const i=()=>{const l=n.scrollHeight-n.scrollTop-n.clientHeight<64;!l&&n.scrollTop<a.current&&(o.current=!0),l&&(o.current=!1),a.current=n.scrollTop};return n.addEventListener("scroll",i,{passive:!0}),()=>n.removeEventListener("scroll",i)},[t]),u.useEffect(()=>{const n=t==null?void 0:t.current;n&&(r&&o.current||(n.scrollTop=n.scrollHeight))},s)}function ze({prompts:s,enabled:t,typingSpeed:r=38,erasingSpeed:o=18,holdTime:a=2200,betweenTime:n=380,manualPauseMs:i=5e3}){const[l,p]=u.useState(0),[d,m]=u.useState(""),h=u.useRef("typing"),x=u.useRef(0),f=u.useRef(0),j=u.useRef(null),_=u.useRef(0);u.useEffect(()=>{f.current=l},[l]),u.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!t||s.length===0){m(""),x.current=0,h.current="typing";return}const R=()=>{const L=Date.now();if(_.current>L){j.current=setTimeout(R,_.current-L);return}const I=s[f.current%s.length]??"";h.current==="typing"?(x.current+=1,m(I.slice(0,x.current)),x.current>=I.length?(h.current="holding",j.current=setTimeout(R,a)):j.current=setTimeout(R,r+Math.random()*28)):h.current==="holding"?(h.current="erasing",j.current=setTimeout(R,o)):(x.current=Math.max(0,x.current-1),m(I.slice(0,x.current)),x.current<=0?(h.current="typing",f.current=(f.current+1)%s.length,p(f.current),j.current=setTimeout(R,n)):j.current=setTimeout(R,o))};return j.current=setTimeout(R,260),()=>{j.current&&clearTimeout(j.current)}},[t,s,r,o,a,n]);const S=R=>{if(s.length===0)return;const L=(R%s.length+s.length)%s.length,I=s[L];f.current=L,x.current=I.length,h.current="holding",_.current=Date.now()+i,p(L),m(I)},T=()=>S(f.current+1),B=()=>S(f.current-1),E=s[l%s.length]??"";return{displayed:d,currentPrompt:E,index:l,next:T,prev:B}}let rt=0;function nt({value:s="",onChange:t,onSubmit:r,onStop:o,onKeyDown:a,loading:n=!1,disabled:i=!1,placeholder:l="Let's get things done...",animatedPlaceholders:p,attachments:d,images:m,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:f,onRemoveImage:j,acceptImage:_,acceptFile:S,maxImages:T,maxImageSize:B,leftSlot:E,rightSlot:R,className:L="",...I}){const V=u.useRef(null),Y=u.useRef(null),z=u.useRef(0),[w,O]=u.useState(!1),[H,W]=u.useState([]),b=v=>{const A=++rt;W(U=>[...U,{id:A,msg:v}]),setTimeout(()=>W(U=>U.filter(K=>K.id!==A)),6e3)},N=v=>W(A=>A.filter(U=>U.id!==v)),$=v=>v.type.startsWith("image/"),P=()=>!0,X=_??$,q=S??P,k=v=>{const A=[],U=[],K=[],G=[];let Z=0,ne=T!=null?T-((m==null?void 0:m.length)??0):1/0;for(const Q of v)X(Q)?B&&Q.size>B?K.push(Q.name):ne>0?(A.push(Q),ne--):Z++:q(Q)?U.push(Q):G.push(Q.name);return{imageFiles:A,docFiles:U,tooLarge:K,skipped:G,limitExceeded:Z}},c=v=>{const{imageFiles:A,docFiles:U,tooLarge:K,skipped:G,limitExceeded:Z}=k(v);K.length&&b(`File${K.length>1?"s":""} too large${B?` (max ${B/1024/1024}MB)`:""}: ${K.join(", ")}`),G.length&&b(`Skipped unsupported file${G.length>1?"s":""}: ${G.join(", ")}`),Z&&b(`Max ${T} images per message`),x&&A.length&&x(A);const ne=U.concat(x?[]:A);h&&ne.length&&h(ne)};u.useEffect(()=>{const v=Y.current;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,200)}px`)},[s]),u.useEffect(()=>{const v=A=>{var K,G,Z;if(n||i)return;const U=(K=A.target)==null?void 0:K.tagName;U==="INPUT"||U==="TEXTAREA"||U==="SELECT"||(G=A.target)!=null&&G.isContentEditable||A.ctrlKey||A.metaKey||A.altKey||A.key.length!==1&&A.key!=="Backspace"&&A.key!=="Delete"||(Z=Y.current)==null||Z.focus()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n,i]);const y=v=>{v.preventDefault(),z.current++,v.dataTransfer.types.includes("Files")&&O(!0)},M=v=>{v.preventDefault(),z.current--,z.current===0&&O(!1)},C=v=>v.preventDefault(),ee=v=>{v.preventDefault(),z.current=0,O(!1);const A=Array.from(v.dataTransfer.files);A.length&&c(A)},te=v=>{const A=Array.from(v.target.files||[]);V.current&&(V.current.value=""),A.length&&c(A)},F=v=>{var Q;if(!x)return;const A=(Q=v.clipboardData)==null?void 0:Q.items;if(!A)return;const U=[];for(const We of A){const Ne=We.getAsFile();Ne&&U.push(Ne)}if(U.length===0)return;const{imageFiles:K,tooLarge:G,skipped:Z,limitExceeded:ne}=k(U);G.length&&b(`File${G.length>1?"s":""} too large: ${G.join(", ")}`),Z.length&&b(`Skipped unsupported file${Z.length>1?"s":""}: ${Z.join(", ")}`),ne&&b(`Max ${T} images per message`),K.length&&(v.preventDefault(),x(K))},J=!n&&!i&&!!(p!=null&&p.length)&&s.length===0,re=ze({prompts:p??[],enabled:J}),pe=v=>{if(J){if(v.key==="ArrowDown"||v.key==="ArrowRight"){v.preventDefault(),re.next();return}if(v.key==="ArrowUp"||v.key==="ArrowLeft"){v.preventDefault(),re.prev();return}if(v.key==="Tab"&&!v.shiftKey){v.preventDefault(),t==null||t(re.currentPrompt);return}}a==null||a(v)},Oe=(s.trim()||(m==null?void 0:m.length)>0||(d==null?void 0:d.length)>0)&&!i,we=h||x;return e.jsxs("div",{className:["ds-prompt-input",L].filter(Boolean).join(" "),...I,children:[we&&e.jsx("input",{ref:V,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:te}),e.jsxs("div",{className:["ds-prompt-input__box",w&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:y,onDragLeave:M,onDragOver:C,onDrop:ee,children:[w&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:"Drop files here"}),e.jsx("textarea",{ref:Y,value:s,onChange:v=>t==null?void 0:t(v.target.value),onKeyDown:pe,onPaste:F,placeholder:J?"":l,disabled:n||i,rows:1,className:["ds-prompt-input__textarea",J&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),J&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:re.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),m&&m.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:m.map((v,A)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:v.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>j==null?void 0:j(A),"aria-label":"Remove image",type:"button",children:e.jsx(g.X,{size:12,strokeWidth:2})})]},A))}),H.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:H.map(v=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:v.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>N(v.id),"aria-label":"Dismiss",children:e.jsx(g.X,{size:D[1],strokeWidth:1.5})})]},v.id))}),d&&d.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:d.map((v,A)=>e.jsx(oe,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[v.uploading?e.jsx(g.Loader,{size:D[1],strokeWidth:1.5,className:"spin"}):e.jsx(g.Paperclip,{size:D[1],strokeWidth:1.5}),v.filename,v.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:"Uploading..."}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>f==null?void 0:f(A),children:e.jsx(g.X,{size:D[1],strokeWidth:1.5})})]})},A))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[we&&e.jsx(ae,{variant:"ghost",size:"xs",icon:e.jsx(g.Paperclip,{size:D[2],strokeWidth:1.5}),"aria-label":"Attach files",onClick:()=>{var v;return(v=V.current)==null?void 0:v.click()}}),E,R,e.jsx("div",{className:"ds-prompt-input__spacer"}),n?e.jsx(ae,{variant:"primary",size:"xs",icon:e.jsx(g.Square,{size:D[2],strokeWidth:1.5}),onClick:o,"aria-label":"Stop"}):e.jsx(ae,{variant:"primary",size:"xs",icon:e.jsx(g.ArrowUp,{size:D[2],strokeWidth:1.5}),onClick:r,disabled:!Oe,"aria-label":"Send"})]})]})]})}const Ee={fast:0,standard:1,premium:2},Te={fast:"data-5",standard:"data-3",premium:"data-6"};function at({models:s=[],value:t,onChange:r,size:o="xs",minTier:a,showAutoOption:n=!1,groupByTier:i=!0,className:l="",...p}){const[d,m]=u.useState(!1),h=u.useRef(null),x=u.useRef(null),f=u.useRef(null),[j,_]=u.useState({}),S=s.filter(w=>!a||w.name==="auto"?!0:(Ee[w.tier]??1)>=(Ee[a]??1)),T=S.find(w=>w.name==="auto"),B=S.filter(w=>w.name!=="auto"),E=s.find(w=>w.name===t),L=new Set(B.map(w=>w.tier).filter(Boolean)).size>1;u.useEffect(()=>{if(!d)return;const w=320,O=()=>{var P;const b=(P=x.current)==null?void 0:P.getBoundingClientRect();if(!b)return;const N=window.innerHeight-b.bottom,$=N<w+8&&b.top>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 H=b=>{var N,$;!((N=h.current)!=null&&N.contains(b.target))&&!(($=f.current)!=null&&$.contains(b.target))&&m(!1)},W=b=>{b.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",H),document.addEventListener("keydown",W),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),document.removeEventListener("mousedown",H),document.removeEventListener("keydown",W)}},[d]);const I=w=>{r==null||r(w),m(!1)},V=w=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",w.name===t&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(w.name),children:[w.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:w.icon}):e.jsx(g.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:w.displayName||w.name}),L&&w.tier&&e.jsx(oe,{size:"xs",variant:Te[w.tier]||"default",children:w.tier})]},w.name),Y=()=>!i||!L?B.map(V):["fast","standard","premium"].flatMap(w=>{const O=B.filter(H=>H.tier===w);return O.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":w,children:w.charAt(0).toUpperCase()+w.slice(1)},`lbl-${w}`),...O.map(V)]:[]}),z=d&&e.jsxs("div",{ref:f,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:j,children:[n&&T&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",t==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx(g.Zap,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),B.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),Y()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...p,children:[e.jsxs("button",{ref:x,type:"button",className:"ds-model-picker__trigger",onClick:()=>m(w=>!w),"aria-haspopup":"listbox","aria-expanded":d,children:[E!=null&&E.icon?e.jsx("span",{children:E.icon}):e.jsx(g.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(E==null?void 0:E.displayName)||(E==null?void 0:E.name)||t}),L&&(E==null?void 0:E.tier)&&e.jsx(oe,{size:"xs",variant:Te[E.tier]||"default",children:E.tier})]}),typeof document<"u"&&fe.createPortal(z,document.body)]})}const ot=({filename:s,pages:t})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:s}),t.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(t)})]});function _e(s){return s!=null&&s.length?"p. "+s.join(", "):null}function it(s){const t=new Map;for(const r of s)t.has(r.filename)||t.set(r.filename,{filename:r.filename,url:r.url,items:[]}),t.get(r.filename).items.push(r);return[...t.values()]}function lt({sources:s=[],layout:t="list",title:r="Sources",maxVisible:o=5,onSourceClick:a}){const[n,i]=u.useState(!1),l=it(s),p=l.length>o,d=n?l:l.slice(0,o),m=s.some(x=>x.snippet),h=["ds-sources-panel",t==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return t==="compact"?e.jsxs("div",{className:h,children:[d.map(x=>{const f=x.items.map(_=>_.page).filter(Boolean),j=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${j?" ds-sources-panel__compact-row--clickable":""}`,onClick:j?()=>a(x.items[0]):void 0,children:[e.jsx(g.FileText,{size:D[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),f.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(f)})]},x.filename)}),p&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>i(!0),children:["+",l.length-o," more sources"]})]}):e.jsxs("div",{className:h,children:[r&&e.jsx("div",{className:"ds-sources-panel__title",children:r}),d.map(x=>{const f=x.items.map(_=>_.page).filter(Boolean),j=!!a;return m?e.jsx(me,{title:e.jsx(ot,{filename:x.filename,pages:f}),padding:"s",children:x.items.map((_,S)=>e.jsx("div",{className:`ds-sources-panel__snippet${j?" ds-sources-panel__snippet--clickable":""}`,onClick:j?()=>a(_):void 0,children:_.snippet??`p. ${_.page}`},S))},x.filename):e.jsxs("div",{className:`ds-sources-panel__row${j?" ds-sources-panel__row--clickable":""}`,onClick:j?()=>a(x.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),f.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:_e(f)})]},x.filename)}),p&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>i(!0),children:["+",l.length-o," more sources"]})]})}function $e(s){return s>=1e6?(s/1e6).toFixed(1).replace(/\.0$/,"")+"M":s>=1e3?(s/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(s)}function ct({used:s,limit:t,size:r="s",showCount:o=!0,showPercent:a=!1,warningThreshold:n=.8,errorThreshold:i=1}){const l=t>0?s/t:0,p=Math.min(l*100,100),d=l>=i?"error":l>=n?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${r}`,role:"meter","aria-valuenow":s,"aria-valuemax":t,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${d}`,style:{width:`${p}%`}})}),(o||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${d}`,children:[o&&e.jsxs("span",{children:[$e(s)," / ",$e(t)," tokens"]}),a&&e.jsxs("span",{children:[Math.round(l*100),"%"]})]})]})}const Re=5;function dt(s){return s<.34?"low":s<.67?"medium":"high"}function ut({value:s=0,size:t="xs",showLabel:r="none",layout:o="inline"}){const a=Math.max(0,Math.min(1,s)),n=Math.round(a*Re),i=dt(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${t}`,`ds-confidence-bar--${i}`,o==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Re},(l,p)=>e.jsx("div",{className:`ds-confidence-bar__seg${p<n?" ds-confidence-bar__seg--filled":""}`},p))}),r==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const ft={add:"+",remove:"-",context:" "};function he({line:s,lineNumbers:t}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${s.type}`,children:[t&&s.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:s.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:ft[s.type]}),e.jsx("span",{className:"ds-diff-view__text",children:s.text})]})}function mt({lines:s=[],layout:t="inline",wordWrap:r=!1,lineNumbers:o=!0,maxHeight:a,title:n}){const i=["ds-diff-view",`ds-diff-view--${t}`,r&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=a?{maxHeight:a,overflowY:"auto"}:void 0;if(t==="split"){const p=s.filter(m=>m.type==="remove"||m.type==="context"),d=s.filter(m=>m.type==="add"||m.type==="context");return e.jsxs("div",{className:i,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),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:p.map((m,h)=>e.jsx(he,{line:m,lineNumbers:o},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((m,h)=>e.jsx(he,{line:m,lineNumbers:o},h))})]})]})}return e.jsxs("div",{className:i,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:s.map((p,d)=>e.jsx(he,{line:p,lineNumbers:o},d))})]})}function Fe({value:s="idle",onLike:t,onDislike:r,className:o="",...a}){const n=s!=="idle";return e.jsxs("div",{className:["ds-message-feedback",n&&"ds-message-feedback--voted",o].filter(Boolean).join(" "),...a,children:[(!n||s==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",s==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:t,disabled:n,"aria-label":"Like","aria-pressed":s==="liked",children:e.jsx(g.ThumbsUp,{size:D[1],strokeWidth:1.5,fill:s==="liked"?"currentColor":"none"})}),(!n||s==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",s==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:r,disabled:n,"aria-label":"Dislike","aria-pressed":s==="disliked",children:e.jsx(g.ThumbsDown,{size:D[1],strokeWidth:1.5,fill:s==="disliked"?"currentColor":"none"})})]})}function pt(s){const t=s instanceof Date?s:new Date(s);if(isNaN(t))return null;const r=new Date,o=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=new Date(a-864e5);if(t>=a)return o;if(t>=n)return`Yesterday ${o}`;const i=t.getDate(),l=t.toLocaleString([],{month:"short"});return`${i} ${l} ${o}`}function ht({role:s="assistant",text:t,timestamp:r,feedbackValue:o="idle",onLike:a,onDislike:n,className:i="",...l}){const p=s==="assistant"&&(a||n),d=!!t,m=r?pt(r):null;return!p&&!d&&!m?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${s}`,i].filter(Boolean).join(" "),...l,children:[s==="user"&&m&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:m}),p&&e.jsx(Fe,{className:"ds-message-action",value:o,onLike:a,onDislike:n}),d&&e.jsx(Ce,{className:"ds-message-action",text:t}),s==="assistant"&&m&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:m})]})}function xt({label:s,className:t="",...r}){return e.jsxs("span",{className:["ds-thinking-dot",t].filter(Boolean).join(" "),...r,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),s&&e.jsx("span",{className:"ds-thinking-dot__label",children:s})]})}function bt({variant:s="light",glow:t,mask:r=!0,style:o,...a}){const n=s==="dark",i=t??n,l=n?"rgba(255,250,250,0.05)":"var(--color-border-light)",p=n?"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%)"},...o},...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(${p} 1px, transparent 1px)`,`linear-gradient(90deg, ${p} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...r&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function jt({children:s,axis:t="y",style:r,className:o="",...a}){const n=t==="x"?{overflowX:"auto",overflowY:"hidden"}:t==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${o}`,style:{...n,...r},...a,children:s})}exports.Accordion=me;exports.Alert=rs;exports.AnimatedNumber=Vs;exports.Avatar=Ns;exports.Badge=oe;exports.Banner=zs;exports.BottomSheet=is;exports.Breadcrumb=Is;exports.Button=ae;exports.Card=Ge;exports.ChatMessage=st;exports.Checkbox=bs;exports.Code=ls;exports.CodeAccordion=De;exports.ConfidenceBar=ut;exports.CopyButton=Ce;exports.DiffView=mt;exports.Drawer=Ls;exports.DrawerFooter=be;exports.Dropdown=Fs;exports.EmptyState=Ss;exports.EngineerGrid=bt;exports.FormField=As;exports.H1=Je;exports.H2=Ze;exports.H3=Qe;exports.H4=es;exports.InView=Ys;exports.Input=Xe;exports.Link=cs;exports.MessageFeedback=Fe;exports.MessageFooter=ht;exports.Modal=as;exports.ModalFooter=ue;exports.ModelPicker=at;exports.P1=ss;exports.P2=Ae;exports.P3=ve;exports.Pagination=Bs;exports.ProgressBar=Os;exports.PromptInput=nt;exports.Radio=js;exports.ReasoningBlock=Zs;exports.Scrollable=jt;exports.SegmentedControl=fs;exports.Select=qe;exports.Skeleton=Ie;exports.SourcesPanel=lt;exports.Spinner=Se;exports.Stat=Ds;exports.StepIndicator=Qs;exports.Stepper=Ke;exports.StreamingText=et;exports.Tab=us;exports.Table=gs;exports.TableBody=ks;exports.TableHead=ys;exports.TableRow=Es;exports.TableSubheaderRow=Ts;exports.Tabs=ds;exports.Td=Rs;exports.Textarea=He;exports.Th=$s;exports.ThinkingDot=xt;exports.ToastContainer=Gs;exports.Toggle=xs;exports.TokenCounter=ct;exports.ToolCallBubble=Le;exports.ToolCallCard=Le;exports.Tooltip=hs;exports.iconSizes=D;exports.useAnimatedNumber=Be;exports.useAnimatedPlaceholder=ze;exports.useInView=Pe;exports.useStreamScroll=tt;exports.useToast=qs;