@donkit-ai/design-system 1.3.16 → 1.4.0
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 +4 -4
- package/dist/index.d.ts +63 -0
- package/dist/index.es.js +945 -752
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),w=require("lucide-react"),ue=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),w=require("lucide-react"),ue=require("react-dom"),A={1:16,2:20,3:24,4:28,5:48};var he={exports:{}},ce={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ye;function Fe(){if(ye)return ce;ye=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,a,n){var o=null;if(n!==void 0&&(o=""+n),a.key!==void 0&&(o=""+a.key),"key"in a){n={};for(var c in a)c!=="key"&&(n[c]=a[c])}else n=a;return a=n.ref,{$$typeof:s,type:i,key:o,ref:a!==void 0?a:null,props:n}}return ce.Fragment=t,ce.jsx=r,ce.jsxs=r,ce}var le={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ge;function ze(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){function s(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Y?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case S:return"Fragment";case E:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case N:return"SuspenseList";case V:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case v:return"Portal";case $:return l.displayName||"Context";case I:return(l._context.displayName||"Context")+".Consumer";case L:var y=l.render;return l=l.displayName,l||(l=y.displayName||y.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case P:return y=l.displayName||null,y!==null?y:s(l.type)||"Memo";case O:y=l._payload,l=l._init;try{return s(l(y))}catch{}}return null}function t(l){return""+l}function r(l){try{t(l);var y=!1}catch{y=!0}if(y){y=console;var B=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return B.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(l)}}function i(l){if(l===S)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===O)return"<...>";try{var y=s(l);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var l=X.A;return l===null?null:l.getOwner()}function n(){return Error("react-stack-top-frame")}function o(l){if(W.call(l,"key")){var y=Object.getOwnPropertyDescriptor(l,"key").get;if(y&&y.isReactWarning)return!1}return l.key!==void 0}function c(l,y){function B(){M||(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))}B.isReactWarning=!0,Object.defineProperty(l,"key",{get:B,configurable:!0})}function h(){var l=s(this.type);return z[l]||(z[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function f(l,y,B,C,ee,te){var F=B.ref;return l={$$typeof:_,type:l,key:y,props:B,_owner:C},(F!==void 0?F:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:h}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function m(l,y,B,C,ee,te){var F=y.children;if(F!==void 0)if(C)if(b(F)){for(C=0;C<F.length;C++)p(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 p(F);if(W.call(y,"key")){F=s(l);var J=Object.keys(y).filter(function(fe){return fe!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",g[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),g[F+C]=!0)}if(F=null,B!==void 0&&(r(B),F=""+B),i(y)&&(r(y.key),F=""+y.key),"key"in y){B={};for(var re in y)re!=="key"&&(B[re]=y[re])}else B=y;return F&&c(B,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,F,B,a(),ee,se)}function m(l){x(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===O&&(l._payload.status==="fulfilled"?x(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function x(l){return typeof l=="object"&&l!==null&&l.$$typeof===j}var d=u,j=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),X=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,b=Array.isArray,k=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(l){return l()}};var L,z={},q=d.react_stack_bottom_frame.bind(d,n)(),G=k(o(n)),g={};le.Fragment=$,le.jsx=function(l,y,B){var C=1e4>X.recentlyCreatedOwnerStacks++;return p(l,y,B,!1,C?Error("react-stack-top-frame"):q,C?k(o(l)):G)},le.jsxs=function(l,y,B){var C=1e4>X.recentlyCreatedOwnerStacks++;return p(l,y,B,!0,C?Error("react-stack-top-frame"):q,C?k(o(l)):G)}}()),le}process.env.NODE_ENV==="production"?me.exports=Le():me.exports=Me();var e=me.exports;function ge({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 Oe={xs:12,s:14,m:16,l:20};function oe({children:s,variant:t="primary",size:r="m",fullWidth:o=!1,icon:a,disabled:n=!1,state:i="idle",onClick:c,type:h="button",href:f,"aria-label":p,...m}){const x=a&&!s,d=i==="loading",j=i==="success",_=i==="error",$=d||j||_,T=r==="xs"?"s":"m",E=Oe[r]??16,A=d?e.jsx(ge,{size:T}):j?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(w.Check,{size:E,strokeWidth:2.5})}):_?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(w.X,{size:E,strokeWidth:2.5})}):null,R=["ds-button",`ds-button--${t}`,`ds-button--${r}`,o&&"ds-button--full",x&&"ds-button--icon-only"].filter(Boolean).join(" "),M=i!=="idle"?i:void 0,D=e.jsxs(e.Fragment,{children:[$?A:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(f){const N=P=>{if(n||d){P.preventDefault();return}P.metaKey||P.ctrlKey||P.button===1||(P.preventDefault(),c==null||c(P))};return e.jsx("a",{className:R,href:n||d?void 0:f,onClick:N,"aria-label":p,"aria-disabled":n||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":M,...m,children:D})}return e.jsx("button",{type:h,className:R,disabled:n,onClick:d?void 0:c,"aria-label":p,"aria-busy":d?"true":void 0,"data-state":M,...m,children:D})}function Ce({label:s,error:t,hint:r,fullWidth:o=!0,icon:a,iconRight:n,onIconRightClick:i,size:c="m",disabled:h,id:f,...p}){const m=f||`input-${u.useId()}`,x=r?`${m}-hint`:void 0,d=t?`${m}-error`:void 0,j=d||x;return e.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${h?"ds-input-wrapper--disabled":""} ${t?"ds-input-wrapper--error":""}`,children:[s&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:s}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${c}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${c} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${t?"ds-input--error":""}`,disabled:h,"aria-invalid":t?"true":"false","aria-describedby":j,...p}),n&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${c}`,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:d,className:"ds-input-error",role:"alert",children:t})})})]})}function Fe({label:s,error:t,hint:r,fullWidth:o=!0,size:a="m",disabled:n,id:i,resize:c=!0,rows:h=3,...f}){const p=i||`textarea-${u.useId()}`,m=r?`${p}-hint`:void 0,x=t?`${p}-error`:void 0,d=x||m;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:p,children:s}),e.jsx("textarea",{id:p,className:`ds-textarea ds-textarea--${a} ${t?"ds-textarea--error":""} ${c?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":t?"true":"false","aria-describedby":d,rows:h,...f}),r&&!t&&e.jsx("span",{id:m,className:"ds-textarea-hint",children:r}),t&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:t})]})}function ze({label:s,value:t,onChange:r,options:o=[],placeholder:a="Select option",error:n,fullWidth:i=!0,size:c="m",disabled:h=!1,id:f,...p}){const[m,x]=u.useState(!1),[d,j]=u.useState(!1),[_,$]=u.useState({}),[T,E]=u.useState("down"),[A,R]=u.useState(-1),M=u.useRef(null),D=u.useRef(null),N=u.useRef(null),P=u.useRef(null),O=f||`select-${u.useId()}`,U=`${O}-label`,H=n?`${O}-error`:void 0,X=150,W=(g=!1)=>{d||(j(!0),R(-1),P.current=setTimeout(()=>{var l;x(!1),j(!1),g&&((l=N.current)==null||l.focus())},X))},b=g=>{clearTimeout(P.current),j(!1);const l=g!==void 0?g:Math.max(o.findIndex(y=>y.value===t),0);R(l),x(!0)};u.useEffect(()=>()=>clearTimeout(P.current),[]);const k=()=>{var se;const g=(se=M.current)==null?void 0:se.getBoundingClientRect();if(!g)return;const l=window.innerHeight,y=l-g.bottom,B=g.top,ee=y<300&&B>y;E(ee?"up":"down"),$(ee?{bottom:l-g.top+4,left:g.left,width:g.width}:{top:g.bottom+4,left:g.left,width:g.width})};u.useEffect(()=>{if(m)return k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[m]),u.useEffect(()=>{const g=l=>{M.current&&!M.current.contains(l.target)&&D.current&&!D.current.contains(l.target)&&W()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[d]),u.useEffect(()=>{var l;if(!m||A<0||!D.current)return;(l=D.current.querySelectorAll(".ds-select-option")[A])==null||l.scrollIntoView({block:"nearest"})},[A,m]);const L=g=>{switch(g.key){case"ArrowDown":g.preventDefault(),m?R(l=>Math.min(l+1,o.length-1)):b();break;case"ArrowUp":g.preventDefault(),m?R(l=>Math.max(l-1,0)):b(o.length-1);break;case"Home":m&&(g.preventDefault(),R(0));break;case"End":m&&(g.preventDefault(),R(o.length-1));break;case"Enter":case" ":g.preventDefault(),m?A>=0&&(r==null||r(o[A].value),W(!0)):b();break;case"Escape":m&&(g.preventDefault(),W(!0));break;case"Tab":m&&W(!1);break}},z=o.find(g=>g.value===t),q=c==="xs"?I[1]:c==="small"?I[2]:I[3],G=m&&e.jsx("div",{ref:D,role:"listbox","aria-labelledby":s?U:void 0,tabIndex:-1,className:["ds-select-dropdown",`ds-select-dropdown--${c}`,`ds-select-dropdown--${T}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:_,children:o.map((g,l)=>e.jsx("button",{id:`${O}-opt-${l}`,type:"button",role:"option",tabIndex:-1,"aria-selected":t===g.value,className:["ds-select-option",`ds-select-option--${c}`,t===g.value&&"ds-select-option--selected",l===A&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(g.value),W(!0)},children:g.label},g.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${h?"ds-select-wrapper--disabled":""}`,children:[s&&e.jsx("label",{id:U,className:"ds-select-label",children:s}),e.jsx("div",{className:"ds-select-container",ref:M,children:e.jsxs("button",{ref:N,type:"button",id:O,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&A>=0?`${O}-opt-${A}`:void 0,"aria-labelledby":s?U:void 0,"aria-invalid":n?"true":"false","aria-describedby":H,className:`ds-select-trigger ds-select-trigger--${c} ${n?"ds-select-trigger--error":""}`,onClick:()=>{h||(m?W():b())},onKeyDown:L,disabled:h,...p,children:[e.jsx("span",{className:z?"":"ds-select-placeholder",children:(z==null?void 0:z.label)||a}),e.jsx(w.ChevronDown,{size:q,strokeWidth:1.5,className:`ds-select-icon ${m&&T==="down"?"ds-select-icon--open":""} ${m&&T==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&e.jsx("span",{id:H,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&ue.createPortal(G,document.body)]})}function We({label:s,value:t=0,onChange:r,min:o=0,max:a=100,step:n=1,size:i="m",disabled:c=!1,hint:h,error:f,...p}){const m=()=>{if(c)return;const T=Math.min(Number(t)+n,a);r==null||r(T)},x=()=>{if(c)return;const T=Math.max(Number(t)-n,o);r==null||r(T)},d=T=>{if(c)return;const E=T.target.value;if(E===""){r==null||r(o);return}const A=Number(E);if(!isNaN(A)){const R=Math.min(Math.max(A,o),a);r==null||r(R)}},j=["ds-stepper-wrapper",c&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),_=["ds-stepper",`ds-stepper--${i}`,c&&"ds-stepper--disabled"].filter(Boolean).join(" "),$=i==="xs"?I[1]:i==="small"?I[2]:I[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:c||t<=o,"aria-label":"Decrease",children:e.jsx(w.Minus,{size:$,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:t,onChange:d,min:o,max:a,step:n,disabled:c,...p}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:m,disabled:c||t>=a,"aria-label":"Increase",children:e.jsx(w.Plus,{size:$,strokeWidth:1.5})})]}),h&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:h}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function ke({children:s,padding:t="m",variant:r="info",hover:o=!1,onClick:a,href:n,disabled:i=!1,...c}){const f=(o?"interactive":r)==="interactive"||a||n,p=["ds-card",`ds-card--${t}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const d=j=>{if(i){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),a==null||a(j))};return e.jsx("a",{className:p,href:i?void 0:n,onClick:d,"aria-disabled":i?"true":void 0,...c,children:s})}const m=f&&a?"button":"div",x=f&&a?{type:"button",onClick:a,disabled:i}:{};return e.jsx(m,{className:p,role:f&&!a?"article":void 0,...x,...c,children:s})}function Ve({children:s,...t}){return e.jsx("h1",{className:"ds-h1",...t,children:s})}function Ue({children:s,...t}){return e.jsx("h2",{className:"ds-h2",...t,children:s})}function He({children:s,...t}){return e.jsx("h3",{className:"ds-h3",...t,children:s})}function qe({children:s,...t}){return e.jsx("h4",{className:"ds-h4",...t,children:s})}function Ye({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p1 ${t?"ds-p1--secondary":""}`,...r,children:s})}function Ee({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p2 ${t?"ds-p2--secondary":""}`,...r,children:s})}function be({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p3 ${t?"ds-p3--secondary":""}`,...r,children:s})}function de({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 Xe={info:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};function Ke({children:s,variant:t="info",title:r,onClose:o,role:a,...n}){const i=Xe[t],c=a||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-alert ds-alert--${t} ${r?"":"ds-alert--no-title"}`,role:c,...n,children:[i&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(i,{size:I[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(w.X,{size:I[3],strokeWidth:1.5})})]})}const Ge=200;function Je({children:s,title:t,onClose:r,size:o="m",...a}){const n=u.useRef(null),i=u.useId(),[c,h]=u.useState(!1),f=()=>{!r||c||(h(!0),setTimeout(()=>{h(!1),r()},Ge))};u.useEffect(()=>{const d=_=>{_.key==="Escape"&&f()},j=_=>{n.current&&!n.current.contains(_.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",j)}},[r,c]);const p=u.Children.toArray(s),m=p.find(d=>(d==null?void 0:d.type)===pe),x=p.filter(d=>(d==null?void 0:d.type)!==pe);return e.jsx("div",{className:["ds-modal-overlay",c&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("div",{className:`ds-modal ds-modal--${o}`,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?i:void 0,children:[(t||r)&&e.jsxs("div",{className:"ds-modal__header",children:[t&&e.jsx("h3",{id:i,className:"ds-modal__title",children:t}),r&&e.jsx(oe,{variant:"ghost",size:"small",icon:e.jsx(w.X,{size:I[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),e.jsx("div",{className:"ds-modal__body",children:x}),m]})})}function pe({children:s}){return e.jsx("div",{className:"ds-modal__footer",children:s})}function Re({children:s,title:t="Code",defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="s",className:i="",...c}){const[h,f]=u.useState(r),p=o!==void 0,m=p?o:h,x=()=>{p?a==null||a(!o):f(j=>!j)},d=["ds-code-accordion",`ds-code-accordion--${n}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:d,...c,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:t}),e.jsx(w.ChevronDown,{size:I[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre",children:e.jsx("code",{children:s})})})})]})}function Ze({children:s,block:t=!1,collapsible:r=!1,title:o="Code",defaultExpanded:a=!1,...n}){return t?r?e.jsx(Re,{title:o,defaultExpanded:a,...n,children:s}):e.jsx("pre",{className:"ds-code-block",...n,children:e.jsx("code",{children:s})}):e.jsx("code",{className:"ds-code-inline",...n,children:s})}function Qe({href:s,children:t,onClick:r,target:o,rel:a,...n}){const c=o==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:s,className:"ds-link",onClick:r,target:o,rel:c,...n,children:t})}function et({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 tt({children:s,selected:t=!1,onClick:r,size:o="m",variant:a="ghost",disabled:n=!1,icon:i,href:c,...h}){const f=i&&!s,p=["ds-tab",`ds-tab--${o}`,`ds-tab--${a}`,t&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),m=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),s]});if(c){const x=d=>{if(n){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return e.jsx("a",{role:"tab","aria-current":t?"page":void 0,"aria-disabled":n?"true":void 0,className:p,href:n?void 0:c,onClick:x,...h,children:m})}return e.jsx("button",{role:"tab","aria-selected":t,className:p,onClick:r,disabled:n,...h,children:m})}function st({options:s,value:t,onChange:r,size:o="m",disabled:a=!1}){const n=u.useRef(null),i=u.useRef(null),[c,h]=u.useState(!1),f=u.useRef(!1),p=u.useRef(null),m=u.useRef(null),x=()=>{if(!n.current)return;const d=n.current.querySelector(`[data-value="${t}"]`);if(!d)return;const j=n.current.getBoundingClientRect(),_=d.getBoundingClientRect(),$=_.left-j.left,T=_.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=$+"px",i.current.style.width=T+"px",f.current=!1):(h(!0),requestAnimationFrame(()=>{if(!i.current||!n.current)return;const E=n.current.querySelector(`[data-value="${t}"]`);if(!E)return;const A=n.current.getBoundingClientRect(),R=E.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=R.left-A.left+"px",i.current.style.width=R.width+"px"}))};return m.current=x,u.useLayoutEffect(()=>{const d=p.current!==t;p.current=t,f.current=c&&d,x()}),u.useEffect(()=>{if(!n.current)return;const d=new ResizeObserver(()=>{f.current=!1,m.current()});return d.observe(n.current),()=>d.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[c&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),s.map(d=>e.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",t===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(d.value),"aria-pressed":t===d.value,disabled:a,children:[d.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function Te({children:s,title:t,defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="m",...i}){const[c,h]=u.useState(r),f=o!==void 0,p=f?o:c,m=()=>{f?a==null||a(!o):h(d=>!d)},x=["ds-accordion",`ds-accordion--${n}`,p&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:m,"aria-expanded":p,children:[e.jsx("span",{className:"ds-accordion__title",children:t}),e.jsx(w.ChevronDown,{size:I[2],strokeWidth:1.5,className:`ds-accordion__icon ${p?"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 te=8,ae=8;function rt(s,t,r){const o=window.innerWidth;let a,n;switch(s){case"top":a=t.top-r.height-te,n=t.left+t.width/2-r.width/2;break;case"bottom":a=t.bottom+te,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-te;break;case"right":a=t.top+t.height/2-r.height/2,n=t.right+te;break;default:a=t.bottom+te,n=t.left}const i=Math.max(ae,Math.min(o-r.width-ae,n)),c=n-i;return{top:a,left:i,arrowOffset:c}}function nt(s,t,r){const o=window.innerWidth,a=window.innerHeight;if(s.top>=t+te+ae)return"top";if(a-s.bottom>=t+te+ae)return"bottom";if(o-s.right>=r+te+ae)return"right";if(s.left>=r+te+ae)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 at({children:s,content:t,position:r,...o}){const[a,n]=u.useState(!1),[i,c]=u.useState({visibility:"hidden"}),[h,f]=u.useState(r||"top"),p=u.useRef(null),m=u.useRef(null),x=u.useRef(!1),d=()=>{if(!p.current||!m.current)return;const _=p.current.getBoundingClientRect(),$=m.current.getBoundingClientRect(),T=r||nt(_,$.height,$.width),{top:E,left:A,arrowOffset:R}=rt(T,_,$);f(T),c({position:"fixed",top:E,left:A,visibility:"visible","--arrow-offset":`${R}px`})};if(u.useEffect(()=>{if(!a)return;c({position:"fixed",visibility:"hidden"});const _=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(_),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[a,r]),u.useEffect(()=>{if(!a)return;const _=$=>{p.current&&!p.current.contains($.target)&&n(!1)};return document.addEventListener("touchstart",_),()=>document.removeEventListener("touchstart",_)},[a]),!t)return s;const j=a&&e.jsx("div",{ref:m,className:`ds-tooltip ds-tooltip--${h}`,role:"tooltip",style:i,children:t});return e.jsxs("div",{ref:p,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"&&ue.createPortal(j,document.body)]})}function ot({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const c=n||`toggle-${u.useId()}`,h=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:h,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-toggle__input",checked:s,onChange:f=>t==null?void 0:t(f.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 it({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...i}){const c=n||`checkbox-${u.useId()}`,h=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return e.jsxs("label",{className:h,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-checkbox__input",checked:s,onChange:p=>t==null?void 0:t(p.target.checked),disabled:o,...i}),e.jsx("span",{className:"ds-checkbox__box",children:s&&e.jsx(w.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function ct({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,name:n,value:i,id:c,...h}){const f=c||`radio-${u.useId()}`,p=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:p,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:m=>t==null?void 0:t(m.target.checked),disabled:o,name:n,value:i,...h}),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 Se({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 lt({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,c)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:c===s-1&&s>1?{width:t}:void 0},c))})}Se.Text=lt;function dt(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 ut(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 ft({seed:s,icon:t,src:r,size:o=32,className:a="",style:n={},...i}){const c=dt(s??""),[h,f]=u.useState(!1),p=t??e.jsx("span",{className:"ds-avatar__initials",children:ut(s)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":c,...n},"aria-hidden":"true",...i,children:r&&!h?e.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):p})}function mt({children:s,size:t="compact",stickyTop:r,maxHeight:o,className:a="",style:n={},...i}){const c={...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",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:c,children:e.jsx("table",{className:["ds-table",`ds-table--${t}`,a].filter(Boolean).join(" "),...i,children:s})})}function pt({children:s,...t}){return e.jsx("thead",{...t,children:s})}function ht({children:s,...t}){return e.jsx("tbody",{...t,children:s})}function xt({children:s,interactive:t,selected:r,subheader:o,className:a="",onClick:n,...i}){return e.jsx("tr",{className:["ds-table-row",t||n?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",a].filter(Boolean).join(" "),onClick:n,...i,children:s})}function bt({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 jt({children:s,align:t="left",sortDir:r,onSort:o,width:a,className:n="",style:i={},...c}){const h=!!o||r!==void 0,f=r==="asc"?w.ChevronUp:r==="desc"?w.ChevronDown:w.ChevronsUpDown;return e.jsx("th",{className:["ds-th",h?"ds-th--sortable":"",r?"ds-th--sorted":"",t!=="left"?`ds-table-cell--${t}`:"",n].filter(Boolean).join(" "),onClick:o,style:{width:a,...i},...c,children:h?e.jsxs("span",{className:"ds-th__inner",children:[s,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):s})}function vt({children:s,align:t="left",secondary:r,muted:o,truncate:a,nowrap:n,className:i="",...c}){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(" "),...c,children:s})}function _t({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 Nt({label:s,hint:t,error:r,required:o=!1,disabled:a=!1,htmlFor:n,children:i,className:c="",style:h,...f}){const p=u.useId(),m=n??p,x=`${m}-hint`,d=`${m}-error`;return e.jsxs("div",{className:`ds-field${c?` ${c}`:""}`,"data-state":r?"error":void 0,"data-required":o?"":void 0,"data-disabled":a?"":void 0,style:h,...f,children:[s&&e.jsx("label",{className:"ds-field-label",htmlFor:m,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:d,role:"alert",children:r})]})}function wt({label:s,value:t,delta:r,size:o="m",inline:a=!1,className:n="",style:i,...c}){const h=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,...c,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--${h}`,children:r})]})}function yt({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((c,h)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[c,h<i.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:t})]},h))})})}function gt({page:s,total:t,onChange:r,siblings:o=1,"aria-label":a="Pagination",className:n="",style:i,...c}){const h=kt(s,t,o);return e.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:i,...c,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(w.ChevronLeft,{size:16})}),h.map((f,p)=>f==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${p}`):e.jsx("button",{className:`ds-pagination-page${f===s?" ds-pagination-page--current":""}`,onClick:()=>f!==s&&(r==null?void 0:r(f)),"aria-current":f===s?"page":void 0,"aria-label":`Page ${f}`,children:f},f)),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(w.ChevronRight,{size:16})})]})}function kt(s,t,r){if(t<=7)return Array.from({length:t},(i,c)=>c+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 Et=200;function Rt({children:s,title:t,onClose:r,side:o="right",...a}){const n=u.useRef(null),i=u.useId(),[c,h]=u.useState(!1),f=()=>{!r||c||(h(!0),setTimeout(()=>{h(!1),r()},Et))};u.useEffect(()=>{const d=_=>{_.key==="Escape"&&f()},j=_=>{n.current&&!n.current.contains(_.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",j)}},[r,c]);const p=u.Children.toArray(s),m=p.find(d=>(d==null?void 0:d.type)===he),x=p.filter(d=>(d==null?void 0:d.type)!==he);return e.jsx("div",{className:["ds-drawer-overlay",c&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("aside",{className:["ds-drawer",c&&"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:f,"aria-label":"Close drawer",children:e.jsx(w.X,{size:I[2],strokeWidth:1.5})})]}),e.jsx("div",{className:"ds-drawer-body",children:x}),m]})})}function he({children:s}){return e.jsx("footer",{className:"ds-drawer-footer",children:s})}const Tt={info:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};function St({children:s,variant:t="info",action:r,onAction:o,onDismiss:a,role:n,...i}){const c=Tt[t],h=n||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${t}`,role:h,...i,children:[c&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(c,{size:I[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(w.X,{size:I[2],strokeWidth:1.5})})]})}function $t({trigger:s,items:t=[],open:r,onOpenChange:o,align:a="left",className:n="",style:i,...c}){const[h,f]=u.useState(!1),[p,m]=u.useState(!1),x=r!==void 0,d=x?r:h,j=u.useRef(null),_=u.useRef(null),$=u.useRef(null),T=u.useRef(null),[E,A]=u.useState({}),R=u.useRef(null),M=150,D=()=>{if(x)o==null||o(!1);else{if(p)return;m(!0),R.current=setTimeout(()=>{f(!1),m(!1)},M)}},N=()=>{const b=!d;x?o==null||o(b):b?(clearTimeout(R.current),m(!1),f(!0)):D()},P=()=>{d||(x?o==null||o(!0):(clearTimeout(R.current),m(!1),f(!0)))};u.useEffect(()=>()=>clearTimeout(R.current),[]),u.useEffect(()=>{if(!d)return;const b=()=>{var L;const k=(L=j.current)==null?void 0:L.getBoundingClientRect();k&&A(a==="right"?{top:k.bottom+4,right:window.innerWidth-k.right}:{top:k.bottom+4,left:k.left})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[d,a]);const O=()=>{var k;const b=(k=$.current)==null?void 0:k.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};u.useEffect(()=>{if(!d)return;const b=L=>{var z,q;!((z=j.current)!=null&&z.contains(L.target))&&!((q=_.current)!=null&&q.contains(L.target))&&D()},k=L=>{L.key==="Escape"&&(D(),O())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",k)}},[d]),u.useEffect(()=>{if(!d||!T.current||!_.current)return;const b=U(),k=T.current==="last"?b[b.length-1]:b[0];k==null||k.focus(),T.current=null},[d]);const U=()=>_.current?[..._.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],H=b=>{var k,L;if(b.key==="ArrowDown")b.preventDefault(),d?(k=U()[0])==null||k.focus():(T.current="first",P());else if(b.key==="ArrowUp")if(b.preventDefault(),!d)T.current="last",P();else{const z=U();(L=z[z.length-1])==null||L.focus()}},X=b=>{var z,q,G,g;const k=U(),L=k.findIndex(l=>l===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(z=k[Math.min(L+1,k.length-1)])==null||z.focus();break;case"ArrowUp":b.preventDefault(),L<=0?O():(q=k[L-1])==null||q.focus();break;case"Home":b.preventDefault(),(G=k[0])==null||G.focus();break;case"End":b.preventDefault(),(g=k[k.length-1])==null||g.focus();break;case"Tab":D();break}},W=d&&e.jsx("div",{ref:_,role:"menu",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,p&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,onKeyDown:X,children:t.map((b,k)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},k);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})]},k);const L=!!b.href,z=L?"a":"button",q=L?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(z,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...q,onClick:()=>{var G;(G=b.onClick)==null||G.call(b),D()},children:[b.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:b.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:b.label}),b.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:b.shortcut})]},k)})});return e.jsxs("div",{ref:j,className:["ds-dropdown",n].filter(Boolean).join(" "),style:i,...c,children:[e.jsx("div",{ref:$,className:"ds-dropdown__trigger",onClick:N,onKeyDown:H,children:s}),typeof document<"u"&&ue.createPortal(W,document.body)]})}function At({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)),c=Math.max(a,i),h=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--${h}`,style:{width:`${c}%`}})}),o&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const It=s=>1-Math.pow(1-s,3),Dt=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function $e(s,{duration:t=600}={}){const[r,o]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(Dt()){o(s),a.current=s;return}const i=a.current,c=s-i;if(c===0)return;let h=null;const f=p=>{h||(h=p);const m=Math.min((p-h)/t,1);o(i+c*It(m)),m<1?n.current=requestAnimationFrame(f):a.current=s};return n.current=requestAnimationFrame(f),()=>cancelAnimationFrame(n.current)},[s,t]),r}function Bt({value:s,duration:t=600,decimals:r=0,prefix:o="",suffix:a=""}){const i=$e(s,{duration:t}).toFixed(r);return`${o}${i}${a}`}function Ae({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 c=new IntersectionObserver(([h])=>{h.isIntersecting?(n(!0),r&&c.disconnect()):r||n(!1)},{threshold:s,rootMargin:t});return c.observe(i),()=>c.disconnect()},[s,t,r]),{ref:o,inView:a}}function Pt({children:s,as:t="div",once:r=!1,threshold:o=.1,rootMargin:a="0px",onEnter:n,onLeave:i,...c}){const{ref:h,inView:f}=Ae({threshold:o,rootMargin:a,once:r}),p=u.useRef(!1);return u.useEffect(()=>{f&&!p.current&&(n==null||n()),!f&&p.current&&(i==null||i()),p.current=f},[f]),e.jsx(t,{ref:h,...c,children:typeof s=="function"?s(f):s})}const we={default:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};let ie=[];const xe=new Set;function Ie(){xe.forEach(s=>s([...ie]))}function Lt(s){ie=[...ie,s],Ie()}function Mt(s){ie=ie.filter(t=>t.id!==s),Ie()}function Ot(){const s=(t,r={})=>{Lt({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 Ct({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=we[s.type]??we.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:I[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(w.X,{size:I[3],strokeWidth:1.5})})]})}function Ft({position:s="bottom-right"}){const[t,r]=u.useState(()=>[...ie]);return u.useEffect(()=>(xe.add(r),()=>xe.delete(r)),[]),!t.length||typeof document>"u"?null:ue.createPortal(e.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:t.map(o=>e.jsx(Ct,{data:o,onDismiss:Mt},o.id))}),document.body)}const zt={running:e.jsx(de,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(de,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(de,{size:"xs",variant:"error",children:"Error"})};function Wt({label:s,status:t="idle",icon:r,badge:o,defaultExpanded:a=!1,expanded:n,onToggle:i,padding:c="s",children:h,...f}){const m=`tc-body-${u.useId().replace(/:/g,"")}`,[x,d]=u.useState(a),j=n!==void 0,_=j?n:x,$=()=>{j?i==null||i(!n):d(T=>!T)};return e.jsxs(ke,{padding:c,...f,children:[e.jsxs("button",{type:"button",className:"ds-tool-card__header",onClick:$,"aria-expanded":_,"aria-controls":m,children:[e.jsx(w.ChevronRight,{size:I[1],strokeWidth:1.5,className:`ds-tool-card__chevron${_?" ds-tool-card__chevron--expanded":""}`}),r&&e.jsx("span",{className:"ds-tool-card__icon",children:r}),e.jsx("span",{className:"ds-tool-card__label",children:s}),zt[t],o]}),_&&e.jsx("div",{id:m,className:"ds-tool-card__body",children:h})]})}function Vt({text:s,size:t="xs",timeout:r=2e3,"aria-label":o="Copy to clipboard",...a}){const[n,i]=u.useState(!1),c=()=>{navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),r)})};return e.jsx(oe,{variant:"ghost",size:t,icon:n?e.jsx(w.Check,{size:I[1],strokeWidth:1.5}):e.jsx(w.Copy,{size:I[1],strokeWidth:1.5}),"aria-label":o,onClick:c,...a})}function Ut({content:s,streaming:t=!1,...r}){const[o,a]=u.useState(t);return u.useEffect(()=>{a(!!t)},[t]),e.jsx(Te,{expanded:o,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(w.Brain,{size:I[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ee,{secondary:!0,children:"Thinking"})]}),...r,children:e.jsxs(be,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[s,t&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Ht({count:s,current:t=0,done:r=[],onChange:o,showCounter:a=!0,className:n="","aria-label":i="Steps",...c}){return e.jsxs("div",{className:["ds-step-indicator",n].filter(Boolean).join(" "),...c,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i,children:Array.from({length:s},(h,f)=>{const p=f===t,m=r.includes(f)&&!p,x=o&&(f<=t||r.includes(f)),d=["ds-step-indicator__dot",p&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:d,role:"tab","aria-selected":p,"aria-label":`Step ${f+1}`,disabled:!x||f===t,onClick:()=>o==null?void 0:o(f),children:m?e.jsx(w.Check,{size:8,strokeWidth:3}):null},f)})}),a&&e.jsxs(be,{secondary:!0,className:"ds-step-indicator__counter",children:[t+1," / ",s]})]})}function qt({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 Yt({role:s="assistant",header:t,footer:r,attachments:o,isStreaming:a=!1,children:n,className:i="",...c}){const h=["ds-chat-message",`ds-chat-message--${s}`,a&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return s==="system"?e.jsx("div",{className:h,...c,children:e.jsx("span",{className:"ds-chat-message__system-label",children:n})}):s==="user"?e.jsxs("div",{className:h,...c,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:h,...c,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 Xt(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 c=n.scrollHeight-n.scrollTop-n.clientHeight<64;!c&&n.scrollTop<a.current&&(o.current=!0),c&&(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 De({prompts:s,enabled:t,typingSpeed:r=38,erasingSpeed:o=18,holdTime:a=2200,betweenTime:n=380,manualPauseMs:i=5e3}){const[c,h]=u.useState(0),[f,p]=u.useState(""),m=u.useRef("typing"),x=u.useRef(0),d=u.useRef(0),j=u.useRef(null),_=u.useRef(0);u.useEffect(()=>{d.current=c},[c]),u.useEffect(()=>{if(j.current&&(clearTimeout(j.current),j.current=null),!t||s.length===0){p(""),x.current=0,m.current="typing";return}const R=()=>{const M=Date.now();if(_.current>M){j.current=setTimeout(R,_.current-M);return}const D=s[d.current%s.length]??"";m.current==="typing"?(x.current+=1,p(D.slice(0,x.current)),x.current>=D.length?(m.current="holding",j.current=setTimeout(R,a)):j.current=setTimeout(R,r+Math.random()*28)):m.current==="holding"?(m.current="erasing",j.current=setTimeout(R,o)):(x.current=Math.max(0,x.current-1),p(D.slice(0,x.current)),x.current<=0?(m.current="typing",d.current=(d.current+1)%s.length,h(d.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 $=R=>{if(s.length===0)return;const M=(R%s.length+s.length)%s.length,D=s[M];d.current=M,x.current=D.length,m.current="holding",_.current=Date.now()+i,h(M),p(D)},T=()=>$(d.current+1),E=()=>$(d.current-1),A=s[c%s.length]??"";return{displayed:f,currentPrompt:A,index:c,next:T,prev:E}}let Kt=0;function Gt({value:s="",onChange:t,onSubmit:r,onStop:o,onKeyDown:a,loading:n=!1,disabled:i=!1,placeholder:c="Let's get things done...",animatedPlaceholders:h,attachments:f,images:p,onAttachFiles:m,onAttachImages:x,onRemoveAttachment:d,onRemoveImage:j,acceptImage:_,acceptFile:$,maxImages:T,maxImageSize:E,leftSlot:A,rightSlot:R,className:M="",...D}){const N=u.useRef(null),P=u.useRef(null),O=u.useRef(0),[U,H]=u.useState(!1),[X,W]=u.useState([]),b=v=>{const S=++Kt;W(V=>[...V,{id:S,msg:v}]),setTimeout(()=>W(V=>V.filter(Y=>Y.id!==S)),6e3)},k=v=>W(S=>S.filter(V=>V.id!==v)),L=v=>v.type.startsWith("image/"),z=()=>!0,q=_??L,G=$??z,g=v=>{const S=[],V=[],Y=[],K=[];let Z=0,ne=T!=null?T-((p==null?void 0:p.length)??0):1/0;for(const Q of v)q(Q)?E&&Q.size>E?Y.push(Q.name):ne>0?(S.push(Q),ne--):Z++:G(Q)?V.push(Q):K.push(Q.name);return{imageFiles:S,docFiles:V,tooLarge:Y,skipped:K,limitExceeded:Z}},l=v=>{const{imageFiles:S,docFiles:V,tooLarge:Y,skipped:K,limitExceeded:Z}=g(v);Y.length&&b(`File${Y.length>1?"s":""} too large${E?` (max ${E/1024/1024}MB)`:""}: ${Y.join(", ")}`),K.length&&b(`Skipped unsupported file${K.length>1?"s":""}: ${K.join(", ")}`),Z&&b(`Max ${T} images per message`),x&&S.length&&x(S);const ne=V.concat(x?[]:S);m&&ne.length&&m(ne)};u.useEffect(()=>{const v=P.current;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,200)}px`)},[s]),u.useEffect(()=>{const v=S=>{var Y,K,Z;if(n||i)return;const V=(Y=S.target)==null?void 0:Y.tagName;V==="INPUT"||V==="TEXTAREA"||V==="SELECT"||(K=S.target)!=null&&K.isContentEditable||S.ctrlKey||S.metaKey||S.altKey||S.key.length!==1&&S.key!=="Backspace"&&S.key!=="Delete"||(Z=P.current)==null||Z.focus()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n,i]);const y=v=>{v.preventDefault(),O.current++,v.dataTransfer.types.includes("Files")&&H(!0)},B=v=>{v.preventDefault(),O.current--,O.current===0&&H(!1)},C=v=>v.preventDefault(),ee=v=>{v.preventDefault(),O.current=0,H(!1);const S=Array.from(v.dataTransfer.files);S.length&&l(S)},se=v=>{const S=Array.from(v.target.files||[]);N.current&&(N.current.value=""),S.length&&l(S)},F=v=>{var Q;if(!x)return;const S=(Q=v.clipboardData)==null?void 0:Q.items;if(!S)return;const V=[];for(const Pe of S){const ve=Pe.getAsFile();ve&&V.push(ve)}if(V.length===0)return;const{imageFiles:Y,tooLarge:K,skipped:Z,limitExceeded:ne}=g(V);K.length&&b(`File${K.length>1?"s":""} too large: ${K.join(", ")}`),Z.length&&b(`Skipped unsupported file${Z.length>1?"s":""}: ${Z.join(", ")}`),ne&&b(`Max ${T} images per message`),Y.length&&(v.preventDefault(),x(Y))},J=!n&&!i&&!!(h!=null&&h.length)&&s.length===0,re=De({prompts:h??[],enabled:J}),fe=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)},Be=(s.trim()||(p==null?void 0:p.length)>0||(f==null?void 0:f.length)>0)&&!i,je=m||x;return e.jsxs("div",{className:["ds-prompt-input",M].filter(Boolean).join(" "),...D,children:[je&&e.jsx("input",{ref:N,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:se}),e.jsxs("div",{className:["ds-prompt-input__box",U&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:y,onDragLeave:B,onDragOver:C,onDrop:ee,children:[U&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:"Drop files here"}),e.jsx("textarea",{ref:P,value:s,onChange:v=>t==null?void 0:t(v.target.value),onKeyDown:fe,onPaste:F,placeholder:J?"":c,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"})]}),p&&p.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:p.map((v,S)=>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(S),"aria-label":"Remove image",type:"button",children:e.jsx(w.X,{size:12,strokeWidth:2})})]},S))}),X.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:X.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:()=>k(v.id),"aria-label":"Dismiss",children:e.jsx(w.X,{size:I[1],strokeWidth:1.5})})]},v.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((v,S)=>e.jsx(de,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[v.uploading?e.jsx(w.Loader,{size:I[1],strokeWidth:1.5,className:"spin"}):e.jsx(w.Paperclip,{size:I[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:()=>d==null?void 0:d(S),children:e.jsx(w.X,{size:I[1],strokeWidth:1.5})})]})},S))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[je&&e.jsx(oe,{variant:"ghost",size:"xs",icon:e.jsx(w.Paperclip,{size:I[2],strokeWidth:1.5}),"aria-label":"Attach files",onClick:()=>{var v;return(v=N.current)==null?void 0:v.click()}}),A,R,e.jsx("div",{className:"ds-prompt-input__spacer"}),n?e.jsx(oe,{variant:"primary",size:"xs",icon:e.jsx(w.Square,{size:I[2],strokeWidth:1.5}),onClick:o,"aria-label":"Stop"}):e.jsx(oe,{variant:"primary",size:"xs",icon:e.jsx(w.ArrowUp,{size:I[2],strokeWidth:1.5}),onClick:r,disabled:!Be,"aria-label":"Send"})]})]})]})}const ye={fast:0,standard:1,premium:2};function Jt({models:s=[],value:t,onChange:r,size:o="xs",minTier:a,showAutoOption:n=!1,groupByTier:i=!0,className:c="",...h}){const[f,p]=u.useState(!1),m=u.useRef(null),x=u.useRef(null),[d,j]=u.useState({}),_=s.filter(N=>!a||N.name==="auto"?!0:(ye[N.tier]??1)>=(ye[a]??1)),$=_.find(N=>N.name==="auto"),T=_.filter(N=>N.name!=="auto"),E=s.find(N=>N.name===t);u.useEffect(()=>{var U;if(!f)return;const N=(U=m.current)==null?void 0:U.getBoundingClientRect();N&&j({position:"fixed",zIndex:"var(--z-dropdown, 500)",top:N.bottom+4,right:window.innerWidth-N.right});const P=H=>{var X,W;!((X=m.current)!=null&&X.contains(H.target))&&!((W=x.current)!=null&&W.contains(H.target))&&p(!1)},O=H=>{H.key==="Escape"&&p(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",O)}},[f]);const A=N=>{r==null||r(N),p(!1)},R=N=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",N.name===t&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>A(N.name),children:[N.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:N.icon}):e.jsx(w.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:N.displayName||N.name}),N.tier&&e.jsx("span",{className:"ds-model-picker__tier-badge","data-tier":N.tier,children:N.tier})]},N.name),M=()=>i?["fast","standard","premium"].flatMap(N=>{const P=T.filter(O=>O.tier===N);return P.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":N,children:N.charAt(0).toUpperCase()+N.slice(1)},`lbl-${N}`),...P.map(R)]:[]}):T.map(R),D=f&&e.jsxs("div",{ref:x,className:"ds-model-picker__menu",style:d,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:()=>A("auto"),children:[e.jsx(w.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)"})]}),T.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),M()]});return e.jsxs("div",{ref:m,className:["ds-model-picker",c].filter(Boolean).join(" "),...h,children:[e.jsxs("button",{type:"button",className:"ds-model-picker__trigger",onClick:()=>p(N=>!N),"aria-haspopup":"listbox","aria-expanded":f,children:[E!=null&&E.icon?e.jsx("span",{children:E.icon}):e.jsx(w.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}),(E==null?void 0:E.tier)&&e.jsx("span",{className:"ds-model-picker__tier-badge","data-tier":E.tier,children:E.tier})]}),typeof document<"u"&&ue.createPortal(D,document.body)]})}exports.Accordion=Te;exports.Alert=Ke;exports.AnimatedNumber=Bt;exports.Avatar=ft;exports.Badge=de;exports.Banner=St;exports.Breadcrumb=yt;exports.Button=oe;exports.Card=ke;exports.ChatMessage=Yt;exports.Checkbox=it;exports.Code=Ze;exports.CodeAccordion=Re;exports.CopyButton=Vt;exports.Drawer=Rt;exports.DrawerFooter=he;exports.Dropdown=$t;exports.EmptyState=_t;exports.FormField=Nt;exports.H1=Ve;exports.H2=Ue;exports.H3=He;exports.H4=qe;exports.InView=Pt;exports.Input=Ce;exports.Link=Qe;exports.Modal=Je;exports.ModalFooter=pe;exports.ModelPicker=Jt;exports.P1=Ye;exports.P2=Ee;exports.P3=be;exports.Pagination=gt;exports.ProgressBar=At;exports.PromptInput=Gt;exports.Radio=ct;exports.ReasoningBlock=Ut;exports.SegmentedControl=st;exports.Select=ze;exports.Skeleton=Se;exports.Spinner=ge;exports.Stat=wt;exports.StepIndicator=Ht;exports.Stepper=We;exports.StreamingText=qt;exports.Tab=tt;exports.Table=mt;exports.TableBody=ht;exports.TableHead=pt;exports.TableRow=xt;exports.TableSubheaderRow=bt;exports.Tabs=et;exports.Td=vt;exports.Textarea=Fe;exports.Th=jt;exports.ToastContainer=Ft;exports.Toggle=ot;exports.ToolCallCard=Wt;exports.Tooltip=at;exports.iconSizes=I;exports.useAnimatedNumber=$e;exports.useAnimatedPlaceholder=De;exports.useInView=Ae;exports.useStreamScroll=Xt;exports.useToast=Ot;
|
|
22
|
+
<%s key={someKey} {...props} />`,C,F,J,F),g[F+C]=!0)}if(F=null,B!==void 0&&(r(B),F=""+B),o(y)&&(r(y.key),F=""+y.key),"key"in y){B={};for(var re in y)re!=="key"&&(B[re]=y[re])}else B=y;return F&&c(B,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,F,B,a(),ee,te)}function p(l){x(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===O&&(l._payload.status==="fulfilled"?x(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function x(l){return typeof l=="object"&&l!==null&&l.$$typeof===_}var d=u,_=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),$=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),X=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,b=Array.isArray,k=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(l){return l()}};var M,z={},q=d.react_stack_bottom_frame.bind(d,n)(),G=k(i(n)),g={};le.Fragment=S,le.jsx=function(l,y,B){var C=1e4>X.recentlyCreatedOwnerStacks++;return m(l,y,B,!1,C?Error("react-stack-top-frame"):q,C?k(i(l)):G)},le.jsxs=function(l,y,B){var C=1e4>X.recentlyCreatedOwnerStacks++;return m(l,y,B,!0,C?Error("react-stack-top-frame"):q,C?k(i(l)):G)}}()),le}process.env.NODE_ENV==="production"?he.exports=Fe():he.exports=ze();var e=he.exports;function Te({size:s="m",color:t="default",className:r="",...i}){return e.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${t}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...i})}const We={xs:12,s:14,m:16,l:20};function ie({children:s,variant:t="primary",size:r="m",fullWidth:i=!1,icon:a,disabled:n=!1,state:o="idle",onClick:c,type:h="button",href:f,"aria-label":m,...p}){const x=a&&!s,d=o==="loading",_=o==="success",v=o==="error",S=d||_||v,R=r==="xs"?"s":"m",E=We[r]??16,I=d?e.jsx(Te,{size:R}):_?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(w.Check,{size:E,strokeWidth:2.5})}):v?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(w.X,{size:E,strokeWidth:2.5})}):null,$=["ds-button",`ds-button--${t}`,`ds-button--${r}`,i&&"ds-button--full",x&&"ds-button--icon-only"].filter(Boolean).join(" "),L=o!=="idle"?o:void 0,D=e.jsxs(e.Fragment,{children:[S?I:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(f){const N=P=>{if(n||d){P.preventDefault();return}P.metaKey||P.ctrlKey||P.button===1||(P.preventDefault(),c==null||c(P))};return e.jsx("a",{className:$,href:n||d?void 0:f,onClick:N,"aria-label":m,"aria-disabled":n||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":L,...p,children:D})}return e.jsx("button",{type:h,className:$,disabled:n,onClick:d?void 0:c,"aria-label":m,"aria-busy":d?"true":void 0,"data-state":L,...p,children:D})}function Ue({label:s,error:t,hint:r,fullWidth:i=!0,icon:a,iconRight:n,onIconRightClick:o,size:c="m",disabled:h,id:f,...m}){const p=f||`input-${u.useId()}`,x=r?`${p}-hint`:void 0,d=t?`${p}-error`:void 0,_=d||x;return e.jsxs("div",{className:`ds-input-wrapper ${i?"ds-input-wrapper--full":""} ${h?"ds-input-wrapper--disabled":""} ${t?"ds-input-wrapper--error":""}`,children:[s&&e.jsx("label",{className:"ds-input-label",htmlFor:p,children:s}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${c}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:p,className:`ds-input ds-input--${c} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${t?"ds-input--error":""}`,disabled:h,"aria-invalid":t?"true":"false","aria-describedby":_,...m}),n&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${c}`,onClick:o,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:d,className:"ds-input-error",role:"alert",children:t})})})]})}function Ve({label:s,error:t,hint:r,fullWidth:i=!0,size:a="m",disabled:n,id:o,resize:c=!0,rows:h=3,...f}){const m=o||`textarea-${u.useId()}`,p=r?`${m}-hint`:void 0,x=t?`${m}-error`:void 0,d=x||p;return e.jsxs("div",{className:`ds-textarea-wrapper ${i?"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":""} ${c?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":t?"true":"false","aria-describedby":d,rows:h,...f}),r&&!t&&e.jsx("span",{id:p,className:"ds-textarea-hint",children:r}),t&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:t})]})}function Ye({label:s,value:t,onChange:r,options:i=[],placeholder:a="Select option",error:n,fullWidth:o=!0,size:c="m",disabled:h=!1,id:f,...m}){const[p,x]=u.useState(!1),[d,_]=u.useState(!1),[v,S]=u.useState({}),[R,E]=u.useState("down"),[I,$]=u.useState(-1),L=u.useRef(null),D=u.useRef(null),N=u.useRef(null),P=u.useRef(null),O=f||`select-${u.useId()}`,V=`${O}-label`,Y=n?`${O}-error`:void 0,X=150,W=(g=!1)=>{d||(_(!0),$(-1),P.current=setTimeout(()=>{var l;x(!1),_(!1),g&&((l=N.current)==null||l.focus())},X))},b=g=>{clearTimeout(P.current),_(!1);const l=g!==void 0?g:Math.max(i.findIndex(y=>y.value===t),0);$(l),x(!0)};u.useEffect(()=>()=>clearTimeout(P.current),[]);const k=()=>{var te;const g=(te=L.current)==null?void 0:te.getBoundingClientRect();if(!g)return;const l=window.innerHeight,y=l-g.bottom,B=g.top,ee=y<300&&B>y;E(ee?"up":"down"),S(ee?{bottom:l-g.top+4,left:g.left,width:g.width}:{top:g.bottom+4,left:g.left,width:g.width})};u.useEffect(()=>{if(p)return k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[p]),u.useEffect(()=>{const g=l=>{L.current&&!L.current.contains(l.target)&&D.current&&!D.current.contains(l.target)&&W()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[d]),u.useEffect(()=>{var l;if(!p||I<0||!D.current)return;(l=D.current.querySelectorAll(".ds-select-option")[I])==null||l.scrollIntoView({block:"nearest"})},[I,p]);const M=g=>{switch(g.key){case"ArrowDown":g.preventDefault(),p?$(l=>Math.min(l+1,i.length-1)):b();break;case"ArrowUp":g.preventDefault(),p?$(l=>Math.max(l-1,0)):b(i.length-1);break;case"Home":p&&(g.preventDefault(),$(0));break;case"End":p&&(g.preventDefault(),$(i.length-1));break;case"Enter":case" ":g.preventDefault(),p?I>=0&&(r==null||r(i[I].value),W(!0)):b();break;case"Escape":p&&(g.preventDefault(),W(!0));break;case"Tab":p&&W(!1);break}},z=i.find(g=>g.value===t),q=c==="xs"?A[1]:c==="small"?A[2]:A[3],G=p&&e.jsx("div",{ref:D,role:"listbox","aria-labelledby":s?V:void 0,tabIndex:-1,className:["ds-select-dropdown",`ds-select-dropdown--${c}`,`ds-select-dropdown--${R}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:v,children:i.map((g,l)=>e.jsx("button",{id:`${O}-opt-${l}`,type:"button",role:"option",tabIndex:-1,"aria-selected":t===g.value,className:["ds-select-option",`ds-select-option--${c}`,t===g.value&&"ds-select-option--selected",l===I&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(g.value),W(!0)},children:g.label},g.value))});return e.jsxs("div",{className:`ds-select-wrapper ${o?"ds-select-wrapper--full":""} ${h?"ds-select-wrapper--disabled":""}`,children:[s&&e.jsx("label",{id:V,className:"ds-select-label",children:s}),e.jsx("div",{className:"ds-select-container",ref:L,children:e.jsxs("button",{ref:N,type:"button",id:O,role:"combobox","aria-haspopup":"listbox","aria-expanded":p,"aria-activedescendant":p&&I>=0?`${O}-opt-${I}`:void 0,"aria-labelledby":s?V:void 0,"aria-invalid":n?"true":"false","aria-describedby":Y,className:`ds-select-trigger ds-select-trigger--${c} ${n?"ds-select-trigger--error":""}`,onClick:()=>{h||(p?W():b())},onKeyDown:M,disabled:h,...m,children:[e.jsx("span",{className:z?"":"ds-select-placeholder",children:(z==null?void 0:z.label)||a}),e.jsx(w.ChevronDown,{size:q,strokeWidth:1.5,className:`ds-select-icon ${p&&R==="down"?"ds-select-icon--open":""} ${p&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&e.jsx("span",{id:Y,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&ue.createPortal(G,document.body)]})}function qe({label:s,value:t=0,onChange:r,min:i=0,max:a=100,step:n=1,size:o="m",disabled:c=!1,hint:h,error:f,...m}){const p=()=>{if(c)return;const R=Math.min(Number(t)+n,a);r==null||r(R)},x=()=>{if(c)return;const R=Math.max(Number(t)-n,i);r==null||r(R)},d=R=>{if(c)return;const E=R.target.value;if(E===""){r==null||r(i);return}const I=Number(E);if(!isNaN(I)){const $=Math.min(Math.max(I,i),a);r==null||r($)}},_=["ds-stepper-wrapper",c&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),v=["ds-stepper",`ds-stepper--${o}`,c&&"ds-stepper--disabled"].filter(Boolean).join(" "),S=o==="xs"?A[1]:o==="small"?A[2]:A[3];return e.jsxs("div",{className:_,children:[s&&e.jsx("label",{className:"ds-stepper-label",children:s}),e.jsxs("div",{className:v,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:c||t<=i,"aria-label":"Decrease",children:e.jsx(w.Minus,{size:S,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:t,onChange:d,min:i,max:a,step:n,disabled:c,...m}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:p,disabled:c||t>=a,"aria-label":"Increase",children:e.jsx(w.Plus,{size:S,strokeWidth:1.5})})]}),h&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:h}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function Se({children:s,padding:t="m",variant:r="info",hover:i=!1,onClick:a,href:n,disabled:o=!1,...c}){const f=(i?"interactive":r)==="interactive"||a||n,m=["ds-card",`ds-card--${t}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const d=_=>{if(o){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),a==null||a(_))};return e.jsx("a",{className:m,href:o?void 0:n,onClick:d,"aria-disabled":o?"true":void 0,...c,children:s})}const p=f&&a?"button":"div",x=f&&a?{type:"button",onClick:a,disabled:o}:{};return e.jsx(p,{className:m,role:f&&!a?"article":void 0,...x,...c,children:s})}function He({children:s,...t}){return e.jsx("h1",{className:"ds-h1",...t,children:s})}function Xe({children:s,...t}){return e.jsx("h2",{className:"ds-h2",...t,children:s})}function Ke({children:s,...t}){return e.jsx("h3",{className:"ds-h3",...t,children:s})}function Ge({children:s,...t}){return e.jsx("h4",{className:"ds-h4",...t,children:s})}function Je({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 je({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p3 ${t?"ds-p3--secondary":""}`,...r,children:s})}function de({children:s,variant:t="default",size:r="m",role:i,...a}){const n=["ds-badge",`ds-badge--${t}`,`ds-badge--${r}`].filter(Boolean).join(" "),o=i||(["info","success","warning","error"].includes(t)?"status":void 0);return e.jsx("span",{className:n,role:o,...a,children:s})}const Ze={info:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};function Qe({children:s,variant:t="info",title:r,onClose:i,role:a,...n}){const o=Ze[t],c=a||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-alert ds-alert--${t} ${r?"":"ds-alert--no-title"}`,role:c,...n,children:[o&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(o,{size:A[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})]}),i&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:i,"aria-label":"Close alert",children:e.jsx(w.X,{size:A[3],strokeWidth:1.5})})]})}const es=200;function ss({children:s,title:t,onClose:r,size:i="m",...a}){const n=u.useRef(null),o=u.useId(),[c,h]=u.useState(!1),f=()=>{!r||c||(h(!0),setTimeout(()=>{h(!1),r()},es))};u.useEffect(()=>{const d=v=>{v.key==="Escape"&&f()},_=v=>{n.current&&!n.current.contains(v.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,c]);const m=u.Children.toArray(s),p=m.find(d=>(d==null?void 0:d.type)===xe),x=m.filter(d=>(d==null?void 0:d.type)!==xe);return e.jsx("div",{className:["ds-modal-overlay",c&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("div",{className:`ds-modal ds-modal--${i}`,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?o:void 0,children:[(t||r)&&e.jsxs("div",{className:"ds-modal__header",children:[t&&e.jsx("h3",{id:o,className:"ds-modal__title",children:t}),r&&e.jsx(ie,{variant:"ghost",size:"small",icon:e.jsx(w.X,{size:A[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),e.jsx("div",{className:"ds-modal__body",children:x}),p]})})}function xe({children:s}){return e.jsx("div",{className:"ds-modal__footer",children:s})}function Ie({children:s,title:t="Code",defaultExpanded:r=!1,expanded:i,onToggle:a,padding:n="s",className:o="",...c}){const[h,f]=u.useState(r),m=i!==void 0,p=m?i:h,x=()=>{m?a==null||a(!i):f(_=>!_)},d=["ds-code-accordion",`ds-code-accordion--${n}`,p&&"ds-code-accordion--expanded",o].filter(Boolean).join(" ");return e.jsxs("div",{className:d,...c,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":p,children:[e.jsx("span",{className:"ds-code-accordion__title",children:t}),e.jsx(w.ChevronDown,{size:A[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${p?"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",children:e.jsx("code",{children:s})})})})]})}function ts({children:s,block:t=!1,collapsible:r=!1,title:i="Code",defaultExpanded:a=!1,...n}){return t?r?e.jsx(Ie,{title:i,defaultExpanded:a,...n,children:s}):e.jsx("pre",{className:"ds-code-block",...n,children:e.jsx("code",{children:s})}):e.jsx("code",{className:"ds-code-inline",...n,children:s})}function rs({href:s,children:t,onClick:r,target:i,rel:a,...n}){const c=i==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:s,className:"ds-link",onClick:r,target:i,rel:c,...n,children:t})}function ns({children:s,size:t="m",variant:r="ghost",...i}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...i,children:u.Children.map(s,a=>u.isValidElement(a)?u.cloneElement(a,{size:t,variant:r}):a)})}function as({children:s,selected:t=!1,onClick:r,size:i="m",variant:a="ghost",disabled:n=!1,icon:o,href:c,...h}){const f=o&&!s,m=["ds-tab",`ds-tab--${i}`,`ds-tab--${a}`,t&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),p=e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:"ds-tab-icon",children:o}),s]});if(c){const x=d=>{if(n){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return e.jsx("a",{role:"tab","aria-current":t?"page":void 0,"aria-disabled":n?"true":void 0,className:m,href:n?void 0:c,onClick:x,...h,children:p})}return e.jsx("button",{role:"tab","aria-selected":t,className:m,onClick:r,disabled:n,...h,children:p})}function is({options:s,value:t,onChange:r,size:i="m",disabled:a=!1}){const n=u.useRef(null),o=u.useRef(null),[c,h]=u.useState(!1),f=u.useRef(!1),m=u.useRef(null),p=u.useRef(null),x=()=>{if(!n.current)return;const d=n.current.querySelector(`[data-value="${t}"]`);if(!d)return;const _=n.current.getBoundingClientRect(),v=d.getBoundingClientRect(),S=v.left-_.left,R=v.width;o.current?(o.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",o.current.style.left=S+"px",o.current.style.width=R+"px",f.current=!1):(h(!0),requestAnimationFrame(()=>{if(!o.current||!n.current)return;const E=n.current.querySelector(`[data-value="${t}"]`);if(!E)return;const I=n.current.getBoundingClientRect(),$=E.getBoundingClientRect();o.current.style.transition="none",o.current.style.left=$.left-I.left+"px",o.current.style.width=$.width+"px"}))};return p.current=x,u.useLayoutEffect(()=>{const d=m.current!==t;m.current=t,f.current=c&&d,x()}),u.useEffect(()=>{if(!n.current)return;const d=new ResizeObserver(()=>{f.current=!1,p.current()});return d.observe(n.current),()=>d.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${i}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[c&&e.jsx("div",{ref:o,className:"ds-seg__pill","aria-hidden":"true"}),s.map(d=>e.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",t===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(d.value),"aria-pressed":t===d.value,disabled:a,children:[d.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function ve({children:s,title:t,defaultExpanded:r=!1,expanded:i,onToggle:a,padding:n="m",...o}){const[c,h]=u.useState(r),f=i!==void 0,m=f?i:c,p=()=>{f?a==null||a(!i):h(d=>!d)},x=["ds-accordion",`ds-accordion--${n}`,m&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...o,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:p,"aria-expanded":m,children:[e.jsx("span",{className:"ds-accordion__title",children:t}),e.jsx(w.ChevronDown,{size:A[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,ae=8;function os(s,t,r){const i=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 o=Math.max(ae,Math.min(i-r.width-ae,n)),c=n-o;return{top:a,left:o,arrowOffset:c}}function cs(s,t,r){const i=window.innerWidth,a=window.innerHeight;if(s.top>=t+se+ae)return"top";if(a-s.bottom>=t+se+ae)return"bottom";if(i-s.right>=r+se+ae)return"right";if(s.left>=r+se+ae)return"left";const n=Math.max(s.top,a-s.bottom,s.left,i-s.right);return n===s.top?"top":n===a-s.bottom?"bottom":n===i-s.right?"right":"left"}function ls({children:s,content:t,position:r,...i}){const[a,n]=u.useState(!1),[o,c]=u.useState({visibility:"hidden"}),[h,f]=u.useState(r||"top"),m=u.useRef(null),p=u.useRef(null),x=u.useRef(!1),d=()=>{if(!m.current||!p.current)return;const v=m.current.getBoundingClientRect(),S=p.current.getBoundingClientRect(),R=r||cs(v,S.height,S.width),{top:E,left:I,arrowOffset:$}=os(R,v,S);f(R),c({position:"fixed",top:E,left:I,visibility:"visible","--arrow-offset":`${$}px`})};if(u.useEffect(()=>{if(!a)return;c({position:"fixed",visibility:"hidden"});const v=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(v),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[a,r]),u.useEffect(()=>{if(!a)return;const v=S=>{m.current&&!m.current.contains(S.target)&&n(!1)};return document.addEventListener("touchstart",v),()=>document.removeEventListener("touchstart",v)},[a]),!t)return s;const _=a&&e.jsx("div",{ref:p,className:`ds-tooltip ds-tooltip--${h}`,role:"tooltip",style:o,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(v=>!v)},...i,children:[s,typeof document<"u"&&ue.createPortal(_,document.body)]})}function ds({checked:s=!1,onChange:t,size:r="m",disabled:i=!1,label:a,id:n,...o}){const c=n||`toggle-${u.useId()}`,h=["ds-toggle",`ds-toggle--${r}`,i&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:h,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-toggle__input",checked:s,onChange:f=>t==null?void 0:t(f.target.checked),disabled:i,...o}),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 us({checked:s=!1,onChange:t,size:r="m",disabled:i=!1,label:a,id:n,...o}){const c=n||`checkbox-${u.useId()}`,h=["ds-checkbox",`ds-checkbox--${r}`,i&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return e.jsxs("label",{className:h,htmlFor:c,children:[e.jsx("input",{type:"checkbox",id:c,className:"ds-checkbox__input",checked:s,onChange:m=>t==null?void 0:t(m.target.checked),disabled:i,...o}),e.jsx("span",{className:"ds-checkbox__box",children:s&&e.jsx(w.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function fs({checked:s=!1,onChange:t,size:r="m",disabled:i=!1,label:a,name:n,value:o,id:c,...h}){const f=c||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,i&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:m,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:p=>t==null?void 0:t(p.target.checked),disabled:i,name:n,value:o,...h}),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 De({width:s,height:t,shape:r="rect",aspectRatio:i,className:a="",style:n={},...o}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,a].filter(Boolean).join(" "),style:{width:s,height:t,aspectRatio:i,...n},"aria-hidden":"true",...o})}function ms({lines:s=1,lastLineWidth:t="70%",gap:r,className:i="",style:a={},...n}){return e.jsx("span",{className:["ds-skeleton-text",i].filter(Boolean).join(" "),style:{gap:r,...a},"aria-hidden":"true",...n,children:Array.from({length:s},(o,c)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:c===s-1&&s>1?{width:t}:void 0},c))})}De.Text=ms;function ps(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 hs(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 xs({seed:s,icon:t,src:r,size:i=32,className:a="",style:n={},...o}){const c=ps(s??""),[h,f]=u.useState(!1),m=t??e.jsx("span",{className:"ds-avatar__initials",children:hs(s)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:i,height:i,"--ds-avatar-h":c,...n},"aria-hidden":"true",...o,children:r&&!h?e.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):m})}function _s({children:s,size:t="compact",stickyTop:r,maxHeight:i,className:a="",style:n={},...o}){const c={...i?{maxHeight:i}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...n};return e.jsx("div",{className:["ds-table-wrap",i?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:c,children:e.jsx("table",{className:["ds-table",`ds-table--${t}`,a].filter(Boolean).join(" "),...o,children:s})})}function bs({children:s,...t}){return e.jsx("thead",{...t,children:s})}function js({children:s,...t}){return e.jsx("tbody",{...t,children:s})}function vs({children:s,interactive:t,selected:r,subheader:i,className:a="",onClick:n,...o}){return e.jsx("tr",{className:["ds-table-row",t||n?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",i?"ds-table-row--subheader":"",a].filter(Boolean).join(" "),onClick:n,...o,children:s})}function Ns({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 ws({children:s,align:t="left",sortDir:r,onSort:i,width:a,className:n="",style:o={},...c}){const h=!!i||r!==void 0,f=r==="asc"?w.ChevronUp:r==="desc"?w.ChevronDown:w.ChevronsUpDown;return e.jsx("th",{className:["ds-th",h?"ds-th--sortable":"",r?"ds-th--sorted":"",t!=="left"?`ds-table-cell--${t}`:"",n].filter(Boolean).join(" "),onClick:i,style:{width:a,...o},...c,children:h?e.jsxs("span",{className:"ds-th__inner",children:[s,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):s})}function ys({children:s,align:t="left",secondary:r,muted:i,truncate:a,nowrap:n,className:o="",...c}){return e.jsx("td",{className:["ds-td",t!=="left"?`ds-table-cell--${t}`:"",r?"ds-table-cell--secondary":"",i?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",n?"ds-table-cell--nowrap":"",o].filter(Boolean).join(" "),...c,children:s})}function gs({icon:s,title:t,description:r,action:i,size:a="m",className:n="",...o}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,n].filter(Boolean).join(" "),...o,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}),i&&e.jsx("div",{className:"ds-empty-state__action",children:i})]})}function ks({label:s,hint:t,error:r,required:i=!1,disabled:a=!1,htmlFor:n,children:o,className:c="",style:h,...f}){const m=u.useId(),p=n??m,x=`${p}-hint`,d=`${p}-error`;return e.jsxs("div",{className:`ds-field${c?` ${c}`:""}`,"data-state":r?"error":void 0,"data-required":i?"":void 0,"data-disabled":a?"":void 0,style:h,...f,children:[s&&e.jsx("label",{className:"ds-field-label",htmlFor:p,children:s}),e.jsx("div",{className:"ds-field-control",children:o}),t&&!r&&e.jsx("p",{className:"ds-field-hint",id:x,children:t}),r&&e.jsx("p",{className:"ds-field-error",id:d,role:"alert",children:r})]})}function Es({label:s,value:t,delta:r,size:i="m",inline:a=!1,className:n="",style:o,...c}){const h=r!=null&&r.startsWith("+")?"up":r!=null&&r.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${i}`,a&&"ds-stat--inline",n].filter(Boolean).join(" "),style:o,...c,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--${h}`,children:r})]})}function $s({children:s,separator:t="/","aria-label":r="Breadcrumb",className:i="",style:a,...n}){const o=u.Children.toArray(s).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${i?` ${i}`:""}`,"aria-label":r,style:a,...n,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:o.map((c,h)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[c,h<o.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:t})]},h))})})}function Rs({page:s,total:t,onChange:r,siblings:i=1,"aria-label":a="Pagination",className:n="",style:o,...c}){const h=Ts(s,t,i);return e.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:o,...c,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(w.ChevronLeft,{size:16})}),h.map((f,m)=>f==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${m}`):e.jsx("button",{className:`ds-pagination-page${f===s?" ds-pagination-page--current":""}`,onClick:()=>f!==s&&(r==null?void 0:r(f)),"aria-current":f===s?"page":void 0,"aria-label":`Page ${f}`,children:f},f)),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(w.ChevronRight,{size:16})})]})}function Ts(s,t,r){if(t<=7)return Array.from({length:t},(o,c)=>c+1);const i=Math.max(2,s-r),a=Math.min(t-1,s+r),n=[1];i>2&&n.push("…");for(let o=i;o<=a;o++)n.push(o);return a<t-1&&n.push("…"),n.push(t),n}const Ss=200;function As({children:s,title:t,onClose:r,side:i="right",...a}){const n=u.useRef(null),o=u.useId(),[c,h]=u.useState(!1),f=()=>{!r||c||(h(!0),setTimeout(()=>{h(!1),r()},Ss))};u.useEffect(()=>{const d=v=>{v.key==="Escape"&&f()},_=v=>{n.current&&!n.current.contains(v.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,c]);const m=u.Children.toArray(s),p=m.find(d=>(d==null?void 0:d.type)===_e),x=m.filter(d=>(d==null?void 0:d.type)!==_e);return e.jsx("div",{className:["ds-drawer-overlay",c&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("aside",{className:["ds-drawer",c&&"ds-drawer--closing"].filter(Boolean).join(" "),"data-side":i,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?o:void 0,children:[e.jsxs("header",{className:"ds-drawer-header",children:[t&&e.jsx("h3",{id:o,className:"ds-drawer-title",children:t}),r&&e.jsx("button",{className:"ds-drawer-close",onClick:f,"aria-label":"Close drawer",children:e.jsx(w.X,{size:A[2],strokeWidth:1.5})})]}),e.jsx("div",{className:"ds-drawer-body",children:x}),p]})})}function _e({children:s}){return e.jsx("footer",{className:"ds-drawer-footer",children:s})}const Is={info:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};function Ds({children:s,variant:t="info",action:r,onAction:i,onDismiss:a,role:n,...o}){const c=Is[t],h=n||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${t}`,role:h,...o,children:[c&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(c,{size:A[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:s}),r&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:i,children:r}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":"Dismiss",children:e.jsx(w.X,{size:A[2],strokeWidth:1.5})})]})}function Bs({trigger:s,items:t=[],open:r,onOpenChange:i,align:a="left",className:n="",style:o,...c}){const[h,f]=u.useState(!1),[m,p]=u.useState(!1),x=r!==void 0,d=x?r:h,_=u.useRef(null),v=u.useRef(null),S=u.useRef(null),R=u.useRef(null),[E,I]=u.useState({}),$=u.useRef(null),L=150,D=()=>{if(x)i==null||i(!1);else{if(m)return;p(!0),$.current=setTimeout(()=>{f(!1),p(!1)},L)}},N=()=>{const b=!d;x?i==null||i(b):b?(clearTimeout($.current),p(!1),f(!0)):D()},P=()=>{d||(x?i==null||i(!0):(clearTimeout($.current),p(!1),f(!0)))};u.useEffect(()=>()=>clearTimeout($.current),[]),u.useEffect(()=>{if(!d)return;const b=()=>{var M;const k=(M=_.current)==null?void 0:M.getBoundingClientRect();k&&I(a==="right"?{top:k.bottom+4,right:window.innerWidth-k.right}:{top:k.bottom+4,left:k.left})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[d,a]);const O=()=>{var k;const b=(k=S.current)==null?void 0:k.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');b==null||b.focus()};u.useEffect(()=>{if(!d)return;const b=M=>{var z,q;!((z=_.current)!=null&&z.contains(M.target))&&!((q=v.current)!=null&&q.contains(M.target))&&D()},k=M=>{M.key==="Escape"&&(D(),O())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",k)}},[d]),u.useEffect(()=>{if(!d||!R.current||!v.current)return;const b=V(),k=R.current==="last"?b[b.length-1]:b[0];k==null||k.focus(),R.current=null},[d]);const V=()=>v.current?[...v.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],Y=b=>{var k,M;if(b.key==="ArrowDown")b.preventDefault(),d?(k=V()[0])==null||k.focus():(R.current="first",P());else if(b.key==="ArrowUp")if(b.preventDefault(),!d)R.current="last",P();else{const z=V();(M=z[z.length-1])==null||M.focus()}},X=b=>{var z,q,G,g;const k=V(),M=k.findIndex(l=>l===document.activeElement);switch(b.key){case"ArrowDown":b.preventDefault(),(z=k[Math.min(M+1,k.length-1)])==null||z.focus();break;case"ArrowUp":b.preventDefault(),M<=0?O():(q=k[M-1])==null||q.focus();break;case"Home":b.preventDefault(),(G=k[0])==null||G.focus();break;case"End":b.preventDefault(),(g=k[k.length-1])==null||g.focus();break;case"Tab":D();break}},W=d&&e.jsx("div",{ref:v,role:"menu",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,onKeyDown:X,children:t.map((b,k)=>{if(b.separator)return e.jsx("div",{className:"ds-dropdown__separator"},k);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})]},k);const M=!!b.href,z=M?"a":"button",q=M?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return e.jsxs(z,{role:"menuitem",className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...q,onClick:()=>{var G;(G=b.onClick)==null||G.call(b),D()},children:[b.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:b.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:b.label}),b.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:b.shortcut})]},k)})});return e.jsxs("div",{ref:_,className:["ds-dropdown",n].filter(Boolean).join(" "),style:o,...c,children:[e.jsx("div",{ref:S,className:"ds-dropdown__trigger",onClick:N,onKeyDown:Y,children:s}),typeof document<"u"&&ue.createPortal(W,document.body)]})}function Ps({value:s=0,size:t="m",variant:r="default",showValue:i=!1,min:a=2,animate:n=!0}){const o=Math.min(100,Math.max(0,s)),c=Math.max(a,o),h=r==="auto"?o>=70?"success":o>=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":o,"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--${h}`,style:{width:`${c}%`}})}),i&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(o),"%"]})]})}const Ms=s=>1-Math.pow(1-s,3),Ls=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Be(s,{duration:t=600}={}){const[r,i]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(Ls()){i(s),a.current=s;return}const o=a.current,c=s-o;if(c===0)return;let h=null;const f=m=>{h||(h=m);const p=Math.min((m-h)/t,1);i(o+c*Ms(p)),p<1?n.current=requestAnimationFrame(f):a.current=s};return n.current=requestAnimationFrame(f),()=>cancelAnimationFrame(n.current)},[s,t]),r}function Os({value:s,duration:t=600,decimals:r=0,prefix:i="",suffix:a=""}){const o=Be(s,{duration:t}).toFixed(r);return`${i}${o}${a}`}function Pe({threshold:s=.1,rootMargin:t="0px",once:r=!1}={}){const i=u.useRef(null),[a,n]=u.useState(!1);return u.useEffect(()=>{const o=i.current;if(!o)return;const c=new IntersectionObserver(([h])=>{h.isIntersecting?(n(!0),r&&c.disconnect()):r||n(!1)},{threshold:s,rootMargin:t});return c.observe(o),()=>c.disconnect()},[s,t,r]),{ref:i,inView:a}}function Cs({children:s,as:t="div",once:r=!1,threshold:i=.1,rootMargin:a="0px",onEnter:n,onLeave:o,...c}){const{ref:h,inView:f}=Pe({threshold:i,rootMargin:a,once:r}),m=u.useRef(!1);return u.useEffect(()=>{f&&!m.current&&(n==null||n()),!f&&m.current&&(o==null||o()),m.current=f},[f]),e.jsx(t,{ref:h,...c,children:typeof s=="function"?s(f):s})}const ke={default:w.Info,success:w.CheckCircle,warning:w.AlertTriangle,error:w.XCircle};let oe=[];const be=new Set;function Me(){be.forEach(s=>s([...oe]))}function Fs(s){oe=[...oe,s],Me()}function zs(s){oe=oe.filter(t=>t.id!==s),Me()}function Ws(){const s=(t,r={})=>{Fs({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 Us({data:s,onDismiss:t}){const[r,i]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>i(!0)),s.duration>0&&(a.current=setTimeout(()=>n(),s.duration)),()=>clearTimeout(a.current)),[]);function n(){i(!1),setTimeout(()=>t(s.id),250)}const o=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(o,{size:A[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(w.X,{size:A[3],strokeWidth:1.5})})]})}function Vs({position:s="bottom-right"}){const[t,r]=u.useState(()=>[...oe]);return u.useEffect(()=>(be.add(r),()=>be.delete(r)),[]),!t.length||typeof document>"u"?null:ue.createPortal(e.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:t.map(i=>e.jsx(Us,{data:i,onDismiss:zs},i.id))}),document.body)}const Ys={running:e.jsx(de,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(de,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(de,{size:"xs",variant:"error",children:"Error"})};function qs({label:s,status:t="idle",icon:r,badge:i,defaultExpanded:a=!1,expanded:n,onToggle:o,padding:c="s",children:h,...f}){const p=`tc-body-${u.useId().replace(/:/g,"")}`,[x,d]=u.useState(a),_=n!==void 0,v=_?n:x,S=()=>{_?o==null||o(!n):d(R=>!R)};return e.jsxs(Se,{padding:c,...f,children:[e.jsxs("button",{type:"button",className:"ds-tool-card__header",onClick:S,"aria-expanded":v,"aria-controls":p,children:[e.jsx(w.ChevronRight,{size:A[1],strokeWidth:1.5,className:`ds-tool-card__chevron${v?" ds-tool-card__chevron--expanded":""}`}),r&&e.jsx("span",{className:"ds-tool-card__icon",children:r}),e.jsx("span",{className:"ds-tool-card__label",children:s}),Ys[t],i]}),v&&e.jsx("div",{id:p,className:"ds-tool-card__body",children:h})]})}function Hs({text:s,size:t="xs",timeout:r=2e3,"aria-label":i="Copy to clipboard",...a}){const[n,o]=u.useState(!1),c=()=>{navigator.clipboard.writeText(s).then(()=>{o(!0),setTimeout(()=>o(!1),r)})};return e.jsx(ie,{variant:"ghost",size:t,icon:n?e.jsx(w.Check,{size:A[1],strokeWidth:1.5}):e.jsx(w.Copy,{size:A[1],strokeWidth:1.5}),"aria-label":i,onClick:c,...a})}function Xs({content:s,streaming:t=!1,...r}){const[i,a]=u.useState(t);return u.useEffect(()=>{a(!!t)},[t]),e.jsx(ve,{expanded:i,onToggle:a,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(w.Brain,{size:A[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ae,{secondary:!0,children:"Thinking"})]}),...r,children:e.jsxs(je,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[s,t&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Ks({count:s,current:t=0,done:r=[],onChange:i,showCounter:a=!0,className:n="","aria-label":o="Steps",...c}){return e.jsxs("div",{className:["ds-step-indicator",n].filter(Boolean).join(" "),...c,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":o,children:Array.from({length:s},(h,f)=>{const m=f===t,p=r.includes(f)&&!m,x=i&&(f<=t||r.includes(f)),d=["ds-step-indicator__dot",m&&"ds-step-indicator__dot--active",p&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:d,role:"tab","aria-selected":m,"aria-label":`Step ${f+1}`,disabled:!x||f===t,onClick:()=>i==null?void 0:i(f),children:p?e.jsx(w.Check,{size:8,strokeWidth:3}):null},f)})}),a&&e.jsxs(je,{secondary:!0,className:"ds-step-indicator__counter",children:[t+1," / ",s]})]})}function Gs({content:s,isStreaming:t=!1,cursor:r="line",onChunk:i,className:a="",...n}){const o=u.useRef(s);return u.useEffect(()=>{s!==o.current&&(i==null||i(s),o.current=s)},[s,i]),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 Js({role:s="assistant",header:t,footer:r,attachments:i,isStreaming:a=!1,children:n,className:o="",...c}){const h=["ds-chat-message",`ds-chat-message--${s}`,a&&"ds-chat-message--streaming",o].filter(Boolean).join(" ");return s==="system"?e.jsx("div",{className:h,...c,children:e.jsx("span",{className:"ds-chat-message__system-label",children:n})}):s==="user"?e.jsxs("div",{className:h,...c,children:[i&&e.jsx("div",{className:"ds-chat-message__attachments",children:i}),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:h,...c,children:[t&&e.jsx("div",{className:"ds-chat-message__header",children:t}),i&&e.jsx("div",{className:"ds-chat-message__attachments",children:i}),e.jsx("div",{className:"ds-chat-message__body",children:n}),r&&e.jsx("div",{className:"ds-chat-message__footer",children:r})]})}function Zs(s,{containerRef:t,smartPause:r=!0}={}){const i=u.useRef(!1),a=u.useRef(0);u.useEffect(()=>{const n=t==null?void 0:t.current;if(!n)return;const o=()=>{const c=n.scrollHeight-n.scrollTop-n.clientHeight<64;!c&&n.scrollTop<a.current&&(i.current=!0),c&&(i.current=!1),a.current=n.scrollTop};return n.addEventListener("scroll",o,{passive:!0}),()=>n.removeEventListener("scroll",o)},[t]),u.useEffect(()=>{const n=t==null?void 0:t.current;n&&(r&&i.current||(n.scrollTop=n.scrollHeight))},s)}function Le({prompts:s,enabled:t,typingSpeed:r=38,erasingSpeed:i=18,holdTime:a=2200,betweenTime:n=380,manualPauseMs:o=5e3}){const[c,h]=u.useState(0),[f,m]=u.useState(""),p=u.useRef("typing"),x=u.useRef(0),d=u.useRef(0),_=u.useRef(null),v=u.useRef(0);u.useEffect(()=>{d.current=c},[c]),u.useEffect(()=>{if(_.current&&(clearTimeout(_.current),_.current=null),!t||s.length===0){m(""),x.current=0,p.current="typing";return}const $=()=>{const L=Date.now();if(v.current>L){_.current=setTimeout($,v.current-L);return}const D=s[d.current%s.length]??"";p.current==="typing"?(x.current+=1,m(D.slice(0,x.current)),x.current>=D.length?(p.current="holding",_.current=setTimeout($,a)):_.current=setTimeout($,r+Math.random()*28)):p.current==="holding"?(p.current="erasing",_.current=setTimeout($,i)):(x.current=Math.max(0,x.current-1),m(D.slice(0,x.current)),x.current<=0?(p.current="typing",d.current=(d.current+1)%s.length,h(d.current),_.current=setTimeout($,n)):_.current=setTimeout($,i))};return _.current=setTimeout($,260),()=>{_.current&&clearTimeout(_.current)}},[t,s,r,i,a,n]);const S=$=>{if(s.length===0)return;const L=($%s.length+s.length)%s.length,D=s[L];d.current=L,x.current=D.length,p.current="holding",v.current=Date.now()+o,h(L),m(D)},R=()=>S(d.current+1),E=()=>S(d.current-1),I=s[c%s.length]??"";return{displayed:f,currentPrompt:I,index:c,next:R,prev:E}}let Qs=0;function et({value:s="",onChange:t,onSubmit:r,onStop:i,onKeyDown:a,loading:n=!1,disabled:o=!1,placeholder:c="Let's get things done...",animatedPlaceholders:h,attachments:f,images:m,onAttachFiles:p,onAttachImages:x,onRemoveAttachment:d,onRemoveImage:_,acceptImage:v,acceptFile:S,maxImages:R,maxImageSize:E,leftSlot:I,rightSlot:$,className:L="",...D}){const N=u.useRef(null),P=u.useRef(null),O=u.useRef(0),[V,Y]=u.useState(!1),[X,W]=u.useState([]),b=j=>{const T=++Qs;W(U=>[...U,{id:T,msg:j}]),setTimeout(()=>W(U=>U.filter(H=>H.id!==T)),6e3)},k=j=>W(T=>T.filter(U=>U.id!==j)),M=j=>j.type.startsWith("image/"),z=()=>!0,q=v??M,G=S??z,g=j=>{const T=[],U=[],H=[],K=[];let Z=0,ne=R!=null?R-((m==null?void 0:m.length)??0):1/0;for(const Q of j)q(Q)?E&&Q.size>E?H.push(Q.name):ne>0?(T.push(Q),ne--):Z++:G(Q)?U.push(Q):K.push(Q.name);return{imageFiles:T,docFiles:U,tooLarge:H,skipped:K,limitExceeded:Z}},l=j=>{const{imageFiles:T,docFiles:U,tooLarge:H,skipped:K,limitExceeded:Z}=g(j);H.length&&b(`File${H.length>1?"s":""} too large${E?` (max ${E/1024/1024}MB)`:""}: ${H.join(", ")}`),K.length&&b(`Skipped unsupported file${K.length>1?"s":""}: ${K.join(", ")}`),Z&&b(`Max ${R} images per message`),x&&T.length&&x(T);const ne=U.concat(x?[]:T);p&&ne.length&&p(ne)};u.useEffect(()=>{const j=P.current;j&&(j.style.height="auto",j.style.height=`${Math.min(j.scrollHeight,200)}px`)},[s]),u.useEffect(()=>{const j=T=>{var H,K,Z;if(n||o)return;const U=(H=T.target)==null?void 0:H.tagName;U==="INPUT"||U==="TEXTAREA"||U==="SELECT"||(K=T.target)!=null&&K.isContentEditable||T.ctrlKey||T.metaKey||T.altKey||T.key.length!==1&&T.key!=="Backspace"&&T.key!=="Delete"||(Z=P.current)==null||Z.focus()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[n,o]);const y=j=>{j.preventDefault(),O.current++,j.dataTransfer.types.includes("Files")&&Y(!0)},B=j=>{j.preventDefault(),O.current--,O.current===0&&Y(!1)},C=j=>j.preventDefault(),ee=j=>{j.preventDefault(),O.current=0,Y(!1);const T=Array.from(j.dataTransfer.files);T.length&&l(T)},te=j=>{const T=Array.from(j.target.files||[]);N.current&&(N.current.value=""),T.length&&l(T)},F=j=>{var Q;if(!x)return;const T=(Q=j.clipboardData)==null?void 0:Q.items;if(!T)return;const U=[];for(const Ce of T){const we=Ce.getAsFile();we&&U.push(we)}if(U.length===0)return;const{imageFiles:H,tooLarge:K,skipped:Z,limitExceeded:ne}=g(U);K.length&&b(`File${K.length>1?"s":""} too large: ${K.join(", ")}`),Z.length&&b(`Skipped unsupported file${Z.length>1?"s":""}: ${Z.join(", ")}`),ne&&b(`Max ${R} images per message`),H.length&&(j.preventDefault(),x(H))},J=!n&&!o&&!!(h!=null&&h.length)&&s.length===0,re=Le({prompts:h??[],enabled:J}),fe=j=>{if(J){if(j.key==="ArrowDown"||j.key==="ArrowRight"){j.preventDefault(),re.next();return}if(j.key==="ArrowUp"||j.key==="ArrowLeft"){j.preventDefault(),re.prev();return}if(j.key==="Tab"&&!j.shiftKey){j.preventDefault(),t==null||t(re.currentPrompt);return}}a==null||a(j)},Oe=(s.trim()||(m==null?void 0:m.length)>0||(f==null?void 0:f.length)>0)&&!o,Ne=p||x;return e.jsxs("div",{className:["ds-prompt-input",L].filter(Boolean).join(" "),...D,children:[Ne&&e.jsx("input",{ref:N,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:te}),e.jsxs("div",{className:["ds-prompt-input__box",V&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:y,onDragLeave:B,onDragOver:C,onDrop:ee,children:[V&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:"Drop files here"}),e.jsx("textarea",{ref:P,value:s,onChange:j=>t==null?void 0:t(j.target.value),onKeyDown:fe,onPaste:F,placeholder:J?"":c,disabled:n||o,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((j,T)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:j.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>_==null?void 0:_(T),"aria-label":"Remove image",type:"button",children:e.jsx(w.X,{size:12,strokeWidth:2})})]},T))}),X.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:X.map(j=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:j.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>k(j.id),"aria-label":"Dismiss",children:e.jsx(w.X,{size:A[1],strokeWidth:1.5})})]},j.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((j,T)=>e.jsx(de,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[j.uploading?e.jsx(w.Loader,{size:A[1],strokeWidth:1.5,className:"spin"}):e.jsx(w.Paperclip,{size:A[1],strokeWidth:1.5}),j.filename,j.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:"Uploading..."}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>d==null?void 0:d(T),children:e.jsx(w.X,{size:A[1],strokeWidth:1.5})})]})},T))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[Ne&&e.jsx(ie,{variant:"ghost",size:"xs",icon:e.jsx(w.Paperclip,{size:A[2],strokeWidth:1.5}),"aria-label":"Attach files",onClick:()=>{var j;return(j=N.current)==null?void 0:j.click()}}),I,$,e.jsx("div",{className:"ds-prompt-input__spacer"}),n?e.jsx(ie,{variant:"primary",size:"xs",icon:e.jsx(w.Square,{size:A[2],strokeWidth:1.5}),onClick:i,"aria-label":"Stop"}):e.jsx(ie,{variant:"primary",size:"xs",icon:e.jsx(w.ArrowUp,{size:A[2],strokeWidth:1.5}),onClick:r,disabled:!Oe,"aria-label":"Send"})]})]})]})}const Ee={fast:0,standard:1,premium:2};function st({models:s=[],value:t,onChange:r,size:i="xs",minTier:a,showAutoOption:n=!1,groupByTier:o=!0,className:c="",...h}){const[f,m]=u.useState(!1),p=u.useRef(null),x=u.useRef(null),[d,_]=u.useState({}),v=s.filter(N=>!a||N.name==="auto"?!0:(Ee[N.tier]??1)>=(Ee[a]??1)),S=v.find(N=>N.name==="auto"),R=v.filter(N=>N.name!=="auto"),E=s.find(N=>N.name===t);u.useEffect(()=>{var V;if(!f)return;const N=(V=p.current)==null?void 0:V.getBoundingClientRect();N&&_({position:"fixed",zIndex:"var(--z-dropdown, 500)",top:N.bottom+4,right:window.innerWidth-N.right});const P=Y=>{var X,W;!((X=p.current)!=null&&X.contains(Y.target))&&!((W=x.current)!=null&&W.contains(Y.target))&&m(!1)},O=Y=>{Y.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",O)}},[f]);const I=N=>{r==null||r(N),m(!1)},$=N=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",N.name===t&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(N.name),children:[N.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:N.icon}):e.jsx(w.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:N.displayName||N.name}),N.tier&&e.jsx("span",{className:"ds-model-picker__tier-badge","data-tier":N.tier,children:N.tier})]},N.name),L=()=>o?["fast","standard","premium"].flatMap(N=>{const P=R.filter(O=>O.tier===N);return P.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":N,children:N.charAt(0).toUpperCase()+N.slice(1)},`lbl-${N}`),...P.map($)]:[]}):R.map($),D=f&&e.jsxs("div",{ref:x,className:"ds-model-picker__menu",style:d,children:[n&&S&&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(w.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)"})]}),R.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),L()]});return e.jsxs("div",{ref:p,className:["ds-model-picker",c].filter(Boolean).join(" "),...h,children:[e.jsxs("button",{type:"button",className:"ds-model-picker__trigger",onClick:()=>m(N=>!N),"aria-haspopup":"listbox","aria-expanded":f,children:[E!=null&&E.icon?e.jsx("span",{children:E.icon}):e.jsx(w.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}),(E==null?void 0:E.tier)&&e.jsx("span",{className:"ds-model-picker__tier-badge","data-tier":E.tier,children:E.tier})]}),typeof document<"u"&&ue.createPortal(D,document.body)]})}function me(s){return s!=null&&s.length?"p. "+s.join(", "):null}function tt(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 rt({sources:s=[],layout:t="list",title:r="Sources",maxVisible:i=5,onSourceClick:a}){const[n,o]=u.useState(!1),c=tt(s),h=c.length>i,f=n?c:c.slice(0,i),m=s.some(x=>x.snippet),p=["ds-sources-panel",t==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return t==="compact"?e.jsxs("div",{className:p,children:[f.map(x=>{const d=x.items.map(v=>v.page).filter(Boolean),_=!!a;return e.jsxs("div",{className:`ds-sources-panel__compact-row${_?" ds-sources-panel__compact-row--clickable":""}`,onClick:_?()=>a(x.items[0]):void 0,children:[e.jsx(w.FileText,{size:A[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),d.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:me(d)})]},x.filename)}),h&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>o(!0),children:["+",c.length-i," more sources"]})]}):e.jsxs("div",{className:p,children:[r&&e.jsx("div",{className:"ds-sources-panel__title",children:r}),f.map(x=>{const d=x.items.map(v=>v.page).filter(Boolean),_=!!a;return m?e.jsx(ve,{title:e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),d.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:me(d)})]}),padding:"s",children:x.items.map((v,S)=>e.jsx("div",{className:`ds-sources-panel__snippet${_?" ds-sources-panel__snippet--clickable":""}`,onClick:_?()=>a(v):void 0,children:v.snippet??`p. ${v.page}`},S))},x.filename):e.jsxs("div",{className:`ds-sources-panel__row${_?" ds-sources-panel__row--clickable":""}`,onClick:_?()=>a(x.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:x.filename}),d.length>0&&e.jsx("span",{className:"ds-sources-panel__pages",children:me(d)})]},x.filename)}),h&&!n&&e.jsxs("button",{className:"ds-sources-panel__more",onClick:()=>o(!0),children:["+",c.length-i," 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 nt({used:s,limit:t,size:r="s",showCount:i=!0,showPercent:a=!1,warningThreshold:n=.8,errorThreshold:o=1}){const c=t>0?s/t:0,h=Math.min(c*100,100),f=c>=o?"error":c>=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--${f}`,style:{width:`${h}%`}})}),(i||a)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[i&&e.jsxs("span",{children:[$e(s)," / ",$e(t)," tokens"]}),a&&e.jsxs("span",{children:[Math.round(c*100),"%"]})]})]})}const Re=5;function at(s){return s<.34?"low":s<.67?"medium":"high"}function it({value:s=0,size:t="xs",showLabel:r="none",layout:i="inline"}){const a=Math.max(0,Math.min(1,s)),n=Math.round(a*Re),o=at(a);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${t}`,`ds-confidence-bar--${o}`,i==="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},(c,h)=>e.jsx("div",{className:`ds-confidence-bar__seg${h<n?" ds-confidence-bar__seg--filled":""}`},h))}),r==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:o})]})}const ot={add:"+",remove:"-",context:" "};function pe({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:ot[s.type]}),e.jsx("span",{className:"ds-diff-view__text",children:s.text})]})}function ct({lines:s=[],layout:t="inline",wordWrap:r=!1,lineNumbers:i=!0,maxHeight:a,title:n}){const o=["ds-diff-view",`ds-diff-view--${t}`,r&&"ds-diff-view--wrap"].filter(Boolean).join(" "),c=a?{maxHeight:a,overflowY:"auto"}:void 0;if(t==="split"){const h=s.filter(m=>m.type==="remove"||m.type==="context"),f=s.filter(m=>m.type==="add"||m.type==="context");return e.jsxs("div",{className:o,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),e.jsxs("div",{className:"ds-diff-view__body",style:c,children:[e.jsx("div",{className:"ds-diff-view__split-col",children:h.map((m,p)=>e.jsx(pe,{line:m,lineNumbers:i},p))}),e.jsx("div",{className:"ds-diff-view__split-col",children:f.map((m,p)=>e.jsx(pe,{line:m,lineNumbers:i},p))})]})]})}return e.jsxs("div",{className:o,children:[n&&e.jsx("div",{className:"ds-diff-view__title",children:n}),e.jsx("div",{className:"ds-diff-view__body",style:c,children:s.map((h,f)=>e.jsx(pe,{line:h,lineNumbers:i},f))})]})}exports.Accordion=ve;exports.Alert=Qe;exports.AnimatedNumber=Os;exports.Avatar=xs;exports.Badge=de;exports.Banner=Ds;exports.Breadcrumb=$s;exports.Button=ie;exports.Card=Se;exports.ChatMessage=Js;exports.Checkbox=us;exports.Code=ts;exports.CodeAccordion=Ie;exports.ConfidenceBar=it;exports.CopyButton=Hs;exports.DiffView=ct;exports.Drawer=As;exports.DrawerFooter=_e;exports.Dropdown=Bs;exports.EmptyState=gs;exports.FormField=ks;exports.H1=He;exports.H2=Xe;exports.H3=Ke;exports.H4=Ge;exports.InView=Cs;exports.Input=Ue;exports.Link=rs;exports.Modal=ss;exports.ModalFooter=xe;exports.ModelPicker=st;exports.P1=Je;exports.P2=Ae;exports.P3=je;exports.Pagination=Rs;exports.ProgressBar=Ps;exports.PromptInput=et;exports.Radio=fs;exports.ReasoningBlock=Xs;exports.SegmentedControl=is;exports.Select=Ye;exports.Skeleton=De;exports.SourcesPanel=rt;exports.Spinner=Te;exports.Stat=Es;exports.StepIndicator=Ks;exports.Stepper=qe;exports.StreamingText=Gs;exports.Tab=as;exports.Table=_s;exports.TableBody=js;exports.TableHead=bs;exports.TableRow=vs;exports.TableSubheaderRow=Ns;exports.Tabs=ns;exports.Td=ys;exports.Textarea=Ve;exports.Th=ws;exports.ToastContainer=Vs;exports.Toggle=ds;exports.TokenCounter=nt;exports.ToolCallCard=qs;exports.Tooltip=ls;exports.iconSizes=A;exports.useAnimatedNumber=Be;exports.useAnimatedPlaceholder=Le;exports.useInView=Pe;exports.useStreamScroll=Zs;exports.useToast=Ws;
|
package/dist/index.d.ts
CHANGED
|
@@ -770,3 +770,66 @@ export interface UseAnimatedPlaceholderResult {
|
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
export declare function useAnimatedPlaceholder(options: UseAnimatedPlaceholderOptions): UseAnimatedPlaceholderResult;
|
|
773
|
+
|
|
774
|
+
// ─── SourcesPanel ─────────────────────────────────────────────────────────────
|
|
775
|
+
|
|
776
|
+
export interface Source {
|
|
777
|
+
filename: string;
|
|
778
|
+
page?: number | string;
|
|
779
|
+
snippet?: string;
|
|
780
|
+
url?: string;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export interface SourcesPanelProps {
|
|
784
|
+
sources?: Source[];
|
|
785
|
+
layout?: 'list' | 'compact';
|
|
786
|
+
title?: string;
|
|
787
|
+
maxVisible?: number;
|
|
788
|
+
onSourceClick?: (source: Source) => void;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export declare function SourcesPanel(props: SourcesPanelProps): JSX.Element;
|
|
792
|
+
|
|
793
|
+
// ─── TokenCounter ─────────────────────────────────────────────────────────────
|
|
794
|
+
|
|
795
|
+
export interface TokenCounterProps {
|
|
796
|
+
used: number;
|
|
797
|
+
limit: number;
|
|
798
|
+
size?: 's' | 'm';
|
|
799
|
+
showCount?: boolean;
|
|
800
|
+
showPercent?: boolean;
|
|
801
|
+
warningThreshold?: number;
|
|
802
|
+
errorThreshold?: number;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export declare function TokenCounter(props: TokenCounterProps): JSX.Element;
|
|
806
|
+
|
|
807
|
+
// ─── ConfidenceBar ────────────────────────────────────────────────────────────
|
|
808
|
+
|
|
809
|
+
export interface ConfidenceBarProps {
|
|
810
|
+
value: number;
|
|
811
|
+
size?: 'xs' | 's';
|
|
812
|
+
showLabel?: 'text' | 'none';
|
|
813
|
+
layout?: 'inline' | 'block';
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare function ConfidenceBar(props: ConfidenceBarProps): JSX.Element;
|
|
817
|
+
|
|
818
|
+
// ─── DiffView ─────────────────────────────────────────────────────────────────
|
|
819
|
+
|
|
820
|
+
export interface DiffLine {
|
|
821
|
+
type: 'add' | 'remove' | 'context';
|
|
822
|
+
text: string;
|
|
823
|
+
lineNo?: number;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export interface DiffViewProps {
|
|
827
|
+
lines?: DiffLine[];
|
|
828
|
+
layout?: 'inline' | 'split';
|
|
829
|
+
wordWrap?: boolean;
|
|
830
|
+
lineNumbers?: boolean;
|
|
831
|
+
maxHeight?: number;
|
|
832
|
+
title?: string;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
export declare function DiffView(props: DiffViewProps): JSX.Element;
|