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