@epam/ai-dial-ui-kit 0.16.0-dev.47 → 0.16.0-dev.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-D93YIwGJ.cjs"),c=require("./DateCellRenderer-uqWWm9rI.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),g=require("react"),ee=require("classnames"),vn=require("./editors.cjs"),Ya=require("react-dom");function qa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Pe=qa(g),Hr=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,$e=({...e})=>s.jsx(Hr,{...e,variant:c.CaptionType.Error}),Cs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},yn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=Cs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),Cs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Xa=7,Qa=2,Cn=g.createContext(null),In=()=>{const e=g.useContext(Cn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ja=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=g.useState(e),l=g.useRef(null),d=n??o,u=a??i,h=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Xa+Qa),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),p=B.useHover(h.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),m=B.useFocus(h.context,{enabled:n==null}),x=B.useDismiss(h.context),y=B.useRole(h.context,{role:"tooltip"}),v=B.useInteractions([p,m,x,y]);return g.useEffect(()=>{if(!d)return;const b=h.refs.reference.current;if(!(b instanceof Element))return;const C=new IntersectionObserver(([I])=>{I.isIntersecting||u(!1)},{root:null,threshold:0});return C.observe(b),()=>C.disconnect()},[d,h.refs.reference,u]),g.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...h}),[d,u,v,h])},Kr=({children:e,...t})=>{const r=Ja(t);return s.jsx(Cn.Provider,{value:r,children:e})},Wr=({style:e,...t})=>{const r=In(),n=c.useHasHover(),a=g.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:ee("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},Vr=({children:e,asChild:t=!1,...r})=>{const n=In(),a=t&&g.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?g.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},Se=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(Kr,{...o,children:[s.jsx(Vr,{className:ee(n,"truncate"),children:r}),s.jsx(Wr,{className:ee("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:h,...p})=>{const m=ee(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&yn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...p,type:u,className:x,"aria-label":typeof e=="string"&&e||p["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:m,children:e}),s.jsx(c.DialIcon,{icon:i})]});return h?s.jsx(Se,{...h,children:y}):y},eo="text-primary",it=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=g.useRef(null),[d,u]=g.useState(!1),[h,p]=g.useState(""),m=g.useCallback(()=>{const b=l.current;b&&(p(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),x=g.useCallback(()=>c.scheduleMeasure(m),[m]);g.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,m)},[m]),g.useEffect(()=>{x()},[e,x]);const y=g.useMemo(()=>typeof e=="string"?e:h,[h,e]),v=g.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Kr,{...i,children:[s.jsx(Vr,{asChild:!0,onMouseEnter:x,onFocusCapture:x,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:x,onFocus:x,ref:l,children:e})}),s.jsx(Wr,{className:f.mergeClasses(eo,r,!v&&"hidden"),children:v})]})},Sn=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(it,{text:e}),a&&i&&s.jsx(Tt,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)},Gr=({label:e="Error",className:t})=>s.jsx(Sn,{label:e,className:f.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)}),to="flex items-center justify-center text-secondary",ro="shrink-0 grow-0 basis-auto animate-spin-steps",so=e=>Pe.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Pe.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),Et=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:ee({[to]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(so,{width:e,height:e,className:ee(ro,r),role:"img","aria-label":a})})});var Ue=(e=>(e.Default="default",e.Compact="compact",e))(Ue||{});const no={[Ue.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[Ue.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},ao=({title:e,value:t,description:r,variant:n=Ue.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=no[n],m=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",m?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(Gr,{className:"self-start"}):o?s.jsx(Et,{fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(it,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(it,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},At=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Nn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),jn=(e,t)=>{if(e<=0)return;let r;for(const n of t)(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=n.color);return r},Wt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=At,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const m=e==null,x=!!(r||n||!m),y=Nn(m?0:e,t),v=jn(y,i),b=o??(m?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,N=r?s.jsx(Gr,{}):n?s.jsx(Et,{fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,S=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:S}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),N]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),w]})},wn=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:h})=>{const p=n!==void 0,[m,x]=g.useState(a),y=i?!0:p?n:m,v=g.useId(),b=()=>{if(o)return;const C=!y;p||x(C),l?.(C)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:ee("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",h),children:r})]})},oo=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:m,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),N=m?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,S=t?s.jsx(Se,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],O="cursor-pointer rounded-xs text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-primary",E="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(wn,{title:S,description:r,defaultExpanded:d,nonCollapsible:u,className:C,children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":m?"gap-2":"gap-3"),children:h?s.jsx(Et,{fullWidth:!1,className:"self-center"}):a?T.map(j=>{const A=j in n?n[j]:null,_=j in a?a[j]:null,L=typeof A=="number"&&typeof _=="number"?parseFloat((_-A).toFixed(3)):null,R=L!=null&&L!==0,M=R&&L>0,$=R?M?`+${L}`:String(L):null,V=b?.[j],K=s.jsx("span",{className:"dial-small-text text-secondary",children:j}),W=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[V?s.jsx(Se,{tooltip:V,children:K}):K,$!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:$})]}),s.jsxs("div",{className:D,children:[s.jsx(Wt,{title:o?.[0],value:A,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:j}),s.jsx(Wt,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:`${j} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:f.mergeClasses(E,O),children:W},j):s.jsx("div",{className:E,children:W},j)}):I.map(([j,A])=>{const _=s.jsx(Wt,{title:j,value:A,maxValue:i,colorMap:l,inline:m,titleClassName:N,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:O,children:_}):_,L=b?.[j];return L?s.jsx(Se,{tooltip:L,triggerClassName:"flex flex-col",children:P},j):s.jsx(g.Fragment,{children:P},j)})})})},io="#FF4E50",lo=(e,t)=>{let r=-1;return t.forEach((n,a)=>{(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=a)}),r},Zt=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=lo(d,t);u>=0&&(r[u]+=1)});const a=Math.max(0,n,...r),o=d=>a>0?d/a:0,i={from:0,to:0,color:io,count:n,ratio:o(n),isZeroBucket:!0},l=t.map((d,u)=>({from:d.from,to:d.to,color:d.color,count:r[u],ratio:o(r[u]),isZeroBucket:!1}));return[i,...l]},Ur=e=>e<=0?2:e%2===0?e:e+1,Dn=e=>{const t=Ur(e);return[t,t/2,0]},br=e=>`${Math.round(e*100)/100}`,sr=(e,t)=>e===t?br(e):`${br(e)}-${br(t)}`,vr=128,co=(e,t)=>{const r=sr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Is=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:co(a.from,a.to)})]}),uo=({title:e,values:t,colorMap:r=At,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Zt(t,r),p=l?Zt(l,r):void 0,m=t.length,x=l?.length??0,y=Math.max(m,x),v=Ur(y),b=Dn(y),C=S=>S.map(T=>({...T,ratio:v>0?T.count/v:0})),I=C(h),N=p?C(p):void 0,w=(S,T,O,E)=>{if(S.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})});const D=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return s.jsx(Se,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":O,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${S.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:vr},children:s.jsx(Et,{fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:vr},children:b.map((S,T)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((S,T)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},S)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:vr},children:N?I.map((S,T)=>{const O=N[T],E=`${S.count} out of ${m} ${n}`,D=`${O.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(S,Is(d,S.count,m,n,S),E,!0),w(O,Is(u,O.count,x,n,O),D,!1)]},T)}):I.map((S,T)=>{const O=`${S.count} out of ${m} ${n}`;return S.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})},T):s.jsx(Se,{placement:"bottom",tooltip:O,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":O,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},T)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,T)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:sr(S.from,S.to)},T))})]})]})},Ot=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&yn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(Se,{...o,children:u}):u},fo="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",po=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Ot,{"aria-label":e,className:fo,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(Se,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},Zr=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(po,{caption:n})]}):null,Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})}),Tn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,id:o,className:i,"aria-label":l,...d})=>{const u=g.useId(),h=o??u,p=!!n?.label,m=p?n?.id??`${h}-label`:void 0,x=t>0?t:0,y=Number.isFinite(e)?e:0,v=Math.min(Math.max(y,0),x),b=x>0?v/x*100:0,C=s.jsx("div",{...d,id:h,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":x,"aria-labelledby":m,"aria-label":c.resolveAccessibleName(l,p?void 0:"Progress"),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:m}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})};var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{});const ho=(e,t)=>{if(t===e.id)switch(e.status){case be.VALID:return"border-accent-secondary text-primary";case be.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case be.VALID:return"border-primary text-primary";case be.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},mo=(e,t)=>{if(t===e.id)switch(e.status){case be.VALID:return"bg-accent-secondary";case be.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case be.VALID:return"bg-accent-secondary";case be.ERROR:return"bg-red-400";default:return"bg-layer-4"}},go=({step:e,index:t,currentStep:r,onChangeStep:n})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full",i=()=>r===e.id&&e.status===be.ERROR?s.jsx(F.IconExclamationCircle,{stroke:2,size:f.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===be.VALID?s.jsx(F.IconCheck,{stroke:2,size:f.DIAL_ICON_SIZE.SM}):t+1;return s.jsxs("button",{className:ee(a,ho(e,r)),onClick:()=>n(e.id),children:[s.jsx("span",{className:ee(o,mo(e,r)),children:i()}),s.jsx("span",{children:e.name})]})},xo=({steps:e,currentStep:t,onChangeStep:r})=>{const n=a=>{const o=e.findIndex(d=>d.id===t),i=e.findIndex(d=>d.id===a);if(a===t)return;(e.slice(0,i).every(d=>d.status===be.VALID)||i<o)&&r(a)};return s.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>s.jsx(go,{currentStep:t,onChangeStep:n,step:a,index:o},a.id))})},bo=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),vo=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Se,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]});var Ae=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ae||{}),yt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(yt||{}),Yt=(e=>(e.Circle="circle",e.Square="square",e))(Yt||{});const yo=e=>{if(typeof e=="number")return e;switch(e){case yt.Small:return 32;case yt.Large:return 64;case yt.Default:default:return 40}},Vt=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ae.Default,width:l,height:d,overlay:u,color:h,className:p,...m})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const x=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",p);if(i!==Ae.Default){const j=f.mergeClasses(x,i===Ae.Circular&&"rounded-full",i===Ae.Rectangular&&"rounded",i===Ae.Text&&"rounded",!!u&&"relative"),A={};return l&&(A.width=typeof l=="number"?`${l}px`:l),d&&(A.height=typeof d=="number"?`${d}px`:d),h&&(A.backgroundColor=h),s.jsx("div",{className:j,style:A,...m,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,C=typeof r=="object"?r:{},I=typeof n=="object"?n:{},N=typeof t=="object"?t:{},w=yo(C.size),S=C.shape??Yt.Circle,T=I.width??"38%",O=N.rows??3,E=N.width,D=j=>E?Array.isArray(E)?E[j]??"100%":E:j===O-1?"61%":"100%";return s.jsxs("div",{...m,className:f.mergeClasses("flex gap-4",!!u&&"relative",p,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(x,S===Yt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...h&&{backgroundColor:h}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:T,...h&&{backgroundColor:h}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:O}).map((j,A)=>s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:D(A),...h&&{backgroundColor:h}}},A))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},Co=ee("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Io=ee("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Lr=ee("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),_r="opacity-75 !cursor-not-allowed",En="text-error",So="my-1 border-t border-hover border-secondary",nt=4,No=s.jsx(F.IconChevronRight,{size:14}),ut=(e,t)=>({appearance:n,...a})=>s.jsx(Ot,{...a,variant:e,appearance:n||t}),jo=(e,t)=>({variant:n,...a})=>s.jsx(Ot,{...a,variant:n||t,appearance:e}),wo=ut(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Do=ut(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),An=ut(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=ut(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),Eo=ut(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),Ao=ut(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),On=jo(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Ln=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(On,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),Oo=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(nt,"menu",!!e.disabled),d=g.useCallback(u=>h=>{u.disabled||(u.onClick?.({key:u.key,domEvent:h}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ee(Lr,e.disabled&&_r,e.className),...i(),children:[e.icon&&s.jsx("span",{className:ee(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:ee("ml-auto shrink-0",e.disabled&&"text-secondary"),children:No})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:ee("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:ee(Lr,u.disabled&&_r,u.danger&&En,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:ee(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Lo=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,qt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:h=!1,onOpenChange:p,closable:m=!1,onClose:x,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:N=!0,allowedPlacements:w,anchorToMouse:S=!1,matchReferenceWidth:T=!0,maxDropdownHeight:O})=>{const[E,D]=g.useState(h),j=u!==void 0,A=j?!!u:E,_=g.useRef(null),P=g.useCallback(k=>{j||D(k),p?.(k)},[j,p]),L=g.useId(),R=l===void 0,{refs:M,floatingStyles:$,context:V}=B.useFloating({placement:l,open:A,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:nt,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:nt,allowedPlacements:w}):B.flip({padding:nt}),B.shift({padding:nt}),B.size({padding:nt,apply({availableWidth:k,availableHeight:U,elements:de}){const ne=de.floating,ge=Lo(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",T?`${Math.round(ge)}px`:"0px"),T?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(k)}px`;const Je=Math.floor(U);ne.style.maxHeight=`${O?Math.min(Je,O):Je}px`}})]}),K=B.useClick(V,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),W=B.useHover(V,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),G=B.useDismiss(V,{bubbles:!0,referencePress:!1,outsidePress:k=>{if(!N)return!1;const U=k.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),J=B.useRole(V,{role:"menu"}),{getReferenceProps:re,getFloatingProps:Y}=B.useInteractions([K,W,G,J]),q=g.useCallback((k,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:k,y:U,top:U,left:k,right:k,bottom:U})})},[M]),se=g.useCallback(k=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(k.preventDefault(),S&&(q(k.clientX,k.clientY),_.current=document.elementFromPoint(k.clientX,k.clientY)),P(!0))},[S,d,P,q,i]),le=g.useCallback(k=>{!S||d||(i.includes(c.DropdownTrigger.ContextMenu)&&A&&P(!1),q(k.clientX,k.clientY),_.current=document.elementFromPoint(k.clientX,k.clientY))},[S,d,q,A,i,P]);g.useEffect(()=>{d&&A&&P(!1)},[d,A,P]);const oe=g.useCallback(k=>U=>{k.disabled||(k.onClick?.({key:k.key,domEvent:U}),r?.({key:k.key,domEvent:U}),P(!1))},[r,P]),me=g.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(k=>k.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(So,b)},k.key):k.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",k.className),children:k.label},k.key):k.children?.length?s.jsx(Oo,{item:k,onRootClose:()=>P(!1)},k.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!k.disabled,className:ee(Lr,k.disabled&&_r,k.danger&&En,k.className),disabled:k.disabled,onClick:oe(k),children:[k.icon&&s.jsx("span",{className:ee(k.danger&&"text-error",k.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:k.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",k.danger&&"text-error",k.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:k.label})]},k.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=re({onContextMenu:se,onMouseDown:le});return g.useEffect(()=>{if(!A)return;const k=M.reference.current;let U=null;if(k instanceof Element?U=k:_.current instanceof Element&&(U=_.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[A,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:ee(Co,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":A,"aria-controls":L,...ve,children:e}),A&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:V,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:L,ref:M.setFloating,style:$,className:ee(Io,!T&&"w-max",C),...Y(),children:[m&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(Ln,{ariaLabel:"Close dropdown",onClose:k=>{x?.(k),P(!1)}})}),me]})})})]})};var Ze=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ze||{}),lt=(e=>(e.Error="error",e.Warning="warning",e))(lt||{}),Ye=(e=>(e.Default="default",e.Inline="inline",e))(Ye||{}),Xt=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Xt||{});const bt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ye.Default,onClick:i})=>{const l=o===Ye.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),h=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:h,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(it,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},_o=()=>{const[e,t]=g.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return g.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},ko=12,Ro=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ze.Horizontal,view:o=Ye.Default,screenThreshold:i=Xt.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:h,inlineContainerClassName:p,inlineTabClassName:m})=>{const[x,y]=g.useState(!1),[v,b]=g.useState(!1),[C,I]=g.useState(!1),N=_o(),w=N===c.ScreenType.Mobile||i===Xt.Tablet&&N===c.ScreenType.Tablet,S=a===Ze.Horizontal,T=g.useRef(null),O=g.useRef(null),E=g.useRef(null),D=e.find(L=>L.id===t),j=g.useMemo(()=>f.mergeClasses("flex gap-2",S?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[S]),A=g.useCallback(()=>{const L=O.current;L&&I(L.scrollWidth>L.clientWidth)},[]),_=g.useCallback(()=>{const L=E.current,R=O.current;if(!L||!R)return;const M=L.getBoundingClientRect(),$=R.getBoundingClientRect();if(M.width===0||$.width===0)return;const V=ko;let K=R.scrollLeft;if(M.left<$.left+V)K-=$.left+V-M.left;else if(M.right>$.right-V)K+=M.right-($.right-V);else return;const W=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,W)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=g.useCallback(L=>{r(L),L===t&&_()},[r,t,_]);return g.useEffect(()=>{A();const L=new ResizeObserver(()=>A()),R=O.current;return R&&L.observe(R),()=>L.disconnect()},[e,A]),g.useEffect(()=>{_()},[t,_]),o===Ye.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",p),children:e.map(L=>s.jsx(bt,{tab:L,active:t===L.id,view:Ye.Inline,onClick:P,className:m},L.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(qt,{trigger:[c.DropdownTrigger.Click],open:x,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(L=>s.jsx(bt,{tab:L,active:L.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},L.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(bt,{tab:D,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",x&&"rotate-180")})]})})}):s.jsxs("div",{ref:T,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:O,role:"tablist",className:j,children:e.map(L=>s.jsx("div",{ref:t===L.id?E:void 0,className:"w-full",children:s.jsx(bt,{tab:L,active:t===L.id,onClick:P,horizontal:S,className:f.mergeClasses("w-full",h)})},L.id))}),C&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(qt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(L=>s.jsx(bt,{tab:L,active:L.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},L.id)),children:s.jsx(Tt,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},_n="w-full overflow-hidden",kn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Qt="flex items-center gap-2 dial-small-text",yr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},kr="flex flex-1 items-center gap-1 min-w-0 transition-colors",Mo="text-secondary hover:text-accent-primary",Rn="text-primary cursor-default",Yr="flex-none inline-flex items-center leading-none text-secondary",Po="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Mn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),vt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=Mn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:h,...p})=>{const m=async I=>{if(h&&!a&&!await h()){I.preventDefault();return}r&&r(I)},x=a?yr.last:o?yr.first:yr.middle,y=f.mergeClasses(Qt,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(kr,Mo):f.mergeClasses(kr,Rn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(it,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...p,className:y,"aria-label":p["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:m,className:b,children:[d,C]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,C]}),!a&&s.jsx("span",{className:Yr,"aria-label":"separator",children:i})]})},Bo=({pathItems:e,separator:t=Mn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=g.useMemo(()=>e?.length?e:g.Children.toArray(a).filter(g.isValidElement).map(h=>{const p=h.props,{labelClassName:m,isLast:x,separator:y,...v}=p;return v}),[e,a]),d=g.useCallback(async h=>{const p=parseInt(h.key,10),m=l[p];if(i&&!await i()){h.domEvent.preventDefault();return}m.onClick?m.onClick(h.domEvent):m.href&&(window.location.href=m.href)},[l,i]),u=g.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>g.createElement(vt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const h=l.at(0),p=l.slice(1,-2),m=l.at(-2),x=l.at(-1);if(!h||!m||!x)return null;const y=p.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[g.createElement(vt,{...h,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Qt,"shrink-0"),children:[s.jsx(qt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:Po,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Yr,children:t})]}),g.createElement(vt,{...m,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),g.createElement(vt,{...x,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(_n,n),children:s.jsx("ol",{className:kn,children:u})})},qr=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),Pn=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),Xr=qr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Bn=qr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),zn=qr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),zo=Pn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Fo=Pn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Fn=({iconClassName:e,label:t,...r})=>t?s.jsx(zn,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(An,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),$o="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Ho=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:ee("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Ot,{className:ee($o,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Ko=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Wo=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Ko.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(r!==void 0||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},$n=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx(Zr,{...e,htmlFor:n}),s.jsx(Hn,{id:n,...o}),s.jsx($e,{text:t}),!t&&s.jsx(Hr,{text:r})]}),Hn=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:h,tooltipText:p,min:m,onChange:x,max:y,inputButtonProps:v,...b})=>{const C=g.useRef(null),I=B.useMergeRefs([u,C]),N=d==="number"||m!==void 0||y!==void 0;g.useEffect(()=>{const O=C.current;if(!O||!N||t)return;const E=D=>{D.preventDefault()};return O.addEventListener("wheel",E,{passive:!1}),()=>{O.removeEventListener("wheel",E)}},[t,N,d]);const w=O=>{Wo(O,d,m,y)},S=O=>{const E=O.currentTarget.value;if(N&&E!==""){const D=parseFloat(E);if(isNaN(D)&&E!=="-"&&E!=="."||!isNaN(D)&&(m!==void 0&&D<+m||y!==void 0&&D>+y))return}x?.(E||void 0)},T=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(Hn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:I,type:d,autoComplete:d==="password"?"new-password":"off",value:h??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:S,onKeyDown:w,min:m,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(Ho,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(Se,{tooltip:p||h,children:T()}):T()},Kn=g.createContext({dragDropManager:void 0});function ye(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Ss=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ns=function(){return Math.random().toString(36).substring(7).split("").join(".")},js={INIT:"@@redux/INIT"+Ns(),REPLACE:"@@redux/REPLACE"+Ns()};function Vo(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Go(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Yo(e))return"date";if(Zo(e))return"error";var r=Uo(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Uo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Zo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Yo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function et(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Go(e)),t}function Wn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+et(r)+"'");return r(Wn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+et(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function h(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+et(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function m(v){if(!Vo(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+et(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,C=0;C<b.length;C++){var I=b[C];I()}return v}function x(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+et(v));a=v,m({type:js.REPLACE})}function y(){var v,b=p;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+et(I)+"'");function N(){I.next&&I.next(h())}N();var w=b(N);return{unsubscribe:w}}},v[Ss]=function(){return this},v}return m({type:js.INIT}),n={dispatch:m,subscribe:p,getState:h,replaceReducer:x},n[Ss]=y,n}function Z(e,t,...r){if(qo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function qo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Xo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Qo(e,t){return e.filter(r=>r!==t)}function Vn(e){return typeof e=="object"}function Jo(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function ei(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Qr="dnd-core/INIT_COORDS",nr="dnd-core/BEGIN_DRAG",Jr="dnd-core/PUBLISH_DRAG_SOURCE",ar="dnd-core/HOVER",or="dnd-core/DROP",ir="dnd-core/END_DRAG";function ws(e,t){return{type:Qr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ti={type:Qr,payload:{clientOffset:null,sourceClientOffset:null}};function ri(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ws(o)),si(r,l,d);const u=oi(r,l);if(u==null){e.dispatch(ti);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");ni(i),h=i(u)}e.dispatch(ws(o,h));const m=d.getSource(u).beginDrag(l,u);if(m==null)return;ai(m),d.pinSource(u);const x=d.getSourceType(u);return{type:nr,payload:{itemType:x,item:m,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function si(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Z(r.getSource(n),"Expected sourceIds to be registered.")})}function ni(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ai(e){Z(Vn(e),"Item must be an object.")}function oi(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function li(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){ii(e,a,r[a])})}return e}function ci(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();di(n),pi(n).forEach((i,l)=>{const d=ui(i,l,a,n),u={type:or,payload:{dropResult:li({},r,d)}};e.dispatch(u)})}}function di(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ui(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return fi(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function fi(e){Z(typeof e>"u"||Vn(e),"Drop result must either be an object or undefined.")}function pi(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function hi(e){return function(){const r=e.getMonitor(),n=e.getRegistry();mi(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:ir}}}function mi(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Rr(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function gi(e){return function(r,{clientOffset:n}={}){xi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return vi(a,i,l),bi(a,o,i),yi(a,o,i),{type:ar,payload:{targetIds:a,clientOffset:n||null}}}}function xi(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function bi(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];Z(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);Z(o,"Expected targetIds to be registered.")}}function vi(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Rr(o,r)||e.splice(n,1)}}function yi(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Ci(e){return function(){if(e.getMonitor().isDragging())return{type:Jr}}}function Ii(e){return{beginDrag:ri(e),publishDragSource:Ci(e),hover:gi(e),drop:ci(e),endDrag:hi(e)}}class Si{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=Ii(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Ni(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Gn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ji(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Gn(Ni(t,n),r)}function wi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Gn(t,r)}const Ct=[],es=[];Ct.__IS_NONE__=!0;es.__IS_ALL__=!0;function Di(e,t){return e===Ct?!1:e===es||typeof t>"u"?!0:ei(t,e).length>0}class Ti{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Z(typeof t=="function","listener must be a function."),Z(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!Di(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Z(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),a=this.getItemType();return Rr(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Rr(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?l===i.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return ji(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return wi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Ds=typeof global<"u"?global:self,Un=Ds.MutationObserver||Ds.WebKitMutationObserver;function Zn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function Ei(e){let t=1;const r=new Un(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Ai=typeof Un=="function"?Ei:Zn;class Oi{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Ai(this.flush),this.requestErrorThrow=Zn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Li{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class _i{create(t){const r=this.freeTasks,n=r.length?r.pop():new Li(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Yn=new Oi,ki=new _i(Yn.registerPendingError);function Ri(e){Yn.enqueueTask(ki.create(e))}const ts="dnd-core/ADD_SOURCE",rs="dnd-core/ADD_TARGET",ss="dnd-core/REMOVE_SOURCE",lr="dnd-core/REMOVE_TARGET";function Mi(e){return{type:ts,payload:{sourceId:e}}}function Pi(e){return{type:rs,payload:{targetId:e}}}function Bi(e){return{type:ss,payload:{sourceId:e}}}function zi(e){return{type:lr,payload:{targetId:e}}}function Fi(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function $i(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Mr(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Mr(r,!1));return}Z(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Hi=0;function Ki(){return Hi++}function Wi(e){const t=Ki().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ts(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Es(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class Vi{addSource(t,r){Mr(t),Fi(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(Mi(n)),n}addTarget(t,r){Mr(t,!0),$i(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(Pi(n)),n}containsHandler(t){return Es(this.dragSources,t)||Es(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ts(t)===Ie.SOURCE}isTargetId(t){return Ts(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(Bi(t)),Ri(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(zi(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=Wi(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Gi=(e,t)=>e===t;function Ui(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Zi(e,t,r=Gi){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Yi(e=Ct,t){switch(t.type){case ar:break;case ts:case rs:case lr:case ss:return Ct;case nr:case Jr:case ir:case or:default:return es}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Jo(r,n);if(!(a.length>0||!Zi(r,n)))return Ct;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function qi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){qi(e,a,r[a])})}return e}const As={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Qi(e=As,t){const{payload:r}=t;switch(t.type){case Qr:case nr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ar:return Ui(e.clientOffset,r.clientOffset)?e:Xi({},e,{clientOffset:r.clientOffset});case ir:case or:return As;default:return e}}function Ji(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ji(e,a,r[a])})}return e}const el={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function tl(e=el,t){const{payload:r}=t;switch(t.type){case nr:return tt({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Jr:return tt({},e,{isSourcePublic:!0});case ar:return tt({},e,{targetIds:r.targetIds});case lr:return e.targetIds.indexOf(r.targetId)===-1?e:tt({},e,{targetIds:Qo(e.targetIds,r.targetId)});case or:return tt({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ir:return tt({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function rl(e=0,t){switch(t.type){case ts:case rs:return e+1;case ss:case lr:return e-1;default:return e}}function sl(e=0){return e+1}function nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function al(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){nl(e,a,r[a])})}return e}function ol(e={},t){return{dirtyHandlerIds:Yi(e.dirtyHandlerIds,{type:t.type,payload:al({},t.payload,{prevTargetIds:Xo(e,"dragOperation.targetIds",[])})}),dragOffset:Qi(e.dragOffset,t),refCount:rl(e.refCount,t),dragOperation:tl(e.dragOperation,t),stateId:sl(e.stateId)}}function il(e,t=void 0,r={},n=!1){const a=ll(n),o=new Ti(a,new Vi(a)),i=new Si(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function ll(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Wn(ol,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function cl(e,t){if(e==null)return{};var r=dl(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dl(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Os=0;const Gt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ul=g.memo(function(t){var{children:r}=t,n=cl(t,["children"]);const[a,o]=fl(n);return g.useEffect(()=>{if(o){const i=qn();return++Os,()=>{--Os===0&&(i[Gt]=null)}}},[]),s.jsx(Kn.Provider,{value:a,children:r})});function fl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=pl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function pl(e,t=qn(),r,n){const a=t;return a[Gt]||(a[Gt]={dragDropManager:il(e,t,r,n)}),a[Gt]}function qn(){return typeof global<"u"?global:window}function hl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cr,Ls;function ml(){return Ls||(Ls=1,Cr=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Cr}var gl=ml();const xl=hl(gl),cr=typeof window<"u"?g.useLayoutEffect:g.useEffect;function bl(e,t,r){const[n,a]=g.useState(()=>t(e)),o=g.useCallback(()=>{const i=t(e);xl(n,i)||(a(i),r&&r())},[n,e,r]);return cr(o),[n,o]}function vl(e,t,r){const[n,a]=bl(e,t,r);return cr(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function yl(e,t,r){return vl(t,e||(()=>({})),()=>r.reconnect())}function Cl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),g.useMemo(()=>typeof e=="function"?e():e,r)}let Ir=!1;class Il{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!Ir,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ir=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ir=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Sl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function Nl(e,t,r,n){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const h=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&h!==p)return!1}return!0}function jl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wl(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Dl(e){return(t=null,r=null)=>{if(!g.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return wl(n),El(n,r?o=>e(o,r):e)}}function Tl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Dl(n);t[r]=()=>a}}),t}function _s(e,t){typeof e=="function"?e(t):e.current=t}function El(e,t){const r=e.ref;return Z(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?g.cloneElement(e,{ref:n=>{_s(r,n),_s(t,n)}}):g.cloneElement(e,{ref:t})}class Al{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Nl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=Tl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,jl(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ns(){const{dragDropManager:e}=g.useContext(Kn);return Z(e!=null,"Expected drag drop context"),e}function Ol(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function Ll(e){const t=ns(),r=g.useMemo(()=>new Al(t.getBackend()),[t]);return cr(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function _l(){const e=ns();return g.useMemo(()=>new Il(e),[e])}function kl(e){const{accept:t}=e;return g.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Rl{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function Ml(e,t){const r=g.useMemo(()=>new Rl(e,t),[t]);return g.useEffect(()=>{r.spec=e},[e]),r}function Pl(e,t,r){const n=ns(),a=Ml(e,t),o=kl(e);cr(function(){const[l,d]=Sl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Xn(e,t){const r=Cl(e,t),n=_l(),a=Ll(r.options);return Pl(r,n,a),[yl(r.collect,n,a),Ol(a)]}function Qn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Bl(e,t){return e.filter(r=>r!==t)}function zl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class Fl{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=zl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Bl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class $l{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const dr="__NATIVE_FILE__",Jn="__NATIVE_URL__",ea="__NATIVE_TEXT__",ta="__NATIVE_HTML__",ks=Object.freeze(Object.defineProperty({__proto__:null,FILE:dr,HTML:ta,TEXT:ea,URL:Jn},Symbol.toStringTag,{value:"Module"}));function Sr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const Pr={[dr]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[ta]:{exposeProperties:{html:(e,t)=>Sr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Jn]:{exposeProperties:{urls:(e,t)=>Sr(e,t,"").split(`
2
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[ea]:{exposeProperties:{text:(e,t)=>Sr(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Hl(e,t){const r=Pr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new $l(r);return n.loadDataTransfer(t),n}function Nr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Pr).filter(r=>{const n=Pr[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Kl=Qn(()=>/firefox/i.test(navigator.userAgent)),ra=Qn(()=>!!window.safari);class Rs{interpolate(t){const{xs:r,ys:n,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return n[l];let d=0,u=i.length-1,h;for(;d<=u;){h=Math.floor(.5*(d+u));const x=r[h];if(x<t)d=h+1;else if(x>t)u=h-1;else return n[h]}l=Math.max(0,u);const p=t-r[l],m=p*p;return n[l]+a[l]*p+o[l]*m+i[l]*p*m}constructor(t,r){const{length:n}=t,a=[];for(let x=0;x<n;x++)a.push(x);a.sort((x,y)=>t[x]<t[y]?-1:1);const o=[],i=[];let l,d;for(let x=0;x<n-1;x++)l=t[x+1]-t[x],d=r[x+1]-r[x],o.push(l),i.push(d/l);const u=[i[0]];for(let x=0;x<o.length-1;x++){const y=i[x],v=i[x+1];if(y*v<=0)u.push(0);else{l=o[x];const b=o[x+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const h=[],p=[];let m;for(let x=0;x<u.length-1;x++){m=i[x];const y=u[x],v=1/o[x],b=y+u[x+1]-m-m;h.push((m-y-b)*v),p.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=h,this.c3s=p}}const Wl=1;function sa(e){const t=e.nodeType===Wl?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function Pt(e){return{x:e.clientX,y:e.clientY}}function Vl(e){var t;return e.nodeName==="IMG"&&(Kl()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Gl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return ra()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Ul(e,t,r,n,a){const o=Vl(t),l=sa(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:h}=e,{anchorX:p,anchorY:m}=n,{dragPreviewWidth:x,dragPreviewHeight:y}=Gl(o,t,u,h),v=()=>{let T=new Rs([0,.5,1],[d.y,d.y/h*y,d.y+y-h]).interpolate(m);return ra()&&o&&(T+=(window.devicePixelRatio-1)*y),T},b=()=>new Rs([0,.5,1],[d.x,d.x/u*x,d.x+x-u]).interpolate(p),{offsetX:C,offsetY:I}=a,N=C===0||C,w=I===0||I;return{x:N?C:b(),y:w?I:v()}}class Zl{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Yl(e,a,r[a])})}return e}class ql{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ms({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ms({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(ks).some(r=>ks[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Hl(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const o=this.sourceNodes.get(a);return o&&sa(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const i=Pt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,d=Nr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const h=this.monitor.getSourceId(),p=this.sourceNodes.get(h),m=this.sourcePreviewNodes.get(h)||p;if(m){const{anchorX:x,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),N=Ul(p,m,i,{anchorX:x,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(m,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,d=Nr(l);d&&this.beginDragNativeItem(d,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Pt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Pt(a),this.scheduleHover(o),(o||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else Nr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Pt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Zl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Fl(this.isNodeInDocument)}}const Xl=function(t,r,n){return new ql(t,r,n)},Ql=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p})=>{const m=g.useRef(null),x=g.useRef(null),[y,v]=g.useState([]),[b,C]=g.useState(!1),[I,N]=g.useState(!1),w=g.useCallback(M=>{const $=M.target.files;if($&&$.length>0){const V=Array.from($),K=h?.(V),W=p?.(V);K?C(!0):W?N(!0):e(V)}},[h,p,e]),S=g.useCallback(M=>o&&M?.length>o,[o]),T=g.useMemo(()=>b||I||S(y),[b,I,S,y]),O=()=>{v([]),C(!1),N(!1)},E=g.useMemo(()=>b?s.jsx($e,{text:l}):I?s.jsx($e,{text:u}):S(y)?s.jsx($e,{text:d}):null,[d,l,u,y,S,b,I]);g.useEffect(()=>{O()},[a]);const[{isOver:D,canDrop:j},A]=Xn(()=>({accept:[dr],drop(M){const $=M.files,V=h?.($)??!1,K=p?.($)??!1,W=S?.($)??!1;if(C(V),N(K),V||K||W){v($);return}e($),O()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,h,p,S]),_=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),x.current?.click())},P=M=>{M?.preventDefault();const $=Array.from(M.dataTransfer?.items??[]);C(!!h?.($)),N(!!p?.($)),v($)},L=M=>{M.target===M.currentTarget&&O()},R=ee("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!j&&!T&&"border-primary",j&&(D?"border-accent-primary":"border-hover"),T&&"border-error");return A(m),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:m,onDragOver:P,onDragLeave:L,children:[s.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:_,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&s.jsx("p",{className:"mb-1",children:t}),r&&s.jsx("p",{className:"mb-0.5",children:r}),n&&s.jsx(Xr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>x.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:x,hidden:!0,accept:a,onChange:w})]}),s.jsx(s.Fragment,{children:E})]})},Jl=({iconBefore:e,className:t,...r})=>{const n=r.invalid,a=()=>s.jsx("div",{className:"mr-2",children:n?s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS,className:"text-error"}):e});return s.jsx($n,{...r,iconBefore:a(),containerClassName:ee("h-[40px] p-0",n&&"h-[60px]"),className:ee("rounded-r-none border-r-0",n&&"text-error",t)})},ec=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=g.useRef(null),[h,p]=g.useState(!1),[m,x]=g.useState(!1),[y,v]=g.useState(0),b=g.useCallback(()=>{p(!1),x(!1),v(0)},[]),C=g.useCallback(D=>!!(o&&t.length+D.length>o),[o,t.length]),I=h||m,[{isOver:N,canDrop:w},S]=Xn(()=>({accept:[dr],drop(D){const j=D.files,A=[...t,...j],_=n?.(j)??!1,P=a?.(j)??!1,L=C?.(j)??!1;if(p(_),x(P),_||P||L){v(j.length);return}r(A),b()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[t,r,n,a,C,b]),T=D=>{D.preventDefault();const j=Array.from(D.dataTransfer?.items??[]);p(!!n?.(j)),x(!1),v(j.length)},O=D=>{D.target===D.currentTarget&&b()};S(u);const E=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:T,onDragLeave:O,className:ee("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!E&&(w&&N?"border-accent-primary":"border-primary"),(I||E)&&"border-error"),children:e}),h&&s.jsx($e,{text:i}),m&&s.jsx($e,{text:l}),!h&&!m&&E&&s.jsx($e,{text:d})]})},na=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:m}=e,x=g.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=g.useCallback(b=>s.jsx(Fn,{"aria-label":l,onClick:C=>x(C,b)}),[l,x]),v=g.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx(Jl,{id:b.name,value:b.name,iconAfter:y(b.name),iconBefore:r||n?.(b.name),invalid:o?.(b),error:o?.(b)?i:""},b.name+C))}),[t,r,n,o,i,y]);return s.jsx(ul,{backend:Xl,children:!t||t.length===0?s.jsx(Ql,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(ec,{existingFiles:t,onDrop:a,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:m,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx($e,{text:u})]})})},tc=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,multiple:p=!0,acceptTypes:m,deleteAllButtonLabel:x,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=g.useRef(null),I=()=>C.current?.click(),N=()=>{e([])},w=g.useCallback(E=>E?.some(D=>!(m==="/"||m?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[m]),S=g.useCallback(E=>{if(!o)return!1;const D=o*(1024*1024);return E?.some(j=>{const A=j.size;return!!A&&A>D})},[o]),T=g.useCallback(E=>{if(!i||!p)return!1;const D=i*1024*1024;return E.reduce((A,_)=>A+_.size,0)>D},[i,p]),O=g.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const j=Array.from(D),A=w(j),_=S(j);!A&&!_&&e([...n||[],...j])}},[w,S,e,n]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[s.jsx(Zr,{label:`${t}: ${p?n?.length||0:""}`,htmlFor:r}),p&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Bn,{label:x,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:N}),(a?a>n?.length:!0)&&s.jsx(Xr,{appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconPlus,{...f.BASE_ICON_PROPS}),label:y,onClick:I}),v]})]}),n&&n.length>0&&s.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:m,onChange:O}),s.jsx(na,{files:n,onChange:e,acceptTypes:m,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,getIsFileFormatError:w,getIsFileSizeError:S,getIsMultiFilesSizeError:T,...b})]})};var _e=(e=>(e.Row="Row",e.Column="Column",e))(_e||{}),Ge=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Ge||{}),ct=(e=>(e.Info="info",e.Danger="danger",e))(ct||{}),aa=(e=>(e.Normal="normal",e.Reverse="reverse",e))(aa||{}),Le=(e=>(e.File="file",e.Folder="folder",e))(Le||{}),St=(e=>(e.Left="left",e.Right="right",e))(St||{}),te=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(te||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{});const as="data-editable-container",rc={[as]:""};function sc({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[h,p]=g.useState(e),[m,x]=g.useState(!1),[y,v]=g.useState(""),b=g.useRef(null),C=g.useRef(!1),I=g.useRef(!1),N=g.useCallback((D=!1,j="")=>{x(D),v(j)},[]),w=g.useCallback(D=>{if(!o)return N(),!0;const j=o(D);return j?j.startsWith(`${te.Warning}__`)?(N(!1,j),!0):(N(!0,j),!1):(N(),!0)},[o,N]),S=g.useCallback(D=>{const j=D??"";p(j),w(j)},[w]),T=g.useCallback(D=>{r&&!C.current&&!n?d?.(D):!r&&t&&i?.(D),C.current=!1},[i,d,r,t,n]),O=g.useCallback(()=>{a&&p(e),r?u?.():l?.(),C.current=!0,N()},[e,l,a,N,u,r]),E=g.useCallback(()=>{if(!I.current){if(I.current=!0,w(h)){T(h);return}!r&&w(e)?(p(e),N(),T(e)):O()}},[w,h,e,T,O,N,r]);return g.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,p(e),N(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,N]),g.useEffect(()=>{const D=b.current;if(!t&&!r||!D)return;const j=A=>{A.key==="Enter"?(A.preventDefault(),b.current?.blur()):A.key==="Escape"&&(A.preventDefault(),O())};return D.addEventListener("keydown",j),()=>D.removeEventListener("keydown",j)},[t,r,O]),g.useEffect(()=>{if(!t&&!r||n)return;const D=b.current;if(!D)return;const j=P=>P?(D.closest(`[${as}]`)??D).contains(P):!1,A=P=>{j(P.target)||E()},_=P=>{j(P.relatedTarget)||E()};return document.addEventListener("pointerdown",A,!0),D.addEventListener("blur",_),()=>{document.removeEventListener("pointerdown",A,!0),D.removeEventListener("blur",_)}},[t,r,n,E]),{inputRef:b,value:h,onChange:S,invalid:m,invalidMessage:y}}var Fe=(e=>(e.ITEM="item",e.FOLDER="folder",e))(Fe||{}),os=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(os||{}),oa=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(oa||{});const nc="application/octet-stream";function ac(e,t){if(!e||e.length===0)return[];const r=e.find(d=>d.parentPath===""&&d.nodeType==="FOLDER");if(!r)return[];const n=r.path||r.url||"",a=jr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",h=oc(d.nodeType),p=h===Fe.FOLDER,m=jr(u,p);let x;return d.parentPath===null||d.parentPath===void 0?x=a:d.parentPath===""?x="":x=jr(d.parentPath,!0),{...d,originalPath:u,path:m,parentPath:x,nodeType:h}}),i=new Map;o.forEach(d=>{const u={...d,id:d.originalPath,name:d.name,path:d.path,parentPath:d.parentPath,nodeType:d.nodeType,resourceType:ic(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===Fe.FOLDER?[]:void 0};d.nodeType===Fe.ITEM&&(u.extension=lc(d.name),u.contentType=d.contentType||nc,u.contentLength=d.contentLength||0),i.set(d.path,u)});const l=[];return i.forEach(d=>{if(d.parentPath===a)l.push(d);else{const u=d.path.lastIndexOf(d.name||""),h=d.path.slice(0,u),p=i.get(h);p&&p.nodeType===Fe.FOLDER?(p.items=p.items||[],p.items.push(d)):l.push(d)}}),l}function jr(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function oc(e){return e.toUpperCase()==="FOLDER"?Fe.FOLDER:Fe.ITEM}function ic(e){if(!e)return;const t=e.toUpperCase();return Object.values(os).find(n=>n.toUpperCase()===t)}function lc(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function cc(e,t="Prompts",r="prompts/public/",n="root"){const a=ac(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:Fe.FOLDER,folderId:n,items:a}]}const ia=({locale:e,timeZone:t,date:r=new Date}={})=>{const n=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:n,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${n}`:n}catch{return n}},la=':;,=/{}%&\\"',is=`(\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-D93YIwGJ.cjs"),c=require("./DateCellRenderer-B2BORgHD.cjs"),F=require("@tabler/icons-react"),B=require("@floating-ui/react"),g=require("react"),ee=require("classnames"),vn=require("./editors.cjs"),Ya=require("react-dom");function qa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Pe=qa(g),Hr=({text:e,className:t,variant:r=c.CaptionType.Description,...n})=>e?s.jsx("span",{...n,role:"alert",className:f.mergeClasses("dial-tiny-text",r===c.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,$e=({...e})=>s.jsx(Hr,{...e,variant:c.CaptionType.Error}),Cs={[c.ButtonVariant.Primary]:{[c.ButtonAppearance.Solid]:"dial-primary-solid-button",[c.ButtonAppearance.Ghost]:"dial-primary-ghost-button",[c.ButtonAppearance.Link]:"dial-primary-link-button"},[c.ButtonVariant.Neutral]:{[c.ButtonAppearance.Outlined]:"dial-neutral-outlined-button"},[c.ButtonVariant.Danger]:{[c.ButtonAppearance.Solid]:"dial-danger-solid-button",[c.ButtonAppearance.Ghost]:"dial-danger-ghost-button",[c.ButtonAppearance.Outlined]:"dial-danger-outlined-button"},[c.ButtonVariant.Success]:{[c.ButtonAppearance.Ghost]:"dial-success-ghost-button"},[c.ButtonVariant.Secondary]:{[c.ButtonAppearance.Ghost]:"dial-secondary-ghost-button"},[c.ButtonVariant.Tertiary]:{[c.ButtonAppearance.Ghost]:"dial-tertiary-ghost-button"},[c.ButtonVariant.Static]:{},[c.ButtonVariant.Starter]:{}},yn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=Cs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),Cs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Xa=7,Qa=2,Cn=g.createContext(null),In=()=>{const e=g.useContext(Cn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ja=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,i]=g.useState(e),l=g.useRef(null),d=n??o,u=a??i,h=B.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:B.autoUpdate,middleware:[B.offset(Xa+Qa),B.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),B.shift({padding:5}),B.arrow({element:l})]}),p=B.useHover(h.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),m=B.useFocus(h.context,{enabled:n==null}),x=B.useDismiss(h.context),y=B.useRole(h.context,{role:"tooltip"}),v=B.useInteractions([p,m,x,y]);return g.useEffect(()=>{if(!d)return;const b=h.refs.reference.current;if(!(b instanceof Element))return;const C=new IntersectionObserver(([I])=>{I.isIntersecting||u(!1)},{root:null,threshold:0});return C.observe(b),()=>C.disconnect()},[d,h.refs.reference,u]),g.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...h}),[d,u,v,h])},Kr=({children:e,...t})=>{const r=Ja(t);return s.jsx(Cn.Provider,{value:r,children:e})},Wr=({style:e,...t})=>{const r=In(),n=c.useHasHover(),a=g.useRef(null),o=B.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(B.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...r.floatingStyles,...e},...r.getFloatingProps(t),className:ee("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",r.getFloatingProps(t).className),children:[t.children,s.jsx(B.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},Vr=({children:e,asChild:t=!1,...r})=>{const n=In(),a=t&&g.isValidElement(e),o=a?e.props?.ref:null,i=B.useMergeRefs([n.refs.setReference,...o?[o]:[]]);return a?g.cloneElement(e,n.getReferenceProps({...e.props,...r,ref:i})):s.jsx("span",{ref:i,...n.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-start",children:e})},Se=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(Kr,{...o,children:[s.jsx(Vr,{className:ee(n,"truncate"),children:r}),s.jsx(Wr,{className:ee("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),Tt=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,hideTitleOnMobile:d,type:u="button",tooltipProps:h,...p})=>{const m=ee(d?"hidden sm:inline":"inline",o),x=f.mergeClasses(t&&yn(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-semi-text",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"h-[24px] px-2":"h-[40px] px-3"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target","disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",a),y=s.jsxs("button",{...p,type:u,className:x,"aria-label":typeof e=="string"&&e||p["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:m,children:e}),s.jsx(c.DialIcon,{icon:i})]});return h?s.jsx(Se,{...h,children:y}):y},eo="text-primary",it=({text:e,className:t,contentClassName:r,hideTooltip:n,id:a,customTooltipContent:o,...i})=>{const l=g.useRef(null),[d,u]=g.useState(!1),[h,p]=g.useState(""),m=g.useCallback(()=>{const b=l.current;b&&(p(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),x=g.useCallback(()=>c.scheduleMeasure(m),[m]);g.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,m)},[m]),g.useEffect(()=>{x()},[e,x]);const y=g.useMemo(()=>typeof e=="string"?e:h,[h,e]),v=g.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Kr,{...i,children:[s.jsx(Vr,{asChild:!0,onMouseEnter:x,onFocusCapture:x,children:s.jsx("span",{id:a,className:f.mergeClasses("block truncate flex-1 min-w-0 max-w-full text-start",t),"aria-label":d?y:void 0,onMouseEnter:x,onFocus:x,ref:l,children:e})}),s.jsx(Wr,{className:f.mergeClasses(eo,r,!v&&"hidden"),children:v})]})},Sn=({label:e,className:t,icon:r,selected:n,closable:a,onClick:o,onRemove:i})=>{const l=f.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",n?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return s.jsxs("div",{className:l,onClick:o,children:[s.jsx(c.DialIcon,{icon:r}),s.jsx(it,{text:e}),a&&i&&s.jsx(Tt,{className:"p-0",iconAfter:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM}),onClick:d=>i(d)})]},e)},Gr=({label:e="Error",className:t})=>s.jsx(Sn,{label:e,className:f.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)}),to="flex items-center justify-center text-secondary",ro="shrink-0 grow-0 basis-auto animate-spin-steps",so=e=>Pe.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Pe.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),Et=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:ee({[to]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(so,{width:e,height:e,className:ee(ro,r),role:"img","aria-label":a})})});var Ue=(e=>(e.Default="default",e.Compact="compact",e))(Ue||{});const no={[Ue.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[Ue.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},ao=({title:e,value:t,description:r,variant:n=Ue.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=no[n],m=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",m?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(Gr,{className:"self-start"}):o?s.jsx(Et,{fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(it,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(it,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},At=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Nn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),jn=(e,t)=>{if(e<=0)return;let r;for(const n of t)(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=n.color);return r},Wt=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=At,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const m=e==null,x=!!(r||n||!m),y=Nn(m?0:e,t),v=jn(y,i),b=o??(m?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,N=r?s.jsx(Gr,{}):n?s.jsx(Et,{fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,S=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:S}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),N]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),w]})},wn=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:h})=>{const p=n!==void 0,[m,x]=g.useState(a),y=i?!0:p?n:m,v=g.useId(),b=()=>{if(o)return;const C=!y;p||x(C),l?.(C)};return s.jsxs("div",{className:f.mergeClasses("rounded border border-secondary",d),children:[s.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":v,disabled:o||i,onClick:b,className:f.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",u),children:[!i&&s.jsx(c.DialIcon,{className:ee("text-secondary transition-transform",y&&"rotate-90"),icon:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM})}),s.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),y&&s.jsx("div",{id:v,role:"region",className:f.mergeClasses("px-4 pb-4",h),children:r})]})},oo=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:m,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),N=m?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,S=t?s.jsx(Se,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],L="cursor-pointer rounded-xs text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-primary",E="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(wn,{title:S,description:r,defaultExpanded:d,nonCollapsible:u,className:C,children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":m?"gap-2":"gap-3"),children:h?s.jsx(Et,{fullWidth:!1,className:"self-center"}):a?T.map(j=>{const A=j in n?n[j]:null,_=j in a?a[j]:null,O=typeof A=="number"&&typeof _=="number"?parseFloat((_-A).toFixed(3)):null,R=O!=null&&O!==0,M=R&&O>0,$=R?M?`+${O}`:String(O):null,V=b?.[j],K=s.jsx("span",{className:"dial-small-text text-secondary",children:j}),W=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[V?s.jsx(Se,{tooltip:V,children:K}):K,$!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:$})]}),s.jsxs("div",{className:D,children:[s.jsx(Wt,{title:o?.[0],value:A,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:j}),s.jsx(Wt,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:`${j} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:f.mergeClasses(E,L),children:W},j):s.jsx("div",{className:E,children:W},j)}):I.map(([j,A])=>{const _=s.jsx(Wt,{title:j,value:A,maxValue:i,colorMap:l,inline:m,titleClassName:N,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:L,children:_}):_,O=b?.[j];return O?s.jsx(Se,{tooltip:O,triggerClassName:"flex flex-col",children:P},j):s.jsx(g.Fragment,{children:P},j)})})})},io="#FF4E50",lo=(e,t)=>{let r=-1;return t.forEach((n,a)=>{(n.from===n.to?e>=n.from:e>n.from&&e<=n.to)&&(r=a)}),r},Zt=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=lo(d,t);u>=0&&(r[u]+=1)});const a=Math.max(0,n,...r),o=d=>a>0?d/a:0,i={from:0,to:0,color:io,count:n,ratio:o(n),isZeroBucket:!0},l=t.map((d,u)=>({from:d.from,to:d.to,color:d.color,count:r[u],ratio:o(r[u]),isZeroBucket:!1}));return[i,...l]},Ur=e=>e<=0?2:e%2===0?e:e+1,Dn=e=>{const t=Ur(e);return[t,t/2,0]},br=e=>`${Math.round(e*100)/100}`,sr=(e,t)=>e===t?br(e):`${br(e)}-${br(t)}`,vr=128,co=(e,t)=>{const r=sr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Is=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:co(a.from,a.to)})]}),uo=({title:e,values:t,colorMap:r=At,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Zt(t,r),p=l?Zt(l,r):void 0,m=t.length,x=l?.length??0,y=Math.max(m,x),v=Ur(y),b=Dn(y),C=S=>S.map(T=>({...T,ratio:v>0?T.count/v:0})),I=C(h),N=p?C(p):void 0,w=(S,T,L,E)=>{if(S.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})});const D=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return s.jsx(Se,{placement:"bottom",tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${S.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:vr},children:s.jsx(Et,{fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:vr},children:b.map((S,T)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((S,T)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},S)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:vr},children:N?I.map((S,T)=>{const L=N[T],E=`${S.count} out of ${m} ${n}`,D=`${L.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(S,Is(d,S.count,m,n,S),E,!0),w(L,Is(u,L.count,x,n,L),D,!1)]},T)}):I.map((S,T)=>{const L=`${S.count} out of ${m} ${n}`;return S.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})},T):s.jsx(Se,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":L,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},T)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,T)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:sr(S.from,S.to)},T))})]})]})},Lt=({variant:e,appearance:t=c.ButtonAppearance.Solid,size:r=c.ElementSize.Standard,className:n,icon:a,tooltipProps:o,type:i="button",...l})=>{const d=f.mergeClasses(e&&yn(e,t),r===c.ElementSize.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",n),u=s.jsx("button",{...l,type:i,className:d,"aria-label":c.resolveAccessibleName(l["aria-label"],o?.tooltip),children:a});return o?s.jsx(Se,{...o,children:u}):u},fo="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",po=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Lt,{"aria-label":e,className:fo,icon:s.jsx(F.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:t});return e?s.jsx(Se,{tooltip:e,triggerClassName:"flex justify-center items-center",children:r}):r},Zr=({label:e,required:t,className:r,caption:n,...a})=>e?s.jsxs("label",{...a,className:f.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",r),children:[typeof e=="string"?s.jsx("span",{className:"min-h-4",children:e}):e,t&&s.jsx("span",{className:"text-accent-primary",children:"*"}),s.jsx(po,{caption:n})]}):null,Ve=({size:e=40,className:t,fullWidth:r=!1,ariaLabel:n="Loading"})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{role:"img","aria-label":n,style:{width:e,height:e},className:"rounded-full border-2 border-secondary border-t-accent animate-spin-steps shrink-0"})}),Tn=({value:e,max:t=100,size:r=c.ElementSize.Standard,labelProps:n,valueLabel:a,id:o,className:i,"aria-label":l,...d})=>{const u=g.useId(),h=o??u,p=!!n?.label,m=p?n?.id??`${h}-label`:void 0,x=t>0?t:0,y=Number.isFinite(e)?e:0,v=Math.min(Math.max(y,0),x),b=x>0?v/x*100:0,C=s.jsx("div",{...d,id:h,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":x,"aria-labelledby":m,"aria-label":c.resolveAccessibleName(l,p?void 0:"Progress"),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&c.DIAL_KIT_CLASS.progressBar),children:s.jsx("div",{style:{width:`${b}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?C:s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-1",c.DIAL_KIT_CLASS.progressBar),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[n&&s.jsx(c.Label,{...n,id:m}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),C]})};var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{});const ho=(e,t)=>{if(t===e.id)switch(e.status){case be.VALID:return"border-accent-secondary text-primary";case be.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case be.VALID:return"border-primary text-primary";case be.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},mo=(e,t)=>{if(t===e.id)switch(e.status){case be.VALID:return"bg-accent-secondary";case be.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case be.VALID:return"bg-accent-secondary";case be.ERROR:return"bg-red-400";default:return"bg-layer-4"}},go=({step:e,index:t,currentStep:r,onChangeStep:n})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full",i=()=>r===e.id&&e.status===be.ERROR?s.jsx(F.IconExclamationCircle,{stroke:2,size:f.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===be.VALID?s.jsx(F.IconCheck,{stroke:2,size:f.DIAL_ICON_SIZE.SM}):t+1;return s.jsxs("button",{className:ee(a,ho(e,r)),onClick:()=>n(e.id),children:[s.jsx("span",{className:ee(o,mo(e,r)),children:i()}),s.jsx("span",{children:e.name})]})},xo=({steps:e,currentStep:t,onChangeStep:r})=>{const n=a=>{const o=e.findIndex(d=>d.id===t),i=e.findIndex(d=>d.id===a);if(a===t)return;(e.slice(0,i).every(d=>d.status===be.VALID)||i<o)&&r(a)};return s.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>s.jsx(go,{currentStep:t,onChangeStep:n,step:a,index:o},a.id))})},bo=({icon:e,title:t,description:r,containerClassName:n,titleClassName:a,descriptionClassName:o})=>s.jsxs("div",{className:f.mergeClasses("h-full w-full flex flex-col items-center justify-center text-secondary",n),"aria-label":"no-data-container",children:[e||s.jsx(F.IconClipboardX,{width:60,height:60,stroke:.5}),s.jsx("span",{className:f.mergeClasses("dial-small-text mt-2 text-primary",a),"aria-label":"no-results-title",children:t}),r&&s.jsx("span",{className:f.mergeClasses("mt-1 text-primary",o),"aria-label":"no-results-description",children:r})]}),vo=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col",n?"":"max-w-[200px]",o),children:[e&&s.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),n||s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Se,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]});var Ae=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Ae||{}),yt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(yt||{}),Yt=(e=>(e.Circle="circle",e.Square="square",e))(Yt||{});const yo=e=>{if(typeof e=="number")return e;switch(e){case yt.Small:return 32;case yt.Large:return 64;case yt.Default:default:return 40}},Vt=({active:e=!0,paragraph:t=!0,avatar:r=!1,showTitle:n=!0,loading:a=!0,children:o,variant:i=Ae.Default,width:l,height:d,overlay:u,color:h,className:p,...m})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const x=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",p);if(i!==Ae.Default){const j=f.mergeClasses(x,i===Ae.Circular&&"rounded-full",i===Ae.Rectangular&&"rounded",i===Ae.Text&&"rounded",!!u&&"relative"),A={};return l&&(A.width=typeof l=="number"?`${l}px`:l),d&&(A.height=typeof d=="number"?`${d}px`:d),h&&(A.backgroundColor=h),s.jsx("div",{className:j,style:A,...m,children:u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})})}const y=!!r,v=!!n,b=!!t,C=typeof r=="object"?r:{},I=typeof n=="object"?n:{},N=typeof t=="object"?t:{},w=yo(C.size),S=C.shape??Yt.Circle,T=I.width??"38%",L=N.rows??3,E=N.width,D=j=>E?Array.isArray(E)?E[j]??"100%":E:j===L-1?"61%":"100%";return s.jsxs("div",{...m,className:f.mergeClasses("flex gap-4",!!u&&"relative",p,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(x,S===Yt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:w,height:w,...h&&{backgroundColor:h}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:T,...h&&{backgroundColor:h}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:L}).map((j,A)=>s.jsx("div",{className:f.mergeClasses(x,"h-4 rounded"),style:{width:D(A),...h&&{backgroundColor:h}}},A))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},Co=ee("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Io=ee("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Or=ee("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-hidden","hover:bg-accent-primary-alpha px-3","dial-small-text h-[34px] rounded text-primary",c.DIAL_KIT_CLASS.menuItem),_r="opacity-75 !cursor-not-allowed",En="text-error",So="my-1 border-t border-hover border-secondary",nt=4,No=s.jsx(F.IconChevronRight,{size:14}),ut=(e,t)=>({appearance:n,...a})=>s.jsx(Lt,{...a,variant:e,appearance:n||t}),jo=(e,t)=>({variant:n,...a})=>s.jsx(Lt,{...a,variant:n||t,appearance:e}),wo=ut(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Do=ut(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),An=ut(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),To=ut(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),Eo=ut(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),Ao=ut(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Ln=jo(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),On=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Ln,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),Lo=({item:e,onRootClose:t})=>{const{isOpen:r,refs:n,floatingStyles:a,context:o,getReferenceProps:i,getFloatingProps:l}=c.useSubMenuFloating(nt,"menu",!!e.disabled),d=g.useCallback(u=>h=>{u.disabled||(u.onClick?.({key:u.key,domEvent:h}),t())},[t]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{ref:n.setReference,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":r,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ee(Or,e.disabled&&_r,e.className),...i(),children:[e.icon&&s.jsx("span",{className:ee(e.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:e.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",e.disabled&&"text-secondary"),children:e.label}),s.jsx("span",{className:ee("ml-auto shrink-0",e.disabled&&"text-secondary"),children:No})]}),r&&s.jsx(c.SubMenuPanel,{refs:n,floatingStyles:a,context:o,getFloatingProps:l,role:"menu",className:"w-max",children:s.jsx("div",{role:"none",className:ee("py-1",c.DIAL_KIT_CLASS.dropdownList),children:e.children.map(u=>s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!u.disabled,disabled:u.disabled,className:ee(Or,u.disabled&&_r,u.danger&&En,u.className),onClick:d(u),children:[u.icon&&s.jsx("span",{className:ee(u.danger&&"text-error",u.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:u.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",u.danger&&"text-error",u.disabled&&"text-secondary"),children:u.label})]},u.key))})})]})},Oo=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,qt=({children:e,items:t,onItemClick:r,menuHeader:n,menuFooter:a,renderOverlay:o,trigger:i=[c.DropdownTrigger.Click],placement:l,disabled:d=!1,open:u,defaultOpen:h=!1,onOpenChange:p,closable:m=!1,onClose:x,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:N=!0,allowedPlacements:w,anchorToMouse:S=!1,matchReferenceWidth:T=!0,maxDropdownHeight:L})=>{const[E,D]=g.useState(h),j=u!==void 0,A=j?!!u:E,_=g.useRef(null),P=g.useCallback(k=>{j||D(k),p?.(k)},[j,p]),O=g.useId(),R=l===void 0,{refs:M,floatingStyles:$,context:V}=B.useFloating({placement:l,open:A,onOpenChange:P,whileElementsMounted:B.autoUpdate,middleware:[B.offset({mainAxis:nt,crossAxis:0}),R?B.autoPlacement({alignment:"start",crossAxis:!0,padding:nt,allowedPlacements:w}):B.flip({padding:nt}),B.shift({padding:nt}),B.size({padding:nt,apply({availableWidth:k,availableHeight:U,elements:de}){const ne=de.floating,ge=Oo(de.reference);ne.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ne.style.setProperty("--reference-width",T?`${Math.round(ge)}px`:"0px"),T?ne.style.minWidth=`${Math.round(ge)}px`:ne.style.removeProperty("min-width"),ne.style.maxWidth=`${Math.floor(k)}px`;const Je=Math.floor(U);ne.style.maxHeight=`${L?Math.min(Je,L):Je}px`}})]}),K=B.useClick(V,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),W=B.useHover(V,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),G=B.useDismiss(V,{bubbles:!0,referencePress:!1,outsidePress:k=>{if(!N)return!1;const U=k.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),J=B.useRole(V,{role:"menu"}),{getReferenceProps:re,getFloatingProps:Y}=B.useInteractions([K,W,G,J]),q=g.useCallback((k,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:k,y:U,top:U,left:k,right:k,bottom:U})})},[M]),se=g.useCallback(k=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(k.preventDefault(),S&&(q(k.clientX,k.clientY),_.current=document.elementFromPoint(k.clientX,k.clientY)),P(!0))},[S,d,P,q,i]),le=g.useCallback(k=>{!S||d||(i.includes(c.DropdownTrigger.ContextMenu)&&A&&P(!1),q(k.clientX,k.clientY),_.current=document.elementFromPoint(k.clientX,k.clientY))},[S,d,q,A,i,P]);g.useEffect(()=>{d&&A&&P(!1)},[d,A,P]);const oe=g.useCallback(k=>U=>{k.disabled||(k.onClick?.({key:k.key,domEvent:U}),r?.({key:k.key,domEvent:U}),P(!1))},[r,P]),me=g.useMemo(()=>o?o():t?s.jsxs(s.Fragment,{children:[n&&s.jsx(s.Fragment,{children:typeof n=="function"?n():n}),s.jsx("div",{role:"none",className:f.mergeClasses("py-1",v,c.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:t.map(k=>k.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(So,b)},k.key):k.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",k.className),children:k.label},k.key):k.children?.length?s.jsx(Lo,{item:k,onRootClose:()=>P(!1)},k.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!k.disabled,className:ee(Or,k.disabled&&_r,k.danger&&En,k.className),disabled:k.disabled,onClick:oe(k),children:[k.icon&&s.jsx("span",{className:ee(k.danger&&"text-error",k.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:k.icon})}),s.jsx("span",{className:ee("flex-1 truncate text-start",k.danger&&"text-error",k.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:k.label})]},k.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[oe,t,a,n,o,P,v,b]),ve=re({onContextMenu:se,onMouseDown:le});return g.useEffect(()=>{if(!A)return;const k=M.reference.current;let U=null;if(k instanceof Element?U=k:_.current instanceof Element&&(U=_.current),!U)return;const de=new IntersectionObserver(([ne])=>{ne.isIntersecting||P(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[A,M.reference,P]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:ee(Co,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":A,"aria-controls":O,...ve,children:e}),A&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:V,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:O,ref:M.setFloating,style:$,className:ee(Io,!T&&"w-max",C),...Y(),children:[m&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(On,{ariaLabel:"Close dropdown",onClose:k=>{x?.(k),P(!1)}})}),me]})})})]})};var Ze=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ze||{}),lt=(e=>(e.Error="error",e.Warning="warning",e))(lt||{}),Ye=(e=>(e.Default="default",e.Inline="inline",e))(Ye||{}),Xt=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Xt||{});const bt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ye.Default,onClick:i})=>{const l=o===Ye.Inline,d=f.mergeClasses("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small-text hover:text-accent-primary",{"border-b-2 px-4":a,"border-l-2 px-3":!a},{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&a&&!e.disabled,"border-l-accent-primary":t&&!a&&!e.disabled}),u=f.mergeClasses("flex flex-row gap-1 h-6 items-center py-1 px-2 rounded cursor-pointer hover:bg-accent-primary-alpha",t?"dial-small-semi-text":"dial-small-text",{"text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-secondary":!t&&!e.disabled}),h=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:h,onClick:()=>i(e.id),disabled:e.disabled,children:[l&&t&&!e.disabled&&s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM}),s.jsx(it,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(r||e.invalid)&&s.jsx("div",{className:"text-error pl-1",children:s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS})}),e.warning&&s.jsx("div",{className:"text-warning pl-1",children:s.jsx(F.IconAlertTriangle,{...f.BASE_ICON_PROPS})})]})},_o=()=>{const[e,t]=g.useState(()=>typeof window>"u"?c.ScreenType.Desktop:c.getScreenType());return g.useEffect(()=>{t(c.getScreenType());const r=()=>t(c.getScreenType());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},ko=12,Ro=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ze.Horizontal,view:o=Ye.Default,screenThreshold:i=Xt.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:h,inlineContainerClassName:p,inlineTabClassName:m})=>{const[x,y]=g.useState(!1),[v,b]=g.useState(!1),[C,I]=g.useState(!1),N=_o(),w=N===c.ScreenType.Mobile||i===Xt.Tablet&&N===c.ScreenType.Tablet,S=a===Ze.Horizontal,T=g.useRef(null),L=g.useRef(null),E=g.useRef(null),D=e.find(O=>O.id===t),j=g.useMemo(()=>f.mergeClasses("flex gap-2",S?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[S]),A=g.useCallback(()=>{const O=L.current;O&&I(O.scrollWidth>O.clientWidth)},[]),_=g.useCallback(()=>{const O=E.current,R=L.current;if(!O||!R)return;const M=O.getBoundingClientRect(),$=R.getBoundingClientRect();if(M.width===0||$.width===0)return;const V=ko;let K=R.scrollLeft;if(M.left<$.left+V)K-=$.left+V-M.left;else if(M.right>$.right-V)K+=M.right-($.right-V);else return;const W=Math.max(0,R.scrollWidth-R.clientWidth);K=Math.max(0,Math.min(K,W)),K!==R.scrollLeft&&R.scrollTo({left:K,behavior:"smooth"})},[]),P=g.useCallback(O=>{r(O),O===t&&_()},[r,t,_]);return g.useEffect(()=>{A();const O=new ResizeObserver(()=>A()),R=L.current;return R&&O.observe(R),()=>O.disconnect()},[e,A]),g.useEffect(()=>{_()},[t,_]),o===Ye.Inline?s.jsx("div",{role:"tablist",className:f.mergeClasses("flex flex-row items-center gap-0.5 bg-layer-4 rounded w-fit p-0.5",p),children:e.map(O=>s.jsx(bt,{tab:O,active:t===O.id,view:Ye.Inline,onClick:P,className:m},O.id))}):w?s.jsx("div",{role:"tablist",className:f.mergeClasses("h-11 flex items-center bg-layer-3 px-4",l),children:s.jsx(qt,{trigger:[c.DropdownTrigger.Click],open:x,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(O=>s.jsx(bt,{tab:O,active:O.id===t,onClick:R=>{P(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},O.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(bt,{tab:D,active:!0,onClick:P,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM}),className:f.mergeClasses("text-primary transition-transform",x&&"rotate-180")})]})})}):s.jsxs("div",{ref:T,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:L,role:"tablist",className:j,children:e.map(O=>s.jsx("div",{ref:t===O.id?E:void 0,className:"w-full",children:s.jsx(bt,{tab:O,active:t===O.id,onClick:P,horizontal:S,className:f.mergeClasses("w-full",h)})},O.id))}),C&&s.jsx("div",{className:"flex items-center ml-2",children:s.jsx(qt,{trigger:[c.DropdownTrigger.Click],open:v,onOpenChange:b,placement:"bottom-end",renderOverlay:()=>e.map(O=>s.jsx(bt,{tab:O,active:O.id===t,onClick:R=>{P(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},O.id)),children:s.jsx(Tt,{iconBefore:s.jsx(F.IconDotsVertical,{size:f.BASE_ICON_SIZE}),className:f.mergeClasses("w-8 h-8 flex items-center justify-center rounded border",v?"bg-layer-4 border-transparent":"border-primary",u)})})})]})},_n="w-full overflow-hidden",kn="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Qt="flex items-center gap-2 dial-small-text",yr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},kr="flex flex-1 items-center gap-1 min-w-0 transition-colors",Mo="text-secondary hover:text-accent-primary",Rn="text-primary cursor-default",Yr="flex-none inline-flex items-center leading-none text-secondary",Po="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Mn=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,"aria-hidden":"true"}),vt=({label:e,href:t,onClick:r,disabled:n,isLast:a,isFirst:o,separator:i=Mn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:h,...p})=>{const m=async I=>{if(h&&!a&&!await h()){I.preventDefault();return}r&&r(I)},x=a?yr.last:o?yr.first:yr.middle,y=f.mergeClasses(Qt,x,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(kr,Mo):f.mergeClasses(kr,Rn,n?"pointer-events-none opacity-75":""),C=typeof e=="string"?s.jsx(it,{className:f.mergeClasses("cursor-pointer",u),text:e,id:"breadcrumb-item-content"}):s.jsx("span",{className:f.mergeClasses("flex-1 min-w-0 truncate cursor-pointer max-w-[300px]",u),"aria-label":"breadcrumb-item-content",children:e});return s.jsxs("li",{...p,className:y,"aria-label":p["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:m,className:b,children:[d,C]}):s.jsxs("span",{className:b,"aria-current":a?"page":void 0,"aria-disabled":n?"true":void 0,children:[d,C]}),!a&&s.jsx("span",{className:Yr,"aria-label":"separator",children:i})]})},Bo=({pathItems:e,separator:t=Mn,ariaLabel:r="Breadcrumb",className:n,children:a,labelClassName:o,onBeforeNavigate:i})=>{const l=g.useMemo(()=>e?.length?e:g.Children.toArray(a).filter(g.isValidElement).map(h=>{const p=h.props,{labelClassName:m,isLast:x,separator:y,...v}=p;return v}),[e,a]),d=g.useCallback(async h=>{const p=parseInt(h.key,10),m=l[p];if(i&&!await i()){h.domEvent.preventDefault();return}m.onClick?m.onClick(h.domEvent):m.href&&(window.location.href=m.href)},[l,i]),u=g.useMemo(()=>{if(l.length===0)return null;if(l.length<=3)return l.map((v,b)=>g.createElement(vt,{...v,key:`item-${b}`,isFirst:b===0&&l.length>1,isLast:b===l.length-1,separator:t,labelClassName:o,onBeforeNavigate:i}));const h=l.at(0),p=l.slice(1,-2),m=l.at(-2),x=l.at(-1);if(!h||!m||!x)return null;const y=p.map((v,b)=>({key:String(b+1),label:typeof v.label=="string"?v.label:`Item ${b+1}`,disabled:v.disabled}));return s.jsxs(s.Fragment,{children:[g.createElement(vt,{...h,key:"item-0",isFirst:!0,separator:t,labelClassName:o,onBeforeNavigate:i}),s.jsxs("li",{className:f.mergeClasses(Qt,"shrink-0"),children:[s.jsx(qt,{items:y,onItemClick:d,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:Po,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Yr,children:t})]}),g.createElement(vt,{...m,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),g.createElement(vt,{...x,key:`item-${l.length-1}`,isLast:!0,separator:t,labelClassName:o,onBeforeNavigate:i})]})},[l,t,o,d,i]);return s.jsx("nav",{"aria-label":r,className:f.mergeClasses(_n,n),children:s.jsx("ol",{className:kn,children:u})})},qr=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),Pn=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),Xr=qr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Bn=qr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),zn=qr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),zo=Pn(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Fo=Pn(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Fn=({iconClassName:e,label:t,...r})=>t?s.jsx(zn,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(An,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),$o="bg-layer-4 flex items-center justify-center enabled:text-secondary enabled:hover:text-accent-primary enabled:active:bg-controls-accent-primary-alpha-active enabled:hover:bg-accent-primary-alpha enabled:active:text-accent-primary",Ho=({icon:e,onClick:t,disabled:r,size:n=c.ElementSize.Standard,className:a})=>s.jsx("div",{className:ee("border-l border-tertiary",n===c.ElementSize.Standard?"h-[40px] w-[44px]":"h-[24px] w-[32px]"),children:s.jsx(Lt,{className:ee($o,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Ko=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Wo=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Ko.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(r!==void 0||n!==void 0){const o=e.currentTarget.value,i=e.currentTarget.selectionStart||0,l=o.slice(0,i)+e.key+o.slice(i),d=parseFloat(l);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(n!==void 0&&d>+n){e.preventDefault();return}}}}},$n=({labelProps:e,error:t,caption:r,id:n,containerClassName:a,...o})=>s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",a),children:[e&&s.jsx(Zr,{...e,htmlFor:n}),s.jsx(Hn,{id:n,...o}),s.jsx($e,{text:t}),!t&&s.jsx(Hr,{text:r})]}),Hn=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:h,tooltipText:p,min:m,onChange:x,max:y,inputButtonProps:v,...b})=>{const C=g.useRef(null),I=B.useMergeRefs([u,C]),N=d==="number"||m!==void 0||y!==void 0;g.useEffect(()=>{const L=C.current;if(!L||!N||t)return;const E=D=>{D.preventDefault()};return L.addEventListener("wheel",E,{passive:!1}),()=>{L.removeEventListener("wheel",E)}},[t,N,d]);const w=L=>{Wo(L,d,m,y)},S=L=>{const E=L.currentTarget.value;if(N&&E!==""){const D=parseFloat(E);if(isNaN(D)&&E!=="-"&&E!=="."||!isNaN(D)&&(m!==void 0&&D<+m||y!==void 0&&D>+y))return}x?.(E||void 0)},T=()=>s.jsxs("div",{className:f.mergeClasses("dial-input flex flex-row items-center gap-x-2 justify-between py-2",e&&"dial-input-error",t&&"dial-input-disable",!r&&"pl-3",!v&&"pr-3",l),"aria-label":"input-container",children:[r&&s.jsx("div",{className:"border-r border-tertiary",children:s.jsx(Hn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,id:`${r}_textBefore`})}),s.jsx(c.DialIcon,{icon:o}),s.jsx("input",{ref:I,type:d,autoComplete:d==="password"?"new-password":"off",value:h??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:S,onKeyDown:w,min:m,disabled:t,max:y,...b}),a&&s.jsxs("p",{className:"text-secondary dial-small-text",children:[" ",a]}),s.jsx(c.DialIcon,{icon:i}),v&&s.jsx(Ho,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(Se,{tooltip:p||h,children:T()}):T()},Kn=g.createContext({dragDropManager:void 0});function ye(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Ss=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ns=function(){return Math.random().toString(36).substring(7).split("").join(".")},js={INIT:"@@redux/INIT"+Ns(),REPLACE:"@@redux/REPLACE"+Ns()};function Vo(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Go(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Yo(e))return"date";if(Zo(e))return"error";var r=Uo(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Uo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Zo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Yo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function et(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Go(e)),t}function Wn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ye(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ye(1):"Expected the enhancer to be a function. Instead, received: '"+et(r)+"'");return r(Wn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ye(2):"Expected the root reducer to be a function. Instead, received: '"+et(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function h(){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(4):"Expected the listener to be a function. Instead, received: '"+et(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?ye(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?ye(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function m(v){if(!Vo(v))throw new Error(process.env.NODE_ENV==="production"?ye(7):"Actions must be plain objects. Instead, the actual type was: '"+et(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ye(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(d)throw new Error(process.env.NODE_ENV==="production"?ye(9):"Reducers may not dispatch actions.");try{d=!0,o=a(o,v)}finally{d=!1}for(var b=i=l,C=0;C<b.length;C++){var I=b[C];I()}return v}function x(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ye(10):"Expected the nextReducer to be a function. Instead, received: '"+et(v));a=v,m({type:js.REPLACE})}function y(){var v,b=p;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?ye(11):"Expected the observer to be an object. Instead, received: '"+et(I)+"'");function N(){I.next&&I.next(h())}N();var w=b(N);return{unsubscribe:w}}},v[Ss]=function(){return this},v}return m({type:js.INIT}),n={dispatch:m,subscribe:p,getState:h,replaceReducer:x},n[Ss]=y,n}function Z(e,t,...r){if(qo()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;n=new Error(t.replace(/%s/g,function(){return r[a++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function qo(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Xo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Qo(e,t){return e.filter(r=>r!==t)}function Vn(e){return typeof e=="object"}function Jo(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function ei(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Qr="dnd-core/INIT_COORDS",nr="dnd-core/BEGIN_DRAG",Jr="dnd-core/PUBLISH_DRAG_SOURCE",ar="dnd-core/HOVER",or="dnd-core/DROP",ir="dnd-core/END_DRAG";function ws(e,t){return{type:Qr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ti={type:Qr,payload:{clientOffset:null,sourceClientOffset:null}};function ri(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(ws(o)),si(r,l,d);const u=oi(r,l);if(u==null){e.dispatch(ti);return}let h=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");ni(i),h=i(u)}e.dispatch(ws(o,h));const m=d.getSource(u).beginDrag(l,u);if(m==null)return;ai(m),d.pinSource(u);const x=d.getSourceType(u);return{type:nr,payload:{itemType:x,item:m,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!a}}}}function si(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Z(r.getSource(n),"Expected sourceIds to be registered.")})}function ni(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ai(e){Z(Vn(e),"Item must be an object.")}function oi(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function li(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){ii(e,a,r[a])})}return e}function ci(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();di(n),pi(n).forEach((i,l)=>{const d=ui(i,l,a,n),u={type:or,payload:{dropResult:li({},r,d)}};e.dispatch(u)})}}function di(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ui(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return fi(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function fi(e){Z(typeof e>"u"||Vn(e),"Drop result must either be an object or undefined.")}function pi(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function hi(e){return function(){const r=e.getMonitor(),n=e.getRegistry();mi(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:ir}}}function mi(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Rr(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function gi(e){return function(r,{clientOffset:n}={}){xi(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return vi(a,i,l),bi(a,o,i),yi(a,o,i),{type:ar,payload:{targetIds:a,clientOffset:n||null}}}}function xi(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function bi(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];Z(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);Z(o,"Expected targetIds to be registered.")}}function vi(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);Rr(o,r)||e.splice(n,1)}}function yi(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Ci(e){return function(){if(e.getMonitor().isDragging())return{type:Jr}}}function Ii(e){return{beginDrag:ri(e),publishDragSource:Ci(e),hover:gi(e),drop:ci(e),endDrag:hi(e)}}class Si{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=Ii(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=n(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Ni(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Gn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ji(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Gn(Ni(t,n),r)}function wi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Gn(t,r)}const Ct=[],es=[];Ct.__IS_NONE__=!0;es.__IS_ALL__=!0;function Di(e,t){return e===Ct?!1:e===es||typeof t>"u"?!0:ei(t,e).length>0}class Ti{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Z(typeof t=="function","listener must be a function."),Z(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!Di(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Z(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),a=this.getItemType();return Rr(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),a=this.getItemType();return n!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Rr(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return n?l===i.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return ji(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return wi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Ds=typeof global<"u"?global:self,Un=Ds.MutationObserver||Ds.WebKitMutationObserver;function Zn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function Ei(e){let t=1;const r=new Un(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Ai=typeof Un=="function"?Ei:Zn;class Li{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,a=t.length-this.index;n<a;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Ai(this.flush),this.requestErrorThrow=Zn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Oi{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class _i{create(t){const r=this.freeTasks,n=r.length?r.pop():new Oi(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Yn=new Li,ki=new _i(Yn.registerPendingError);function Ri(e){Yn.enqueueTask(ki.create(e))}const ts="dnd-core/ADD_SOURCE",rs="dnd-core/ADD_TARGET",ss="dnd-core/REMOVE_SOURCE",lr="dnd-core/REMOVE_TARGET";function Mi(e){return{type:ts,payload:{sourceId:e}}}function Pi(e){return{type:rs,payload:{targetId:e}}}function Bi(e){return{type:ss,payload:{sourceId:e}}}function zi(e){return{type:lr,payload:{targetId:e}}}function Fi(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function $i(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Mr(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Mr(r,!1));return}Z(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ie;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ie||(Ie={}));let Hi=0;function Ki(){return Hi++}function Wi(e){const t=Ki().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ts(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Es(e,t){const r=e.entries();let n=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;n=!!a}while(!n);return!1}class Vi{addSource(t,r){Mr(t),Fi(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(Mi(n)),n}addTarget(t,r){Mr(t,!0),$i(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(Pi(n)),n}containsHandler(t){return Es(this.dragSources,t)||Es(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ts(t)===Ie.SOURCE}isTargetId(t){return Ts(t)===Ie.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(Bi(t)),Ri(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(zi(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=Wi(t);return this.types.set(a,r),t===Ie.SOURCE?this.dragSources.set(a,n):t===Ie.TARGET&&this.dropTargets.set(a,n),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Gi=(e,t)=>e===t;function Ui(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Zi(e,t,r=Gi){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Yi(e=Ct,t){switch(t.type){case ar:break;case ts:case rs:case lr:case ss:return Ct;case nr:case Jr:case ir:case or:default:return es}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Jo(r,n);if(!(a.length>0||!Zi(r,n)))return Ct;const i=n[n.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function qi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){qi(e,a,r[a])})}return e}const As={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Qi(e=As,t){const{payload:r}=t;switch(t.type){case Qr:case nr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ar:return Ui(e.clientOffset,r.clientOffset)?e:Xi({},e,{clientOffset:r.clientOffset});case ir:case or:return As;default:return e}}function Ji(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Ji(e,a,r[a])})}return e}const el={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function tl(e=el,t){const{payload:r}=t;switch(t.type){case nr:return tt({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Jr:return tt({},e,{isSourcePublic:!0});case ar:return tt({},e,{targetIds:r.targetIds});case lr:return e.targetIds.indexOf(r.targetId)===-1?e:tt({},e,{targetIds:Qo(e.targetIds,r.targetId)});case or:return tt({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ir:return tt({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function rl(e=0,t){switch(t.type){case ts:case rs:return e+1;case ss:case lr:return e-1;default:return e}}function sl(e=0){return e+1}function nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function al(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){nl(e,a,r[a])})}return e}function ol(e={},t){return{dirtyHandlerIds:Yi(e.dirtyHandlerIds,{type:t.type,payload:al({},t.payload,{prevTargetIds:Xo(e,"dragOperation.targetIds",[])})}),dragOffset:Qi(e.dragOffset,t),refCount:rl(e.refCount,t),dragOperation:tl(e.dragOperation,t),stateId:sl(e.stateId)}}function il(e,t=void 0,r={},n=!1){const a=ll(n),o=new Ti(a,new Vi(a)),i=new Si(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function ll(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Wn(ol,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function cl(e,t){if(e==null)return{};var r=dl(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dl(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Ls=0;const Gt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ul=g.memo(function(t){var{children:r}=t,n=cl(t,["children"]);const[a,o]=fl(n);return g.useEffect(()=>{if(o){const i=qn();return++Ls,()=>{--Ls===0&&(i[Gt]=null)}}},[]),s.jsx(Kn.Provider,{value:a,children:r})});function fl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=pl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function pl(e,t=qn(),r,n){const a=t;return a[Gt]||(a[Gt]={dragDropManager:il(e,t,r,n)}),a[Gt]}function qn(){return typeof global<"u"?global:window}function hl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cr,Os;function ml(){return Os||(Os=1,Cr=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,a,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=n;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Cr}var gl=ml();const xl=hl(gl),cr=typeof window<"u"?g.useLayoutEffect:g.useEffect;function bl(e,t,r){const[n,a]=g.useState(()=>t(e)),o=g.useCallback(()=>{const i=t(e);xl(n,i)||(a(i),r&&r())},[n,e,r]);return cr(o),[n,o]}function vl(e,t,r){const[n,a]=bl(e,t,r);return cr(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function yl(e,t,r){return vl(t,e||(()=>({})),()=>r.reconnect())}function Cl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),g.useMemo(()=>typeof e=="function"?e():e,r)}let Ir=!1;class Il{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!Ir,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ir=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ir=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Sl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function Nl(e,t,r,n){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<o.length;d++){const u=o[d];if(!l(u))return!1;const h=e[u],p=t[u];if(a=void 0,a===!1||a===void 0&&h!==p)return!1}return!0}function jl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wl(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Dl(e){return(t=null,r=null)=>{if(!g.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return wl(n),El(n,r?o=>e(o,r):e)}}function Tl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Dl(n);t[r]=()=>a}}),t}function _s(e,t){typeof e=="function"?e(t):e.current=t}function El(e,t){const r=e.ref;return Z(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?g.cloneElement(e,{ref:n=>{_s(r,n),_s(t,n)}}):g.cloneElement(e,{ref:t})}class Al{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Nl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=Tl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,jl(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ns(){const{dragDropManager:e}=g.useContext(Kn);return Z(e!=null,"Expected drag drop context"),e}function Ll(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function Ol(e){const t=ns(),r=g.useMemo(()=>new Al(t.getBackend()),[t]);return cr(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function _l(){const e=ns();return g.useMemo(()=>new Il(e),[e])}function kl(e){const{accept:t}=e;return g.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Rl{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function Ml(e,t){const r=g.useMemo(()=>new Rl(e,t),[t]);return g.useEffect(()=>{r.spec=e},[e]),r}function Pl(e,t,r){const n=ns(),a=Ml(e,t),o=kl(e);cr(function(){const[l,d]=Sl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Xn(e,t){const r=Cl(e,t),n=_l(),a=Ol(r.options);return Pl(r,n,a),[yl(r.collect,n,a),Ll(a)]}function Qn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Bl(e,t){return e.filter(r=>r!==t)}function zl(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const a=[];return r.forEach(o=>a.push(o)),a}class Fl{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=zl(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Bl(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class $l{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const a=this.config.exposeProperties[n];a!=null&&(r[n]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const dr="__NATIVE_FILE__",Jn="__NATIVE_URL__",ea="__NATIVE_TEXT__",ta="__NATIVE_HTML__",ks=Object.freeze(Object.defineProperty({__proto__:null,FILE:dr,HTML:ta,TEXT:ea,URL:Jn},Symbol.toStringTag,{value:"Module"}));function Sr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const Pr={[dr]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[ta]:{exposeProperties:{html:(e,t)=>Sr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Jn]:{exposeProperties:{urls:(e,t)=>Sr(e,t,"").split(`
2
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[ea]:{exposeProperties:{text:(e,t)=>Sr(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Hl(e,t){const r=Pr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new $l(r);return n.loadDataTransfer(t),n}function Nr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Pr).filter(r=>{const n=Pr[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Kl=Qn(()=>/firefox/i.test(navigator.userAgent)),ra=Qn(()=>!!window.safari);class Rs{interpolate(t){const{xs:r,ys:n,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return n[l];let d=0,u=i.length-1,h;for(;d<=u;){h=Math.floor(.5*(d+u));const x=r[h];if(x<t)d=h+1;else if(x>t)u=h-1;else return n[h]}l=Math.max(0,u);const p=t-r[l],m=p*p;return n[l]+a[l]*p+o[l]*m+i[l]*p*m}constructor(t,r){const{length:n}=t,a=[];for(let x=0;x<n;x++)a.push(x);a.sort((x,y)=>t[x]<t[y]?-1:1);const o=[],i=[];let l,d;for(let x=0;x<n-1;x++)l=t[x+1]-t[x],d=r[x+1]-r[x],o.push(l),i.push(d/l);const u=[i[0]];for(let x=0;x<o.length-1;x++){const y=i[x],v=i[x+1];if(y*v<=0)u.push(0);else{l=o[x];const b=o[x+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const h=[],p=[];let m;for(let x=0;x<u.length-1;x++){m=i[x];const y=u[x],v=1/o[x],b=y+u[x+1]-m-m;h.push((m-y-b)*v),p.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=h,this.c3s=p}}const Wl=1;function sa(e){const t=e.nodeType===Wl?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function Pt(e){return{x:e.clientX,y:e.clientY}}function Vl(e){var t;return e.nodeName==="IMG"&&(Kl()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Gl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return ra()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Ul(e,t,r,n,a){const o=Vl(t),l=sa(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:h}=e,{anchorX:p,anchorY:m}=n,{dragPreviewWidth:x,dragPreviewHeight:y}=Gl(o,t,u,h),v=()=>{let T=new Rs([0,.5,1],[d.y,d.y/h*y,d.y+y-h]).interpolate(m);return ra()&&o&&(T+=(window.devicePixelRatio-1)*y),T},b=()=>new Rs([0,.5,1],[d.x,d.x/u*x,d.x+x-u]).interpolate(p),{offsetX:C,offsetY:I}=a,N=C===0||C,w=I===0||I;return{x:N?C:b(),y:w?I:v()}}class Zl{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Yl(e,a,r[a])})}return e}class ql{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,n){return this.sourcePreviewNodeOptions.set(t,n),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ms({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ms({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(ks).some(r=>ks[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Hl(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const o=this.sourceNodes.get(a);return o&&sa(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const i=Pt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,d=Nr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const h=this.monitor.getSourceId(),p=this.sourceNodes.get(h),m=this.sourcePreviewNodes.get(h)||p;if(m){const{anchorX:x,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),N=Ul(p,m,i,{anchorX:x,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(m,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,d=Nr(l);d&&this.beginDragNativeItem(d,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Pt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Pt(a),this.scheduleHover(o),(o||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else Nr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Pt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Zl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Fl(this.isNodeInDocument)}}const Xl=function(t,r,n){return new ql(t,r,n)},Ql=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p})=>{const m=g.useRef(null),x=g.useRef(null),[y,v]=g.useState([]),[b,C]=g.useState(!1),[I,N]=g.useState(!1),w=g.useCallback(M=>{const $=M.target.files;if($&&$.length>0){const V=Array.from($),K=h?.(V),W=p?.(V);K?C(!0):W?N(!0):e(V)}},[h,p,e]),S=g.useCallback(M=>o&&M?.length>o,[o]),T=g.useMemo(()=>b||I||S(y),[b,I,S,y]),L=()=>{v([]),C(!1),N(!1)},E=g.useMemo(()=>b?s.jsx($e,{text:l}):I?s.jsx($e,{text:u}):S(y)?s.jsx($e,{text:d}):null,[d,l,u,y,S,b,I]);g.useEffect(()=>{L()},[a]);const[{isOver:D,canDrop:j},A]=Xn(()=>({accept:[dr],drop(M){const $=M.files,V=h?.($)??!1,K=p?.($)??!1,W=S?.($)??!1;if(C(V),N(K),V||K||W){v($);return}e($),L()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,h,p,S]),_=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),x.current?.click())},P=M=>{M?.preventDefault();const $=Array.from(M.dataTransfer?.items??[]);C(!!h?.($)),N(!!p?.($)),v($)},O=M=>{M.target===M.currentTarget&&L()},R=ee("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!j&&!T&&"border-primary",j&&(D?"border-accent-primary":"border-hover"),T&&"border-error");return A(m),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:m,onDragOver:P,onDragLeave:O,children:[s.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:_,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&s.jsx("p",{className:"mb-1",children:t}),r&&s.jsx("p",{className:"mb-0.5",children:r}),n&&s.jsx(Xr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>x.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:x,hidden:!0,accept:a,onChange:w})]}),s.jsx(s.Fragment,{children:E})]})},Jl=({iconBefore:e,className:t,...r})=>{const n=r.invalid,a=()=>s.jsx("div",{className:"mr-2",children:n?s.jsx(F.IconExclamationCircle,{...f.BASE_ICON_PROPS,className:"text-error"}):e});return s.jsx($n,{...r,iconBefore:a(),containerClassName:ee("h-[40px] p-0",n&&"h-[60px]"),className:ee("rounded-r-none border-r-0",n&&"text-error",t)})},ec=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=g.useRef(null),[h,p]=g.useState(!1),[m,x]=g.useState(!1),[y,v]=g.useState(0),b=g.useCallback(()=>{p(!1),x(!1),v(0)},[]),C=g.useCallback(D=>!!(o&&t.length+D.length>o),[o,t.length]),I=h||m,[{isOver:N,canDrop:w},S]=Xn(()=>({accept:[dr],drop(D){const j=D.files,A=[...t,...j],_=n?.(j)??!1,P=a?.(j)??!1,O=C?.(j)??!1;if(p(_),x(P),_||P||O){v(j.length);return}r(A),b()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[t,r,n,a,C,b]),T=D=>{D.preventDefault();const j=Array.from(D.dataTransfer?.items??[]);p(!!n?.(j)),x(!1),v(j.length)},L=D=>{D.target===D.currentTarget&&b()};S(u);const E=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:T,onDragLeave:L,className:ee("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!E&&(w&&N?"border-accent-primary":"border-primary"),(I||E)&&"border-error"),children:e}),h&&s.jsx($e,{text:i}),m&&s.jsx($e,{text:l}),!h&&!m&&E&&s.jsx($e,{text:d})]})},na=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:m}=e,x=g.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=g.useCallback(b=>s.jsx(Fn,{"aria-label":l,onClick:C=>x(C,b)}),[l,x]),v=g.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx(Jl,{id:b.name,value:b.name,iconAfter:y(b.name),iconBefore:r||n?.(b.name),invalid:o?.(b),error:o?.(b)?i:""},b.name+C))}),[t,r,n,o,i,y]);return s.jsx(ul,{backend:Xl,children:!t||t.length===0?s.jsx(Ql,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(ec,{existingFiles:t,onDrop:a,getIsFileFormatError:h,getIsFileSizeError:p,maxFilesCount:m,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx($e,{text:u})]})})},tc=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,multiple:p=!0,acceptTypes:m,deleteAllButtonLabel:x,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=g.useRef(null),I=()=>C.current?.click(),N=()=>{e([])},w=g.useCallback(E=>E?.some(D=>!(m==="/"||m?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[m]),S=g.useCallback(E=>{if(!o)return!1;const D=o*(1024*1024);return E?.some(j=>{const A=j.size;return!!A&&A>D})},[o]),T=g.useCallback(E=>{if(!i||!p)return!1;const D=i*1024*1024;return E.reduce((A,_)=>A+_.size,0)>D},[i,p]),L=g.useCallback(E=>{const D=E.target.files;if(D&&D.length>0){const j=Array.from(D),A=w(j),_=S(j);!A&&!_&&e([...n||[],...j])}},[w,S,e,n]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[s.jsx(Zr,{label:`${t}: ${p?n?.length||0:""}`,htmlFor:r}),p&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Bn,{label:x,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:N}),(a?a>n?.length:!0)&&s.jsx(Xr,{appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconPlus,{...f.BASE_ICON_PROPS}),label:y,onClick:I}),v]})]}),n&&n.length>0&&s.jsx("input",{id:"file",type:"file",multiple:p,ref:C,hidden:!0,accept:m,onChange:L}),s.jsx(na,{files:n,onChange:e,acceptTypes:m,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:h,getIsFileFormatError:w,getIsFileSizeError:S,getIsMultiFilesSizeError:T,...b})]})};var _e=(e=>(e.Row="Row",e.Column="Column",e))(_e||{}),Ge=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Ge||{}),ct=(e=>(e.Info="info",e.Danger="danger",e))(ct||{}),aa=(e=>(e.Normal="normal",e.Reverse="reverse",e))(aa||{}),Oe=(e=>(e.File="file",e.Folder="folder",e))(Oe||{}),St=(e=>(e.Left="left",e.Right="right",e))(St||{}),te=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e.Loading="loading",e.General="general",e))(te||{}),fe=(e=>(e.Toast="toast",e.SectionMessage="section-message",e))(fe||{});const as="data-editable-container",rc={[as]:""};function sc({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[h,p]=g.useState(e),[m,x]=g.useState(!1),[y,v]=g.useState(""),b=g.useRef(null),C=g.useRef(!1),I=g.useRef(!1),N=g.useCallback((D=!1,j="")=>{x(D),v(j)},[]),w=g.useCallback(D=>{if(!o)return N(),!0;const j=o(D);return j?j.startsWith(`${te.Warning}__`)?(N(!1,j),!0):(N(!0,j),!1):(N(),!0)},[o,N]),S=g.useCallback(D=>{const j=D??"";p(j),w(j)},[w]),T=g.useCallback(D=>{r&&!C.current&&!n?d?.(D):!r&&t&&i?.(D),C.current=!1},[i,d,r,t,n]),L=g.useCallback(()=>{a&&p(e),r?u?.():l?.(),C.current=!0,N()},[e,l,a,N,u,r]),E=g.useCallback(()=>{if(!I.current){if(I.current=!0,w(h)){T(h);return}!r&&w(e)?(p(e),N(),T(e)):L()}},[w,h,e,T,L,N,r]);return g.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,p(e),N(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,N]),g.useEffect(()=>{const D=b.current;if(!t&&!r||!D)return;const j=A=>{A.key==="Enter"?(A.preventDefault(),b.current?.blur()):A.key==="Escape"&&(A.preventDefault(),L())};return D.addEventListener("keydown",j),()=>D.removeEventListener("keydown",j)},[t,r,L]),g.useEffect(()=>{if(!t&&!r||n)return;const D=b.current;if(!D)return;const j=P=>P?(D.closest(`[${as}]`)??D).contains(P):!1,A=P=>{j(P.target)||E()},_=P=>{j(P.relatedTarget)||E()};return document.addEventListener("pointerdown",A,!0),D.addEventListener("blur",_),()=>{document.removeEventListener("pointerdown",A,!0),D.removeEventListener("blur",_)}},[t,r,n,E]),{inputRef:b,value:h,onChange:S,invalid:m,invalidMessage:y}}var Fe=(e=>(e.ITEM="item",e.FOLDER="folder",e))(Fe||{}),os=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(os||{}),oa=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(oa||{});const nc="application/octet-stream";function ac(e,t){if(!e||e.length===0)return[];const r=e.find(d=>d.parentPath===""&&d.nodeType==="FOLDER");if(!r)return[];const n=r.path||r.url||"",a=jr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",h=oc(d.nodeType),p=h===Fe.FOLDER,m=jr(u,p);let x;return d.parentPath===null||d.parentPath===void 0?x=a:d.parentPath===""?x="":x=jr(d.parentPath,!0),{...d,originalPath:u,path:m,parentPath:x,nodeType:h}}),i=new Map;o.forEach(d=>{const u={...d,id:d.originalPath,name:d.name,path:d.path,parentPath:d.parentPath,nodeType:d.nodeType,resourceType:ic(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===Fe.FOLDER?[]:void 0};d.nodeType===Fe.ITEM&&(u.extension=lc(d.name),u.contentType=d.contentType||nc,u.contentLength=d.contentLength||0),i.set(d.path,u)});const l=[];return i.forEach(d=>{if(d.parentPath===a)l.push(d);else{const u=d.path.lastIndexOf(d.name||""),h=d.path.slice(0,u),p=i.get(h);p&&p.nodeType===Fe.FOLDER?(p.items=p.items||[],p.items.push(d)):l.push(d)}}),l}function jr(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function oc(e){return e.toUpperCase()==="FOLDER"?Fe.FOLDER:Fe.ITEM}function ic(e){if(!e)return;const t=e.toUpperCase();return Object.values(os).find(n=>n.toUpperCase()===t)}function lc(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function cc(e,t="Prompts",r="prompts/public/",n="root"){const a=ac(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:Fe.FOLDER,folderId:n,items:a}]}const ia=({locale:e,timeZone:t,date:r=new Date}={})=>{const n=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:n,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${n}`:n}catch{return n}},la=':;,=/{}%&\\"',is=`(\r
3
3
  |
4
- |\r| )|[\0-]`,dc=`[${la.replace(/\\/g,"\\\\")}]`,uc=new RegExp(`${dc}|${is}`),fc=new RegExp(is);var at=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(at||{}),ur=(e=>(e.Select="select",e.Radio="radio",e))(ur||{}),fr=(e=>(e.Row="row",e.Column="column",e))(fr||{}),H=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(H||{});const pc={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"};function Ps(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function X(e,t,r=0){if(r>10)return e;let n=e;if(n.$ref){const a=n.$ref.replace(/^#\//,"").split("/");let o=t;for(const h of a)o=o?.[h];if(!o||typeof o!="object")return e;const{$ref:i,...l}=n,d=o;n={...d.$ref?X(d,t,r+1):d,...l}}if(n.allOf&&n.allOf.length>0){const{allOf:a,...o}=n;let i={};for(const l of a)i=Ps(i,X(l,t,r+1));n=Ps(i,o)}return n}function ca(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const n=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return n!==a?n-a:t.index-r.index}).map(({entry:t})=>t)}function pr(e){return e==null||e===""}function Xe(e){return e.type===H.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Jt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const ls=e=>`"${e}" is required`;function da(e,t){return e.type===H.Null?"null":e.$ref?X(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function He(e,t,r=0){if(r>15)return;const n=X(e,t);if("default"in n)return n.default;if(n.discriminator&&n.oneOf){const a=Object.keys(n.discriminator.mapping)[0];if(a){const o=X({$ref:n.discriminator.mapping[a]},t);return{...He(o,t,r+1)??{},[n.discriminator.propertyName]:a}}}if(Xe(n)){if(n.properties){const a={};let o=!1;for(const[i,l]of Object.entries(n.properties)){const d=He(l,t,r+1);d!==void 0&&(a[i]=d,o=!0)}return o?a:void 0}if(n.additionalProperties!=null&&n.additionalProperties!==!1)return{}}}function ze(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=X(t,r);if(i.anyOf){const u=i.anyOf.filter(h=>h.type!==H.Null);return e!=null&&u.length===1?ze(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,h=e?.[u];if(h&&i.discriminator.mapping[h]){const p={$ref:i.discriminator.mapping[h]},m=X(p,r);return ze(e,m,r,n,a+1)}return o}if(i.type===H.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let u=0;u<e.length;u++){const h=ze(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...h)}return o}if(!Xe(i))return o;const l=i.required??[],d=e;for(const u of l){const h=i.properties?.[u];if(h&&X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,m=d?.[u];if(pr(m)){const x=h?.title??Jt(u);o.push({path:p,message:ls(x)})}}if(d&&i.properties)for(const[u,h]of Object.entries(i.properties)){if(X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,m=d[u];if(m!=null){const x=ze(m,h,r,p,a+1);o.push(...x)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[h,p]of Object.entries(d)){const m=n?`${n}.${h}`:h,x=ze(p,u,r,m,a+1);o.push(...x)}}return o}function cs(e,t,r){const n=X(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Xe(n)&&n.properties){const a=Object.entries(n.properties).filter(([,d])=>!X(d,r).isHidden),o=a.length,i=e;return`${a.filter(([d])=>{const u=i?.[d];return u!=null&&u!==""}).length}/${o} fields`}return""}function hc(e,t,r){if(e==null){const n=t.findIndex(a=>a.type===H.Null);return n>=0?n:0}if(Array.isArray(e)){const n=t.findIndex(a=>X(a,r).type===H.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>X(a,r).type===H.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=X(a,r);return o.type===H.Number||o.type===H.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>X(a,r).type===H.String);return n>=0?n:0}if(typeof e=="object"){const n=e;for(let a=0;a<t.length;a++){const o=X(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=X(t[a],r);if(Xe(o)||o.oneOf)return a}return 0}return 0}function mc(e,t,r){if(t&&typeof e=="object"&&e!==null){const n=e[t];if(n)return`Item ${r+1}: ${n}`}if(typeof e=="object"&&e!==null){const n=e,a=n.name??n.title??n.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function ua(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case H.String:return"";case H.Boolean:return!1;case H.Array:return[];case H.Integer:case H.Number:return;default:return{}}}const gc=[H.String,H.Number,H.Boolean,H.Null,H.Object,H.Array];function xc(e){return Array.isArray(e)?H.Array:typeof e=="object"&&e!==null?H.Object:typeof e=="boolean"?H.Boolean:typeof e=="number"?H.Number:e===null?H.Null:H.String}const bc={[H.String]:"",[H.Number]:0,[H.Boolean]:!1,[H.Null]:null,[H.Object]:{},[H.Array]:[]};function vc(e){return bc[e]}const fa=g.createContext(null),Re=()=>{const e=g.useContext(fa);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},Nt=(e,t=new Set,r=!1,n=!1)=>{if(!r||t.has(e))return!0;if(!n)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},pa=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:n})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+n;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+n;return o};var De=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(De||{});const yc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",Cc={[De.Outlined]:"dial-tiny-text",[De.Selectable]:"dial-tiny-text",[De.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},Ic={[De.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[De.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[De.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},Sc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Nc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Oe=({label:e,icon:t,appearance:r=De.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:h,onKeyDown:p,...m})=>{const x=r===De.Selectable,y=!!u&&!a,v=o&&!!h&&!a,b=x&&n,C=I=>{p?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...m,role:y?"button":m.role,tabIndex:y?0:m.tabIndex,"aria-disabled":a||void 0,"aria-pressed":x&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(yc,b?"dial-tiny-semi-text":Cc[r],Ic[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[Sc,Nc],l,c.DIAL_KIT_CLASS.tag),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",title:d??e,children:e}),v&&s.jsx(c.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:c.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),h?.(I)}})]})},er="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",It=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:n})=>s.jsx(s.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return s.jsx(Oe,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(er,n)},a)})}),jc=8,wc=e=>e.stopPropagation(),Dc=e=>{e.key!=="Escape"&&e.stopPropagation()},Tc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=g.useRef(null),a=g.useRef(null),[o,i]=g.useState(null),l=g.useCallback(()=>{const p=n.current,m=a.current;if(!p||!m)return;const x=Array.from(m.children,v=>v.offsetWidth),y=x.pop()??0;i(pa({tagWidths:x,overflowChipWidth:y,availableWidth:p.clientWidth,gap:jc}))},[]);g.useLayoutEffect(()=>{l()},[l,e,t]),g.useLayoutEffect(()=>{const p=n.current;return p?c.observeElementSize(p,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),h=t.slice(d);return s.jsxs("div",{ref:n,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[s.jsx(It,{options:e,selectedValues:u,handleRemoveTag:r,tagClassName:"min-w-0"}),h.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:wc,onKeyDown:Dc,children:s.jsx(It,{options:e,selectedValues:h,handleRemoveTag:r})}),children:s.jsx(Oe,{label:`+${h.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${h.length} more selected: ${h.map(p=>e.find(m=>m.value===p)?.label??p).join(", ")}`,title:"",className:f.mergeClasses(er,"shrink-0")})}),s.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[s.jsx(It,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),s.jsx(Oe,{label:`+${t.length}`,className:f.mergeClasses(er,"shrink-0")})]})]})},Ec=f.mergeClasses("w-full flex flex-col"),Ac=c.overlayItemClassName,Oc="!max-w-[var(--reference-width)]",Lc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),_c=c.overlayGap,kc=c.overlaySubMenuListClassName,Rc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Mc="text-secondary transition-transform",Pc=8,Bc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),zc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fc=({opt:e,selectedValues:t,mark:r=c.MenuItemMark.Tint,onSelect:n})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:d,getReferenceProps:u,getFloatingProps:h}=c.useSubMenuFloating(_c,"listbox",!!e.disabled),p=e.children?.some(x=>t.includes(x.value)),m=s.jsx(c.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Rc,...u()});return s.jsxs(B.FloatingNode,{id:o,children:[e.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:m}):m,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:h,role:"listbox",surfaceClassName:kc,children:e.children.map(x=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(x.value),"aria-disabled":!!x.disabled,disabled:x.disabled,mark:r,selected:t.includes(x.value),ellipsisLabel:!0,icon:x.icon,label:x.labelNode??x.label,rightControl:x.rightControl,onClick:()=>!x.disabled&&n(x.value)});return s.jsx(g.Fragment,{children:x.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:x.interactiveTooltip.placement,content:x.interactiveTooltip.content,contentClassName:x.interactiveTooltip.contentClassName,children:y}):y},x.value)})})]})},Ke=({options:e,multiple:t=!1,id:r,value:n,defaultValue:a,size:o=c.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:d="Select...",labelProps:u,error:h,caption:p,ariaLabel:m,ariaDescribedBy:x,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:N="Select all",collapseTagOverflow:w=!1,selectedOptionMark:S=c.MenuItemMark.Tint,emptyStateTitle:T="No options available",emptyStateDescription:O,emptyStateIcon:E,disabled:D=!1,className:j,fieldClassName:A,listClassName:_,closable:P=!1,header:L,footer:R,onClose:M,onChange:$,dismissRef:V,onFooterClick:K,open:W,onOpenChange:G,onSearchQueryChange:J,customMultiSelectTagsRenderer:re})=>{const Y=g.useId(),q=r||Y,se=`list-${q}`,le=h?`${q}-error`:void 0,oe=!h&&p?`${q}-caption`:void 0,me=o===c.ElementSize.Small,[ve,k]=g.useState(!1),U=W!==void 0,de=U?!!W:ve,ne=g.useCallback(z=>{U||k(z),G?.(z)},[U,G]),[ge,Je]=g.useState(""),ht=g.useCallback(z=>{z!==ge&&(Je(z||""),J?.(z||""))},[J,ge]),mt=n!==void 0,[Q,ce]=g.useState(a),he=mt?n:Q,ue=g.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Lt=g.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(ae=>ae.label.toLowerCase().includes(z)):e},[e,ge]);g.useEffect(()=>{de||ht("")},[de,ht]);const Me=g.useCallback(z=>{mt||ce(z),$?.(z)},[mt,$]),hr=g.useCallback(z=>{if(t){const ae=new Set(ue);ae.has(z)?ae.delete(z):ae.add(z),Me(Array.from(ae));return}Me(z),ne(!1)},[t,Me,ne,ue]),_t=g.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Me("");return}const Mt=ue.filter(Za=>Za!==ae);Me(Mt)},[t,ue,Me]),Te=g.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),mr=g.useMemo(()=>Te.filter(z=>ue.includes(z.value)).length,[Te,ue]),{allSelectedInFiltered:gr,someSelectedInFiltered:Fa}=g.useMemo(()=>{const z=Te.length>0&&mr===Te.length;return{allSelectedInFiltered:z,someSelectedInFiltered:mr>0&&!z}},[Te,mr]),$a=g.useCallback(()=>{if(!(!t||Te.length===0))if(gr){const z=new Set(Te.map(ae=>ae.value));Me(ue.filter(ae=>!z.has(ae)))}else{const z=new Set(ue);Te.forEach(ae=>z.add(ae.value)),Me(Array.from(z))}},[gr,t,Te,ue,Me]),kt=ue.length>0,Rt=!t&&kt?ue[0]:void 0,Ne=g.useMemo(()=>Rt?e.find(z=>z.value===Rt)??e.flatMap(z=>z.children??[]).find(z=>z.value===Rt):void 0,[e,Rt]),gt=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Ha=c.useIsMobileScreen(),xr=t&&w&&!re&&!Ha,xt=g.useMemo(()=>t?kt?xr?s.jsx(Tc,{options:e,selectedValues:ue,handleRemoveTag:_t}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:re?.(e,ue,_t)??s.jsx(It,{options:e,selectedValues:ue,handleRemoveTag:_t})}):null:!Ne||!Ne.labelNode&&!Ne.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Ne.labelNode??gt}),Ne.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Ne.description})]}),[xr,re,_t,kt,t,e,gt,ue,Ne]),Ka=t||xt?"":gt||(l&&n?l:""),Wa=typeof u?.label=="string"?u.label:void 0,Va=xt?[c.resolveAccessibleName(m,Wa),t?ue.map(z=>e.find(ae=>ae.value===z)?.label??z).join(", "):gt].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(m);g.useImperativeHandle(V,()=>({dismiss:()=>{ne(!1)}}));const Ga=g.useCallback(z=>{D||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[D,de,ne]),Ua=()=>s.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:Ec,children:[L&&s.jsx(s.Fragment,{children:typeof L=="function"?L():L}),(y||P)&&(e.length>Pc||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${q}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ht(z),value:ge,iconBefore:Bc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:zc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&C&&Te.length>0&&s.jsx("div",{className:f.mergeClasses(Ac,"mt-2"),children:s.jsx(c.Checkbox,{id:`${q}-selectAll`,labelProps:{label:N},isSelected:gr,isIndeterminate:Fa,onChange:$a})}),s.jsx("div",{role:"none",className:Lc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:E,title:T,description:O})}):Lt.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(Fc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:S,onSelect:hr},z.value);const Mt=t?s.jsx(c.MenuItem,{id:`${q}-${z.value}`,role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:ae,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>hr(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:S,selected:ae,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&hr(z.value)});return s.jsx(g.Fragment,{children:z.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:Mt}):Mt},z.value)})}),R&&s.jsx("div",{onClick:z=>{K?.(z),K&&ne(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",j,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:q}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ne,disabled:D,closable:P,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(Oc,_),className:"w-full",renderOverlay:Ua,children:s.jsx(c.Input,{id:q,size:o,disabled:D,invalid:I,value:Ka,placeholder:xt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:me?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(Mc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":se,"aria-autocomplete":"none","aria-label":Va,"aria-describedby":[x,le,oe].filter(Boolean).join(" ")||void 0,"aria-invalid":h||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!D&&"cursor-pointer",t&&kt&&!xr&&["!h-auto flex-wrap py-2",me?"min-h-[24px]":"min-h-[40px]"],A),className:f.mergeClasses("cursor-pointer",xt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ga,children:xt})}),s.jsx(c.ErrorText,{id:le,text:h}),!h&&s.jsx(c.CaptionText,{id:oe,text:p})]})]})},Bs={[H.Array]:[],[H.String]:"",[H.Boolean]:!1,[H.Integer]:0,[H.Number]:0},$c=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=e.anyOf??[],h=hc(t,u,i),p=u[h],m=!p||X(p,i).type===H.Null,x=y=>{const v=X(u[y],i);if(v.type===H.Null){r(null);return}const b=He(v,i);if(b!==void 0){r(b);return}const C=typeof v.type=="string"?v.type:"";r(C in Bs?Bs[C]:{})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:da(y,i)})),value:String(h),disabled:d,onChange:y=>x(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!m&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(We,{schema:p,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Qe=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:d="button",tooltipProps:u,href:h,target:p,rel:m,disabled:x,...y})=>{const v=f.mergeClasses("dial-kit-base-button",t&&c.getButtonClassNames(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",n===c.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",n===c.ElementSize.Small&&"dial-kit-base-button-small",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"px-2":"px-4"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,C=c.resolveAccessibleName(typeof e=="string"?e:void 0,y["aria-label"],b),I=s.jsxs(s.Fragment,{children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:o,children:e}),s.jsx(c.DialIcon,{icon:i})]}),N=y,w=h!==void 0?s.jsx("a",{...N,href:x?void 0:h,target:p,rel:m??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":x||void 0,tabIndex:x?-1:N.tabIndex,onClick:x?void 0:N.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(x,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:w}):w},ds=(e,t)=>({appearance:n,...a})=>s.jsx(Qe,{...a,variant:e,appearance:n||t}),us=(e,t)=>({variant:n,...a})=>s.jsx(Qe,{...a,variant:n||t,appearance:e}),ha=ds(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),fs=ds(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Hc=ds(c.ButtonVariant.Danger,c.ButtonAppearance.Solid),rt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},Kc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Wc=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Kc,iconAfter:r,style:n,...a})=>{const o=`dial-kit-starter-gradient-${g.useId().replace(/[^\w-]/g,"")}`,i=s.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:o,x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:rt.from}),s.jsx("stop",{offset:"1",stopColor:rt.to})]})})}),l=d=>s.jsxs(s.Fragment,{children:[i,d]});return s.jsx(Qe,{...a,variant:c.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...n}})},Vc=us(c.ButtonAppearance.Link,c.ButtonVariant.Primary),ps=us(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Gc=us(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),jt=({title:e,description:t,summary:r,errorCount:n=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:d="Remove item"})=>{const[u,h]=g.useState(l),p=g.useId(),m=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",m?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",m?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?p:void 0,onClick:()=>h(x=>!x),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform",!u&&"-rotate-90")}),s.jsx("span",{className:f.mergeClasses("truncate",m?"dial-small-semi-text":"dial-small-text"),children:e})]}),s.jsx(c.InfoButton,{caption:t}),r&&s.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:r}),n>0?s.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),n," error",n>1?"s":""]}):s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":d,onClick:i,className:"shrink-0"})]}),u&&s.jsx("div",{id:p,className:f.mergeClasses("border-t border-tertiary",m?"p-4":"p-3"),children:o})]})},Uc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=Re(),[u,h]=g.useState(),p=Array.isArray(t)?t:[],m=e.items;if(!m)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const x=X(m,o),y=x.discriminator,v=y?Object.keys(y.mapping).map(w=>({value:w,label:w})):[],b=u??v[0]?.value,C=()=>{let w;if(y&&b){const S=X({$ref:y.mapping[b]},o);w={...He(S,o)??{},[y.propertyName]:b}}else w=He(x,o)??ua(x);r([...p,w])},I=w=>{r(p.filter((S,T)=>T!==w))},N=(w,S)=>{r(p.map((T,O)=>O===w?S:T))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((w,S)=>{const T=mc(w,y?.propertyName,S),O=ze(w,x,o,`${n.join(".")}[${S}]`);return s.jsx(jt,{title:T,level:a,summary:cs(w,x,o),errorCount:O.length,onRemove:l?void 0:()=>I(S),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${T}`,children:s.jsx(We,{schema:m,value:w,onChange:E=>N(S,E),path:[...n,String(S)],level:a+1,ariaLabel:T})},S)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx(Ke,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:w=>h(typeof w=="string"?w:w[0]),className:"max-w-[280px] flex-1"}),s.jsx(ps,{label:i.addItem,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})]})]})};var hs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(hs||{});const zs={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Zc=e=>typeof e=="boolean"?zs[e?"both":"none"]:zs[e],ma=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":h,"aria-invalid":p,...m})=>{const x=g.useId(),y=d??x,v=n?`${y}-error`:void 0,b=!n&&l?`${y}-caption`:void 0,C=f.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u&&"dial-kit-input-error",m.disabled&&"dial-kit-input-disable",Zc(o),e);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",a),children:[i&&s.jsx(c.Label,{...i,htmlFor:y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("textarea",{id:y,value:t||"",className:C,onChange:I=>r?.(I.currentTarget.value),"aria-describedby":[h,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":p??(n||u?!0:void 0),...m}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},Fs=e=>{try{return JSON.parse(e),!0}catch{return!1}},ms=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=Re(),[i,l]=g.useState(()=>JSON.stringify(e,null,2)??""),d=!Fs(i),u=h=>{l(h),Fs(h)&&t(JSON.parse(h))};return s.jsx(ma,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:hs.Vertical,className:"font-mono !whitespace-pre"})},Yc=/^0+\.(\d+)?$/,qc=/^0+/,Xc=[".","-","+","e","E"],$s=e=>!e||e==="-"?e:String(e).match(Yc)?String(e).replace(qc,"0"):Number(e),gs=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Xc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const h=u.clipboardData.getData("text"),p=h.replace(/\D/g,"");if(p!==h&&(u.preventDefault(),p)){const m=u.currentTarget,x=m.selectionStart??0,y=m.selectionEnd??0,v=m.value.slice(0,x)+p+m.value.slice(y);t?.($s(v))}}o?.(u)};return s.jsx(c.Input,{...i,wrapperClassName:f.mergeClasses(i.wrapperClassName,c.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:n,onChange:u=>t?.($s(u)),onKeyDown:l,onPaste:d})},ga=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,isToggleHidden:n,size:a=c.ElementSize.Standard,...o})=>{const[i,l]=g.useState(!1),d=!r&&!n,u=i&&d;return g.useEffect(()=>{d||l(!1)},[d]),s.jsx(c.Input,{...o,wrapperClassName:f.mergeClasses(o.wrapperClassName,c.DIAL_KIT_CLASS.passwordInput),size:a,disabled:r,type:u?"text":"password",iconAfter:d?s.jsx(c.GhostIconButton,{size:c.ElementSize.Small,"aria-label":u?t:e,"aria-pressed":u,icon:u?s.jsx(F.IconEyeOff,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconEye,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>l(h=>!h)}):void 0})},Qc="flex flex-col gap-2",Jc="flex",ed="mt-2 ml-[26px]",td={[_e.Column]:"flex-col gap-y-3",[_e.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},wt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=_e.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:h,className:p,optionsClassName:m,radioClassName:x,contentClassName:y})=>{const v=g.useId(),b=a??v,C=`${b}-label`,I=d?`${b}-error`:void 0,N=!d&&u?`${b}-caption`:void 0,w=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(Qc,p,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":w?C:void 0,"aria-label":w?void 0:c.resolveAccessibleName(h),"aria-describedby":[I,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Jc,td[o],m),children:e.map(S=>{const T=S.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${S.value}`,name:n??b,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:T,disabled:l||S.disabled,onChange:r,className:x}),T&&S.content?s.jsx("div",{className:f.mergeClasses(ed,y),children:S.content}):null]},S.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:N,text:u})]})},xa=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=g.useId(),u=e??d,h=o?`${u}-caption`:void 0,p=g.useCallback(m=>{a?.(m.target.checked)},[a]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("group/choice flex items-center gap-2",i,c.DIAL_KIT_CLASS.switch),children:[s.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:n,onChange:p,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":h,className:"peer sr-only"}),s.jsx("label",{htmlFor:u,className:f.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",n?"cursor-not-allowed bg-control-disable-primary":f.mergeClasses("cursor-pointer",r?"bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover":"bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong")),children:s.jsx("span",{className:f.mergeClasses("size-3.5 shrink-0 rounded-full",n?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&s.jsx(c.Label,{size:c.ElementSize.Standard,...t,htmlFor:u,className:f.mergeClasses("py-[1px]",n?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&s.jsx("span",{id:h,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Hs=e=>typeof e=="string"?e:e[0],wr=e=>e!=null?String(e):"",rd=e=>e!==void 0?Number(e):void 0,ba=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:h}=Re(),p=e.const!==void 0,m=Array.isArray(e.enum)?e.enum:[],x=m.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===H.String||e.type===void 0)){const v=(e.acceptableResourceTypes??[]).flatMap(b=>{const C=h?.[b];return Array.isArray(C)?C.map(I=>{const N=String(I);return{value:N,label:N}}):[]});return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(Hs(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(p)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(x&&e.enumDisplay===ur.Radio)return s.jsx(wt,{id:a,ariaLabel:o,items:m.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===fr.Row?_e.Row:_e.Column,disabled:d,onChange:v=>r(v)});if(x)return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:m.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Hs(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case H.Boolean:return s.jsx(xa,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case H.Integer:case H.Number:return s.jsx(gs,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===H.Integer,value:wr(t),invalid:n,disabled:d,onChange:v=>r(rd(v)),placeholder:e.type===H.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(ga,{id:a,"aria-label":o,"aria-describedby":i,value:wr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u}):s.jsx(c.Input,{id:a,"aria-label":o,"aria-describedby":i,value:wr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Ks=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),va=e=>!!(e.oneOf||e.anyOf||e.type===H.Array||Xe(e)),sd={[H.String]:"entryTypeString",[H.Number]:"entryTypeNumber",[H.Boolean]:"entryTypeBoolean",[H.Null]:"entryTypeNull",[H.Object]:"entryTypeObject",[H.Array]:"entryTypeArray"},Ws=e=>typeof e=="string"?e:e[0],nd=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:h=!1,inputClassName:p,defaultExpanded:m=!0,touchedPaths:x,markTouched:y,skipUntouched:v}=Re(),[b,C]=g.useState(e.key),[I,N]=g.useState(()=>xc(e.value)),w=va(t),S=r&&(I===H.Object||I===H.Array),T=r&&I===H.Null,O=r&&I===H.Boolean,E=w||S,D=[...i,e.id,"key"].join("."),j=Nt(D,x,v)&&e.key==="",A=e.key||u.valueColumnHeader,_=K=>{a(vc(K)),N(K)},P=g.useMemo(()=>gc.map(K=>({value:K,label:u[sd[K]]})),[u]),L=g.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>T?s.jsx(c.Input,{"aria-label":A,value:"null",disabled:!0}):O?s.jsx(Ke,{ariaLabel:A,options:L,value:e.value?"true":"false",disabled:h,onChange:K=>{const W=Ws(K);W&&a(W==="true")}}):s.jsx(ba,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:A}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:E?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:h,invalid:j,error:j?`${u.keyColumnHeader} is required`:void 0,onChange:K=>C(K??""),onBlur:()=>{y?.(D),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:p})}),!E&&s.jsx("div",{className:"min-w-0 flex-1",children:R()}),r&&s.jsx("div",{className:"w-28 shrink-0",children:s.jsx(c.Tooltip,{tooltip:u.entryTypeChangeWarning,triggerClassName:"block",children:s.jsx(Ke,{ariaLabel:u.typeColumnHeader,options:P,value:I,disabled:h,onChange:K=>{const W=Ws(K);W&&_(W)}})})}),!h&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${u.removeFieldAriaLabel}: ${e.key}`:u.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!E)return M;if(S)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(ms,{value:e.value,onChange:a,ariaLabel:A},I)]});const $=[...i,e.key],V=ze(e.value,t,d,$.join("."));return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(jt,{title:e.key,level:l,summary:cs(e.value,t,d),errorCount:V.length+(j?1:0),defaultExpanded:m,children:s.jsx(We,{schema:t,value:e.value,onChange:a,path:$,level:l+1,ariaLabel:A})})]})},ad=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Re(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?X(e.additionalProperties,o):{type:H.String},h=va(u),[p,m]=g.useState(()=>Object.entries(t??{}).map(([b,C])=>Ks(b,C))),x=b=>{m(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>x(p.map((I,N)=>N===b?{...I,...C}:I)),v=()=>{const b=h?He(u,o)??ua(u):"";m(C=>[...C,Ks("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!h&&s.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[s.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),s.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),d&&s.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((b,C)=>s.jsx(nd,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>x(p.filter((I,N)=>N!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(ps,{label:i.addField,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:v})})]})},Br=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=Re(),l=X(e,o),d=ca(Object.entries(l.properties??{}).filter(([,p])=>!X(p,o).isHidden)),u=l.required??[],h=t??{};return d.length===0?s.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):s.jsx("div",{className:"flex flex-col gap-4",children:d.map(([p,m])=>{const x=X(m,o);return s.jsx(ya,{schema:m,value:h[p],onChange:y=>r({...h,[p]:y}),path:[...n,p],level:a,required:u.includes(p),label:x.title??m.title??Jt(p)},p)})})},Vs=e=>typeof e=="string"?e:e[0],od=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},id=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=g.useId(),h=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===ur.Radio,m=e.discriminator;if(m){const I=m.propertyName,N=m.mapping,w=E=>X({$ref:N[E]},i),S=typeof t=="object"&&t!==null?t[I]:void 0,T=S?w(S):void 0,O=E=>{const D=He(w(E),i)??{};r({...D,[I]:E})};if(p){const E=e.discriminatorOrientation===fr.Row,D=A=>s.jsx(Br,{schema:od(A,I),value:t,onChange:r,path:n,level:a}),j=s.jsx(wt,{id:u,ariaLabel:h,value:S,onChange:O,disabled:d,orientation:E?_e.Row:_e.Column,items:Object.keys(N).map(A=>{const _=w(A);return{value:A,label:_.title??A,content:E?void 0:D(_)}})});return E?s.jsxs("div",{className:"flex flex-col gap-3",children:[j,T&&D(T)]}):j}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:h,options:Object.keys(N).map(E=>({value:E,label:E})),value:S,placeholder:l.selectTypePlaceholder,disabled:d,onChange:E=>{const D=Vs(E);D&&O(D)},className:"max-w-[280px]"}),T&&s.jsx("div",{className:"pl-3",children:s.jsx(Br,{schema:T,value:t,onChange:r,path:n,level:a})})]})}const x=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=x.findIndex(N=>X(N,i).required?.every(w=>w in t));return I>=0?I:0})(),b=x[v],C=I=>{const N=He(X(x[I],i),i);r(N??null)};return p?s.jsx(wt,{id:u,ariaLabel:h,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:x.map((I,N)=>({value:String(N),label:da(I,i)??`Option ${N+1}`,content:s.jsx(We,{schema:X(I,i),value:t,onChange:r,path:n,level:a,ariaLabel:o})}))}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:h,options:x.map((I,N)=>({value:String(N),label:X(I,i).title??`Option ${N+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(Vs(I))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(We,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},We=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const h=g.useId(),{rootSchema:p,renderField:m,markTouched:x,touchedPaths:y,skipUntouched:v}=Re(),b=X(e,p),C=n.join("."),I=S=>{x?.(C),r(S)},N={schema:b,value:t,onChange:I,path:n,level:a};let w;if(b.oneOf)w=s.jsx(id,{...N,ariaLabel:d});else if(b.anyOf&&b.type!==H.Object)w=s.jsx($c,{...N,ariaLabel:d});else if(Xe(b)){const S=b.additionalProperties!=null&&b.additionalProperties!==!1,T=!b.properties||Object.keys(b.properties).length===0;S&&T?w=s.jsx(ad,{...N}):T&&b.additionalProperties!==!1?w=s.jsx(ms,{value:t,onChange:I,id:l,ariaLabel:d}):w=s.jsx(Br,{...N})}else if(b.type===H.Array)w=s.jsx(Uc,{...N});else{const S=Nt(C,y,v)&&!!o&&pr(t),T=!i&&S?ls(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ba,{schema:b,value:t,onChange:I,invalid:S,id:l,ariaLabel:d,ariaDescribedBy:T?h:u}),s.jsx(c.ErrorText,{id:h,text:T})]})}return m?m(n,b,w):w},ya=({schema:e,value:t,onChange:r,path:n,level:a=0,required:o,label:i})=>{const l=g.useId(),{rootSchema:d,defaultExpanded:u=!0,touchedPaths:h,skipUntouched:p}=Re(),m=X(e,d),x=n.join(".");if(Xe(m)||m.type===H.Array){const v=ze(t,m,d,x),b=i??m.title??n[n.length-1]??"Section";return s.jsx(jt,{title:b,description:m.description,level:a,summary:cs(t,m,d),errorCount:Nt(x,h,p,!0)?v.length:0,defaultExpanded:u,children:s.jsx(We,{schema:m,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=Nt(x,h,p)&&o&&pr(t)?ls(i??"Field"):void 0;return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(c.Label,{htmlFor:l,label:i,required:o,caption:m.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(We,{schema:m,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i,ariaDescribedBy:y?`${l}-error`:void 0}),s.jsx(c.ErrorText,{id:`${l}-error`,text:y})]})]})},Gs="dial-small-semi-text text-primary",ld=({schema:e,defaultValue:t,texts:r,className:n,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=at.Sections,onChange:d,onPropertyChange:u,onDefaultValues:h,renderField:p,skipUntouched:m=!1,acceptableResourceTypes:x})=>{const y=g.useMemo(()=>({...pc,...r}),[r]),v=g.useMemo(()=>t||(He(e,e)??{}),[]),[b,C]=g.useState(v),[I,N]=g.useState(()=>new Set),w=g.useCallback(j=>{N(A=>A.has(j)?A:new Set([...A,j]))},[]);g.useEffect(()=>{h?.(v)},[]);const S=(j,A)=>{const _={...b,[j]:A};C(_),d?.(_),u?.(j,A)},T=new Set(Object.keys(e.properties??{})),O=Object.keys(b).filter(j=>!T.has(j)),E=ca(Object.entries(e.properties??{}).filter(([,j])=>!X(j,e).isHidden)),D=e.required??[];return s.jsx(fa.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:x,renderField:p,touchedPaths:I,markTouched:w,skipUntouched:m},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[E.map(([j,A])=>{const _=X(A,e),P=_.title??A.title??Jt(j),L=D.includes(j),R=b[j],M=K=>S(j,K);if(l===at.Flat)return s.jsx(ya,{schema:A,value:R,onChange:M,path:[j],level:0,required:L,label:P},j);if(l===at.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Gs,children:P}),s.jsx(We,{schema:A,value:R,onChange:M,path:[j],level:0,required:L,ariaLabel:P})]},j);const $=ze(R,_,e,j),V=L&&pr(R)?Math.max($.length,1):$.length;return s.jsx(jt,{title:P,description:_.description,level:0,defaultExpanded:o,errorCount:Nt(j,I,m,!0)?V:0,children:s.jsx(We,{schema:A,value:R,onChange:M,path:[j],level:1,required:L,ariaLabel:P})},j)}),O.map(j=>{const A=Jt(j),_=s.jsx(ms,{value:b[j],onChange:P=>S(j,P),ariaLabel:A});return l===at.Sections?s.jsx(jt,{title:A,level:0,defaultExpanded:o,children:_},j):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Gs,children:A}),_]},j)})]})})},cd=e=>({info:s.jsx(F.IconInfoCircleFilled,{size:e.size}),error:s.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:s.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:s.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:s.jsx(Ve,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),dd={[te.Info]:"bg-info text-info",[te.Success]:"bg-success text-success",[te.Warning]:"bg-warning text-warning",[te.Error]:"bg-error text-error",[te.Loading]:"bg-layer-raised text-info",[te.General]:"bg-layer-sunken text-primary"},ud={[te.Info]:"status",[te.Success]:"status",[te.Warning]:"alert",[te.Error]:"alert",[te.Loading]:"status",[te.General]:"status"},fd="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",xs=({variant:e=te.Info,type:t=fe.Toast,title:r,message:n,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:d=!1,onClose:u,children:h,textClassName:p,...m})=>{const x=g.useMemo(()=>cd({size:i,stroke:l})[e],[e,i,l]),y=p??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:ud[e],...m,className:f.mergeClasses(fd,dd[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===te.Loading&&"border-secondary",o,c.DIAL_KIT_CLASS.notification),children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:s.jsx(c.DialIcon,{icon:x})}),r?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",y),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:n})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:n})]}),a!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:a}),h,d&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>u?.(v)})]})},pd=({className:e,children:t,...r})=>s.jsx("article",{...r,className:f.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e,c.DIAL_KIT_CLASS.cardShell),children:t}),ft=(e,t)=>({type:n,...a})=>s.jsx(xs,{...a,variant:e,type:n||t}),pt=(e,t)=>({variant:n,...a})=>s.jsx(xs,{...a,variant:n||t,type:e}),hd=ft(te.Error,fe.Toast),md=ft(te.Info,fe.Toast),gd=ft(te.Success,fe.Toast),xd=ft(te.Warning,fe.Toast),bd=ft(te.Loading,fe.Toast),vd=ft(te.General,fe.Toast),yd=pt(fe.SectionMessage,te.Error),Cd=pt(fe.SectionMessage,te.Info),Id=pt(fe.SectionMessage,te.Success),Sd=pt(fe.SectionMessage,te.Warning),Nd=pt(fe.SectionMessage,te.Loading),jd=pt(fe.SectionMessage,te.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const wd="en-GB",Dd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},Ca="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus",Ia="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",Sa="!border-error",Td="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Ed="z-floating rounded-lg bg-layer-raised p-2 shadow-md",Ad="absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent",Od="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus",Ld="bg-control-accent text-control-permanent",_d="text-accent dial-small-semi-text",kd="text-control-disable-primary",Na="text-secondary",Rd=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Na}),Us={prev:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Md=(e,t)=>{const n=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-n);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Zs=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ys=(e,t,r)=>{const n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(n<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(n>a)return!0}return!1},Pd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),qs=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Bd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Bt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Xs=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},zd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Fd=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const n=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),n.length===0)return r;const a=String(Math.min(Number(n),59)).padStart(n.length,"0");return`${r}:${a}`},ja=5,wa=e=>e.charAt(0).toUpperCase()+e.slice(1),$d=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ja+r));return wa(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Hd=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ja+r));return{value:String(r+1),label:wa(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Kd=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Wd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Vd="flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus",Gd="bg-control-accent text-control-permanent hover:bg-control-accent",Qs=({label:e,options:t,selected:r,onSelect:n})=>{const a=g.useRef(null);g.useEffect(()=>{const l=a.current,d=l?.querySelector('[aria-selected="true"]');!l||!d||(l.scrollTop=d.offsetTop-l.clientHeight/2+d.offsetHeight/2)},[]);const o=l=>{const d=Array.from(l.currentTarget.querySelectorAll("button")),u=d.indexOf(document.activeElement),h={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];h&&(l.preventDefault(),h.focus())},i=r??t[0];return s.jsx("div",{ref:a,role:"listbox","aria-label":e,tabIndex:-1,className:"flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",onKeyDown:o,children:t.map(l=>s.jsx("button",{type:"button",role:"option","aria-selected":l===r,tabIndex:l===i?0:-1,className:f.mergeClasses(Vd,l===r&&Gd),onClick:()=>n(l),children:l},l))})},Ud=({value:e,onSelect:t})=>{const[r,n]=g.useMemo(()=>{const a=/^(\d{2}):(\d{2})$/.exec(e);return a?[a[1],a[2]]:[void 0,void 0]},[e]);return s.jsxs("div",{className:"flex w-[168px] gap-1",children:[s.jsx(Qs,{label:"Hours",options:Kd,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Qs,{label:"Minutes",options:Wd,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Js=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:d})=>{const u=c.useThemeScope(),[h,p]=g.useState(!1),{refs:m,floatingStyles:x,context:y}=B.useFloating({open:h,onOpenChange:w=>p(t?!1:w),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),v=B.useClick(y,{enabled:!t}),b=B.useDismiss(y),C=B.useRole(y,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:N}=B.useInteractions([v,b,C]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:e,ref:m.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:f.mergeClasses(Ca,"focus-visible:outline focus-visible:outline-focus",r&&Sa,t&&Ia,o),...I(),children:n}),h&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:y,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:m.setFloating,style:x,"aria-label":d,className:f.mergeClasses(Td,u,a),...N(),children:i(()=>p(!1))})})})]})},en=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:d="--:--",timezoneLabel:u,timezoneLabelClassName:h,picker:p=!1})=>{const[m,x]=g.useState(t),[y,v]=g.useState(!1),b=c.useThemeScope(),{refs:C,floatingStyles:I,context:N}=B.useFloating({open:y,onOpenChange:E=>v(a?!1:E),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),w=B.useDismiss(N),S=B.useRole(N,{role:"dialog"}),{getFloatingProps:T}=B.useInteractions([w,S]);g.useEffect(()=>{x(t)},[t]);const O=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:d,disabled:a,value:m,onChange:E=>{const D=Fd(E.target.value);x(D),zd(D)&&r(D)},onBlur:n,className:f.mergeClasses(Ca,o&&Sa,a&&Ia,p&&"pe-12",i)});return!u&&!p?O:s.jsxs("div",{ref:p?C.setReference:void 0,className:"relative w-full",children:[O,u&&s.jsx("span",{className:f.mergeClasses("dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",p&&"end-12",h),children:u}),p&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":y,disabled:a,className:Ad,onClick:()=>v(E=>!E),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),y&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:C.setFloating,style:I,"aria-label":"Choose time",className:f.mergeClasses(Ed,b),...T(),children:s.jsx(Ud,{value:m,onSelect:(E,D)=>{x(E),r(E),D&&v(!1)}})})})})]})]})},Zd=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:d,className:u,minDate:h,maxDate:p,locale:m=wd,fieldClassName:x,showTimezone:y=!1,showTimePicker:v=!0})=>{const b=o??Dd[e],C=t instanceof Date?t:null,I=g.useId(),N=d??I,w=a?.id??`${N}-label`,S=!!a?.label,T=typeof a?.label=="string"?a.label:void 0,O=S?`${w} ${N}`:void 0,E=a?s.jsx(c.Label,{...a,id:w,htmlFor:N}):null,[D,j]=g.useState(()=>C??new Date),A=g.useMemo(()=>new Date,[]),_=g.useMemo(()=>y?ia({locale:m}):null,[y,m]),P=g.useMemo(()=>$d(m),[m]),L=g.useMemo(()=>Hd(m),[m]),R=g.useMemo(()=>Md(D.getFullYear(),D.getMonth()),[D]),M=W=>{j(G=>new Date(G.getFullYear(),G.getMonth()+W,1))},$=(W,G)=>{if(Ys(W,h,p))return;const J=e===xe.DateTime&&C?Xs(W,Bt(C)):W;r?.(J),e===xe.Date&&G()},V=W=>{r?.(Xs(C??new Date,W))},K=()=>C?e===xe.DateTime?`${qs(C,m)}, ${Bt(C)}`:qs(C,m):b;if(e===xe.Time){const W=typeof t=="string"?t:C?Bt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(en,{id:N,value:W,onChange:G=>r?.(G),onBlur:n,disabled:i,invalid:l,placeholder:b,className:x,timezoneLabel:_,picker:v})]})}if(e===xe.Weekday){const W=typeof t=="string"?t:void 0,G=L.find(J=>J.value===W);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(Js,{id:N,disabled:i,invalid:l,labelledBy:O,panelLabel:T??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??b}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Na})]}),panel:J=>s.jsx("div",{role:"listbox","aria-label":T??b,className:"flex flex-col gap-0.5",children:L.map(re=>s.jsx("button",{type:"button",role:"option","aria-selected":re.value===W,className:f.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",re.value===W&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(re.value),J()},children:re.label},re.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(Js,{id:N,disabled:i,invalid:l,labelledBy:O,panelLabel:T??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!C&&"text-secondary"),children:K()}),Rd]}),panel:W=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:Us.prev,size:c.ElementSize.Small,onClick:()=>M(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Pd(D,m)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:Us.next,size:c.ElementSize.Small,onClick:()=>M(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[P.map(G=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),R.map(G=>{const J=G.getMonth()!==D.getMonth(),re=Zs(G,C),Y=Zs(G,A),q=Ys(G,h,p);return s.jsx("button",{type:"button",disabled:q,"aria-label":Bd(G,m),"aria-pressed":re,"aria-current":Y?"date":void 0,className:f.mergeClasses(Od,J&&kd,Y&&!re&&_d,re&&Ld,q&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>$(G,W),children:G.getDate()},G.toISOString())})]}),e===xe.DateTime&&s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[s.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),s.jsx(en,{ariaLabel:"Time",value:C?Bt(C):"",onChange:V,onBlur:n,className:f.mergeClasses(!_&&"w-[120px]","px-3 py-1.5"),timezoneLabel:_,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Yd=3,qd=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:n,ariaLabel:a="Folder path"})=>{const o=g.useRef(null),i=g.useRef(null),l=g.useRef(null),[d,u]=g.useState(!1),h=g.useRef(!1),p=g.useRef(0),m=g.useCallback(D=>{h.current=D,u(D)},[]),x=g.useCallback(()=>{const D=o.current;if(!D)return;if(h.current){D.clientWidth>=p.current&&m(!1);return}const j=i.current,A=l.current;if(!j||!A)return;const _=j.scrollWidth-j.clientWidth,P=parseFloat(getComputedStyle(A).minWidth)||0,L=A.clientWidth<=P+1;_>0&&L&&(p.current=D.clientWidth+_,m(!0))},[m]);g.useEffect(()=>{const D=o.current;if(D)return c.observeElementSize(D,x)},[x]);const y=e.join("\0");g.useEffect(()=>{m(!1),c.scheduleMeasure(x)},[y,x,m]),g.useEffect(()=>{d||c.scheduleMeasure(x)},[d,x]);const v=s.jsx(c.DialIcon,{icon:s.jsx(F.IconFolder,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),b=s.jsx("span",{className:Yr,children:s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronRight,{size:14,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"})}),C=f.mergeClasses(t,"text-secondary cursor-default"),I=e.length-1,N=e.length>=3?I-1:-1,w=e.length>Yd||d,S=e.slice(1,d?I:I-1),T=D=>{const j=D===I,A=D===N;let _=e[D];return j&&(_=s.jsx("span",{className:r,children:e[D]})),s.jsxs("li",{className:f.mergeClasses(Qt,j&&"min-w-0",A&&"shrink-[1000]",!j&&!A&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(kr,Rn,"pointer-events-none opacity-75",A&&"min-w-auto"),"aria-current":j?"page":void 0,"aria-disabled":"true",children:[D===0&&v,s.jsx("span",{ref:j&&i||A&&l||void 0,className:f.mergeClasses("truncate",j&&"min-w-0 flex-1",A&&"min-w-[2ch]",C),children:_})]}),!j&&b]},`item-${D}`)},O=()=>s.jsxs("li",{className:f.mergeClasses(Qt,"shrink-0"),children:[s.jsxs(c.Tooltip,{tooltip:e.join(" > "),triggerClassName:"inline-flex cursor-default items-center text-secondary",children:[s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:S.join(", ")})]}),b]},"ellipsis"),E=[];return w?(E.push(T(0),O()),d||E.push(T(I-1)),E.push(T(I))):e.forEach((D,j)=>E.push(T(j))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(_n,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:kn,children:E})})};var qe=(e=>(e.Small="small",e.Heading="heading",e))(qe||{});const Xd="w-full overflow-hidden",Qd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",tn="flex min-w-0 items-center gap-2",rn={[qe.Small]:"dial-small-text",[qe.Heading]:"dial-h2-text"},Jd={[qe.Small]:"dial-small-semi-text",[qe.Heading]:"dial-h2-text"},eu={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},tu="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",ru="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",su="cursor-default text-primary",nu="cursor-default text-secondary",sn="inline-flex flex-none items-center leading-none text-secondary",au="dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",ou=3,iu=4,lu=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),cu=({items:e,maxVisibleItems:t=iu,size:r=qe.Small,separator:n=lu,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,ou),u=g.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),h=g.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),p=g.useCallback(({key:y,domEvent:v})=>{const b=u[Number(y)];b&&(b.onClick?.(v),!b.onClick&&b.href&&!v.defaultPrevented&&(window.location.href=b.href))},[u]);if(e.length===0)return null;const m=e.slice(u.length+1),x=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),N=f.mergeClasses(tu,I?ru:C?f.mergeClasses(su,Jd[r]):nu,l,c.DIAL_KIT_CLASS.breadcrumbsItem),w=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(tn,rn[r],eu[C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:N,children:w}):s.jsx("button",{type:"button",onClick:y.onClick,className:N,children:w}):s.jsx("span",{className:N,"aria-current":C?"page":void 0,children:w}),!C&&s.jsx("span",{className:sn,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Xd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:Qd,children:[x(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(tn,rn[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:h,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:au,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:sn,"aria-hidden":"true",children:n})]}),m.map((y,v)=>x(y,{index:e.length-m.length+v,isFirst:!1,isCurrent:v===m.length-1}))]})})},du=({className:e,icon:t,tooltipProps:r,type:n="button",...a})=>{const o=f.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),i=s.jsx("button",{...a,type:n,className:o,"aria-label":c.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||s.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?s.jsx(Se,{...r,children:i}):i},uu=e=>s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",e&&"rotate-180")}),fu=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=g.useState(!1),l=g.useMemo(()=>uu(o),[o]);return s.jsx("div",{className:c.DIAL_KIT_CLASS.buttonDropdown,children:s.jsx(c.Dropdown,{...n,items:r,onOpenChange:d=>i(d),children:s.jsx(Qe,{...a,iconAfter:l,variant:e||c.ButtonVariant.Primary,appearance:t||c.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Da=({label:e,size:t,isOpen:r=!1,labelClassName:n,className:a,"aria-label":o,...i})=>{const l=t===c.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return s.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:f.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",l,a,c.DIAL_KIT_CLASS.inlineSelect),children:[s.jsx("span",{className:n,children:e}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",r&&"rotate-180")})]})},pu=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:h,triggerClassName:p,triggerLabelClassName:m,open:x,onOpenChange:y})=>{const[v,b]=g.useState(!1),C=x!==void 0,I=C?x:v,N=g.useCallback(j=>{C||b(j),y?.(j)},[C,y]),[w,S]=g.useState(r??e[0]?.key),T=t!==void 0,O=T?t:w,E=g.useMemo(()=>{const j=e.find(A=>A.key===O);return j?.label?String(j.label):""},[e,O]),D=g.useCallback(({key:j})=>{const A=e.find(_=>_.key===j);A&&(T||S(j),n?.(A))},[e,T,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?x:void 0,onOpenChange:N,onItemClick:D,children:s.jsx(Da,{label:E,size:a,isOpen:I,disabled:o,"aria-label":h,className:p,labelClassName:m})})};var ke=(e=>(e.Outlined="outlined",e.Filled="filled",e))(ke||{}),je=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(je||{});const hu={[je.Blue]:"bg-blue text-blue",[je.Green]:"bg-green-2 text-green-1",[je.Violet]:"bg-violet-2 text-violet-1",[je.Indigo]:"bg-violet-1 text-violet-2",[je.Brown]:"bg-brown text-brown-2",[je.Red]:"bg-red text-red"},mu={[ke.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[ke.Filled]:"rounded-full"},gu={[ke.Outlined]:"dial-tiny-text",[ke.Filled]:"dial-caption-lead-semi-text"},bs=({label:e,variant:t=ke.Outlined,color:r=je.Blue,icon:n,textClassName:a,className:o,...i})=>s.jsxs("span",{...i,className:f.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",mu[t],t===ke.Filled&&hu[r],o,c.DIAL_KIT_CLASS.badge),children:[n&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:n}),s.jsx("span",{className:a??gu[t],children:e})]}),xu={[Ue.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[Ue.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},bu=({title:e,value:t,description:r,variant:n=Ue.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=xu[n],m=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i,c.DIAL_KIT_CLASS.analyticsCard),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",m?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(bs,{label:"Error",variant:ke.Filled,color:je.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},Ut=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=At,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const m=e==null,x=!!(r||n||!m),y=Nn(m?0:e,t),v=jn(y,i),b=o??(m?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,N=r?s.jsx(bs,{label:"Error",variant:ke.Filled,color:je.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(Ve,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,S=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:S}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),N]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),w]})};var tr=(e=>(e.Start="start",e.End="end",e))(tr||{});const Ta=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=tr.End,className:h,headerClassName:p,contentClassName:m})=>{const x=n!==void 0,[y,v]=g.useState(a),b=i?!0:x?n:y,C=g.useId(),I=`accordion-header-${C}`,N=`accordion-content-${C}`,w=()=>{if(o)return;const D=!b;x||v(D),d?.(D)},S=u===tr.Start,T=i?null:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b?"rotate-90":"rtl:rotate-180")}),O=s.jsxs(s.Fragment,{children:[S&&T,s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?s.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!S&&T]}),E=S?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",h,c.DIAL_KIT_CLASS.accordion),children:[i?s.jsx("div",{id:I,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,p),children:O}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":N,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:w,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:O}),s.jsx("div",{inert:!b,className:f.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"pt-3",children:s.jsx("div",{id:N,role:"region","aria-labelledby":I,className:f.mergeClasses("px-4 dial-small-text text-primary",m),children:r})})})})]})},vu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:m,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),N=m?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,S=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],O="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",E="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(Ta,{title:S,description:r,defaultExpanded:d,nonCollapsible:u,className:f.mergeClasses(C,c.DIAL_KIT_CLASS.analyticsBarGroup),children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":m?"gap-2":"gap-3"),children:h?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?T.map(j=>{const A=j in n?n[j]:null,_=j in a?a[j]:null,L=typeof A=="number"&&typeof _=="number"?parseFloat((_-A).toFixed(3)):null,R=L!=null&&L!==0,M=R&&L>0,$=R?M?`+${L}`:String(L):null,V=b?.[j],K=s.jsx("span",{className:"dial-small-text text-secondary",children:j}),W=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[V?s.jsx(c.Tooltip,{tooltip:V,children:K}):K,$!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:$})]}),s.jsxs("div",{className:D,children:[s.jsx(Ut,{title:o?.[0],value:A,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:j}),s.jsx(Ut,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:`${j} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:f.mergeClasses(E,O),children:W},j):s.jsx("div",{className:E,children:W},j)}):I.map(([j,A])=>{const _=s.jsx(Ut,{title:j,value:A,maxValue:i,colorMap:l,inline:m,titleClassName:N,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:O,children:_}):_,L=b?.[j];return L?s.jsx(c.Tooltip,{tooltip:L,triggerClassName:"flex flex-col",children:P},j):s.jsx(g.Fragment,{children:P},j)})})})},Dr=128,yu=(e,t)=>{const r=sr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},nn=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:yu(a.from,a.to)})]}),Cu=({title:e,values:t,colorMap:r=At,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Zt(t,r),p=l?Zt(l,r):void 0,m=t.length,x=l?.length??0,y=Math.max(m,x),v=Ur(y),b=Dn(y),C=S=>S.map(T=>({...T,ratio:v>0?T.count/v:0})),I=C(h),N=p?C(p):void 0,w=(S,T,O,E)=>{if(S.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})});const D=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":O,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${S.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i,c.DIAL_KIT_CLASS.analyticsHistogram),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:Dr},children:s.jsx(Ve,{size:18,fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Dr},children:b.map((S,T)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((S,T)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},S)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Dr},children:N?I.map((S,T)=>{const O=N[T],E=`${S.count} out of ${m} ${n}`,D=`${O.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(S,nn(d,S.count,m,n,S),E,!0),w(O,nn(u,O.count,x,n,O),D,!1)]},T)}):I.map((S,T)=>{const O=`${S.count} out of ${m} ${n}`;return S.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})},T):s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:O,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":O,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},T)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,T)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:sr(S.from,S.to)},T))})]})]})},Iu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Su="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Nu="flex flex-row items-center justify-between px-6 py-4",ju="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",wu="border-b border-tertiary",Du="flex flex-row items-center gap-2 px-6 py-4",Tu="border-t border-tertiary",Tr="flex shrink-0 flex-row items-center gap-2",Eu="ml-auto mobile:flex-1",rr="mobile:flex-1",Au={[Ge.Sm]:"max-w-full md:max-w-[400px]",[Ge.Md]:"max-w-full md:max-w-[800px]",[Ge.Lg]:"max-w-full md:max-w-[1200px]"},vs=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:h,footer:p,footerClassName:m,onClose:x,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:N,additionalButtonsOnLeft:w=!1,footerDivider:S=!1,size:T=Ge.Md,hideClose:O=!1,closeAriaLabel:E="Close dialog",closeOnOutsideClick:D=!0,preventKeyboardOnOpen:j=!1})=>{const A=c.useThemeScope(),_=g.useRef(null),P=g.useId(),{refs:L,context:R}=B.useFloating({open:e,onOpenChange:Y=>{Y||x?.(null)}}),M=B.useRole(R,{role:"dialog"}),$=B.useDismiss(R,{outsidePress:D}),{getFloatingProps:V}=B.useInteractions([M,$]);if(!e)return null;const K=typeof t=="string"?`popup-heading-${P}`:void 0,W=Y=>Y?typeof Y=="string"?s.jsx("h2",{id:K,className:f.mergeClasses(ju,l),children:s.jsx(c.Tooltip,{tooltip:Y,triggerClassName:"truncate",children:Y})}):Y:s.jsx("span",{}),G=O?null:s.jsx(c.CloseButton,{ariaLabel:E,onClose:Y=>x?.(Y)}),J=(Y,q=[],se)=>q.map(({variant:le=c.ButtonVariant.Neutral,className:oe,...me},ve)=>s.jsx(Qe,{variant:le,className:f.mergeClasses(se,oe),...me},`${Y}-${ve}`)),re=()=>{if(p!==void 0)return p;if(!I?.length&&!N?.length)return null;const Y=J("additional",N,w?void 0:rr);return s.jsxs("div",{className:f.mergeClasses(Du,S&&Tu,m),children:[w&&Y.length>0&&s.jsx("div",{className:Tr,children:Y}),s.jsxs("div",{className:f.mergeClasses(Tr,Eu),children:[!w&&Y,J("main",I,rr)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(Iu,A,o),children:s.jsx(B.FloatingFocusManager,{context:R,initialFocus:j?_:L.floating,children:s.jsxs("div",{ref:L.setFloating,...V(),role:"dialog","aria-modal":"true","aria-labelledby":K,"aria-label":K?void 0:r,className:f.mergeClasses(Su,Au[T],a,c.DIAL_KIT_CLASS.popup),children:[j&&s.jsx("div",{ref:_,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(Nu,C&&wu,d),children:[y&&s.jsx(c.GhostIconButton,{"aria-label":v,size:c.ElementSize.Small,className:"mr-2",onClick:y,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),W(t),b?s.jsxs("div",{className:Tr,children:[b,G]}):G]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:h}),re()]})})})})},Ou="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Lu="text-secondary dial-small-paragraph-text px-6 pb-4",_u="px-6 py-4 h-[120px]",ku="Cancel",Ru="Ok",an={[ct.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[ct.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},Ea=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Ru,cancelLabel:o=ku,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:h,onConfirm:p,onCancel:m,children:x,variant:y=ct.Info,size:v=Ge.Sm,footer:b,hideClose:C,...I})=>{const N=i?null:s.jsxs("div",{className:Ou,children:[s.jsx(fs,{className:rr,label:o,onClick:()=>m?m():h?.()}),s.jsx(Qe,{variant:an[y].confirm.variant,appearance:an[y].confirm.appearance,className:f.mergeClasses(rr,u),label:a,disabled:l,onClick:p})]}),w=g.useCallback(()=>i?s.jsx("div",{className:_u,children:s.jsx(Ve,{size:40})}):x??(t?s.jsx("div",{className:f.mergeClasses(Lu,r),children:t}):null),[x,t,i,r]);return s.jsx(vs,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>h?.(),footer:b??N,size:v,hideClose:C??(!i&&b===void 0),children:w()})},Mu="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Pu="min-w-0 flex-1 truncate text-primary",Bu="min-w-0 flex-1 truncate text-secondary",zu="shrink-0 text-secondary",Fu="px-6 pb-4",$u="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Hu="Cancel",Ku="Apply",Wu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:h,onClose:p,isValid:m=!0,applyButtonLabel:x=Ku,cancelButtonLabel:y=Hu,size:v=Ge.Md,portalId:b,disabled:C,invalid:I,error:N,caption:w,ariaLabel:S,className:T,fieldClassName:O})=>{const E=g.useId(),D=o??E,j=`${D}-label`,A=`${D}-value`,_=N?`${D}-error`:void 0,P=!N&&w?`${D}-caption`:void 0,[L,R]=g.useState(!1),M=d!==void 0,[$,V]=g.useState(t),K=M?d:$,W=g.useCallback(()=>{C||(M||V(t),R(!0))},[C,M,t]),G=g.useCallback(()=>{R(!1),p?.()},[p]),J=g.useCallback(()=>{h?.(),G()},[h,G]),re=g.useCallback(()=>{a(K),G()},[a,K,G]),Y=g.useCallback(k=>{M||V(k),u?.(k)},[M,u]),q=c.resolveAccessibleName(i?.label),se=q?void 0:c.resolveAccessibleName(S),le=q?j:se&&`${D}-name`,oe=c.resolveAccessibleName(n),me=e.find(k=>k.value===t)?.label,ve=r??me;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",T,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:j,htmlFor:D}),s.jsxs("div",{className:"flex flex-col gap-1",children:[se&&s.jsx("span",{id:le,className:"sr-only",children:se}),s.jsxs("button",{type:"button",id:D,disabled:C,"aria-haspopup":"dialog","aria-expanded":L,"aria-labelledby":le?`${le} ${A}`:void 0,"aria-describedby":[_,P].filter(Boolean).join(" ")||void 0,onClick:W,className:f.mergeClasses(Mu,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",O),children:[s.jsx("span",{id:A,className:ve==null?Bu:Pu,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:zu})]}),s.jsx(c.ErrorText,{id:_,text:N}),!N&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(vs,{open:L,header:n,ariaLabel:oe?void 0:q,portalId:b,size:v,onClose:J,footer:s.jsxs("div",{className:$u,children:[s.jsx(fs,{label:y,onClick:J}),s.jsx(ha,{label:x,disabled:!m,onClick:re})]}),children:s.jsx("div",{className:Fu,children:s.jsx(wt,{id:`${D}-options`,items:e,value:K,onChange:Y,orientation:_e.Column,ariaLabel:q??oe})})})]})},Vu=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:n,onClick:a,tooltipProps:o,size:i=c.ElementSize.Small,className:l,...d})=>{const u=g.useCallback(p=>{a?.(p),n?.(!r)},[a,n,r]),h=s.jsx(c.IconButton,{...d,size:i,variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":c.resolveAccessibleName(d["aria-label"],o?.tooltip),onClick:u,className:f.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,c.DIAL_KIT_CLASS.toggleIconButton)});return o?s.jsx(c.Tooltip,{asChild:!0,...o,children:h}):h},Gu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Uu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Zu="flex h-8 min-w-8 grow shrink-0 basis-auto items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",Yu="bg-layer-raised text-accent shadow-xs",qu="bg-transparent text-secondary",Xu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Qu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Ju="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",ef="cursor-not-allowed bg-transparent text-control-disable-primary",tf=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=g.useRef({}),d=e.find(p=>p.value===t),u=d&&!d.disabled?d.value:e.find(p=>!p.disabled)?.value,h=g.useCallback(p=>{if(n||!Gu.includes(p.key))return;const m=e.filter(C=>!C.disabled);if(m.length===0)return;const x=Math.max(m.findIndex(C=>C.value===t),0),y=m.length-1;let v=x;switch(p.key){case"ArrowRight":case"ArrowDown":v=x===y?0:x+1;break;case"ArrowLeft":case"ArrowUp":v=x===0?y:x-1;break;case"Home":v=0;break;case"End":v=y;break}p.preventDefault();const b=m[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[n,e,t,r]);return s.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":n||void 0,onKeyDown:h,className:f.mergeClasses(Uu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const m=p.value===t,x=n||p.disabled;return s.jsxs("button",{ref:y=>{l.current[p.value]=y},type:"button",role:"radio","aria-checked":m,"aria-label":c.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===u?0:-1,disabled:x,onClick:()=>r(p.value),className:f.mergeClasses(Zu,m?Yu:qu,x?m?Ju:ef:m?Xu:Qu,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},rf={[lt.Error]:"Error",[lt.Warning]:"Warning"},sf={[Ze.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ze.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},nf=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ze.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const h=g.useRef({}),p=g.useId(),m=n===Ze.Vertical,x=e.find(C=>C.id===t),y=x&&!x.disabled?x.id:e.find(C=>!C.disabled)?.id,v=g.useCallback(C=>{const{next:I,previous:N}=sf[n];if(![I,N,"Home","End"].includes(C.key)||e.length===0)return;const w=e.filter(D=>!D.disabled);if(w.length===0)return;const S=Math.max(w.findIndex(D=>D.id===t),0),T=w.length-1;let O=S;C.key===I?O=S===T?0:S+1:C.key===N?O=S===0?T:S-1:C.key==="Home"?O=0:O=T,C.preventDefault();const E=w[O];h.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":m?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:v,className:f.mergeClasses(m?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,c.DIAL_KIT_CLASS.tabList,!a&&c.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const I=t===C.id,N=!!C.disabled;return s.jsxs("button",{ref:w=>{h.current[C.id]=w},type:"button",role:"tab","aria-selected":I,disabled:N,tabIndex:C.id===y?0:-1,onClick:()=>r(C.id),className:f.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",m?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],N&&(m?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(m?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),d,c.DIAL_KIT_CLASS.tab,I&&c.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),s.jsx("span",{className:f.mergeClasses(m&&!I&&!N&&"text-primary"),children:C.label}),C.status&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",C.status===lt.Error?"text-error":"text-warning",m&&C.count==null&&"ms-auto"),children:C.status===lt.Error?s.jsx(F.IconExclamationCircle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})}),s.jsx("span",{className:"sr-only",children:C.statusLabel??rf[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",m&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.tabs),children:[s.jsx("div",{className:f.mergeClasses("flex h-16 shrink-0 items-center",m?"px-4":"px-3"),children:s.jsx("span",{id:p,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},af="flex flex-nowrap items-center gap-1",of="min-w-max flex-1 justify-center",lf=({items:e,value:t,onChange:r,stretch:n=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>s.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:f.mergeClasses(af,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Oe,{label:d.label,icon:d.icon,appearance:De.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&of,o)},d.value))}),zr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const n=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},cf=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:h,ariaLabel:p,className:m})=>{const x=g.useId(),y=h??`file-dropzone-${x}`,v=d?`${y}-error`:void 0,[b,C]=g.useState(!1),I=g.useRef(0),N=g.useCallback(j=>{if(j.length===0)return;const A=i?j:j.slice(0,1),_=A.filter(L=>zr(L,o)),P=A.filter(L=>!zr(L,o));P.length>0&&a?.(P),_.length>0&&n(_)},[o,i,n,a]),w=g.useCallback(j=>{N(Array.from(j.target.files??[])),j.target.value=""},[N]),S=g.useCallback(()=>{I.current=0,C(!1)},[]),T=g.useCallback(j=>{l||(j.preventDefault(),I.current+=1,C(!0))},[l]),O=g.useCallback(j=>{l||(j.preventDefault(),j.dataTransfer.dropEffect="copy")},[l]),E=g.useCallback(()=>{l||(I.current-=1,I.current<=0&&S())},[l,S]),D=g.useCallback(j=>{j.preventDefault(),!l&&(S(),N(Array.from(j.dataTransfer?.files??[])))},[l,S,N]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[e&&s.jsx(c.Label,{...e,htmlFor:y}),s.jsx("input",{id:y,type:"file",accept:o,multiple:i,disabled:l,onChange:w,"aria-label":c.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:T,onDragOver:O,onDragLeave:E,onDrop:D,className:f.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",d&&!b&&"border-error hover:border-error",m,c.DIAL_KIT_CLASS.fileDropzone),children:[u??s.jsx(F.IconUpload,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),s.jsxs("span",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:f.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&s.jsx("span",{className:f.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),s.jsx(c.ErrorText,{id:v,text:d})]})},Aa=({label:e="Shared",tooltip:t,size:r=12,className:n})=>s.jsx(c.Tooltip,{tooltip:t||"Shared",asChild:!0,children:s.jsx("span",{role:"img","aria-label":e,className:f.mergeClasses("flex shrink-0 rounded-xs bg-layer-raised text-accent",n,c.DIAL_KIT_CLASS.sharedEntityIndicator),children:s.jsx(F.IconArrowUpRight,{size:r,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ce=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(Ce||{});const df={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},uf=new Map(Object.entries(df).flatMap(([e,t])=>t.map(r=>[r,e]))),ff=e=>uf.get(e)??"other",on="var(--text-control-permanent, #FCFCFC)",zt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},pf="#1B212D",hf={[Ce.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:zt},[Ce.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:pf}},[Ce.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[Ce.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[Ce.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[Ce.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:zt},[Ce.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:zt},[Ce.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[Ce.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[Ce.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[Ce.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:zt}},mf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${g.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=hf[t],i=typeof o=="string";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),n&&s.jsx("path",{d:n,stroke:on,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:on}),!i&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:o.from}),s.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},gf=({size:e})=>{const t=`dial-kit-folder-gradient-${g.useId().replace(/[^\w-]/g,"")}`;return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),s.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),s.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},xf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),bf=(e,t)=>e===Le.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",vf=(e,t,r)=>e===Le.Folder?s.jsx(gf,{size:r}):s.jsx(mf,{size:r,kind:ff(t)}),ys=({type:e,name:t,fileExtension:r,shared:n=!1,loading:a=!1,size:o=f.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:d,loadingLabel:u="Loading",sharedIndicatorClassName:h,sharedIndicatorTooltip:p})=>{if(e!==Le.File&&e!==Le.Folder)return null;const m=e===Le.File?xf(t,r):"",x=bf(e,m),y=d??(n?`${x}, shared`:x),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":y};return s.jsxs("span",{className:f.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,c.DIAL_KIT_CLASS.fileIcon),...v,children:[a?s.jsx(Ve,{size:o,ariaLabel:u}):vf(e,m,o),n&&s.jsx(Aa,{tooltip:p,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",h)})]})},Oa=({name:e,type:t=Le.File,fileExtension:r,shared:n=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:d=!1,className:u,nameClassName:h,sharedIndicatorClassName:p,sharedIndicatorTooltip:m,sharedLabel:x="Shared",hideTooltip:y=!1,tooltipContent:v})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",u,c.DIAL_KIT_CLASS.fileName),children:[s.jsx(ys,{name:e,type:t,fileExtension:r,shared:n,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:m,decorative:!a}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",d?"text-secondary":"text-primary",h),text:e,hideTooltip:y,customTooltipContent:v}),n&&s.jsx("span",{className:"sr-only",children:x}),l]})]}),yf=({className:e,...t})=>s.jsx(Oa,{...t,type:Le.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),Cf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:h,headerClassName:p,style:m,overlayStyle:x,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${g.useId()}`,{refs:N,context:w}=B.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=B.useRole(w,{role:"dialog"}),T=B.useDismiss(w,{outsidePress:l}),{getFloatingProps:O}=B.useInteractions([S,T]);return e?s.jsx(B.FloatingPortal,{id:b,children:s.jsx(B.FloatingOverlay,{lockScroll:!0,style:x,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,h,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(B.FloatingFocusManager,{context:w,initialFocus:N.floating,children:s.jsxs("div",{ref:N.setFloating,...O(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:n,style:m,className:f.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-hidden","animate-slideUp motion-reduce:animate-none",u,c.DIAL_KIT_CLASS.bottomSheet),children:[r&&s.jsxs("div",{className:f.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&s.jsx(c.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:s.jsx(F.IconArrowLeft,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),s.jsx("h2",{id:I,className:f.mergeClasses("min-w-0 truncate text-primary",v??"dial-body-semi-text"),children:r}),s.jsx(c.CloseButton,{ariaLabel:i,onClose:t,size:c.ElementSize.Standard,className:"absolute end-4"})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 overflow-y-auto",y),children:d})]})})})}):null};var dt=(e=>(e.Circle="circle",e.Square="square",e))(dt||{}),Be=(e=>(e.Green1="green-1",e.Violet2="violet-2",e.Brown="brown",e.Red="red",e.Green2="green-2",e.Blue="blue",e.Violet1="violet-1",e))(Be||{});const La={[Be.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Be.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Be.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Be.Red]:{background:"bg-red",foreground:"text-red"},[Be.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Be.Blue]:{background:"bg-blue",foreground:"text-accent"},[Be.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},If=e=>{const t=Object.values(La);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},ln=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",_a=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(ln(t[0])+ln(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Sf={[dt.Circle]:"rounded-full",[dt.Square]:"rounded-md"},ka=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=dt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:h})=>{const[p,m]=g.useState(),x=!!r&&p!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Sf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(x)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{m(r),h?.(I)}});const{background:b,foreground:C}=i??If(e);return s.jsx("span",{role:y?"img":void 0,"aria-label":y?n:void 0,"aria-hidden":y?void 0:!0,className:v(f.mergeClasses(b,C)),style:{width:a,height:a,fontSize:d?void 0:Math.round(a*.4)},children:s.jsx("span",{className:f.mergeClasses("leading-none",d??"font-semibold"),children:t??_a(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const Nf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},cn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},jf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},wf=["h1","h2","h3","h4","h5","h6"],Df=e=>wf[Math.min(6,Math.max(1,Math.round(e)))-1],Ra=({item:e,labels:t,showType:r=!0,showVersion:n=!0,hasFeaturedTag:a=!0,iconSize:o=48,headingLevel:i=3,query:l,footer:d,statusBadge:u,className:h,nameClassName:p="dial-h3-text",typeClassName:m="dial-caption-lead-semi-text",versionClassName:x="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=Df(i),C=a&&!!e.isFeatured,I=u!=null||C,N=n?e.version:void 0,w=r?t?.type??Nf[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",h,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(ka,{name:e.name,src:e.iconUrl,size:o,shape:dt.Square,imageClassName:"bg-entity-icon",className:f.mergeClasses("rounded-[14px]",y)}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",d!=null&&"self-stretch"),children:[(I||w)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[w&&s.jsx("span",{className:f.mergeClasses("uppercase",m,cn[e.type]),children:w}),I&&s.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[u,C&&s.jsx("span",{className:f.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",jf[e.type],cn[e.type],v),children:t?.featured??"Featured"})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(b,{className:f.mergeClasses("min-w-0 shrink text-primary",p),children:l?s.jsx(c.Highlight,{text:e.name,query:l,maxLines:1}):s.jsx(c.EllipsisTooltip,{text:e.name})}),N!=null&&s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("max-w-[30%] shrink-0 text-secondary",x),text:N})]}),d!=null&&d]})]})},Er="bg-control-neutral-active",Tf=({iconSize:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"shrink-0 overflow-hidden rounded-[14px]",children:s.jsx(Vt,{variant:Ae.Rectangular,width:e,height:e,className:Er})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Vt,{variant:Ae.Text,width:"30%",height:12,className:Er}),s.jsx(Vt,{variant:Ae.Text,width:"60%",height:16,className:Er})]})]}),Ef=({entityId:e,item:t,isLoading:r=!1,isDisabled:n=!1,error:a,details:o,labels:i,showType:l=!0,iconSize:d=44,headingLevel:u=4,className:h})=>{const p=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,m=()=>e?r?s.jsx(Tf,{iconSize:d}):t==null?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:e}),p]}):s.jsx(Ra,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:p}):s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:i?.placeholder??"Not selected"});return s.jsxs("div",{children:[s.jsx("div",{className:f.mergeClasses("rounded-2xl border bg-layer-raised p-3",a?"border-error":"border-tertiary",n&&"opacity-50",h,c.DIAL_KIT_CLASS.selectedEntityCard),children:m()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Af=({open:e,onClose:t,header:r,ariaLabel:n,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:d="Close",closeDisabled:u=!1,hideClose:h=!1,closeOnOutsideClick:p=!0,children:m,className:x,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:N,portalId:w})=>{const S=c.useThemeScope(),T=`side-drawer-title-${g.useId()}`,O=typeof r=="string",{refs:E,context:D}=B.useFloating({open:e,onOpenChange:L=>{L||t()}}),j=B.useRole(D,{role:"dialog"}),A=B.useDismiss(D,{outsidePress:p}),{getFloatingProps:_}=B.useInteractions([j,A]),P=r!=null||o!=null||!h;return s.jsx(B.FloatingPortal,{id:w,children:s.jsx(B.FloatingOverlay,{lockScroll:e,style:C,className:f.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,y),children:s.jsx(B.FloatingFocusManager,{context:D,disabled:!e,initialFocus:E.floating,children:s.jsxs("div",{ref:E.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":O?T:void 0,"aria-label":O?void 0:n,inert:!e,style:b,className:f.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-hidden","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",x,c.DIAL_KIT_CLASS.sideDrawer),children:[P&&s.jsxs("div",{className:f.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",v),children:[o&&s.jsx(c.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),O?s.jsx("h2",{id:T,className:f.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):s.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!h&&s.jsx(c.CloseButton,{ariaLabel:d,onClose:t,disabled:u,size:c.ElementSize.Standard})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:m})]})})})})},Of=4,Lf=24,dn=e=>parseFloat(e)||0,_f=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},kf=()=>{},Rf=({id:e,value:t,defaultValue:r,size:n=c.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:d,disabled:u=!1,readOnly:h=!1,collapseTagOverflow:p=!1,ariaLabel:m,tagListLabel:x="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=g.useId(),N=e||I,w=n===c.ElementSize.Small,S=g.useRef(null),T=g.useRef([]),O=g.useRef(null),E=t!==void 0,[D,j]=g.useState(r??[]),A=E?t:D,_=A.length,[P,L]=g.useState(""),[R,M]=g.useState(_),$=!h&&!u,V=g.useCallback(k=>{E||j(k),C?.(k)},[E,C]),K=g.useCallback(k=>U=>{T.current[k]=U},[]),W=g.useCallback(()=>{const k=S.current;if(!k||k.clientWidth===0){M(A.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(k);M(pa({availableWidth:k.clientWidth-dn(U)-dn(de)-(h?0:Lf),tagWidths:A.map((ne,ge)=>T.current[ge]?.offsetWidth??0),overflowChipWidth:O.current?.offsetWidth??0,gap:Of}))},[h,A]);g.useEffect(()=>{if(!p){M(_);return}const k=S.current;if(!k)return;const U=new ResizeObserver(()=>W());return U.observe(k),W(),()=>U.disconnect()},[p,W,_]);const G=f.mergeClasses(p?"shrink-0":"min-w-0",b),J=k=>{const U=_f(k.trim()).trim();!U||A.includes(U)||V([...A,U])},re=k=>{V(A.filter(U=>U!==k))},Y=()=>{J(P),L("")},q=k=>{if($){if(k.key==="Enter"||k.key===","){k.preventDefault(),Y();return}k.key==="Backspace"&&!P&&_>0&&(k.preventDefault(),V(A.slice(0,-1)))}},se=()=>{$&&P.trim()&&Y()},le=p?A.slice(0,R):A,oe=p?A.slice(R):[],me=oe.join(", "),ve=_>0&&s.jsxs("span",{role:"list","aria-label":x,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[le.map(k=>s.jsx(Oe,{role:"listitem",label:k,className:G,disabled:u,closable:$,onRemove:$?()=>re(k):void 0},k)),oe.length>0&&s.jsx(Oe,{role:"listitem",label:`+${oe.length}`,"aria-label":me,title:me,className:f.mergeClasses("shrink-0",b),disabled:u}),p&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[A.map((k,U)=>s.jsx("span",{ref:K(U),className:"inline-flex",children:s.jsx(Oe,{label:k,className:b,disabled:u,closable:$,onRemove:$?kf:void 0})},k)),s.jsx("span",{ref:O,className:"inline-flex",children:s.jsx(Oe,{label:`+${_}`,className:b})})]})]});return s.jsx(c.Input,{id:N,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:h,value:P,placeholder:_>0?void 0:o,"aria-label":m,wrapperRef:S,onChange:k=>L(k??""),onKeyDown:q,onBlur:se,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(_>0&&["!h-auto",w?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",h&&"cursor-default"),children:ve})},Mf=(e,t,r,n)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:d})=>!o.has(i)&&[l,i,d].some(u=>u?.toLowerCase().includes(a))).slice(0,Math.max(n,0))},Pf=5,Bf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Pf,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:h,invalid:p=!1,disabled:m=!1,readOnly:x=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:N,listClassName:w,onChange:S})=>{const T=g.useId(),O=e||T,E=`${O}-listbox`,D=c.useThemeScope(),j=i===c.ElementSize.Small,A=t!==void 0,[_,P]=g.useState(r??[]),L=A?t:_,R=L.length>0,M=!x&&!m,[$,V]=g.useState(""),[K,W]=g.useState(!1),[G,J]=g.useState(0),re=!$.trim(),Y=g.useMemo(()=>Mf(n,$,L,o&&re?n.length:a),[$,re,a,o,n,L]),q=K&&M&&Y.length>0,se=Math.min(G,Y.length-1),le=q&&se>=0,oe=Q=>`${E}-option-${Q}`,{refs:me,floatingStyles:ve}=B.useFloating({open:q,placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(c.overlayGap),B.flip({padding:c.overlayGap}),B.size({padding:c.overlayGap,apply({rects:Q,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(Q.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),k=g.useCallback(Q=>{A||P(Q),S?.(Q)},[A,S]),U=()=>{W(!1),J(0)},de=()=>{!o||!M||(W(!0),J(re?-1:0))},ne=Q=>{const ce=Q.trim();ce&&!L.includes(ce)&&k([...L,ce]),V(""),o?J(-1):U()},ge=Q=>k(L.filter(ce=>ce!==Q)),Je=Q=>{const ce=Q??"",he=!!ce.trim();V(ce),W(he||o),J(he?0:-1)},ht=Q=>{if(M)switch(Q.key){case"ArrowDown":case"ArrowUp":{if(Q.preventDefault(),!q){W(!0),J(0);return}const ce=Q.key==="ArrowDown"?1:-1,he=se<0?Math.min(-ce,0):se;J((he+ce+Y.length)%Y.length);return}case"Enter":case",":Q.preventDefault(),ne(le?Y[se].value:$);return;case"Escape":q&&Q.preventDefault(),U();return;case"Backspace":!$&&R&&(Q.preventDefault(),k(L.slice(0,-1)));return}},mt=Q=>Q.preventDefault();return s.jsxs(s.Fragment,{children:[s.jsx(c.Input,{id:O,role:"combobox","aria-autocomplete":"list","aria-expanded":q,"aria-controls":E,"aria-activedescendant":le?oe(se):void 0,"aria-invalid":p||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:h,invalid:p,disabled:m,readOnly:x,value:$,placeholder:R?void 0:d,wrapperRef:me.setReference,onChange:Je,onKeyDown:ht,onFocus:de,onClick:de,onBlur:U,containerClassName:f.mergeClasses("w-full",C),wrapperClassName:f.mergeClasses(R&&["!h-auto flex-wrap gap-1 py-2",j?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",x&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:L.map(Q=>s.jsx(Oe,{role:"listitem",label:Q,className:f.mergeClasses(er,"min-w-0",N),disabled:m,closable:M,removeLabel:b?.(Q),onRemove:M?()=>ge(Q):void 0},Q))})}),s.jsx(B.FloatingPortal,{children:s.jsx("div",{ref:me.setFloating,id:E,role:"listbox","aria-label":v,hidden:!q,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!q&&"hidden",D,w),children:q&&Y.map((Q,ce)=>{const he=ce===se;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:Q.label,description:Q.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:mt,onMouseEnter:()=>J(ce),onClick:()=>ne(Q.value)},Q.value)})})})]})},zf=(e,t)=>{if(e<=0||t<=0)return[];const r=Math.floor(e/t+1e-9);return Array.from({length:r},(n,a)=>(a+1)*t/e*100)},Ma=e=>(e.toString().split(".")[1]??"").length,Ff=(e,t,r,n)=>{const a=Math.min(r,Math.max(t,e));if(n<=0)return a;const o=Math.round(Number(((a-t)/n).toFixed(9))),i=t+o*n;return Number(Math.min(r,i).toFixed(Ma(n)))},$f=12,un=e=>`calc(${e}% + ${(.5-e/100)*$f}px)`,Hf=(e,t)=>e&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":e?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",Kf=({id:e,value:t,min:r=0,max:n=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:d,showValue:u=!1,showTooltip:h=!1,showTicks:p=!1,leftContent:m,rightContent:x,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:N,trackClassName:w,fillClassName:S,className:T,...O})=>{const E=g.useId(),D=e??E,j=b&&!C?`${D}-caption`:void 0,A=C?`${D}-error`:void 0,_=n-r,P=_>0?Math.min(100,Math.max(0,(t-r)/_*100)):0,L=un(P),R=p&&!o?zf(_,a):[],M=h&&!o,$=m!=null,V=y||x!=null,K=Ma(a),[W,G]=g.useState(null),J=d?d(t):t.toFixed(K),re=g.useCallback(se=>{I?.(Number(se.target.value))},[I]),Y=g.useCallback(se=>{const le=se==null?"":String(se);G(le);const oe=Number(le);le!==""&&Number.isFinite(oe)&&I?.(Ff(oe,r,n,a))},[n,r,I,a]),q=g.useCallback(()=>G(null),[]);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",N),children:[(i||u)&&s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx(c.Label,{...i,htmlFor:D}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:J})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("grid items-center gap-y-1",y?"gap-x-2":"gap-x-3",Hf($,V),M&&"mt-2"),children:[$&&s.jsx("div",{className:"flex items-center",children:m}),s.jsxs("div",{className:"relative flex h-6 items-center",children:[s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",w)}),R.map(se=>s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",style:{left:un(se)}},se)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",S),style:{width:L}}),M&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",style:{left:L},children:[s.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:J}),s.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:s.jsx("path",{d:"M0 0h8L4 4z"})})]}),s.jsx("input",{...O,type:"range",id:D,value:t,min:r,max:n,step:a,disabled:o,onChange:re,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?O["aria-label"]:void 0),"aria-valuetext":d?J:void 0,"aria-describedby":A??j,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",T)})]}),V&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(gs,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:W??t.toFixed(K),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:Y,onBlur:q}):x}),l&&s.jsx("div",{className:f.mergeClasses("dial-tiny-text flex text-secondary",$&&"col-start-2"),children:l.length===3?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"flex-1 text-center",children:l[1]}),s.jsx("span",{children:l[2]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),s.jsx(c.ErrorText,{id:A,text:C}),!C&&s.jsx(c.CaptionText,{id:j,text:b})]})]})},Wf=48,Vf=({children:e,title:t,width:r=280,collapsedWidth:n=Wf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:h="Expand sidebar",className:p,titleClassName:m,contentClassName:x,footerClassName:y})=>{const v=a!==void 0,[b,C]=g.useState(o),I=v?a:b,N=`collapsible-sidebar-content-${g.useId()}`,w=I?u:h,S=T=>{const O=!I;v||C(O),i?.(O,T)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",p,c.DIAL_KIT_CLASS.collapsibleSidebar),children:[s.jsx("div",{id:N,hidden:!I,className:f.mergeClasses("min-h-0 flex-1 overflow-auto p-4",x),children:e}),s.jsx("div",{hidden:I,className:f.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",m),children:t}),s.jsxs("div",{className:f.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",y),children:[I&&l,s.jsx(c.IconButton,{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,size:c.ElementSize.Standard,onClick:S,"aria-label":w,"aria-expanded":I,"aria-controls":N,tooltipProps:{tooltip:w},icon:I?s.jsx(F.IconChevronsLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconChevronsRight,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})};var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ie.apply(this,arguments)},fn={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},pn={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ft={width:"20px",height:"20px",position:"absolute",zIndex:1},Gf={top:ie(ie({},fn),{top:"-5px"}),right:ie(ie({},pn),{left:void 0,right:"-5px"}),bottom:ie(ie({},fn),{top:void 0,bottom:"-5px"}),left:ie(ie({},pn),{left:"-5px"}),topRight:ie(ie({},Ft),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Ft),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Ft),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Ft),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Uf=g.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,a=e.replaceStyles,o=e.className,i=g.useCallback(function(u){t(u,r)},[t,r]),l=g.useCallback(function(u){t(u,r)},[t,r]),d=g.useMemo(function(){return ie(ie({position:"absolute",userSelect:"none"},Gf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Zf=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Ee=function(){return Ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ee.apply(this,arguments)},Yf={width:"auto",height:"auto"},$t=function(e,t,r){return Math.max(Math.min(e,r),t)},hn=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},st=function(e,t){return new RegExp(e,"i").test(t)},Ht=function(e){return!!(e.touches&&e.touches.length)},qf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},mn=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(o,i,l){return Math.abs(i-e)<Math.abs(t[o]-e)?l:o},0),a=Math.abs(t[n]-e);return r===0||a<r?t[n]:e},Ar=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Kt=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var a=Number(e.replace("%",""))/100;return t*a}if(e.endsWith("vw")){var a=Number(e.replace("vw",""))/100;return r*a}if(e.endsWith("vh")){var a=Number(e.replace("vh",""))/100;return n*a}}return e},Xf=function(e,t,r,n,a,o,i){return n=Kt(n,e.width,t,r),a=Kt(a,e.height,t,r),o=Kt(o,e.width,t,r),i=Kt(i,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof a>"u"?void 0:Number(a),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},Qf=function(e){return Array.isArray(e)?e:[e,e]},Jf=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],gn="__resizable_base__",ep=(function(e){Zf(t,e);function t(r){var n,a,o,i,l=e.call(this,r)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var d=l.parentNode;if(!d)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(gn):u.className+=gn,d.appendChild(u),u},l.removeBase=function(d){var u=l.parentNode;u&&u.removeChild(d)},l.state={isResizing:!1,width:(a=(n=l.propsSize)===null||n===void 0?void 0:n.width)!==null&&a!==void 0?a:"auto",height:(i=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Yf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var a=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:a,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,a=function(l){var d;if(typeof r.state[l]>"u"||r.state[l]==="auto")return"auto";if(r.propsSize&&r.propsSize[l]&&(!((d=r.propsSize[l])===null||d===void 0)&&d.toString().endsWith("%"))){if(r.state[l].toString().endsWith("%"))return r.state[l].toString();var u=r.getParentSize(),h=Number(r.state[l].toString().replace("px","")),p=h/u[l]*100;return"".concat(p,"%")}return Ar(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?Ar(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?Ar(n.height):a("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,a=this.parentNode.style.flexWrap;a!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var o={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=a),this.removeBase(r),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var a=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof a>"u"||a==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var a=this.props.boundsByDirection,o=this.state.direction,i=a&&st("left",o),l=a&&st("top",o),d,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=i?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(r=r&&r<d?r:d),u&&Number.isFinite(u)&&(n=n&&n<u?n:u),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var a=this.props.scale||1,o=Qf(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,h=d.original,p=this.props,m=p.lockAspectRatio,x=p.lockAspectRatioExtraHeight,y=p.lockAspectRatioExtraWidth,v=h.width,b=h.height,C=x||0,I=y||0;return st("right",u)&&(v=h.width+(r-h.x)*i/a,m&&(b=(v-I)/this.ratio+C)),st("left",u)&&(v=h.width-(r-h.x)*i/a,m&&(b=(v-I)/this.ratio+C)),st("bottom",u)&&(b=h.height+(n-h.y)*l/a,m&&(v=(b-C)*this.ratio+I)),st("top",u)&&(b=h.height-(n-h.y)*l/a,m&&(v=(b-C)*this.ratio+I)),{newWidth:v,newHeight:b}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,a,o){var i=this.props,l=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,h=typeof o.width>"u"?10:o.width,p=typeof a.width>"u"||a.width<0?r:a.width,m=typeof o.height>"u"?10:o.height,x=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(m-y)*this.ratio+v,C=(x-y)*this.ratio+v,I=(h-v)/this.ratio+y,N=(p-v)/this.ratio+y,w=Math.max(h,b),S=Math.min(p,C),T=Math.max(m,I),O=Math.min(x,N);r=$t(r,w,S),n=$t(n,T,O)}else r=$t(r,h,p),n=$t(n,m,x);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var a=n.getBoundingClientRect();this.parentLeft=a.left*r,this.parentTop=a.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*r,this.targetTop=o.top*r}if(this.resizable){var i=this.resizable.getBoundingClientRect(),l=i.left,d=i.top,u=i.right,h=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=h*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&qf(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&Ht(r.nativeEvent)&&(a=r.nativeEvent.touches[0].clientX,o=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(r,n,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ee(Ee({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(p)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ht(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=Ht(r)?r.touches[0].clientX:r.clientX,h=Ht(r)?r.touches[0].clientY:r.clientY,p=this.state,m=p.direction,x=p.original,y=p.width,v=p.height,b=this.getParentSize(),C=Xf(b,this.window.innerWidth,this.window.innerHeight,o,i,l,d);o=C.maxWidth,i=C.maxHeight,l=C.minWidth,d=C.minHeight;var I=this.calculateNewSizeFromDirection(u,h),N=I.newHeight,w=I.newWidth,S=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(w=mn(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(N=mn(N,this.props.snap.y,this.props.snapGap));var T=this.calculateNewSizeFromAspectRatio(w,N,{width:S.maxWidth,height:S.maxHeight},{width:l,height:d});if(w=T.newWidth,N=T.newHeight,this.props.grid){var O=hn(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),E=hn(N,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,j=D===0||Math.abs(O-w)<=D?O:w,A=D===0||Math.abs(E-N)<=D?E:N;w=j,N=A}var _={width:w-x.width,height:N-x.height};if(this.delta=_,y&&typeof y=="string"){if(y.endsWith("%")){var P=w/b.width*100;w="".concat(P,"%")}else if(y.endsWith("vw")){var L=w/this.window.innerWidth*100;w="".concat(L,"vw")}else if(y.endsWith("vh")){var R=w/this.window.innerHeight*100;w="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var P=N/b.height*100;N="".concat(P,"%")}else if(v.endsWith("vw")){var L=N/this.window.innerWidth*100;N="".concat(L,"vw")}else if(v.endsWith("vh")){var R=N/this.window.innerHeight*100;N="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(N,"height")};this.flexDir==="row"?M.flexBasis=M.width:this.flexDir==="column"&&(M.flexBasis=M.height);var $=this.state.width!==M.width,V=this.state.height!==M.height,K=this.state.flexBasis!==M.flexBasis,W=$||V||K;W&&Ya.flushSync(function(){n.setState(M)}),this.props.onResize&&W&&this.props.onResize(r,m,this.resizable,_)}},t.prototype.onMouseUp=function(r){var n,a,o=this.state,i=o.isResizing,l=o.direction;o.original,!(!i||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,l,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(a=this.props.size.height)!==null&&a!==void 0?a:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Ee(Ee({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,a;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(a=r.height)!==null&&a!==void 0?a:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,a=n.enable,o=n.handleStyles,i=n.handleClasses,l=n.handleWrapperStyle,d=n.handleWrapperClass,u=n.handleComponent;if(!a)return null;var h=Object.keys(a).map(function(p){return a[p]!==!1?s.jsx(Uf,{direction:p,onResizeStart:r.onResizeStart,replaceStyles:o&&o[p],className:i&&i[p],children:u&&u[p]?u[p]:null},p):null});return s.jsx("div",{className:d,style:l,children:h})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return Jf.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Ee(Ee(Ee({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(a.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return s.jsxs(o,Ee({style:a,className:this.props.className},n,{ref:function(i){i&&(r.resizable=i)},children:[this.state.isResizing&&s.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(g.PureComponent);const tp=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const h=e===St.Left,p=h?F.IconChevronLeft:F.IconChevronRight,m=x=>{let y;switch(x.key){case"ArrowLeft":y=r+(h?o:-o);break;case"ArrowRight":y=r+(h?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}x.preventDefault(),l(y)};return s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":a,tabIndex:0,onKeyDown:m,className:f.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:d??s.jsx(p,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",h?"right-full":"left-full")})})},rp=16,Pa=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=St.Right,keyboardStep:d=rp,ariaLabel:u="Resize panel",className:h,resizeHandlerClassName:p,resizeHandler:m})=>{const[x,y]=g.useState(!1),[v,b]=g.useState(a??t),C=n!==void 0,I=C?n:v,N=g.useRef(null),w=g.useCallback(()=>{y(!0)},[]),S=g.useCallback(()=>{y(!1);const E=N.current?.resizable?.getBoundingClientRect(),D=E?Math.round(E.width):t;C||b(D),o?.(D)},[o,C,t]),T=g.useCallback(E=>{const D=Math.min(r,Math.max(t,E));D!==I&&(C||(b(D),N.current?.updateSize({width:D,height:"100%"})),i?.(D),o?.(D))},[r,t,I,C,i,o]),O=g.useMemo(()=>{const E=l===St.Left,D=s.jsx(tp,{side:l,isResizing:x,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:T,customHandler:m,handlerClassName:p});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?D:void 0,right:E?void 0:D},onResizeStart:w,onResize:(j,A,_)=>{i?.(Math.round(_.offsetWidth))},onResizeStop:S}},[l,C,I,t,r,d,u,T,m,p,x,w,S,i]);return s.jsx(ep,{ref:N,...O,children:s.jsx("div",{className:f.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",h,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},sp=16,np=1e3,ap=4,Or=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",op=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=sp,className:d})=>{const[u,h]=g.useState(!1),[p,m]=g.useState(!1),[x,y]=g.useState(!1),v=g.useRef(null),b=g.useRef(null),C=g.useRef({x:0,y:0}),I=g.useRef(null),N=g.useRef(void 0),w=g.useRef(void 0);g.useEffect(()=>()=>{clearTimeout(N.current),w.current!=null&&cancelAnimationFrame(w.current)},[]);const S=g.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),T=R=>{b.current?.style.setProperty("transform",`translate(${R.clientX}px, ${R.clientY}px) translate(-50%, -50%)`),y(!0)},O=R=>{C.current={x:R.clientX,y:R.clientY},clearTimeout(N.current),N.current=setTimeout(()=>m(!0),np)},E=R=>{T(R),O(R)},D=()=>{y(!1),clearTimeout(N.current),m(!1)},j=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},h(!0))},A=R=>{T(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>ap&&(m(!1),O(R));return}const $=Or(v.current)?-1:1,V=S(M.width+(R.clientX-M.x)*$);w.current!=null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>a(V))},_=R=>{I.current!=null&&(I.current=null,h(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},P=R=>{const M=Or(v.current)?-1:1;let $;switch(R.key){case"ArrowRight":$=e+l*M;break;case"ArrowLeft":$=e-l*M;break;case"Home":$=t;break;case"End":$=r;break;default:return}R.preventDefault(),a(S($))},L=()=>{n!=null&&a(S(n))};return s.jsx("div",{ref:v,role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,tabIndex:0,className:f.mergeClasses("absolute inset-y-0 end-0 -me-1 w-2 touch-none select-none","dial-resize-handle",x&&"dial-resize-handle-cursor-ready",p&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:E,onPointerLeave:D,onPointerDown:j,onPointerMove:A,onPointerUp:_,onPointerCancel:_,onKeyDown:P,onDoubleClick:L,children:s.jsx(c.Tooltip,{tooltip:i,open:p&&!u,placement:Or(v.current)?c.TooltipPlacement.Left:c.TooltipPlacement.Right,asChild:!0,children:s.jsx("span",{ref:b,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none fixed top-0 left-0 z-tooltip hidden text-secondary","dial-resize-handle-arrow"),children:s.jsx(F.IconArrowsHorizontal,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE})})})})},ip=({enabled:e=!0,children:t,...r})=>e?s.jsx(Pa,{...r,children:t}):t,lp=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i})=>{const l=g.useId();return s.jsxs("section",{"aria-labelledby":l,className:f.mergeClasses("flex size-full flex-col items-center justify-center px-4 text-center",a,c.DIAL_KIT_CLASS.stateScreen),children:[r!=null&&s.jsx("span",{"aria-hidden":"true",className:"mb-4 flex size-14 items-center justify-center rounded-full border border-secondary text-secondary",children:r}),s.jsx("h1",{id:l,className:f.mergeClasses("dial-body-semi-text text-primary",o),children:e}),t!=null&&s.jsx("p",{className:f.mergeClasses("dial-small-text mt-2 text-secondary",i),children:t}),n!=null&&s.jsx("div",{className:"mt-4",children:n})]})};var ot=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(ot||{});const cp={[ot.Row]:{header:"gap-2",title:"dial-small-semi-text",description:"dial-small-text"},[ot.Caption]:{header:"gap-4",title:"dial-caption-lead-semi-text",description:"dial-tiny-text"},[ot.Setting]:{header:"gap-4",title:"dial-tiny-semi-text",description:"dial-tiny-text"}},dp=({title:e,action:t,description:r,variant:n=ot.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const h=g.useId(),p=cp[n],m=`h${a}`;return s.jsxs("section",{"aria-labelledby":h,className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.formSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center justify-between",p.header),children:[s.jsx(m,{id:h,className:f.mergeClasses("min-w-0 text-primary",p.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",p.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var we=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(we||{});const Ba=8e3,Dt="flex size-7 shrink-0 items-center justify-center",za={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},up=({title:e,isCollapsed:t,itemsId:r,labels:n,onToggleCollapse:a,onClose:o})=>{const i=t?F.IconChevronUp:F.IconChevronDown;return s.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[s.jsx("span",{className:"dial-small-paragraph-semi-text min-w-0 truncate text-primary",children:e}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(c.GhostIconButton,{"aria-label":t?n.expandAriaLabel:n.collapseAriaLabel,"aria-expanded":!t,"aria-controls":r,size:c.ElementSize.Small,icon:s.jsx(i,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:a,className:Dt}),s.jsx(c.GhostIconButton,{"aria-label":n.closeAriaLabel,size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Dt})]})]})},xn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return s.jsx(c.Tooltip,{tooltip:e,asChild:!0,children:s.jsx("span",{className:Dt,role:"img","aria-label":e,tabIndex:0,children:s.jsx(r,{size:f.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Fr=2,$r=(f.DIAL_ICON_SIZE.SM-Fr)/2,bn=2*Math.PI*$r,fp=({percent:e,label:t,className:r})=>{const n=Math.min(100,Math.max(0,Math.round(e))),a=f.DIAL_ICON_SIZE.SM/2;return s.jsx("span",{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,className:f.mergeClasses("flex",r),children:s.jsxs("svg",{width:f.DIAL_ICON_SIZE.SM,height:f.DIAL_ICON_SIZE.SM,viewBox:`0 0 ${f.DIAL_ICON_SIZE.SM} ${f.DIAL_ICON_SIZE.SM}`,className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:a,cy:a,r:$r,fill:"none",strokeWidth:Fr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:$r,fill:"none",strokeWidth:Fr,strokeLinecap:"round",strokeDasharray:bn,strokeDashoffset:bn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},pp=({item:e,labels:t,onCancel:r})=>{const n=e.status===we.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(ys,{type:Le.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===we.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(fp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===we.Success&&s.jsx("span",{className:Dt,role:"img","aria-label":t.successLabel,children:s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===we.Warning&&s.jsx(xn,{message:e.message||t.warningMessage,isError:!1}),e.status===we.Failed&&s.jsx(xn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},hp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===we.InProgress?0:100)),0)/e.length),mp=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,gp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=Ba,className:i,bodyClassName:l})=>{const[d,u]=g.useState(!1),[h,p]=g.useState(!1),m=g.useId(),x={...za,...a},y=t.filter(S=>S.status===we.InProgress).length,v=y>0,b=t.some(S=>S.status===we.Failed),C=t.length>0&&t.every(S=>S.status===we.Success),I=g.useCallback(()=>{v?p(!0):r()},[v,r]),N=g.useCallback(()=>{p(!1),r()},[r]),w=g.useCallback(()=>{u(S=>!S)},[]);return g.useEffect(()=>{if(!C||o<=0)return;const S=setTimeout(r,o);return()=>clearTimeout(S)},[C,o,r]),t.length===0?null:s.jsxs("div",{role:"status","aria-live":"polite",className:f.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,c.DIAL_KIT_CLASS.transferQueue),children:[s.jsx(up,{title:e,isCollapsed:d,itemsId:m,labels:x,onToggleCollapse:w,onClose:I}),d&&v&&s.jsx(Tn,{value:hp(t),size:c.ElementSize.Small,"aria-label":x.queueProgressAriaLabel,"aria-valuetext":x.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:m,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(S=>s.jsx(pp,{item:S,labels:x,onCancel:n},S.id))}),s.jsx(Ea,{open:h,header:x.closeConfirmHeader,description:mp(b,x),confirmLabel:x.closeConfirmLabel,cancelLabel:x.closeCancelLabel,variant:ct.Danger,onConfirm:N,onClose:()=>p(!1)})]})};exports.BASE_ICON_PROPS=f.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=f.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=f.DIAL_ICON_SIZE;exports.DIAL_KIT_ICON_STROKE=f.DIAL_KIT_ICON_STROKE;exports.mergeClasses=f.mergeClasses;exports.ButtonAppearance=c.ButtonAppearance;exports.ButtonVariant=c.ButtonVariant;exports.CaptionText=c.CaptionText;exports.Checkbox=c.Checkbox;exports.CheckboxBox=c.CheckboxBox;exports.CloseButton=c.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=c.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=c.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=c.DIAL_KIT_CLASS;exports.DangerIconButton=c.DangerIconButton;exports.DateCellRenderer=c.DateCellRenderer;exports.DialIcon=c.DialIcon;exports.Dropdown=c.Dropdown;exports.DropdownItemType=c.DropdownItemType;exports.DropdownTrigger=c.DropdownTrigger;exports.DropdownType=c.DropdownType;exports.ElementSize=c.ElementSize;exports.EllipsisTooltip=c.EllipsisTooltip;exports.ErrorText=c.ErrorText;exports.GRID_ALIGN_RIGHT_CLASS=c.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=c.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=c.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=c.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=c.GRID_THEME_PARAMS;exports.GhostIconButton=c.GhostIconButton;exports.Grid=c.Grid;exports.GridAppearance=c.GridAppearance;exports.GridColorScheme=c.GridColorScheme;exports.GridSelectionMode=c.GridSelectionMode;exports.Highlight=c.Highlight;exports.IconButton=c.IconButton;exports.InfoButton=c.InfoButton;exports.Input=c.Input;exports.InteractiveTooltip=c.InteractiveTooltip;exports.InteractiveTooltipTrigger=c.InteractiveTooltipTrigger;exports.Label=c.Label;exports.MenuItem=c.MenuItem;exports.MenuItemMark=c.MenuItemMark;exports.NeutralIconButton=c.NeutralIconButton;exports.NoDataContent=c.NoDataContent;exports.PrimaryIconButton=c.PrimaryIconButton;exports.Radio=c.Radio;exports.Search=c.Search;exports.StaticIconButton=c.StaticIconButton;exports.ThemeScope=c.ThemeScope;exports.Tooltip=c.Tooltip;exports.TooltipContainer=c.TooltipContainer;exports.TooltipContent=c.TooltipContent;exports.TooltipPlacement=c.TooltipPlacement;exports.TooltipTrigger=c.TooltipTrigger;exports.baseColumnComparator=c.baseColumnComparator;exports.checkColDefsChanges=c.checkColDefsChanges;exports.convertToDate=c.convertToDate;exports.useThemeScope=c.useThemeScope;exports.EditorThemes=vn.EditorThemes;exports.LazyMarkdownEditor=vn.LazyMarkdownEditor;exports.AVATAR_PALETTE=La;exports.Accordion=Ta;exports.AccordionCaretPosition=tr;exports.AnalyticsBar=Ut;exports.AnalyticsBarGroup=vu;exports.AnalyticsCard=bu;exports.AnalyticsCardVariant=Ue;exports.AnalyticsHistogram=Cu;exports.AutocompleteTagInput=Bf;exports.Avatar=ka;exports.AvatarColor=Be;exports.AvatarShape=dt;exports.Badge=bs;exports.BadgeColor=je;exports.BadgeVariant=ke;exports.BottomSheet=Cf;exports.Breadcrumbs=cu;exports.BreadcrumbsSize=qe;exports.Button=Qe;exports.ButtonDropdown=fu;exports.Calendar=Zd;exports.CalendarMode=xe;exports.CardShell=pd;exports.CollapsibleSidebar=Vf;exports.ConditionalResizableContainer=ip;exports.ConfirmationPopup=Ea;exports.ConfirmationPopupVariant=ct;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=At;exports.DEFAULT_TRANSFER_QUEUE_LABELS=za;exports.DangerButton=Hc;exports.DialAccordion=wn;exports.DialAnalyticsBar=Wt;exports.DialAnalyticsBarGroup=oo;exports.DialAnalyticsCard=ao;exports.DialAnalyticsErrorTag=Gr;exports.DialAnalyticsHistogram=uo;exports.DialBreadcrumb=Bo;exports.DialBreadcrumbItem=vt;exports.DialButton=Tt;exports.DialCaptionText=Hr;exports.DialCloseButton=Ln;exports.DialDangerButton=zn;exports.DialDangerIconButton=An;exports.DialDropdown=qt;exports.DialEllipsisTooltip=it;exports.DialErrorText=$e;exports.DialFileNodeType=Fe;exports.DialFilePermission=oa;exports.DialFileResourceType=os;exports.DialGhostButton=Fo;exports.DialGhostIconButton=On;exports.DialIconButton=Ot;exports.DialInput=$n;exports.DialItemType=Le;exports.DialLabel=Zr;exports.DialLabelledText=vo;exports.DialLinkButton=zo;exports.DialLoadFileArea=na;exports.DialLoadFileAreaField=tc;exports.DialLoader=Et;exports.DialNeutralButton=Bn;exports.DialNeutralIconButton=Do;exports.DialNoDataContent=bo;exports.DialPrimaryButton=Xr;exports.DialPrimaryIconButton=wo;exports.DialRemoveButton=Fn;exports.DialSecondaryIconButton=To;exports.DialSteps=xo;exports.DialSuccessIconButton=Ao;exports.DialTabs=Ro;exports.DialTag=Sn;exports.DialTertiaryIconButton=Eo;exports.DialTooltip=Se;exports.DialTooltipContainer=Kr;exports.DialTooltipContent=Wr;exports.DialTooltipTrigger=Vr;exports.EDITABLE_CONTAINER_ATTRIBUTE=as;exports.EntityIdentity=Ra;exports.EntityType=pe;exports.ErrorMessageNotification=yd;exports.ErrorToastNotification=hd;exports.FabButton=du;exports.FileDropzone=cf;exports.FileIcon=ys;exports.FileName=Oa;exports.FilterChips=lf;exports.FlexibleActionsDirection=aa;exports.FolderName=yf;exports.FolderPath=qd;exports.FormSection=dp;exports.FormSectionVariant=ot;exports.GeneralMessageNotification=jd;exports.GeneralToastNotification=vd;exports.GhostButton=ps;exports.InfoMessageNotification=Cd;exports.InfoToastNotification=md;exports.InlineSelect=pu;exports.InlineSelectTrigger=Da;exports.JsonSchemaType=H;exports.LinkButton=Vc;exports.LoadingMessageNotification=Nd;exports.LoadingToastNotification=bd;exports.MultiSelectTags=It;exports.NOT_ALLOWED_SPACES=is;exports.NOT_ALLOWED_SPACES_REGEXP=fc;exports.NOT_ALLOWED_SYMBOLS=la;exports.NOT_ALLOWED_SYMBOLS_REGEXP=uc;exports.NeutralButton=fs;exports.Notification=xs;exports.NotificationType=fe;exports.NotificationVariant=te;exports.NumberInput=gs;exports.OutlinedButton=Gc;exports.PasswordInput=ga;exports.Popup=vs;exports.PopupSize=Ge;exports.PrimaryButton=ha;exports.ProgressBar=Tn;exports.RadioGroup=wt;exports.RadioGroupOrientation=_e;exports.RadioGroupPopupField=Wu;exports.ResizableContainer=Pa;exports.ResizableContainerSide=St;exports.ResizeHandle=op;exports.SchemaDisplayMode=ur;exports.SchemaOrientation=fr;exports.SchemaRenderer=ld;exports.SchemaRendererVariant=at;exports.ScreenResolution=Xt;exports.SegmentedControl=tf;exports.Select=Ke;exports.SelectedEntityCard=Ef;exports.SharedEntityIndicator=Aa;exports.SideDrawer=Af;exports.Skeleton=Vt;exports.SkeletonAvatarShape=Yt;exports.SkeletonAvatarSize=yt;exports.SkeletonVariant=Ae;exports.Slider=Kf;exports.Spinner=Ve;exports.StarterButton=Wc;exports.StateScreen=lp;exports.StepStatus=be;exports.SuccessMessageNotification=Id;exports.SuccessToastNotification=gd;exports.Switch=xa;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Ba;exports.TabOrientation=Ze;exports.TabStatus=lt;exports.TabView=Ye;exports.Tabs=nf;exports.Tag=Oe;exports.TagAppearance=De;exports.TagInput=Rf;exports.Textarea=ma;exports.TextareaResize=hs;exports.ToggleIconButton=Vu;exports.TransferQueue=gp;exports.TransferQueueItemStatus=we;exports.WarningMessageNotification=Sd;exports.WarningToastNotification=xd;exports.editableContainerProps=rc;exports.extractInitials=_a;exports.getTimezoneLabel=ia;exports.matchesAccept=zr;exports.useEditableItem=sc;exports.wrapInRootFolder=cc;
4
+ |\r| )|[\0-]`,dc=`[${la.replace(/\\/g,"\\\\")}]`,uc=new RegExp(`${dc}|${is}`),fc=new RegExp(is);var at=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(at||{}),ur=(e=>(e.Select="select",e.Radio="radio",e))(ur||{}),fr=(e=>(e.Row="row",e.Column="column",e))(fr||{}),H=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(H||{});const pc={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"};function Ps(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function X(e,t,r=0){if(r>10)return e;let n=e;if(n.$ref){const a=n.$ref.replace(/^#\//,"").split("/");let o=t;for(const h of a)o=o?.[h];if(!o||typeof o!="object")return e;const{$ref:i,...l}=n,d=o;n={...d.$ref?X(d,t,r+1):d,...l}}if(n.allOf&&n.allOf.length>0){const{allOf:a,...o}=n;let i={};for(const l of a)i=Ps(i,X(l,t,r+1));n=Ps(i,o)}return n}function ca(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const n=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return n!==a?n-a:t.index-r.index}).map(({entry:t})=>t)}function pr(e){return e==null||e===""}function Xe(e){return e.type===H.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Jt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const ls=e=>`"${e}" is required`;function da(e,t){return e.type===H.Null?"null":e.$ref?X(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function He(e,t,r=0){if(r>15)return;const n=X(e,t);if("default"in n)return n.default;if(n.discriminator&&n.oneOf){const a=Object.keys(n.discriminator.mapping)[0];if(a){const o=X({$ref:n.discriminator.mapping[a]},t);return{...He(o,t,r+1)??{},[n.discriminator.propertyName]:a}}}if(Xe(n)){if(n.properties){const a={};let o=!1;for(const[i,l]of Object.entries(n.properties)){const d=He(l,t,r+1);d!==void 0&&(a[i]=d,o=!0)}return o?a:void 0}if(n.additionalProperties!=null&&n.additionalProperties!==!1)return{}}}function ze(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=X(t,r);if(i.anyOf){const u=i.anyOf.filter(h=>h.type!==H.Null);return e!=null&&u.length===1?ze(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,h=e?.[u];if(h&&i.discriminator.mapping[h]){const p={$ref:i.discriminator.mapping[h]},m=X(p,r);return ze(e,m,r,n,a+1)}return o}if(i.type===H.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let u=0;u<e.length;u++){const h=ze(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...h)}return o}if(!Xe(i))return o;const l=i.required??[],d=e;for(const u of l){const h=i.properties?.[u];if(h&&X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,m=d?.[u];if(pr(m)){const x=h?.title??Jt(u);o.push({path:p,message:ls(x)})}}if(d&&i.properties)for(const[u,h]of Object.entries(i.properties)){if(X(h,r).isHidden)continue;const p=n?`${n}.${u}`:u,m=d[u];if(m!=null){const x=ze(m,h,r,p,a+1);o.push(...x)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[h,p]of Object.entries(d)){const m=n?`${n}.${h}`:h,x=ze(p,u,r,m,a+1);o.push(...x)}}return o}function cs(e,t,r){const n=X(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Xe(n)&&n.properties){const a=Object.entries(n.properties).filter(([,d])=>!X(d,r).isHidden),o=a.length,i=e;return`${a.filter(([d])=>{const u=i?.[d];return u!=null&&u!==""}).length}/${o} fields`}return""}function hc(e,t,r){if(e==null){const n=t.findIndex(a=>a.type===H.Null);return n>=0?n:0}if(Array.isArray(e)){const n=t.findIndex(a=>X(a,r).type===H.Array);return n>=0?n:0}if(typeof e=="boolean"){const n=t.findIndex(a=>X(a,r).type===H.Boolean);return n>=0?n:0}if(typeof e=="number"){const n=t.findIndex(a=>{const o=X(a,r);return o.type===H.Number||o.type===H.Integer});return n>=0?n:0}if(typeof e=="string"){const n=t.findIndex(a=>X(a,r).type===H.String);return n>=0?n:0}if(typeof e=="object"){const n=e;for(let a=0;a<t.length;a++){const o=X(t[a],r);if(o.discriminator&&o.discriminator.propertyName in n)return a}for(let a=0;a<t.length;a++){const o=X(t[a],r);if(Xe(o)||o.oneOf)return a}return 0}return 0}function mc(e,t,r){if(t&&typeof e=="object"&&e!==null){const n=e[t];if(n)return`Item ${r+1}: ${n}`}if(typeof e=="object"&&e!==null){const n=e,a=n.name??n.title??n.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function ua(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case H.String:return"";case H.Boolean:return!1;case H.Array:return[];case H.Integer:case H.Number:return;default:return{}}}const gc=[H.String,H.Number,H.Boolean,H.Null,H.Object,H.Array];function xc(e){return Array.isArray(e)?H.Array:typeof e=="object"&&e!==null?H.Object:typeof e=="boolean"?H.Boolean:typeof e=="number"?H.Number:e===null?H.Null:H.String}const bc={[H.String]:"",[H.Number]:0,[H.Boolean]:!1,[H.Null]:null,[H.Object]:{},[H.Array]:[]};function vc(e){return bc[e]}const fa=g.createContext(null),Re=()=>{const e=g.useContext(fa);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},Nt=(e,t=new Set,r=!1,n=!1)=>{if(!r||t.has(e))return!0;if(!n)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},pa=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:n})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+n;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+n;return o};var De=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(De||{});const yc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",Cc={[De.Outlined]:"dial-tiny-text",[De.Selectable]:"dial-tiny-text",[De.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},Ic={[De.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[De.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[De.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},Sc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Nc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Le=({label:e,icon:t,appearance:r=De.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:h,onKeyDown:p,...m})=>{const x=r===De.Selectable,y=!!u&&!a,v=o&&!!h&&!a,b=x&&n,C=I=>{p?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...m,role:y?"button":m.role,tabIndex:y?0:m.tabIndex,"aria-disabled":a||void 0,"aria-pressed":x&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(yc,b?"dial-tiny-semi-text":Cc[r],Ic[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[Sc,Nc],l,c.DIAL_KIT_CLASS.tag),children:[t&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),s.jsx("span",{className:"truncate",title:d??e,children:e}),v&&s.jsx(c.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:c.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),h?.(I)}})]})},er="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",It=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:n})=>s.jsx(s.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return s.jsx(Le,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(er,n)},a)})}),jc=8,wc=e=>e.stopPropagation(),Dc=e=>{e.key!=="Escape"&&e.stopPropagation()},Tc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=g.useRef(null),a=g.useRef(null),[o,i]=g.useState(null),l=g.useCallback(()=>{const p=n.current,m=a.current;if(!p||!m)return;const x=Array.from(m.children,v=>v.offsetWidth),y=x.pop()??0;i(pa({tagWidths:x,overflowChipWidth:y,availableWidth:p.clientWidth,gap:jc}))},[]);g.useLayoutEffect(()=>{l()},[l,e,t]),g.useLayoutEffect(()=>{const p=n.current;return p?c.observeElementSize(p,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),h=t.slice(d);return s.jsxs("div",{ref:n,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[s.jsx(It,{options:e,selectedValues:u,handleRemoveTag:r,tagClassName:"min-w-0"}),h.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:wc,onKeyDown:Dc,children:s.jsx(It,{options:e,selectedValues:h,handleRemoveTag:r})}),children:s.jsx(Le,{label:`+${h.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${h.length} more selected: ${h.map(p=>e.find(m=>m.value===p)?.label??p).join(", ")}`,title:"",className:f.mergeClasses(er,"shrink-0")})}),s.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[s.jsx(It,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),s.jsx(Le,{label:`+${t.length}`,className:f.mergeClasses(er,"shrink-0")})]})]})},Ec=f.mergeClasses("w-full flex flex-col"),Ac=c.overlayItemClassName,Lc="!max-w-[var(--reference-width)]",Oc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),_c=c.overlayGap,kc=c.overlaySubMenuListClassName,Rc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Mc="text-secondary transition-transform",Pc=8,Bc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),zc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fc=({opt:e,selectedValues:t,mark:r=c.MenuItemMark.Tint,onSelect:n})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:d,getReferenceProps:u,getFloatingProps:h}=c.useSubMenuFloating(_c,"listbox",!!e.disabled),p=e.children?.some(x=>t.includes(x.value)),m=s.jsx(c.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Rc,...u()});return s.jsxs(B.FloatingNode,{id:o,children:[e.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:m}):m,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:h,role:"listbox",surfaceClassName:kc,children:e.children.map(x=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(x.value),"aria-disabled":!!x.disabled,disabled:x.disabled,mark:r,selected:t.includes(x.value),ellipsisLabel:!0,icon:x.icon,label:x.labelNode??x.label,rightControl:x.rightControl,onClick:()=>!x.disabled&&n(x.value)});return s.jsx(g.Fragment,{children:x.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:x.interactiveTooltip.placement,content:x.interactiveTooltip.content,contentClassName:x.interactiveTooltip.contentClassName,children:y}):y},x.value)})})]})},Ke=({options:e,multiple:t=!1,id:r,value:n,defaultValue:a,size:o=c.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:d="Select...",labelProps:u,error:h,caption:p,ariaLabel:m,ariaDescribedBy:x,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:N="Select all",collapseTagOverflow:w=!1,selectedOptionMark:S=c.MenuItemMark.Tint,emptyStateTitle:T="No options available",emptyStateDescription:L,emptyStateIcon:E,disabled:D=!1,className:j,fieldClassName:A,listClassName:_,closable:P=!1,header:O,footer:R,onClose:M,onChange:$,dismissRef:V,onFooterClick:K,open:W,onOpenChange:G,onSearchQueryChange:J,customMultiSelectTagsRenderer:re})=>{const Y=g.useId(),q=r||Y,se=`list-${q}`,le=h?`${q}-error`:void 0,oe=!h&&p?`${q}-caption`:void 0,me=o===c.ElementSize.Small,[ve,k]=g.useState(!1),U=W!==void 0,de=U?!!W:ve,ne=g.useCallback(z=>{U||k(z),G?.(z)},[U,G]),[ge,Je]=g.useState(""),ht=g.useCallback(z=>{z!==ge&&(Je(z||""),J?.(z||""))},[J,ge]),mt=n!==void 0,[Q,ce]=g.useState(a),he=mt?n:Q,ue=g.useMemo(()=>t?Array.isArray(he)?he:[]:typeof he=="string"?[he]:[],[he,t]),Ot=g.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(ae=>ae.label.toLowerCase().includes(z)):e},[e,ge]);g.useEffect(()=>{de||ht("")},[de,ht]);const Me=g.useCallback(z=>{mt||ce(z),$?.(z)},[mt,$]),hr=g.useCallback(z=>{if(t){const ae=new Set(ue);ae.has(z)?ae.delete(z):ae.add(z),Me(Array.from(ae));return}Me(z),ne(!1)},[t,Me,ne,ue]),_t=g.useCallback((z,ae)=>{if(z.stopPropagation(),!t){Me("");return}const Mt=ue.filter(Za=>Za!==ae);Me(Mt)},[t,ue,Me]),Te=g.useMemo(()=>Ot.filter(z=>!z.disabled),[Ot]),mr=g.useMemo(()=>Te.filter(z=>ue.includes(z.value)).length,[Te,ue]),{allSelectedInFiltered:gr,someSelectedInFiltered:Fa}=g.useMemo(()=>{const z=Te.length>0&&mr===Te.length;return{allSelectedInFiltered:z,someSelectedInFiltered:mr>0&&!z}},[Te,mr]),$a=g.useCallback(()=>{if(!(!t||Te.length===0))if(gr){const z=new Set(Te.map(ae=>ae.value));Me(ue.filter(ae=>!z.has(ae)))}else{const z=new Set(ue);Te.forEach(ae=>z.add(ae.value)),Me(Array.from(z))}},[gr,t,Te,ue,Me]),kt=ue.length>0,Rt=!t&&kt?ue[0]:void 0,Ne=g.useMemo(()=>Rt?e.find(z=>z.value===Rt)??e.flatMap(z=>z.children??[]).find(z=>z.value===Rt):void 0,[e,Rt]),gt=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Ha=c.useIsMobileScreen(),xr=t&&w&&!re&&!Ha,xt=g.useMemo(()=>t?kt?xr?s.jsx(Tc,{options:e,selectedValues:ue,handleRemoveTag:_t}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:re?.(e,ue,_t)??s.jsx(It,{options:e,selectedValues:ue,handleRemoveTag:_t})}):null:!Ne||!Ne.labelNode&&!Ne.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:Ne.labelNode??gt}),Ne.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:Ne.description})]}),[xr,re,_t,kt,t,e,gt,ue,Ne]),Ka=t||xt?"":gt||(l&&n?l:""),Wa=typeof u?.label=="string"?u.label:void 0,Va=xt?[c.resolveAccessibleName(m,Wa),t?ue.map(z=>e.find(ae=>ae.value===z)?.label??z).join(", "):gt].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(m);g.useImperativeHandle(V,()=>({dismiss:()=>{ne(!1)}}));const Ga=g.useCallback(z=>{D||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ne(!0))},[D,de,ne]),Ua=()=>s.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:Ec,children:[O&&s.jsx(s.Fragment,{children:typeof O=="function"?O():O}),(y||P)&&(e.length>Pc||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${q}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ht(z),value:ge,iconBefore:Bc,containerClassName:"w-full"}),P&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:zc,onClick:z=>{M?.(z),ne(!1)}})]}),t&&C&&Te.length>0&&s.jsx("div",{className:f.mergeClasses(Ac,"mt-2"),children:s.jsx(c.Checkbox,{id:`${q}-selectAll`,labelProps:{label:N},isSelected:gr,isIndeterminate:Fa,onChange:$a})}),s.jsx("div",{role:"none",className:Oc,children:Ot.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:E,title:T,description:L})}):Ot.map(z=>{const ae=ue.includes(z.value);if(z.children?.length)return s.jsx(Fc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:S,onSelect:hr},z.value);const Mt=t?s.jsx(c.MenuItem,{id:`${q}-${z.value}`,role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:ae,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>hr(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":ae,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:S,selected:ae,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&hr(z.value)});return s.jsx(g.Fragment,{children:z.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:Mt}):Mt},z.value)})}),R&&s.jsx("div",{onClick:z=>{K?.(z),K&&ne(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",j,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:q}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ne,disabled:D,closable:P,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(Lc,_),className:"w-full",renderOverlay:Ua,children:s.jsx(c.Input,{id:q,size:o,disabled:D,invalid:I,value:Ka,placeholder:xt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:me?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(Mc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":se,"aria-autocomplete":"none","aria-label":Va,"aria-describedby":[x,le,oe].filter(Boolean).join(" ")||void 0,"aria-invalid":h||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!D&&"cursor-pointer",t&&kt&&!xr&&["!h-auto flex-wrap py-2",me?"min-h-[24px]":"min-h-[40px]"],A),className:f.mergeClasses("cursor-pointer",xt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ga,children:xt})}),s.jsx(c.ErrorText,{id:le,text:h}),!h&&s.jsx(c.CaptionText,{id:oe,text:p})]})]})},Bs={[H.Array]:[],[H.String]:"",[H.Boolean]:!1,[H.Integer]:0,[H.Number]:0},$c=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=e.anyOf??[],h=hc(t,u,i),p=u[h],m=!p||X(p,i).type===H.Null,x=y=>{const v=X(u[y],i);if(v.type===H.Null){r(null);return}const b=He(v,i);if(b!==void 0){r(b);return}const C=typeof v.type=="string"?v.type:"";r(C in Bs?Bs[C]:{})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:da(y,i)})),value:String(h),disabled:d,onChange:y=>x(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!m&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(We,{schema:p,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Qe=({label:e,variant:t,appearance:r=c.ButtonAppearance.Solid,size:n=c.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:d="button",tooltipProps:u,href:h,target:p,rel:m,disabled:x,...y})=>{const v=f.mergeClasses("dial-kit-base-button",t&&c.getButtonClassNames(t,r),n===c.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",n===c.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",n===c.ElementSize.Small&&"dial-kit-base-button-small",r!==c.ButtonAppearance.Link&&(n===c.ElementSize.Small?"px-2":"px-4"),n!==c.ElementSize.Small&&r!==c.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),b=e?void 0:u?.tooltip,C=c.resolveAccessibleName(typeof e=="string"?e:void 0,y["aria-label"],b),I=s.jsxs(s.Fragment,{children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:o,children:e}),s.jsx(c.DialIcon,{icon:i})]}),N=y,w=h!==void 0?s.jsx("a",{...N,href:x?void 0:h,target:p,rel:m??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":x||void 0,tabIndex:x?-1:N.tabIndex,onClick:x?void 0:N.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(x,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:w}):w},ds=(e,t)=>({appearance:n,...a})=>s.jsx(Qe,{...a,variant:e,appearance:n||t}),us=(e,t)=>({variant:n,...a})=>s.jsx(Qe,{...a,variant:n||t,appearance:e}),ha=ds(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),fs=ds(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Hc=ds(c.ButtonVariant.Danger,c.ButtonAppearance.Solid),rt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},Kc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Wc=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Kc,iconAfter:r,style:n,...a})=>{const o=`dial-kit-starter-gradient-${g.useId().replace(/[^\w-]/g,"")}`,i=s.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:o,x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:rt.from}),s.jsx("stop",{offset:"1",stopColor:rt.to})]})})}),l=d=>s.jsxs(s.Fragment,{children:[i,d]});return s.jsx(Qe,{...a,variant:c.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...n}})},Vc=us(c.ButtonAppearance.Link,c.ButtonVariant.Primary),ps=us(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Gc=us(c.ButtonAppearance.Outlined,c.ButtonVariant.Neutral),jt=({title:e,description:t,summary:r,errorCount:n=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:d="Remove item"})=>{const[u,h]=g.useState(l),p=g.useId(),m=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",m?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",m?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?p:void 0,onClick:()=>h(x=>!x),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform",!u&&"-rotate-90")}),s.jsx("span",{className:f.mergeClasses("truncate",m?"dial-small-semi-text":"dial-small-text"),children:e})]}),s.jsx(c.InfoButton,{caption:t}),r&&s.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:r}),n>0?s.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),n," error",n>1?"s":""]}):s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":d,onClick:i,className:"shrink-0"})]}),u&&s.jsx("div",{id:p,className:f.mergeClasses("border-t border-tertiary",m?"p-4":"p-3"),children:o})]})},Uc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=Re(),[u,h]=g.useState(),p=Array.isArray(t)?t:[],m=e.items;if(!m)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const x=X(m,o),y=x.discriminator,v=y?Object.keys(y.mapping).map(w=>({value:w,label:w})):[],b=u??v[0]?.value,C=()=>{let w;if(y&&b){const S=X({$ref:y.mapping[b]},o);w={...He(S,o)??{},[y.propertyName]:b}}else w=He(x,o)??ua(x);r([...p,w])},I=w=>{r(p.filter((S,T)=>T!==w))},N=(w,S)=>{r(p.map((T,L)=>L===w?S:T))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((w,S)=>{const T=mc(w,y?.propertyName,S),L=ze(w,x,o,`${n.join(".")}[${S}]`);return s.jsx(jt,{title:T,level:a,summary:cs(w,x,o),errorCount:L.length,onRemove:l?void 0:()=>I(S),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${T}`,children:s.jsx(We,{schema:m,value:w,onChange:E=>N(S,E),path:[...n,String(S)],level:a+1,ariaLabel:T})},S)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx(Ke,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:w=>h(typeof w=="string"?w:w[0]),className:"max-w-[280px] flex-1"}),s.jsx(ps,{label:i.addItem,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})]})]})};var hs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(hs||{});const zs={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Zc=e=>typeof e=="boolean"?zs[e?"both":"none"]:zs[e],ma=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":h,"aria-invalid":p,...m})=>{const x=g.useId(),y=d??x,v=n?`${y}-error`:void 0,b=!n&&l?`${y}-caption`:void 0,C=f.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u&&"dial-kit-input-error",m.disabled&&"dial-kit-input-disable",Zc(o),e);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",a),children:[i&&s.jsx(c.Label,{...i,htmlFor:y}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("textarea",{id:y,value:t||"",className:C,onChange:I=>r?.(I.currentTarget.value),"aria-describedby":[h,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":p??(n||u?!0:void 0),...m}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},Fs=e=>{try{return JSON.parse(e),!0}catch{return!1}},ms=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=Re(),[i,l]=g.useState(()=>JSON.stringify(e,null,2)??""),d=!Fs(i),u=h=>{l(h),Fs(h)&&t(JSON.parse(h))};return s.jsx(ma,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:hs.Vertical,className:"font-mono !whitespace-pre"})},Yc=/^0+\.(\d+)?$/,qc=/^0+/,Xc=[".","-","+","e","E"],$s=e=>!e||e==="-"?e:String(e).match(Yc)?String(e).replace(qc,"0"):Number(e),gs=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Xc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const h=u.clipboardData.getData("text"),p=h.replace(/\D/g,"");if(p!==h&&(u.preventDefault(),p)){const m=u.currentTarget,x=m.selectionStart??0,y=m.selectionEnd??0,v=m.value.slice(0,x)+p+m.value.slice(y);t?.($s(v))}}o?.(u)};return s.jsx(c.Input,{...i,wrapperClassName:f.mergeClasses(i.wrapperClassName,c.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:n,onChange:u=>t?.($s(u)),onKeyDown:l,onPaste:d})},ga=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,isToggleHidden:n,size:a=c.ElementSize.Standard,...o})=>{const[i,l]=g.useState(!1),d=!r&&!n,u=i&&d;return g.useEffect(()=>{d||l(!1)},[d]),s.jsx(c.Input,{...o,wrapperClassName:f.mergeClasses(o.wrapperClassName,c.DIAL_KIT_CLASS.passwordInput),size:a,disabled:r,type:u?"text":"password",iconAfter:d?s.jsx(c.GhostIconButton,{size:c.ElementSize.Small,"aria-label":u?t:e,"aria-pressed":u,icon:u?s.jsx(F.IconEyeOff,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconEye,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>l(h=>!h)}):void 0})},Qc="flex flex-col gap-2",Jc="flex",ed="mt-2 ml-[26px]",td={[_e.Column]:"flex-col gap-y-3",[_e.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},wt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=_e.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:h,className:p,optionsClassName:m,radioClassName:x,contentClassName:y})=>{const v=g.useId(),b=a??v,C=`${b}-label`,I=d?`${b}-error`:void 0,N=!d&&u?`${b}-caption`:void 0,w=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(Qc,p,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":w?C:void 0,"aria-label":w?void 0:c.resolveAccessibleName(h),"aria-describedby":[I,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Jc,td[o],m),children:e.map(S=>{const T=S.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${S.value}`,name:n??b,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:T,disabled:l||S.disabled,onChange:r,className:x}),T&&S.content?s.jsx("div",{className:f.mergeClasses(ed,y),children:S.content}):null]},S.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:N,text:u})]})},xa=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=g.useId(),u=e??d,h=o?`${u}-caption`:void 0,p=g.useCallback(m=>{a?.(m.target.checked)},[a]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("group/choice flex items-center gap-2",i,c.DIAL_KIT_CLASS.switch),children:[s.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:n,onChange:p,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":h,className:"peer sr-only"}),s.jsx("label",{htmlFor:u,className:f.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",n?"cursor-not-allowed bg-control-disable-primary":f.mergeClasses("cursor-pointer",r?"bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover":"bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong")),children:s.jsx("span",{className:f.mergeClasses("size-3.5 shrink-0 rounded-full",n?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&s.jsx(c.Label,{size:c.ElementSize.Standard,...t,htmlFor:u,className:f.mergeClasses("py-[1px]",n?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&s.jsx("span",{id:h,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Hs=e=>typeof e=="string"?e:e[0],wr=e=>e!=null?String(e):"",rd=e=>e!==void 0?Number(e):void 0,ba=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:h}=Re(),p=e.const!==void 0,m=Array.isArray(e.enum)?e.enum:[],x=m.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===H.String||e.type===void 0)){const v=(e.acceptableResourceTypes??[]).flatMap(b=>{const C=h?.[b];return Array.isArray(C)?C.map(I=>{const N=String(I);return{value:N,label:N}}):[]});return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(Hs(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(p)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(x&&e.enumDisplay===ur.Radio)return s.jsx(wt,{id:a,ariaLabel:o,items:m.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===fr.Row?_e.Row:_e.Column,disabled:d,onChange:v=>r(v)});if(x)return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:m.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Hs(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case H.Boolean:return s.jsx(xa,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case H.Integer:case H.Number:return s.jsx(gs,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===H.Integer,value:wr(t),invalid:n,disabled:d,onChange:v=>r(rd(v)),placeholder:e.type===H.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(ga,{id:a,"aria-label":o,"aria-describedby":i,value:wr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u}):s.jsx(c.Input,{id:a,"aria-label":o,"aria-describedby":i,value:wr(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Ks=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),va=e=>!!(e.oneOf||e.anyOf||e.type===H.Array||Xe(e)),sd={[H.String]:"entryTypeString",[H.Number]:"entryTypeNumber",[H.Boolean]:"entryTypeBoolean",[H.Null]:"entryTypeNull",[H.Object]:"entryTypeObject",[H.Array]:"entryTypeArray"},Ws=e=>typeof e=="string"?e:e[0],nd=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:h=!1,inputClassName:p,defaultExpanded:m=!0,touchedPaths:x,markTouched:y,skipUntouched:v}=Re(),[b,C]=g.useState(e.key),[I,N]=g.useState(()=>xc(e.value)),w=va(t),S=r&&(I===H.Object||I===H.Array),T=r&&I===H.Null,L=r&&I===H.Boolean,E=w||S,D=[...i,e.id,"key"].join("."),j=Nt(D,x,v)&&e.key==="",A=e.key||u.valueColumnHeader,_=K=>{a(vc(K)),N(K)},P=g.useMemo(()=>gc.map(K=>({value:K,label:u[sd[K]]})),[u]),O=g.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>T?s.jsx(c.Input,{"aria-label":A,value:"null",disabled:!0}):L?s.jsx(Ke,{ariaLabel:A,options:O,value:e.value?"true":"false",disabled:h,onChange:K=>{const W=Ws(K);W&&a(W==="true")}}):s.jsx(ba,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:A}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:E?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:h,invalid:j,error:j?`${u.keyColumnHeader} is required`:void 0,onChange:K=>C(K??""),onBlur:()=>{y?.(D),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:p})}),!E&&s.jsx("div",{className:"min-w-0 flex-1",children:R()}),r&&s.jsx("div",{className:"w-28 shrink-0",children:s.jsx(c.Tooltip,{tooltip:u.entryTypeChangeWarning,triggerClassName:"block",children:s.jsx(Ke,{ariaLabel:u.typeColumnHeader,options:P,value:I,disabled:h,onChange:K=>{const W=Ws(K);W&&_(W)}})})}),!h&&s.jsx(c.DangerIconButton,{size:c.ElementSize.Small,icon:s.jsx(F.IconTrash,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${u.removeFieldAriaLabel}: ${e.key}`:u.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!E)return M;if(S)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(ms,{value:e.value,onChange:a,ariaLabel:A},I)]});const $=[...i,e.key],V=ze(e.value,t,d,$.join("."));return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(jt,{title:e.key,level:l,summary:cs(e.value,t,d),errorCount:V.length+(j?1:0),defaultExpanded:m,children:s.jsx(We,{schema:t,value:e.value,onChange:a,path:$,level:l+1,ariaLabel:A})})]})},ad=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Re(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?X(e.additionalProperties,o):{type:H.String},h=va(u),[p,m]=g.useState(()=>Object.entries(t??{}).map(([b,C])=>Ks(b,C))),x=b=>{m(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>x(p.map((I,N)=>N===b?{...I,...C}:I)),v=()=>{const b=h?He(u,o)??ua(u):"";m(C=>[...C,Ks("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!h&&s.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[s.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),s.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),d&&s.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((b,C)=>s.jsx(nd,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>x(p.filter((I,N)=>N!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(ps,{label:i.addField,iconBefore:s.jsx(F.IconPlus,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:v})})]})},Br=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=Re(),l=X(e,o),d=ca(Object.entries(l.properties??{}).filter(([,p])=>!X(p,o).isHidden)),u=l.required??[],h=t??{};return d.length===0?s.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):s.jsx("div",{className:"flex flex-col gap-4",children:d.map(([p,m])=>{const x=X(m,o);return s.jsx(ya,{schema:m,value:h[p],onChange:y=>r({...h,[p]:y}),path:[...n,p],level:a,required:u.includes(p),label:x.title??m.title??Jt(p)},p)})})},Vs=e=>typeof e=="string"?e:e[0],od=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},id=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=g.useId(),h=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===ur.Radio,m=e.discriminator;if(m){const I=m.propertyName,N=m.mapping,w=E=>X({$ref:N[E]},i),S=typeof t=="object"&&t!==null?t[I]:void 0,T=S?w(S):void 0,L=E=>{const D=He(w(E),i)??{};r({...D,[I]:E})};if(p){const E=e.discriminatorOrientation===fr.Row,D=A=>s.jsx(Br,{schema:od(A,I),value:t,onChange:r,path:n,level:a}),j=s.jsx(wt,{id:u,ariaLabel:h,value:S,onChange:L,disabled:d,orientation:E?_e.Row:_e.Column,items:Object.keys(N).map(A=>{const _=w(A);return{value:A,label:_.title??A,content:E?void 0:D(_)}})});return E?s.jsxs("div",{className:"flex flex-col gap-3",children:[j,T&&D(T)]}):j}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:h,options:Object.keys(N).map(E=>({value:E,label:E})),value:S,placeholder:l.selectTypePlaceholder,disabled:d,onChange:E=>{const D=Vs(E);D&&L(D)},className:"max-w-[280px]"}),T&&s.jsx("div",{className:"pl-3",children:s.jsx(Br,{schema:T,value:t,onChange:r,path:n,level:a})})]})}const x=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=x.findIndex(N=>X(N,i).required?.every(w=>w in t));return I>=0?I:0})(),b=x[v],C=I=>{const N=He(X(x[I],i),i);r(N??null)};return p?s.jsx(wt,{id:u,ariaLabel:h,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:x.map((I,N)=>({value:String(N),label:da(I,i)??`Option ${N+1}`,content:s.jsx(We,{schema:X(I,i),value:t,onChange:r,path:n,level:a,ariaLabel:o})}))}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:h,options:x.map((I,N)=>({value:String(N),label:X(I,i).title??`Option ${N+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(Vs(I))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(We,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},We=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const h=g.useId(),{rootSchema:p,renderField:m,markTouched:x,touchedPaths:y,skipUntouched:v}=Re(),b=X(e,p),C=n.join("."),I=S=>{x?.(C),r(S)},N={schema:b,value:t,onChange:I,path:n,level:a};let w;if(b.oneOf)w=s.jsx(id,{...N,ariaLabel:d});else if(b.anyOf&&b.type!==H.Object)w=s.jsx($c,{...N,ariaLabel:d});else if(Xe(b)){const S=b.additionalProperties!=null&&b.additionalProperties!==!1,T=!b.properties||Object.keys(b.properties).length===0;S&&T?w=s.jsx(ad,{...N}):T&&b.additionalProperties!==!1?w=s.jsx(ms,{value:t,onChange:I,id:l,ariaLabel:d}):w=s.jsx(Br,{...N})}else if(b.type===H.Array)w=s.jsx(Uc,{...N});else{const S=Nt(C,y,v)&&!!o&&pr(t),T=!i&&S?ls(b.title??d??"Field"):void 0;w=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ba,{schema:b,value:t,onChange:I,invalid:S,id:l,ariaLabel:d,ariaDescribedBy:T?h:u}),s.jsx(c.ErrorText,{id:h,text:T})]})}return m?m(n,b,w):w},ya=({schema:e,value:t,onChange:r,path:n,level:a=0,required:o,label:i})=>{const l=g.useId(),{rootSchema:d,defaultExpanded:u=!0,touchedPaths:h,skipUntouched:p}=Re(),m=X(e,d),x=n.join(".");if(Xe(m)||m.type===H.Array){const v=ze(t,m,d,x),b=i??m.title??n[n.length-1]??"Section";return s.jsx(jt,{title:b,description:m.description,level:a,summary:cs(t,m,d),errorCount:Nt(x,h,p,!0)?v.length:0,defaultExpanded:u,children:s.jsx(We,{schema:m,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=Nt(x,h,p)&&o&&pr(t)?ls(i??"Field"):void 0;return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(c.Label,{htmlFor:l,label:i,required:o,caption:m.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(We,{schema:m,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i,ariaDescribedBy:y?`${l}-error`:void 0}),s.jsx(c.ErrorText,{id:`${l}-error`,text:y})]})]})},Gs="dial-small-semi-text text-primary",ld=({schema:e,defaultValue:t,texts:r,className:n,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=at.Sections,onChange:d,onPropertyChange:u,onDefaultValues:h,renderField:p,skipUntouched:m=!1,acceptableResourceTypes:x})=>{const y=g.useMemo(()=>({...pc,...r}),[r]),v=g.useMemo(()=>t||(He(e,e)??{}),[]),[b,C]=g.useState(v),[I,N]=g.useState(()=>new Set),w=g.useCallback(j=>{N(A=>A.has(j)?A:new Set([...A,j]))},[]);g.useEffect(()=>{h?.(v)},[]);const S=(j,A)=>{const _={...b,[j]:A};C(_),d?.(_),u?.(j,A)},T=new Set(Object.keys(e.properties??{})),L=Object.keys(b).filter(j=>!T.has(j)),E=ca(Object.entries(e.properties??{}).filter(([,j])=>!X(j,e).isHidden)),D=e.required??[];return s.jsx(fa.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:x,renderField:p,touchedPaths:I,markTouched:w,skipUntouched:m},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[E.map(([j,A])=>{const _=X(A,e),P=_.title??A.title??Jt(j),O=D.includes(j),R=b[j],M=K=>S(j,K);if(l===at.Flat)return s.jsx(ya,{schema:A,value:R,onChange:M,path:[j],level:0,required:O,label:P},j);if(l===at.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Gs,children:P}),s.jsx(We,{schema:A,value:R,onChange:M,path:[j],level:0,required:O,ariaLabel:P})]},j);const $=ze(R,_,e,j),V=O&&pr(R)?Math.max($.length,1):$.length;return s.jsx(jt,{title:P,description:_.description,level:0,defaultExpanded:o,errorCount:Nt(j,I,m,!0)?V:0,children:s.jsx(We,{schema:A,value:R,onChange:M,path:[j],level:1,required:O,ariaLabel:P})},j)}),L.map(j=>{const A=Jt(j),_=s.jsx(ms,{value:b[j],onChange:P=>S(j,P),ariaLabel:A});return l===at.Sections?s.jsx(jt,{title:A,level:0,defaultExpanded:o,children:_},j):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Gs,children:A}),_]},j)})]})})},cd=e=>({info:s.jsx(F.IconInfoCircleFilled,{size:e.size}),error:s.jsx(F.IconAlertCircleFilled,{size:e.size}),warning:s.jsx(F.IconAlertTriangleFilled,{size:e.size}),success:s.jsx(F.IconCircleCheckFilled,{size:e.size}),loading:s.jsx(Ve,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),dd={[te.Info]:"bg-info text-info",[te.Success]:"bg-success text-success",[te.Warning]:"bg-warning text-warning",[te.Error]:"bg-error text-error",[te.Loading]:"bg-layer-raised text-info",[te.General]:"bg-layer-sunken text-primary"},ud={[te.Info]:"status",[te.Success]:"status",[te.Warning]:"alert",[te.Error]:"alert",[te.Loading]:"status",[te.General]:"status"},fd="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",xs=({variant:e=te.Info,type:t=fe.Toast,title:r,message:n,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:d=!1,onClose:u,children:h,textClassName:p,...m})=>{const x=g.useMemo(()=>cd({size:i,stroke:l})[e],[e,i,l]),y=p??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:ud[e],...m,className:f.mergeClasses(fd,dd[e],t===fe.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===fe.SectionMessage&&e===te.Loading&&"border-secondary",o,c.DIAL_KIT_CLASS.notification),children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:s.jsx(c.DialIcon,{icon:x})}),r?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",y),children:[s.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),s.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:n})]}):s.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:n})]}),a!=null&&s.jsx("div",{className:"flex shrink-0 items-center",children:a}),h,d&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:v=>u?.(v)})]})},pd=({className:e,children:t,...r})=>s.jsx("article",{...r,className:f.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e,c.DIAL_KIT_CLASS.cardShell),children:t}),ft=(e,t)=>({type:n,...a})=>s.jsx(xs,{...a,variant:e,type:n||t}),pt=(e,t)=>({variant:n,...a})=>s.jsx(xs,{...a,variant:n||t,type:e}),hd=ft(te.Error,fe.Toast),md=ft(te.Info,fe.Toast),gd=ft(te.Success,fe.Toast),xd=ft(te.Warning,fe.Toast),bd=ft(te.Loading,fe.Toast),vd=ft(te.General,fe.Toast),yd=pt(fe.SectionMessage,te.Error),Cd=pt(fe.SectionMessage,te.Info),Id=pt(fe.SectionMessage,te.Success),Sd=pt(fe.SectionMessage,te.Warning),Nd=pt(fe.SectionMessage,te.Loading),jd=pt(fe.SectionMessage,te.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const wd="en-GB",Dd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},Ca="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus",Ia="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",Sa="!border-error",Td="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Ed="z-floating rounded-lg bg-layer-raised p-2 shadow-md",Ad="absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent",Ld="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus",Od="bg-control-accent text-control-permanent",_d="text-accent dial-small-semi-text",kd="text-control-disable-primary",Na="text-secondary",Rd=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Na}),Us={prev:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Md=(e,t)=>{const n=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-n);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Zs=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ys=(e,t,r)=>{const n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(n<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(n>a)return!0}return!1},Pd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),qs=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Bd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Bt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Xs=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},zd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Fd=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const n=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),n.length===0)return r;const a=String(Math.min(Number(n),59)).padStart(n.length,"0");return`${r}:${a}`},ja=5,wa=e=>e.charAt(0).toUpperCase()+e.slice(1),$d=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ja+r));return wa(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Hd=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ja+r));return{value:String(r+1),label:wa(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Kd=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Wd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Vd="flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus",Gd="bg-control-accent text-control-permanent hover:bg-control-accent",Qs=({label:e,options:t,selected:r,onSelect:n})=>{const a=g.useRef(null);g.useEffect(()=>{const l=a.current,d=l?.querySelector('[aria-selected="true"]');!l||!d||(l.scrollTop=d.offsetTop-l.clientHeight/2+d.offsetHeight/2)},[]);const o=l=>{const d=Array.from(l.currentTarget.querySelectorAll("button")),u=d.indexOf(document.activeElement),h={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];h&&(l.preventDefault(),h.focus())},i=r??t[0];return s.jsx("div",{ref:a,role:"listbox","aria-label":e,tabIndex:-1,className:"flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",onKeyDown:o,children:t.map(l=>s.jsx("button",{type:"button",role:"option","aria-selected":l===r,tabIndex:l===i?0:-1,className:f.mergeClasses(Vd,l===r&&Gd),onClick:()=>n(l),children:l},l))})},Ud=({value:e,onSelect:t})=>{const[r,n]=g.useMemo(()=>{const a=/^(\d{2}):(\d{2})$/.exec(e);return a?[a[1],a[2]]:[void 0,void 0]},[e]);return s.jsxs("div",{className:"flex w-[168px] gap-1",children:[s.jsx(Qs,{label:"Hours",options:Kd,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Qs,{label:"Minutes",options:Wd,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Js=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:d})=>{const u=c.useThemeScope(),[h,p]=g.useState(!1),{refs:m,floatingStyles:x,context:y}=B.useFloating({open:h,onOpenChange:w=>p(t?!1:w),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),v=B.useClick(y,{enabled:!t}),b=B.useDismiss(y),C=B.useRole(y,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:N}=B.useInteractions([v,b,C]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:e,ref:m.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:f.mergeClasses(Ca,"focus-visible:outline focus-visible:outline-focus",r&&Sa,t&&Ia,o),...I(),children:n}),h&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:y,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:m.setFloating,style:x,"aria-label":d,className:f.mergeClasses(Td,u,a),...N(),children:i(()=>p(!1))})})})]})},en=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:d="--:--",timezoneLabel:u,timezoneLabelClassName:h,picker:p=!1})=>{const[m,x]=g.useState(t),[y,v]=g.useState(!1),b=c.useThemeScope(),{refs:C,floatingStyles:I,context:N}=B.useFloating({open:y,onOpenChange:E=>v(a?!1:E),placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(8),B.flip({padding:8}),B.shift({padding:8})]}),w=B.useDismiss(N),S=B.useRole(N,{role:"dialog"}),{getFloatingProps:T}=B.useInteractions([w,S]);g.useEffect(()=>{x(t)},[t]);const L=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:d,disabled:a,value:m,onChange:E=>{const D=Fd(E.target.value);x(D),zd(D)&&r(D)},onBlur:n,className:f.mergeClasses(Ca,o&&Sa,a&&Ia,p&&"pe-12",i)});return!u&&!p?L:s.jsxs("div",{ref:p?C.setReference:void 0,className:"relative w-full",children:[L,u&&s.jsx("span",{className:f.mergeClasses("dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",p&&"end-12",h),children:u}),p&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":y,disabled:a,className:Ad,onClick:()=>v(E=>!E),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),y&&s.jsx(B.FloatingPortal,{children:s.jsx(B.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:C.setFloating,style:I,"aria-label":"Choose time",className:f.mergeClasses(Ed,b),...T(),children:s.jsx(Ud,{value:m,onSelect:(E,D)=>{x(E),r(E),D&&v(!1)}})})})})]})]})},Zd=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:d,className:u,minDate:h,maxDate:p,locale:m=wd,fieldClassName:x,showTimezone:y=!1,showTimePicker:v=!0})=>{const b=o??Dd[e],C=t instanceof Date?t:null,I=g.useId(),N=d??I,w=a?.id??`${N}-label`,S=!!a?.label,T=typeof a?.label=="string"?a.label:void 0,L=S?`${w} ${N}`:void 0,E=a?s.jsx(c.Label,{...a,id:w,htmlFor:N}):null,[D,j]=g.useState(()=>C??new Date),A=g.useMemo(()=>new Date,[]),_=g.useMemo(()=>y?ia({locale:m}):null,[y,m]),P=g.useMemo(()=>$d(m),[m]),O=g.useMemo(()=>Hd(m),[m]),R=g.useMemo(()=>Md(D.getFullYear(),D.getMonth()),[D]),M=W=>{j(G=>new Date(G.getFullYear(),G.getMonth()+W,1))},$=(W,G)=>{if(Ys(W,h,p))return;const J=e===xe.DateTime&&C?Xs(W,Bt(C)):W;r?.(J),e===xe.Date&&G()},V=W=>{r?.(Xs(C??new Date,W))},K=()=>C?e===xe.DateTime?`${qs(C,m)}, ${Bt(C)}`:qs(C,m):b;if(e===xe.Time){const W=typeof t=="string"?t:C?Bt(C):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(en,{id:N,value:W,onChange:G=>r?.(G),onBlur:n,disabled:i,invalid:l,placeholder:b,className:x,timezoneLabel:_,picker:v})]})}if(e===xe.Weekday){const W=typeof t=="string"?t:void 0,G=O.find(J=>J.value===W);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(Js,{id:N,disabled:i,invalid:l,labelledBy:L,panelLabel:T??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??b}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Na})]}),panel:J=>s.jsx("div",{role:"listbox","aria-label":T??b,className:"flex flex-col gap-0.5",children:O.map(re=>s.jsx("button",{type:"button",role:"option","aria-selected":re.value===W,className:f.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",re.value===W&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(re.value),J()},children:re.label},re.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",u,c.DIAL_KIT_CLASS.calendar),children:[E,s.jsx(Js,{id:N,disabled:i,invalid:l,labelledBy:L,panelLabel:T??b,fieldClassName:x,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!C&&"text-secondary"),children:K()}),Rd]}),panel:W=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:Us.prev,size:c.ElementSize.Small,onClick:()=>M(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Pd(D,m)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:Us.next,size:c.ElementSize.Small,onClick:()=>M(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[P.map(G=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),R.map(G=>{const J=G.getMonth()!==D.getMonth(),re=Zs(G,C),Y=Zs(G,A),q=Ys(G,h,p);return s.jsx("button",{type:"button",disabled:q,"aria-label":Bd(G,m),"aria-pressed":re,"aria-current":Y?"date":void 0,className:f.mergeClasses(Ld,J&&kd,Y&&!re&&_d,re&&Od,q&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>$(G,W),children:G.getDate()},G.toISOString())})]}),e===xe.DateTime&&s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[s.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),s.jsx(en,{ariaLabel:"Time",value:C?Bt(C):"",onChange:V,onBlur:n,className:f.mergeClasses(!_&&"w-[120px]","px-3 py-1.5"),timezoneLabel:_,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Yd=3,qd=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:n,ariaLabel:a="Folder path"})=>{const o=g.useRef(null),i=g.useRef(null),l=g.useRef(null),[d,u]=g.useState(!1),h=g.useRef(!1),p=g.useRef(0),m=g.useCallback(D=>{h.current=D,u(D)},[]),x=g.useCallback(()=>{const D=o.current;if(!D)return;if(h.current){D.clientWidth>=p.current&&m(!1);return}const j=i.current,A=l.current;if(!j||!A)return;const _=j.scrollWidth-j.clientWidth,P=parseFloat(getComputedStyle(A).minWidth)||0,O=A.clientWidth<=P+1;_>0&&O&&(p.current=D.clientWidth+_,m(!0))},[m]);g.useEffect(()=>{const D=o.current;if(D)return c.observeElementSize(D,x)},[x]);const y=e.join("\0");g.useEffect(()=>{m(!1),c.scheduleMeasure(x)},[y,x,m]),g.useEffect(()=>{d||c.scheduleMeasure(x)},[d,x]);const v=s.jsx(c.DialIcon,{icon:s.jsx(F.IconFolder,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),b=s.jsx("span",{className:Yr,children:s.jsx(c.DialIcon,{icon:s.jsx(F.IconChevronRight,{size:14,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"})}),C=f.mergeClasses(t,"text-secondary cursor-default"),I=e.length-1,N=e.length>=3?I-1:-1,w=e.length>Yd||d,S=e.slice(1,d?I:I-1),T=D=>{const j=D===I,A=D===N;let _=e[D];return j&&(_=s.jsx("span",{className:r,children:e[D]})),s.jsxs("li",{className:f.mergeClasses(Qt,j&&"min-w-0",A&&"shrink-[1000]",!j&&!A&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(kr,Rn,"pointer-events-none opacity-75",A&&"min-w-auto"),"aria-current":j?"page":void 0,"aria-disabled":"true",children:[D===0&&v,s.jsx("span",{ref:j&&i||A&&l||void 0,className:f.mergeClasses("truncate",j&&"min-w-0 flex-1",A&&"min-w-[2ch]",C),children:_})]}),!j&&b]},`item-${D}`)},L=()=>s.jsxs("li",{className:f.mergeClasses(Qt,"shrink-0"),children:[s.jsxs(c.Tooltip,{tooltip:e.join(" > "),triggerClassName:"inline-flex cursor-default items-center text-secondary",children:[s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),s.jsx("span",{className:"sr-only",children:S.join(", ")})]}),b]},"ellipsis"),E=[];return w?(E.push(T(0),L()),d||E.push(T(I-1)),E.push(T(I))):e.forEach((D,j)=>E.push(T(j))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(_n,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:kn,children:E})})};var qe=(e=>(e.Small="small",e.Heading="heading",e))(qe||{});const Xd="w-full overflow-hidden",Qd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",tn="flex min-w-0 items-center gap-2",rn={[qe.Small]:"dial-small-text",[qe.Heading]:"dial-h2-text"},Jd={[qe.Small]:"dial-small-semi-text",[qe.Heading]:"dial-h2-text"},eu={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},tu="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",ru="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",su="cursor-default text-primary",nu="cursor-default text-secondary",sn="inline-flex flex-none items-center leading-none text-secondary",au="dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",ou=3,iu=4,lu=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),cu=({items:e,maxVisibleItems:t=iu,size:r=qe.Small,separator:n=lu,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,ou),u=g.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),h=g.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),p=g.useCallback(({key:y,domEvent:v})=>{const b=u[Number(y)];b&&(b.onClick?.(v),!b.onClick&&b.href&&!v.defaultPrevented&&(window.location.href=b.href))},[u]);if(e.length===0)return null;const m=e.slice(u.length+1),x=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),N=f.mergeClasses(tu,I?ru:C?f.mergeClasses(su,Jd[r]):nu,l,c.DIAL_KIT_CLASS.breadcrumbsItem),w=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(tn,rn[r],eu[C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:N,children:w}):s.jsx("button",{type:"button",onClick:y.onClick,className:N,children:w}):s.jsx("span",{className:N,"aria-current":C?"page":void 0,children:w}),!C&&s.jsx("span",{className:sn,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Xd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:Qd,children:[x(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(tn,rn[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:h,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:au,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:sn,"aria-hidden":"true",children:n})]}),m.map((y,v)=>x(y,{index:e.length-m.length+v,isFirst:!1,isCurrent:v===m.length-1}))]})})},du=({className:e,icon:t,tooltipProps:r,type:n="button",...a})=>{const o=f.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),i=s.jsx("button",{...a,type:n,className:o,"aria-label":c.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||s.jsx(F.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?s.jsx(Se,{...r,children:i}):i},uu=e=>s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",e&&"rotate-180")}),fu=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=g.useState(!1),l=g.useMemo(()=>uu(o),[o]);return s.jsx("div",{className:c.DIAL_KIT_CLASS.buttonDropdown,children:s.jsx(c.Dropdown,{...n,items:r,onOpenChange:d=>i(d),children:s.jsx(Qe,{...a,iconAfter:l,variant:e||c.ButtonVariant.Primary,appearance:t||c.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Da=({label:e,size:t,isOpen:r=!1,labelClassName:n,className:a,"aria-label":o,...i})=>{const l=t===c.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return s.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:f.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",l,a,c.DIAL_KIT_CLASS.inlineSelect),children:[s.jsx("span",{className:n,children:e}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:f.mergeClasses("transition-transform",r&&"rotate-180")})]})},pu=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:h,triggerClassName:p,triggerLabelClassName:m,open:x,onOpenChange:y})=>{const[v,b]=g.useState(!1),C=x!==void 0,I=C?x:v,N=g.useCallback(j=>{C||b(j),y?.(j)},[C,y]),[w,S]=g.useState(r??e[0]?.key),T=t!==void 0,L=T?t:w,E=g.useMemo(()=>{const j=e.find(A=>A.key===L);return j?.label?String(j.label):""},[e,L]),D=g.useCallback(({key:j})=>{const A=e.find(_=>_.key===j);A&&(T||S(j),n?.(A))},[e,T,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?x:void 0,onOpenChange:N,onItemClick:D,children:s.jsx(Da,{label:E,size:a,isOpen:I,disabled:o,"aria-label":h,className:p,labelClassName:m})})};var ke=(e=>(e.Outlined="outlined",e.Filled="filled",e))(ke||{}),je=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(je||{});const hu={[je.Blue]:"bg-blue text-blue",[je.Green]:"bg-green-2 text-green-1",[je.Violet]:"bg-violet-2 text-violet-1",[je.Indigo]:"bg-violet-1 text-violet-2",[je.Brown]:"bg-brown text-brown-2",[je.Red]:"bg-red text-red"},mu={[ke.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[ke.Filled]:"rounded-full"},gu={[ke.Outlined]:"dial-tiny-text",[ke.Filled]:"dial-caption-lead-semi-text"},bs=({label:e,variant:t=ke.Outlined,color:r=je.Blue,icon:n,textClassName:a,className:o,...i})=>s.jsxs("span",{...i,className:f.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",mu[t],t===ke.Filled&&hu[r],o,c.DIAL_KIT_CLASS.badge),children:[n&&s.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:n}),s.jsx("span",{className:a??gu[t],children:e})]}),xu={[Ue.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[Ue.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},bu=({title:e,value:t,description:r,variant:n=Ue.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:h})=>{const p=xu[n],m=d!==void 0?d:(l??0)>=0,x=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return s.jsxs("div",{className:f.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i,c.DIAL_KIT_CLASS.analyticsCard),children:[l!==void 0?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:p.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",m?"bg-success text-success":"bg-error text-error"),children:x})]}):s.jsx("span",{className:p.title,children:e}),a?s.jsx(bs,{label:"Error",variant:ke.Filled,color:je.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):h?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[0].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[0].value})]}),s.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx(c.EllipsisTooltip,{text:h[1].title,className:"dial-tiny-text text-secondary"}),s.jsx("span",{className:p.value,children:h[1].value})]})]}):s.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},Ut=({value:e,maxValue:t=1,error:r,isLoading:n,title:a,valueLabel:o,colorMap:i=At,className:l,titleClassName:d,valueClassName:u,inline:h,ariaLabel:p})=>{const m=e==null,x=!!(r||n||!m),y=Nn(m?0:e,t),v=jn(y,i),b=o??(m?"—":e),C=p??(typeof a=="string"?a:void 0),I=r||n,N=r?s.jsx(bs,{label:"Error",variant:ke.Filled,color:je.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(Ve,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",h?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),w=x?s.jsx("div",{role:"progressbar","aria-valuenow":r||n||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":C,className:f.mergeClasses("w-full overflow-hidden rounded-xs",h?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&s.jsx("div",{className:"h-full rounded-xs transition-[width] duration-300",style:{width:`${y*100}%`,backgroundColor:v}})}):null,S=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return h?s.jsxs("div",{className:f.mergeClasses("flex flex-row items-center gap-2",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsx("div",{className:"w-1/2 min-w-0",children:S}),s.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:w}),N]})]}):s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",l,c.DIAL_KIT_CLASS.analyticsBar),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),w]})};var tr=(e=>(e.Start="start",e.End="end",e))(tr||{});const Ta=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=tr.End,className:h,headerClassName:p,contentClassName:m})=>{const x=n!==void 0,[y,v]=g.useState(a),b=i?!0:x?n:y,C=g.useId(),I=`accordion-header-${C}`,N=`accordion-content-${C}`,w=()=>{if(o)return;const D=!b;x||v(D),d?.(D)},S=u===tr.Start,T=i?null:s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b?"rotate-90":"rtl:rotate-180")}),L=s.jsxs(s.Fragment,{children:[S&&T,s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?s.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!S&&T]}),E=S?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",h,c.DIAL_KIT_CLASS.accordion),children:[i?s.jsx("div",{id:I,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,p),children:L}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":N,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:w,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:L}),s.jsx("div",{inert:!b,className:f.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"pt-3",children:s.jsx("div",{id:N,role:"region","aria-labelledby":I,className:f.mergeClasses("px-4 dial-small-text text-primary",m),children:r})})})})]})},vu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:h,onBarClick:p,inline:m,barTitleClassName:x,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),N=m?f.mergeClasses("text-secondary",x):x,w=o?"dial-tiny-text text-secondary":void 0,S=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,T=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],L="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",E="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(Ta,{title:S,description:r,defaultExpanded:d,nonCollapsible:u,className:f.mergeClasses(C,c.DIAL_KIT_CLASS.analyticsBarGroup),children:s.jsx("div",{className:f.mergeClasses("flex flex-col",a?"gap-4":m?"gap-2":"gap-3"),children:h?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?T.map(j=>{const A=j in n?n[j]:null,_=j in a?a[j]:null,O=typeof A=="number"&&typeof _=="number"?parseFloat((_-A).toFixed(3)):null,R=O!=null&&O!==0,M=R&&O>0,$=R?M?`+${O}`:String(O):null,V=b?.[j],K=s.jsx("span",{className:"dial-small-text text-secondary",children:j}),W=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[V?s.jsx(c.Tooltip,{tooltip:V,children:K}):K,$!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",M?"bg-success text-success":"bg-error text-error"),children:$})]}),s.jsxs("div",{className:D,children:[s.jsx(Ut,{title:o?.[0],value:A,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:j}),s.jsx(Ut,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:m,titleClassName:w,ariaLabel:`${j} compare`})]})]});return p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:f.mergeClasses(E,L),children:W},j):s.jsx("div",{className:E,children:W},j)}):I.map(([j,A])=>{const _=s.jsx(Ut,{title:j,value:A,maxValue:i,colorMap:l,inline:m,titleClassName:N,valueClassName:y,className:v}),P=p?s.jsx("button",{type:"button",onClick:()=>p(j,A),className:L,children:_}):_,O=b?.[j];return O?s.jsx(c.Tooltip,{tooltip:O,triggerClassName:"flex flex-col",children:P},j):s.jsx(g.Fragment,{children:P},j)})})})},Dr=128,yu=(e,t)=>{const r=sr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},nn=(e,t,r,n,a)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[t," out of ",r," ",n]}),s.jsx("span",{children:yu(a.from,a.to)})]}),Cu=({title:e,values:t,colorMap:r=At,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const h=Zt(t,r),p=l?Zt(l,r):void 0,m=t.length,x=l?.length??0,y=Math.max(m,x),v=Ur(y),b=Dn(y),C=S=>S.map(T=>({...T,ratio:v>0?T.count/v:0})),I=C(h),N=p?C(p):void 0,w=(S,T,L,E)=>{if(S.count===0)return s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})});const D=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:T,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-xs border border-transparent",style:{height:`${S.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",i,c.DIAL_KIT_CLASS.analyticsHistogram),children:[s.jsx("span",{className:"dial-small-text text-primary",children:e}),o?s.jsx("div",{className:"flex items-center justify-center",style:{height:Dr},children:s.jsx(Ve,{size:18,fullWidth:!1})}):s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[s.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Dr},children:b.map((S,T)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${T/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((S,T)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${T/(b.length-1)*100}%`}},S)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Dr},children:N?I.map((S,T)=>{const L=N[T],E=`${S.count} out of ${m} ${n}`,D=`${L.count} out of ${x} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[w(S,nn(d,S.count,m,n,S),E,!0),w(L,nn(u,L.count,x,n,L),D,!1)]},T)}):I.map((S,T)=>{const L=`${S.count} out of ${m} ${n}`;return S.count===0?s.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:s.jsx("div",{className:"min-h-2 w-full rounded-xs",style:{height:`${S.ratio*100}%`}})},T):s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:s.jsx("div",{role:"img","aria-label":L,className:f.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-xs border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},T)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,T)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:sr(S.from,S.to)},T))})]})]})},Iu=({label:e,text:t,tooltip:r,children:n,postfix:a,className:o})=>{const i=!!n||t!=null;return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-1",!n&&"max-w-[200px]",o,c.DIAL_KIT_CLASS.labelledText),children:[s.jsx(c.Label,{label:e}),i&&s.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:[n??s.jsx(c.EllipsisTooltip,{text:t,customTooltipContent:r,className:"dial-small-text min-w-0 flex-1"}),!n&&a]})]})},Su="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Nu="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",ju="flex flex-row items-center justify-between px-6 py-4",wu="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",Du="border-b border-tertiary",Tu="flex flex-row items-center gap-2 px-6 py-4",Eu="border-t border-tertiary",Tr="flex shrink-0 flex-row items-center gap-2",Au="ml-auto mobile:flex-1",rr="mobile:flex-1",Lu={[Ge.Sm]:"max-w-full md:max-w-[400px]",[Ge.Md]:"max-w-full md:max-w-[800px]",[Ge.Lg]:"max-w-full md:max-w-[1200px]"},vs=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:h,footer:p,footerClassName:m,onClose:x,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:N,additionalButtonsOnLeft:w=!1,footerDivider:S=!1,size:T=Ge.Md,hideClose:L=!1,closeAriaLabel:E="Close dialog",closeOnOutsideClick:D=!0,preventKeyboardOnOpen:j=!1})=>{const A=c.useThemeScope(),_=g.useRef(null),P=g.useId(),{refs:O,context:R}=B.useFloating({open:e,onOpenChange:Y=>{Y||x?.(null)}}),M=B.useRole(R,{role:"dialog"}),$=B.useDismiss(R,{outsidePress:D}),{getFloatingProps:V}=B.useInteractions([M,$]);if(!e)return null;const K=typeof t=="string"?`popup-heading-${P}`:void 0,W=Y=>Y?typeof Y=="string"?s.jsx("h2",{id:K,className:f.mergeClasses(wu,l),children:s.jsx(c.Tooltip,{tooltip:Y,triggerClassName:"truncate",children:Y})}):Y:s.jsx("span",{}),G=L?null:s.jsx(c.CloseButton,{ariaLabel:E,onClose:Y=>x?.(Y)}),J=(Y,q=[],se)=>q.map(({variant:le=c.ButtonVariant.Neutral,className:oe,...me},ve)=>s.jsx(Qe,{variant:le,className:f.mergeClasses(se,oe),...me},`${Y}-${ve}`)),re=()=>{if(p!==void 0)return p;if(!I?.length&&!N?.length)return null;const Y=J("additional",N,w?void 0:rr);return s.jsxs("div",{className:f.mergeClasses(Tu,S&&Eu,m),children:[w&&Y.length>0&&s.jsx("div",{className:Tr,children:Y}),s.jsxs("div",{className:f.mergeClasses(Tr,Au),children:[!w&&Y,J("main",I,rr)]})]})};return s.jsx(B.FloatingPortal,{id:n,children:s.jsx(B.FloatingOverlay,{style:i,className:f.mergeClasses(Su,A,o),children:s.jsx(B.FloatingFocusManager,{context:R,initialFocus:j?_:O.floating,children:s.jsxs("div",{ref:O.setFloating,...V(),role:"dialog","aria-modal":"true","aria-labelledby":K,"aria-label":K?void 0:r,className:f.mergeClasses(Nu,Lu[T],a,c.DIAL_KIT_CLASS.popup),children:[j&&s.jsx("div",{ref:_,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(ju,C&&Du,d),children:[y&&s.jsx(c.GhostIconButton,{"aria-label":v,size:c.ElementSize.Small,className:"mr-2",onClick:y,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),W(t),b?s.jsxs("div",{className:Tr,children:[b,G]}):G]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:h}),re()]})})})})},Ou="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",_u="text-secondary dial-small-paragraph-text px-6 pb-4",ku="px-6 py-4 h-[120px]",Ru="Cancel",Mu="Ok",an={[ct.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[ct.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},Ea=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Mu,cancelLabel:o=Ru,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:h,onConfirm:p,onCancel:m,children:x,variant:y=ct.Info,size:v=Ge.Sm,footer:b,hideClose:C,...I})=>{const N=i?null:s.jsxs("div",{className:Ou,children:[s.jsx(fs,{className:rr,label:o,onClick:()=>m?m():h?.()}),s.jsx(Qe,{variant:an[y].confirm.variant,appearance:an[y].confirm.appearance,className:f.mergeClasses(rr,u),label:a,disabled:l,onClick:p})]}),w=g.useCallback(()=>i?s.jsx("div",{className:ku,children:s.jsx(Ve,{size:40})}):x??(t?s.jsx("div",{className:f.mergeClasses(_u,r),children:t}):null),[x,t,i,r]);return s.jsx(vs,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>h?.(),footer:b??N,size:v,hideClose:C??(!i&&b===void 0),children:w()})},Pu="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Bu="min-w-0 flex-1 truncate text-primary",zu="min-w-0 flex-1 truncate text-secondary",Fu="shrink-0 text-secondary",$u="px-6 pb-4",Hu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Ku="Cancel",Wu="Apply",Vu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:h,onClose:p,isValid:m=!0,applyButtonLabel:x=Wu,cancelButtonLabel:y=Ku,size:v=Ge.Md,portalId:b,disabled:C,invalid:I,error:N,caption:w,ariaLabel:S,className:T,fieldClassName:L})=>{const E=g.useId(),D=o??E,j=`${D}-label`,A=`${D}-value`,_=N?`${D}-error`:void 0,P=!N&&w?`${D}-caption`:void 0,[O,R]=g.useState(!1),M=d!==void 0,[$,V]=g.useState(t),K=M?d:$,W=g.useCallback(()=>{C||(M||V(t),R(!0))},[C,M,t]),G=g.useCallback(()=>{R(!1),p?.()},[p]),J=g.useCallback(()=>{h?.(),G()},[h,G]),re=g.useCallback(()=>{a(K),G()},[a,K,G]),Y=g.useCallback(k=>{M||V(k),u?.(k)},[M,u]),q=c.resolveAccessibleName(i?.label),se=q?void 0:c.resolveAccessibleName(S),le=q?j:se&&`${D}-name`,oe=c.resolveAccessibleName(n),me=e.find(k=>k.value===t)?.label,ve=r??me;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",T,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:j,htmlFor:D}),s.jsxs("div",{className:"flex flex-col gap-1",children:[se&&s.jsx("span",{id:le,className:"sr-only",children:se}),s.jsxs("button",{type:"button",id:D,disabled:C,"aria-haspopup":"dialog","aria-expanded":O,"aria-labelledby":le?`${le} ${A}`:void 0,"aria-describedby":[_,P].filter(Boolean).join(" ")||void 0,onClick:W,className:f.mergeClasses(Pu,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",L),children:[s.jsx("span",{id:A,className:ve==null?zu:Bu,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Fu})]}),s.jsx(c.ErrorText,{id:_,text:N}),!N&&s.jsx(c.CaptionText,{id:P,text:w})]}),s.jsx(vs,{open:O,header:n,ariaLabel:oe?void 0:q,portalId:b,size:v,onClose:J,footer:s.jsxs("div",{className:Hu,children:[s.jsx(fs,{label:y,onClick:J}),s.jsx(ha,{label:x,disabled:!m,onClick:re})]}),children:s.jsx("div",{className:$u,children:s.jsx(wt,{id:`${D}-options`,items:e,value:K,onChange:Y,orientation:_e.Column,ariaLabel:q??oe})})})]})},Gu=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:n,onClick:a,tooltipProps:o,size:i=c.ElementSize.Small,className:l,...d})=>{const u=g.useCallback(p=>{a?.(p),n?.(!r)},[a,n,r]),h=s.jsx(c.IconButton,{...d,size:i,variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":c.resolveAccessibleName(d["aria-label"],o?.tooltip),onClick:u,className:f.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,c.DIAL_KIT_CLASS.toggleIconButton)});return o?s.jsx(c.Tooltip,{asChild:!0,...o,children:h}):h},Uu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Zu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Yu="flex h-8 min-w-8 grow shrink-0 basis-auto items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",qu="bg-layer-raised text-accent shadow-xs",Xu="bg-transparent text-secondary",Qu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ju="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",ef="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",tf="cursor-not-allowed bg-transparent text-control-disable-primary",rf=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=g.useRef({}),d=e.find(p=>p.value===t),u=d&&!d.disabled?d.value:e.find(p=>!p.disabled)?.value,h=g.useCallback(p=>{if(n||!Uu.includes(p.key))return;const m=e.filter(C=>!C.disabled);if(m.length===0)return;const x=Math.max(m.findIndex(C=>C.value===t),0),y=m.length-1;let v=x;switch(p.key){case"ArrowRight":case"ArrowDown":v=x===y?0:x+1;break;case"ArrowLeft":case"ArrowUp":v=x===0?y:x-1;break;case"Home":v=0;break;case"End":v=y;break}p.preventDefault();const b=m[v];l.current[b.value]?.focus(),b.value!==t&&r(b.value)},[n,e,t,r]);return s.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":n||void 0,onKeyDown:h,className:f.mergeClasses(Zu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const m=p.value===t,x=n||p.disabled;return s.jsxs("button",{ref:y=>{l.current[p.value]=y},type:"button",role:"radio","aria-checked":m,"aria-label":c.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===u?0:-1,disabled:x,onClick:()=>r(p.value),className:f.mergeClasses(Yu,m?qu:Xu,x?m?ef:tf:m?Qu:Ju,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},sf={[lt.Error]:"Error",[lt.Warning]:"Warning"},nf={[Ze.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ze.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},af=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ze.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const h=g.useRef({}),p=g.useId(),m=n===Ze.Vertical,x=e.find(C=>C.id===t),y=x&&!x.disabled?x.id:e.find(C=>!C.disabled)?.id,v=g.useCallback(C=>{const{next:I,previous:N}=nf[n];if(![I,N,"Home","End"].includes(C.key)||e.length===0)return;const w=e.filter(D=>!D.disabled);if(w.length===0)return;const S=Math.max(w.findIndex(D=>D.id===t),0),T=w.length-1;let L=S;C.key===I?L=S===T?0:S+1:C.key===N?L=S===0?T:S-1:C.key==="Home"?L=0:L=T,C.preventDefault();const E=w[L];h.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":m?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:v,className:f.mergeClasses(m?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,c.DIAL_KIT_CLASS.tabList,!a&&c.DIAL_KIT_CLASS.tabs),children:e.map(C=>{const I=t===C.id,N=!!C.disabled;return s.jsxs("button",{ref:w=>{h.current[C.id]=w},type:"button",role:"tab","aria-selected":I,disabled:N,tabIndex:C.id===y?0:-1,onClick:()=>r(C.id),className:f.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",m?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],N&&(m?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(m?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),d,c.DIAL_KIT_CLASS.tab,I&&c.DIAL_KIT_CLASS.tabSelected),children:[C.icon&&s.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:C.icon}),s.jsx("span",{className:f.mergeClasses(m&&!I&&!N&&"text-primary"),children:C.label}),C.status&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("flex shrink-0",C.status===lt.Error?"text-error":"text-warning",m&&C.count==null&&"ms-auto"),children:C.status===lt.Error?s.jsx(F.IconExclamationCircle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE})}),s.jsx("span",{className:"sr-only",children:C.statusLabel??sf[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",m&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:C.count})]},C.id)})});return a?s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.tabs),children:[s.jsx("div",{className:f.mergeClasses("flex h-16 shrink-0 items-center",m?"px-4":"px-3"),children:s.jsx("span",{id:p,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},of="flex flex-nowrap items-center gap-1",lf="min-w-max flex-1 justify-center",cf=({items:e,value:t,onChange:r,stretch:n=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>s.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:f.mergeClasses(of,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Le,{label:d.label,icon:d.icon,appearance:De.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&lf,o)},d.value))}),zr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const n=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},df=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:h,ariaLabel:p,className:m})=>{const x=g.useId(),y=h??`file-dropzone-${x}`,v=d?`${y}-error`:void 0,[b,C]=g.useState(!1),I=g.useRef(0),N=g.useCallback(j=>{if(j.length===0)return;const A=i?j:j.slice(0,1),_=A.filter(O=>zr(O,o)),P=A.filter(O=>!zr(O,o));P.length>0&&a?.(P),_.length>0&&n(_)},[o,i,n,a]),w=g.useCallback(j=>{N(Array.from(j.target.files??[])),j.target.value=""},[N]),S=g.useCallback(()=>{I.current=0,C(!1)},[]),T=g.useCallback(j=>{l||(j.preventDefault(),I.current+=1,C(!0))},[l]),L=g.useCallback(j=>{l||(j.preventDefault(),j.dataTransfer.dropEffect="copy")},[l]),E=g.useCallback(()=>{l||(I.current-=1,I.current<=0&&S())},[l,S]),D=g.useCallback(j=>{j.preventDefault(),!l&&(S(),N(Array.from(j.dataTransfer?.files??[])))},[l,S,N]);return s.jsxs("div",{className:"flex flex-col gap-1",children:[e&&s.jsx(c.Label,{...e,htmlFor:y}),s.jsx("input",{id:y,type:"file",accept:o,multiple:i,disabled:l,onChange:w,"aria-label":c.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:T,onDragOver:L,onDragLeave:E,onDrop:D,className:f.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&b&&"border-accent bg-control-accent-alpha",!l&&!b&&"border-secondary hover:border-accent",d&&!b&&"border-error hover:border-error",m,c.DIAL_KIT_CLASS.fileDropzone),children:[u??s.jsx(F.IconUpload,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),s.jsxs("span",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:f.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&s.jsx("span",{className:f.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),s.jsx(c.ErrorText,{id:v,text:d})]})},Aa=({label:e="Shared",tooltip:t,size:r=12,className:n})=>s.jsx(c.Tooltip,{tooltip:t||"Shared",asChild:!0,children:s.jsx("span",{role:"img","aria-label":e,className:f.mergeClasses("flex shrink-0 rounded-xs bg-layer-raised text-accent",n,c.DIAL_KIT_CLASS.sharedEntityIndicator),children:s.jsx(F.IconArrowUpRight,{size:r,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ce=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(Ce||{});const uf={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},ff=new Map(Object.entries(uf).flatMap(([e,t])=>t.map(r=>[r,e]))),pf=e=>ff.get(e)??"other",on="var(--text-control-permanent, #FCFCFC)",zt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},hf="#1B212D",mf={[Ce.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:zt},[Ce.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:hf}},[Ce.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[Ce.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[Ce.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[Ce.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:zt},[Ce.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:zt},[Ce.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[Ce.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[Ce.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[Ce.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:zt}},gf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${g.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=mf[t],i=typeof o=="string";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),n&&s.jsx("path",{d:n,stroke:on,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:on}),!i&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:o.from}),s.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},xf=({size:e})=>{const t=`dial-kit-folder-gradient-${g.useId().replace(/[^\w-]/g,"")}`;return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[s.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),s.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),s.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},bf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),vf=(e,t)=>e===Oe.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",yf=(e,t,r)=>e===Oe.Folder?s.jsx(xf,{size:r}):s.jsx(gf,{size:r,kind:pf(t)}),ys=({type:e,name:t,fileExtension:r,shared:n=!1,loading:a=!1,size:o=f.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:d,loadingLabel:u="Loading",sharedIndicatorClassName:h,sharedIndicatorTooltip:p})=>{if(e!==Oe.File&&e!==Oe.Folder)return null;const m=e===Oe.File?bf(t,r):"",x=vf(e,m),y=d??(n?`${x}, shared`:x),v=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":y};return s.jsxs("span",{className:f.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,c.DIAL_KIT_CLASS.fileIcon),...v,children:[a?s.jsx(Ve,{size:o,ariaLabel:u}):yf(e,m,o),n&&s.jsx(Aa,{tooltip:p,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",h)})]})},La=({name:e,type:t=Oe.File,fileExtension:r,shared:n=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:d=!1,className:u,nameClassName:h,sharedIndicatorClassName:p,sharedIndicatorTooltip:m,sharedLabel:x="Shared",hideTooltip:y=!1,tooltipContent:v})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",u,c.DIAL_KIT_CLASS.fileName),children:[s.jsx(ys,{name:e,type:t,fileExtension:r,shared:n,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:m,decorative:!a}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("dial-small-paragraph-text",d?"text-secondary":"text-primary",h),text:e,hideTooltip:y,customTooltipContent:v}),n&&s.jsx("span",{className:"sr-only",children:x}),l]})]}),Cf=({className:e,...t})=>s.jsx(La,{...t,type:Oe.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),If=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:h,headerClassName:p,style:m,overlayStyle:x,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${g.useId()}`,{refs:N,context:w}=B.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=B.useRole(w,{role:"dialog"}),T=B.useDismiss(w,{outsidePress:l}),{getFloatingProps:L}=B.useInteractions([S,T]);return e?s.jsx(B.FloatingPortal,{id:b,children:s.jsx(B.FloatingOverlay,{lockScroll:!0,style:x,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,h,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(B.FloatingFocusManager,{context:w,initialFocus:N.floating,children:s.jsxs("div",{ref:N.setFloating,...L(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:n,style:m,className:f.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-hidden","animate-slideUp motion-reduce:animate-none",u,c.DIAL_KIT_CLASS.bottomSheet),children:[r&&s.jsxs("div",{className:f.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&s.jsx(c.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:s.jsx(F.IconArrowLeft,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),s.jsx("h2",{id:I,className:f.mergeClasses("min-w-0 truncate text-primary",v??"dial-body-semi-text"),children:r}),s.jsx(c.CloseButton,{ariaLabel:i,onClose:t,size:c.ElementSize.Standard,className:"absolute end-4"})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 overflow-y-auto",y),children:d})]})})})}):null};var dt=(e=>(e.Circle="circle",e.Square="square",e))(dt||{}),Be=(e=>(e.Green1="green-1",e.Violet2="violet-2",e.Brown="brown",e.Red="red",e.Green2="green-2",e.Blue="blue",e.Violet1="violet-1",e))(Be||{});const Oa={[Be.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Be.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Be.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Be.Red]:{background:"bg-red",foreground:"text-red"},[Be.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Be.Blue]:{background:"bg-blue",foreground:"text-accent"},[Be.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},Sf=e=>{const t=Object.values(Oa);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},ln=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",_a=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(ln(t[0])+ln(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Nf={[dt.Circle]:"rounded-full",[dt.Square]:"rounded-md"},ka=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=dt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:h})=>{const[p,m]=g.useState(),x=!!r&&p!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Nf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(x)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{m(r),h?.(I)}});const{background:b,foreground:C}=i??Sf(e);return s.jsx("span",{role:y?"img":void 0,"aria-label":y?n:void 0,"aria-hidden":y?void 0:!0,className:v(f.mergeClasses(b,C)),style:{width:a,height:a,fontSize:d?void 0:Math.round(a*.4)},children:s.jsx("span",{className:f.mergeClasses("leading-none",d??"font-semibold"),children:t??_a(e)})})};var pe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(pe||{});const jf={[pe.Model]:"Model",[pe.Agent]:"Agent",[pe.Toolset]:"Toolset",[pe.Skill]:"Skill",[pe.Prompt]:"Prompt"},cn={[pe.Model]:"text-blue",[pe.Agent]:"text-green-1",[pe.Toolset]:"text-brown-2",[pe.Skill]:"text-violet-1",[pe.Prompt]:"text-violet-2"},wf={[pe.Model]:"bg-blue",[pe.Agent]:"bg-green-2",[pe.Toolset]:"bg-brown",[pe.Skill]:"bg-violet-2",[pe.Prompt]:"bg-violet-1"},Df=["h1","h2","h3","h4","h5","h6"],Tf=e=>Df[Math.min(6,Math.max(1,Math.round(e)))-1],Ra=({item:e,labels:t,showType:r=!0,showVersion:n=!0,hasFeaturedTag:a=!0,iconSize:o=48,headingLevel:i=3,query:l,footer:d,statusBadge:u,className:h,nameClassName:p="dial-h3-text",typeClassName:m="dial-caption-lead-semi-text",versionClassName:x="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=Tf(i),C=a&&!!e.isFeatured,I=u!=null||C,N=n?e.version:void 0,w=r?t?.type??jf[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",h,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(ka,{name:e.name,src:e.iconUrl,size:o,shape:dt.Square,imageClassName:"bg-entity-icon",className:f.mergeClasses("rounded-[14px]",y)}),s.jsxs("div",{className:f.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",d!=null&&"self-stretch"),children:[(I||w)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[w&&s.jsx("span",{className:f.mergeClasses("uppercase",m,cn[e.type]),children:w}),I&&s.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[u,C&&s.jsx("span",{className:f.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",wf[e.type],cn[e.type],v),children:t?.featured??"Featured"})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(b,{className:f.mergeClasses("min-w-0 shrink text-primary",p),children:l?s.jsx(c.Highlight,{text:e.name,query:l,maxLines:1}):s.jsx(c.EllipsisTooltip,{text:e.name})}),N!=null&&s.jsx(c.EllipsisTooltip,{className:f.mergeClasses("max-w-[30%] shrink-0 text-secondary",x),text:N})]}),d!=null&&d]})]})},Er="bg-control-neutral-active",Ef=({iconSize:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"shrink-0 overflow-hidden rounded-[14px]",children:s.jsx(Vt,{variant:Ae.Rectangular,width:e,height:e,className:Er})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Vt,{variant:Ae.Text,width:"30%",height:12,className:Er}),s.jsx(Vt,{variant:Ae.Text,width:"60%",height:16,className:Er})]})]}),Af=({entityId:e,item:t,isLoading:r=!1,isDisabled:n=!1,error:a,details:o,labels:i,showType:l=!0,iconSize:d=44,headingLevel:u=4,className:h})=>{const p=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,m=()=>e?r?s.jsx(Ef,{iconSize:d}):t==null?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:e}),p]}):s.jsx(Ra,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:p}):s.jsx("span",{className:"dial-body-semi-text block truncate text-secondary",children:i?.placeholder??"Not selected"});return s.jsxs("div",{children:[s.jsx("div",{className:f.mergeClasses("rounded-2xl border bg-layer-raised p-3",a?"border-error":"border-tertiary",n&&"opacity-50",h,c.DIAL_KIT_CLASS.selectedEntityCard),children:m()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Lf=({open:e,onClose:t,header:r,ariaLabel:n,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:d="Close",closeDisabled:u=!1,hideClose:h=!1,closeOnOutsideClick:p=!0,children:m,className:x,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:N,portalId:w})=>{const S=c.useThemeScope(),T=`side-drawer-title-${g.useId()}`,L=typeof r=="string",{refs:E,context:D}=B.useFloating({open:e,onOpenChange:O=>{O||t()}}),j=B.useRole(D,{role:"dialog"}),A=B.useDismiss(D,{outsidePress:p}),{getFloatingProps:_}=B.useInteractions([j,A]),P=r!=null||o!=null||!h;return s.jsx(B.FloatingPortal,{id:w,children:s.jsx(B.FloatingOverlay,{lockScroll:e,style:C,className:f.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,y),children:s.jsx(B.FloatingFocusManager,{context:D,disabled:!e,initialFocus:E.floating,children:s.jsxs("div",{ref:E.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":L?T:void 0,"aria-label":L?void 0:n,inert:!e,style:b,className:f.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-hidden","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",x,c.DIAL_KIT_CLASS.sideDrawer),children:[P&&s.jsxs("div",{className:f.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",v),children:[o&&s.jsx(c.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:s.jsx(F.IconChevronLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),L?s.jsx("h2",{id:T,className:f.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):s.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!h&&s.jsx(c.CloseButton,{ariaLabel:d,onClose:t,disabled:u,size:c.ElementSize.Standard})]}),s.jsx("div",{className:f.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:m})]})})})})},Of=4,_f=24,dn=e=>parseFloat(e)||0,kf=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Rf=()=>{},Mf=({id:e,value:t,defaultValue:r,size:n=c.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:d,disabled:u=!1,readOnly:h=!1,collapseTagOverflow:p=!1,ariaLabel:m,tagListLabel:x="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=g.useId(),N=e||I,w=n===c.ElementSize.Small,S=g.useRef(null),T=g.useRef([]),L=g.useRef(null),E=t!==void 0,[D,j]=g.useState(r??[]),A=E?t:D,_=A.length,[P,O]=g.useState(""),[R,M]=g.useState(_),$=!h&&!u,V=g.useCallback(k=>{E||j(k),C?.(k)},[E,C]),K=g.useCallback(k=>U=>{T.current[k]=U},[]),W=g.useCallback(()=>{const k=S.current;if(!k||k.clientWidth===0){M(A.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(k);M(pa({availableWidth:k.clientWidth-dn(U)-dn(de)-(h?0:_f),tagWidths:A.map((ne,ge)=>T.current[ge]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:Of}))},[h,A]);g.useEffect(()=>{if(!p){M(_);return}const k=S.current;if(!k)return;const U=new ResizeObserver(()=>W());return U.observe(k),W(),()=>U.disconnect()},[p,W,_]);const G=f.mergeClasses(p?"shrink-0":"min-w-0",b),J=k=>{const U=kf(k.trim()).trim();!U||A.includes(U)||V([...A,U])},re=k=>{V(A.filter(U=>U!==k))},Y=()=>{J(P),O("")},q=k=>{if($){if(k.key==="Enter"||k.key===","){k.preventDefault(),Y();return}k.key==="Backspace"&&!P&&_>0&&(k.preventDefault(),V(A.slice(0,-1)))}},se=()=>{$&&P.trim()&&Y()},le=p?A.slice(0,R):A,oe=p?A.slice(R):[],me=oe.join(", "),ve=_>0&&s.jsxs("span",{role:"list","aria-label":x,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[le.map(k=>s.jsx(Le,{role:"listitem",label:k,className:G,disabled:u,closable:$,onRemove:$?()=>re(k):void 0},k)),oe.length>0&&s.jsx(Le,{role:"listitem",label:`+${oe.length}`,"aria-label":me,title:me,className:f.mergeClasses("shrink-0",b),disabled:u}),p&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[A.map((k,U)=>s.jsx("span",{ref:K(U),className:"inline-flex",children:s.jsx(Le,{label:k,className:b,disabled:u,closable:$,onRemove:$?Rf:void 0})},k)),s.jsx("span",{ref:L,className:"inline-flex",children:s.jsx(Le,{label:`+${_}`,className:b})})]})]});return s.jsx(c.Input,{id:N,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:h,value:P,placeholder:_>0?void 0:o,"aria-label":m,wrapperRef:S,onChange:k=>O(k??""),onKeyDown:q,onBlur:se,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(_>0&&["!h-auto",w?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",h&&"cursor-default"),children:ve})},Pf=(e,t,r,n)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:d})=>!o.has(i)&&[l,i,d].some(u=>u?.toLowerCase().includes(a))).slice(0,Math.max(n,0))},Bf=5,zf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Bf,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:h,invalid:p=!1,disabled:m=!1,readOnly:x=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:N,listClassName:w,onChange:S})=>{const T=g.useId(),L=e||T,E=`${L}-listbox`,D=c.useThemeScope(),j=i===c.ElementSize.Small,A=t!==void 0,[_,P]=g.useState(r??[]),O=A?t:_,R=O.length>0,M=!x&&!m,[$,V]=g.useState(""),[K,W]=g.useState(!1),[G,J]=g.useState(0),re=!$.trim(),Y=g.useMemo(()=>Pf(n,$,O,o&&re?n.length:a),[$,re,a,o,n,O]),q=K&&M&&Y.length>0,se=Math.min(G,Y.length-1),le=q&&se>=0,oe=Q=>`${E}-option-${Q}`,{refs:me,floatingStyles:ve}=B.useFloating({open:q,placement:"bottom-start",whileElementsMounted:B.autoUpdate,middleware:[B.offset(c.overlayGap),B.flip({padding:c.overlayGap}),B.size({padding:c.overlayGap,apply({rects:Q,availableHeight:ce,elements:he}){he.floating.style.width=`${Math.round(Q.reference.width)}px`,he.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),k=g.useCallback(Q=>{A||P(Q),S?.(Q)},[A,S]),U=()=>{W(!1),J(0)},de=()=>{!o||!M||(W(!0),J(re?-1:0))},ne=Q=>{const ce=Q.trim();ce&&!O.includes(ce)&&k([...O,ce]),V(""),o?J(-1):U()},ge=Q=>k(O.filter(ce=>ce!==Q)),Je=Q=>{const ce=Q??"",he=!!ce.trim();V(ce),W(he||o),J(he?0:-1)},ht=Q=>{if(M)switch(Q.key){case"ArrowDown":case"ArrowUp":{if(Q.preventDefault(),!q){W(!0),J(0);return}const ce=Q.key==="ArrowDown"?1:-1,he=se<0?Math.min(-ce,0):se;J((he+ce+Y.length)%Y.length);return}case"Enter":case",":Q.preventDefault(),ne(le?Y[se].value:$);return;case"Escape":q&&Q.preventDefault(),U();return;case"Backspace":!$&&R&&(Q.preventDefault(),k(O.slice(0,-1)));return}},mt=Q=>Q.preventDefault();return s.jsxs(s.Fragment,{children:[s.jsx(c.Input,{id:L,role:"combobox","aria-autocomplete":"list","aria-expanded":q,"aria-controls":E,"aria-activedescendant":le?oe(se):void 0,"aria-invalid":p||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:h,invalid:p,disabled:m,readOnly:x,value:$,placeholder:R?void 0:d,wrapperRef:me.setReference,onChange:Je,onKeyDown:ht,onFocus:de,onClick:de,onBlur:U,containerClassName:f.mergeClasses("w-full",C),wrapperClassName:f.mergeClasses(R&&["!h-auto flex-wrap gap-1 py-2",j?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",x&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:O.map(Q=>s.jsx(Le,{role:"listitem",label:Q,className:f.mergeClasses(er,"min-w-0",N),disabled:m,closable:M,removeLabel:b?.(Q),onRemove:M?()=>ge(Q):void 0},Q))})}),s.jsx(B.FloatingPortal,{children:s.jsx("div",{ref:me.setFloating,id:E,role:"listbox","aria-label":v,hidden:!q,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!q&&"hidden",D,w),children:q&&Y.map((Q,ce)=>{const he=ce===se;return s.jsx(c.MenuItem,{id:oe(ce),role:"option","aria-selected":he,tabIndex:-1,label:Q.label,description:Q.description,mark:c.MenuItemMark.Tint,selected:he,onMouseDown:mt,onMouseEnter:()=>J(ce),onClick:()=>ne(Q.value)},Q.value)})})})]})},Ff=(e,t)=>{if(e<=0||t<=0)return[];const r=Math.floor(e/t+1e-9);return Array.from({length:r},(n,a)=>(a+1)*t/e*100)},Ma=e=>(e.toString().split(".")[1]??"").length,$f=(e,t,r,n)=>{const a=Math.min(r,Math.max(t,e));if(n<=0)return a;const o=Math.round(Number(((a-t)/n).toFixed(9))),i=t+o*n;return Number(Math.min(r,i).toFixed(Ma(n)))},Hf=12,un=e=>`calc(${e}% + ${(.5-e/100)*Hf}px)`,Kf=(e,t)=>e&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":e?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]",Wf=({id:e,value:t,min:r=0,max:n=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:d,showValue:u=!1,showTooltip:h=!1,showTicks:p=!1,leftContent:m,rightContent:x,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:N,trackClassName:w,fillClassName:S,className:T,...L})=>{const E=g.useId(),D=e??E,j=b&&!C?`${D}-caption`:void 0,A=C?`${D}-error`:void 0,_=n-r,P=_>0?Math.min(100,Math.max(0,(t-r)/_*100)):0,O=un(P),R=p&&!o?Ff(_,a):[],M=h&&!o,$=m!=null,V=y||x!=null,K=Ma(a),[W,G]=g.useState(null),J=d?d(t):t.toFixed(K),re=g.useCallback(se=>{I?.(Number(se.target.value))},[I]),Y=g.useCallback(se=>{const le=se==null?"":String(se);G(le);const oe=Number(le);le!==""&&Number.isFinite(oe)&&I?.($f(oe,r,n,a))},[n,r,I,a]),q=g.useCallback(()=>G(null),[]);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-2",N),children:[(i||u)&&s.jsxs("div",{className:"flex items-center gap-2",children:[i&&s.jsx(c.Label,{...i,htmlFor:D}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:J})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:f.mergeClasses("grid items-center gap-y-1",y?"gap-x-2":"gap-x-3",Kf($,V),M&&"mt-2"),children:[$&&s.jsx("div",{className:"flex items-center",children:m}),s.jsxs("div",{className:"relative flex h-6 items-center",children:[s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",w)}),R.map(se=>s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",style:{left:un(se)}},se)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",S),style:{width:O}}),M&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",style:{left:O},children:[s.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:J}),s.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:s.jsx("path",{d:"M0 0h8L4 4z"})})]}),s.jsx("input",{...L,type:"range",id:D,value:t,min:r,max:n,step:a,disabled:o,onChange:re,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?L["aria-label"]:void 0),"aria-valuetext":d?J:void 0,"aria-describedby":A??j,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",T)})]}),V&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(gs,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:W??t.toFixed(K),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:Y,onBlur:q}):x}),l&&s.jsx("div",{className:f.mergeClasses("dial-tiny-text flex text-secondary",$&&"col-start-2"),children:l.length===3?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"flex-1 text-center",children:l[1]}),s.jsx("span",{children:l[2]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:l[0]}),s.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),s.jsx(c.ErrorText,{id:A,text:C}),!C&&s.jsx(c.CaptionText,{id:j,text:b})]})]})},Vf=48,Gf=({children:e,title:t,width:r=280,collapsedWidth:n=Vf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:h="Expand sidebar",className:p,titleClassName:m,contentClassName:x,footerClassName:y})=>{const v=a!==void 0,[b,C]=g.useState(o),I=v?a:b,N=`collapsible-sidebar-content-${g.useId()}`,w=I?u:h,S=T=>{const L=!I;v||C(L),i?.(L,T)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",p,c.DIAL_KIT_CLASS.collapsibleSidebar),children:[s.jsx("div",{id:N,hidden:!I,className:f.mergeClasses("min-h-0 flex-1 overflow-auto p-4",x),children:e}),s.jsx("div",{hidden:I,className:f.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",m),children:t}),s.jsxs("div",{className:f.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",y),children:[I&&l,s.jsx(c.IconButton,{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Ghost,size:c.ElementSize.Standard,onClick:S,"aria-label":w,"aria-expanded":I,"aria-controls":N,tooltipProps:{tooltip:w},icon:I?s.jsx(F.IconChevronsLeft,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):s.jsx(F.IconChevronsRight,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})};var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ie.apply(this,arguments)},fn={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},pn={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ft={width:"20px",height:"20px",position:"absolute",zIndex:1},Uf={top:ie(ie({},fn),{top:"-5px"}),right:ie(ie({},pn),{left:void 0,right:"-5px"}),bottom:ie(ie({},fn),{top:void 0,bottom:"-5px"}),left:ie(ie({},pn),{left:"-5px"}),topRight:ie(ie({},Ft),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:ie(ie({},Ft),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:ie(ie({},Ft),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:ie(ie({},Ft),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Zf=g.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,a=e.replaceStyles,o=e.className,i=g.useCallback(function(u){t(u,r)},[t,r]),l=g.useCallback(function(u){t(u,r)},[t,r]),d=g.useMemo(function(){return ie(ie({position:"absolute",userSelect:"none"},Uf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Yf=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Ee=function(){return Ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ee.apply(this,arguments)},qf={width:"auto",height:"auto"},$t=function(e,t,r){return Math.max(Math.min(e,r),t)},hn=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},st=function(e,t){return new RegExp(e,"i").test(t)},Ht=function(e){return!!(e.touches&&e.touches.length)},Xf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},mn=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(o,i,l){return Math.abs(i-e)<Math.abs(t[o]-e)?l:o},0),a=Math.abs(t[n]-e);return r===0||a<r?t[n]:e},Ar=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Kt=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var a=Number(e.replace("%",""))/100;return t*a}if(e.endsWith("vw")){var a=Number(e.replace("vw",""))/100;return r*a}if(e.endsWith("vh")){var a=Number(e.replace("vh",""))/100;return n*a}}return e},Qf=function(e,t,r,n,a,o,i){return n=Kt(n,e.width,t,r),a=Kt(a,e.height,t,r),o=Kt(o,e.width,t,r),i=Kt(i,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof a>"u"?void 0:Number(a),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},Jf=function(e){return Array.isArray(e)?e:[e,e]},ep=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],gn="__resizable_base__",tp=(function(e){Yf(t,e);function t(r){var n,a,o,i,l=e.call(this,r)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var d=l.parentNode;if(!d)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(gn):u.className+=gn,d.appendChild(u),u},l.removeBase=function(d){var u=l.parentNode;u&&u.removeChild(d)},l.state={isResizing:!1,width:(a=(n=l.propsSize)===null||n===void 0?void 0:n.width)!==null&&a!==void 0?a:"auto",height:(i=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||qf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var a=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:a,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,a=function(l){var d;if(typeof r.state[l]>"u"||r.state[l]==="auto")return"auto";if(r.propsSize&&r.propsSize[l]&&(!((d=r.propsSize[l])===null||d===void 0)&&d.toString().endsWith("%"))){if(r.state[l].toString().endsWith("%"))return r.state[l].toString();var u=r.getParentSize(),h=Number(r.state[l].toString().replace("px","")),p=h/u[l]*100;return"".concat(p,"%")}return Ar(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?Ar(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?Ar(n.height):a("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,a=this.parentNode.style.flexWrap;a!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var o={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=a),this.removeBase(r),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var a=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof a>"u"||a==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var a=this.props.boundsByDirection,o=this.state.direction,i=a&&st("left",o),l=a&&st("top",o),d,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=i?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(r=r&&r<d?r:d),u&&Number.isFinite(u)&&(n=n&&n<u?n:u),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var a=this.props.scale||1,o=Jf(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,h=d.original,p=this.props,m=p.lockAspectRatio,x=p.lockAspectRatioExtraHeight,y=p.lockAspectRatioExtraWidth,v=h.width,b=h.height,C=x||0,I=y||0;return st("right",u)&&(v=h.width+(r-h.x)*i/a,m&&(b=(v-I)/this.ratio+C)),st("left",u)&&(v=h.width-(r-h.x)*i/a,m&&(b=(v-I)/this.ratio+C)),st("bottom",u)&&(b=h.height+(n-h.y)*l/a,m&&(v=(b-C)*this.ratio+I)),st("top",u)&&(b=h.height-(n-h.y)*l/a,m&&(v=(b-C)*this.ratio+I)),{newWidth:v,newHeight:b}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,a,o){var i=this.props,l=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,h=typeof o.width>"u"?10:o.width,p=typeof a.width>"u"||a.width<0?r:a.width,m=typeof o.height>"u"?10:o.height,x=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(m-y)*this.ratio+v,C=(x-y)*this.ratio+v,I=(h-v)/this.ratio+y,N=(p-v)/this.ratio+y,w=Math.max(h,b),S=Math.min(p,C),T=Math.max(m,I),L=Math.min(x,N);r=$t(r,w,S),n=$t(n,T,L)}else r=$t(r,h,p),n=$t(n,m,x);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var a=n.getBoundingClientRect();this.parentLeft=a.left*r,this.parentTop=a.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*r,this.targetTop=o.top*r}if(this.resizable){var i=this.resizable.getBoundingClientRect(),l=i.left,d=i.top,u=i.right,h=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=h*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&Xf(r.nativeEvent)?(a=r.nativeEvent.clientX,o=r.nativeEvent.clientY):r.nativeEvent&&Ht(r.nativeEvent)&&(a=r.nativeEvent.touches[0].clientX,o=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(r,n,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ee(Ee({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(p)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ht(r))try{r.preventDefault(),r.stopPropagation()}catch{}var a=this.props,o=a.maxWidth,i=a.maxHeight,l=a.minWidth,d=a.minHeight,u=Ht(r)?r.touches[0].clientX:r.clientX,h=Ht(r)?r.touches[0].clientY:r.clientY,p=this.state,m=p.direction,x=p.original,y=p.width,v=p.height,b=this.getParentSize(),C=Qf(b,this.window.innerWidth,this.window.innerHeight,o,i,l,d);o=C.maxWidth,i=C.maxHeight,l=C.minWidth,d=C.minHeight;var I=this.calculateNewSizeFromDirection(u,h),N=I.newHeight,w=I.newWidth,S=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(w=mn(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(N=mn(N,this.props.snap.y,this.props.snapGap));var T=this.calculateNewSizeFromAspectRatio(w,N,{width:S.maxWidth,height:S.maxHeight},{width:l,height:d});if(w=T.newWidth,N=T.newHeight,this.props.grid){var L=hn(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),E=hn(N,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,j=D===0||Math.abs(L-w)<=D?L:w,A=D===0||Math.abs(E-N)<=D?E:N;w=j,N=A}var _={width:w-x.width,height:N-x.height};if(this.delta=_,y&&typeof y=="string"){if(y.endsWith("%")){var P=w/b.width*100;w="".concat(P,"%")}else if(y.endsWith("vw")){var O=w/this.window.innerWidth*100;w="".concat(O,"vw")}else if(y.endsWith("vh")){var R=w/this.window.innerHeight*100;w="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var P=N/b.height*100;N="".concat(P,"%")}else if(v.endsWith("vw")){var O=N/this.window.innerWidth*100;N="".concat(O,"vw")}else if(v.endsWith("vh")){var R=N/this.window.innerHeight*100;N="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(N,"height")};this.flexDir==="row"?M.flexBasis=M.width:this.flexDir==="column"&&(M.flexBasis=M.height);var $=this.state.width!==M.width,V=this.state.height!==M.height,K=this.state.flexBasis!==M.flexBasis,W=$||V||K;W&&Ya.flushSync(function(){n.setState(M)}),this.props.onResize&&W&&this.props.onResize(r,m,this.resizable,_)}},t.prototype.onMouseUp=function(r){var n,a,o=this.state,i=o.isResizing,l=o.direction;o.original,!(!i||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,l,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(a=this.props.size.height)!==null&&a!==void 0?a:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Ee(Ee({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,a;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(a=r.height)!==null&&a!==void 0?a:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,a=n.enable,o=n.handleStyles,i=n.handleClasses,l=n.handleWrapperStyle,d=n.handleWrapperClass,u=n.handleComponent;if(!a)return null;var h=Object.keys(a).map(function(p){return a[p]!==!1?s.jsx(Zf,{direction:p,onResizeStart:r.onResizeStart,replaceStyles:o&&o[p],className:i&&i[p],children:u&&u[p]?u[p]:null},p):null});return s.jsx("div",{className:d,style:l,children:h})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return ep.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Ee(Ee(Ee({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(a.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return s.jsxs(o,Ee({style:a,className:this.props.className},n,{ref:function(i){i&&(r.resizable=i)},children:[this.state.isResizing&&s.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t})(g.PureComponent);const rp=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const h=e===St.Left,p=h?F.IconChevronLeft:F.IconChevronRight,m=x=>{let y;switch(x.key){case"ArrowLeft":y=r+(h?o:-o);break;case"ArrowRight":y=r+(h?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}x.preventDefault(),l(y)};return s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":n,"aria-valuemax":a,tabIndex:0,onKeyDown:m,className:f.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:d??s.jsx(p,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",h?"right-full":"left-full")})})},sp=16,Pa=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=St.Right,keyboardStep:d=sp,ariaLabel:u="Resize panel",className:h,resizeHandlerClassName:p,resizeHandler:m})=>{const[x,y]=g.useState(!1),[v,b]=g.useState(a??t),C=n!==void 0,I=C?n:v,N=g.useRef(null),w=g.useCallback(()=>{y(!0)},[]),S=g.useCallback(()=>{y(!1);const E=N.current?.resizable?.getBoundingClientRect(),D=E?Math.round(E.width):t;C||b(D),o?.(D)},[o,C,t]),T=g.useCallback(E=>{const D=Math.min(r,Math.max(t,E));D!==I&&(C||(b(D),N.current?.updateSize({width:D,height:"100%"})),i?.(D),o?.(D))},[r,t,I,C,i,o]),L=g.useMemo(()=>{const E=l===St.Left,D=s.jsx(rp,{side:l,isResizing:x,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:T,customHandler:m,handlerClassName:p});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?D:void 0,right:E?void 0:D},onResizeStart:w,onResize:(j,A,_)=>{i?.(Math.round(_.offsetWidth))},onResizeStop:S}},[l,C,I,t,r,d,u,T,m,p,x,w,S,i]);return s.jsx(tp,{ref:N,...L,children:s.jsx("div",{className:f.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",h,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},np=16,ap=1e3,op=4,Lr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",ip=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=np,className:d})=>{const[u,h]=g.useState(!1),[p,m]=g.useState(!1),[x,y]=g.useState(!1),v=g.useRef(null),b=g.useRef(null),C=g.useRef({x:0,y:0}),I=g.useRef(null),N=g.useRef(void 0),w=g.useRef(void 0);g.useEffect(()=>()=>{clearTimeout(N.current),w.current!=null&&cancelAnimationFrame(w.current)},[]);const S=g.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),T=R=>{b.current?.style.setProperty("transform",`translate(${R.clientX}px, ${R.clientY}px) translate(-50%, -50%)`),y(!0)},L=R=>{C.current={x:R.clientX,y:R.clientY},clearTimeout(N.current),N.current=setTimeout(()=>m(!0),ap)},E=R=>{T(R),L(R)},D=()=>{y(!1),clearTimeout(N.current),m(!1)},j=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},h(!0))},A=R=>{T(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>op&&(m(!1),L(R));return}const $=Lr(v.current)?-1:1,V=S(M.width+(R.clientX-M.x)*$);w.current!=null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>a(V))},_=R=>{I.current!=null&&(I.current=null,h(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},P=R=>{const M=Lr(v.current)?-1:1;let $;switch(R.key){case"ArrowRight":$=e+l*M;break;case"ArrowLeft":$=e-l*M;break;case"Home":$=t;break;case"End":$=r;break;default:return}R.preventDefault(),a(S($))},O=()=>{n!=null&&a(S(n))};return s.jsx("div",{ref:v,role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,tabIndex:0,className:f.mergeClasses("absolute inset-y-0 end-0 -me-1 w-2 touch-none select-none","dial-resize-handle",x&&"dial-resize-handle-cursor-ready",p&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:E,onPointerLeave:D,onPointerDown:j,onPointerMove:A,onPointerUp:_,onPointerCancel:_,onKeyDown:P,onDoubleClick:O,children:s.jsx(c.Tooltip,{tooltip:i,open:p&&!u,placement:Lr(v.current)?c.TooltipPlacement.Left:c.TooltipPlacement.Right,asChild:!0,children:s.jsx("span",{ref:b,"aria-hidden":"true",className:f.mergeClasses("pointer-events-none fixed top-0 left-0 z-tooltip hidden text-secondary","dial-resize-handle-arrow"),children:s.jsx(F.IconArrowsHorizontal,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE})})})})},lp=({enabled:e=!0,children:t,...r})=>e?s.jsx(Pa,{...r,children:t}):t,cp=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i})=>{const l=g.useId();return s.jsxs("section",{"aria-labelledby":l,className:f.mergeClasses("flex size-full flex-col items-center justify-center px-4 text-center",a,c.DIAL_KIT_CLASS.stateScreen),children:[r!=null&&s.jsx("span",{"aria-hidden":"true",className:"mb-4 flex size-14 items-center justify-center rounded-full border border-secondary text-secondary",children:r}),s.jsx("h1",{id:l,className:f.mergeClasses("dial-body-semi-text text-primary",o),children:e}),t!=null&&s.jsx("p",{className:f.mergeClasses("dial-small-text mt-2 text-secondary",i),children:t}),n!=null&&s.jsx("div",{className:"mt-4",children:n})]})};var ot=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(ot||{});const dp={[ot.Row]:{header:"gap-2",title:"dial-small-semi-text",description:"dial-small-text"},[ot.Caption]:{header:"gap-4",title:"dial-caption-lead-semi-text",description:"dial-tiny-text"},[ot.Setting]:{header:"gap-4",title:"dial-tiny-semi-text",description:"dial-tiny-text"}},up=({title:e,action:t,description:r,variant:n=ot.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const h=g.useId(),p=dp[n],m=`h${a}`;return s.jsxs("section",{"aria-labelledby":h,className:f.mergeClasses("flex flex-col gap-3",i,c.DIAL_KIT_CLASS.formSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center justify-between",p.header),children:[s.jsx(m,{id:h,className:f.mergeClasses("min-w-0 text-primary",p.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",p.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var we=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(we||{});const Ba=8e3,Dt="flex size-7 shrink-0 items-center justify-center",za={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},fp=({title:e,isCollapsed:t,itemsId:r,labels:n,onToggleCollapse:a,onClose:o})=>{const i=t?F.IconChevronUp:F.IconChevronDown;return s.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[s.jsx("span",{className:"dial-small-paragraph-semi-text min-w-0 truncate text-primary",children:e}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(c.GhostIconButton,{"aria-label":t?n.expandAriaLabel:n.collapseAriaLabel,"aria-expanded":!t,"aria-controls":r,size:c.ElementSize.Small,icon:s.jsx(i,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:a,className:Dt}),s.jsx(c.GhostIconButton,{"aria-label":n.closeAriaLabel,size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Dt})]})]})},xn=({message:e,isError:t})=>{const r=t?F.IconAlertCircleFilled:F.IconAlertTriangleFilled;return s.jsx(c.Tooltip,{tooltip:e,asChild:!0,children:s.jsx("span",{className:Dt,role:"img","aria-label":e,tabIndex:0,children:s.jsx(r,{size:f.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},Fr=2,$r=(f.DIAL_ICON_SIZE.SM-Fr)/2,bn=2*Math.PI*$r,pp=({percent:e,label:t,className:r})=>{const n=Math.min(100,Math.max(0,Math.round(e))),a=f.DIAL_ICON_SIZE.SM/2;return s.jsx("span",{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,className:f.mergeClasses("flex",r),children:s.jsxs("svg",{width:f.DIAL_ICON_SIZE.SM,height:f.DIAL_ICON_SIZE.SM,viewBox:`0 0 ${f.DIAL_ICON_SIZE.SM} ${f.DIAL_ICON_SIZE.SM}`,className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:a,cy:a,r:$r,fill:"none",strokeWidth:Fr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:$r,fill:"none",strokeWidth:Fr,strokeLinecap:"round",strokeDasharray:bn,strokeDashoffset:bn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},hp=({item:e,labels:t,onCancel:r})=>{const n=e.status===we.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(ys,{type:Oe.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===we.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(pp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===we.Success&&s.jsx("span",{className:Dt,role:"img","aria-label":t.successLabel,children:s.jsx(F.IconCheck,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===we.Warning&&s.jsx(xn,{message:e.message||t.warningMessage,isError:!1}),e.status===we.Failed&&s.jsx(xn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},mp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===we.InProgress?0:100)),0)/e.length),gp=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,xp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=Ba,className:i,bodyClassName:l})=>{const[d,u]=g.useState(!1),[h,p]=g.useState(!1),m=g.useId(),x={...za,...a},y=t.filter(S=>S.status===we.InProgress).length,v=y>0,b=t.some(S=>S.status===we.Failed),C=t.length>0&&t.every(S=>S.status===we.Success),I=g.useCallback(()=>{v?p(!0):r()},[v,r]),N=g.useCallback(()=>{p(!1),r()},[r]),w=g.useCallback(()=>{u(S=>!S)},[]);return g.useEffect(()=>{if(!C||o<=0)return;const S=setTimeout(r,o);return()=>clearTimeout(S)},[C,o,r]),t.length===0?null:s.jsxs("div",{role:"status","aria-live":"polite",className:f.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,c.DIAL_KIT_CLASS.transferQueue),children:[s.jsx(fp,{title:e,isCollapsed:d,itemsId:m,labels:x,onToggleCollapse:w,onClose:I}),d&&v&&s.jsx(Tn,{value:mp(t),size:c.ElementSize.Small,"aria-label":x.queueProgressAriaLabel,"aria-valuetext":x.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:m,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(S=>s.jsx(hp,{item:S,labels:x,onCancel:n},S.id))}),s.jsx(Ea,{open:h,header:x.closeConfirmHeader,description:gp(b,x),confirmLabel:x.closeConfirmLabel,cancelLabel:x.closeCancelLabel,variant:ct.Danger,onConfirm:N,onClose:()=>p(!1)})]})};exports.BASE_ICON_PROPS=f.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=f.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=f.DIAL_ICON_SIZE;exports.DIAL_KIT_ICON_STROKE=f.DIAL_KIT_ICON_STROKE;exports.mergeClasses=f.mergeClasses;exports.ButtonAppearance=c.ButtonAppearance;exports.ButtonVariant=c.ButtonVariant;exports.CaptionText=c.CaptionText;exports.Checkbox=c.Checkbox;exports.CheckboxBox=c.CheckboxBox;exports.CloseButton=c.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=c.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=c.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=c.DIAL_KIT_CLASS;exports.DangerIconButton=c.DangerIconButton;exports.DateCellRenderer=c.DateCellRenderer;exports.DialIcon=c.DialIcon;exports.Dropdown=c.Dropdown;exports.DropdownItemType=c.DropdownItemType;exports.DropdownTrigger=c.DropdownTrigger;exports.DropdownType=c.DropdownType;exports.ElementSize=c.ElementSize;exports.EllipsisTooltip=c.EllipsisTooltip;exports.ErrorText=c.ErrorText;exports.GRID_ALIGN_RIGHT_CLASS=c.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=c.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=c.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=c.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=c.GRID_THEME_PARAMS;exports.GhostIconButton=c.GhostIconButton;exports.Grid=c.Grid;exports.GridAppearance=c.GridAppearance;exports.GridColorScheme=c.GridColorScheme;exports.GridSelectionMode=c.GridSelectionMode;exports.Highlight=c.Highlight;exports.IconButton=c.IconButton;exports.InfoButton=c.InfoButton;exports.Input=c.Input;exports.InteractiveTooltip=c.InteractiveTooltip;exports.InteractiveTooltipTrigger=c.InteractiveTooltipTrigger;exports.Label=c.Label;exports.MenuItem=c.MenuItem;exports.MenuItemMark=c.MenuItemMark;exports.NeutralIconButton=c.NeutralIconButton;exports.NoDataContent=c.NoDataContent;exports.PrimaryIconButton=c.PrimaryIconButton;exports.Radio=c.Radio;exports.Search=c.Search;exports.StaticIconButton=c.StaticIconButton;exports.ThemeScope=c.ThemeScope;exports.Tooltip=c.Tooltip;exports.TooltipContainer=c.TooltipContainer;exports.TooltipContent=c.TooltipContent;exports.TooltipPlacement=c.TooltipPlacement;exports.TooltipTrigger=c.TooltipTrigger;exports.baseColumnComparator=c.baseColumnComparator;exports.checkColDefsChanges=c.checkColDefsChanges;exports.convertToDate=c.convertToDate;exports.useThemeScope=c.useThemeScope;exports.EditorThemes=vn.EditorThemes;exports.LazyMarkdownEditor=vn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Oa;exports.Accordion=Ta;exports.AccordionCaretPosition=tr;exports.AnalyticsBar=Ut;exports.AnalyticsBarGroup=vu;exports.AnalyticsCard=bu;exports.AnalyticsCardVariant=Ue;exports.AnalyticsHistogram=Cu;exports.AutocompleteTagInput=zf;exports.Avatar=ka;exports.AvatarColor=Be;exports.AvatarShape=dt;exports.Badge=bs;exports.BadgeColor=je;exports.BadgeVariant=ke;exports.BottomSheet=If;exports.Breadcrumbs=cu;exports.BreadcrumbsSize=qe;exports.Button=Qe;exports.ButtonDropdown=fu;exports.Calendar=Zd;exports.CalendarMode=xe;exports.CardShell=pd;exports.CollapsibleSidebar=Gf;exports.ConditionalResizableContainer=lp;exports.ConfirmationPopup=Ea;exports.ConfirmationPopupVariant=ct;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=At;exports.DEFAULT_TRANSFER_QUEUE_LABELS=za;exports.DangerButton=Hc;exports.DialAccordion=wn;exports.DialAnalyticsBar=Wt;exports.DialAnalyticsBarGroup=oo;exports.DialAnalyticsCard=ao;exports.DialAnalyticsErrorTag=Gr;exports.DialAnalyticsHistogram=uo;exports.DialBreadcrumb=Bo;exports.DialBreadcrumbItem=vt;exports.DialButton=Tt;exports.DialCaptionText=Hr;exports.DialCloseButton=On;exports.DialDangerButton=zn;exports.DialDangerIconButton=An;exports.DialDropdown=qt;exports.DialEllipsisTooltip=it;exports.DialErrorText=$e;exports.DialFileNodeType=Fe;exports.DialFilePermission=oa;exports.DialFileResourceType=os;exports.DialGhostButton=Fo;exports.DialGhostIconButton=Ln;exports.DialIconButton=Lt;exports.DialInput=$n;exports.DialItemType=Oe;exports.DialLabel=Zr;exports.DialLabelledText=vo;exports.DialLinkButton=zo;exports.DialLoadFileArea=na;exports.DialLoadFileAreaField=tc;exports.DialLoader=Et;exports.DialNeutralButton=Bn;exports.DialNeutralIconButton=Do;exports.DialNoDataContent=bo;exports.DialPrimaryButton=Xr;exports.DialPrimaryIconButton=wo;exports.DialRemoveButton=Fn;exports.DialSecondaryIconButton=To;exports.DialSteps=xo;exports.DialSuccessIconButton=Ao;exports.DialTabs=Ro;exports.DialTag=Sn;exports.DialTertiaryIconButton=Eo;exports.DialTooltip=Se;exports.DialTooltipContainer=Kr;exports.DialTooltipContent=Wr;exports.DialTooltipTrigger=Vr;exports.EDITABLE_CONTAINER_ATTRIBUTE=as;exports.EntityIdentity=Ra;exports.EntityType=pe;exports.ErrorMessageNotification=yd;exports.ErrorToastNotification=hd;exports.FabButton=du;exports.FileDropzone=df;exports.FileIcon=ys;exports.FileName=La;exports.FilterChips=cf;exports.FlexibleActionsDirection=aa;exports.FolderName=Cf;exports.FolderPath=qd;exports.FormSection=up;exports.FormSectionVariant=ot;exports.GeneralMessageNotification=jd;exports.GeneralToastNotification=vd;exports.GhostButton=ps;exports.InfoMessageNotification=Cd;exports.InfoToastNotification=md;exports.InlineSelect=pu;exports.InlineSelectTrigger=Da;exports.JsonSchemaType=H;exports.LabelledText=Iu;exports.LinkButton=Vc;exports.LoadingMessageNotification=Nd;exports.LoadingToastNotification=bd;exports.MultiSelectTags=It;exports.NOT_ALLOWED_SPACES=is;exports.NOT_ALLOWED_SPACES_REGEXP=fc;exports.NOT_ALLOWED_SYMBOLS=la;exports.NOT_ALLOWED_SYMBOLS_REGEXP=uc;exports.NeutralButton=fs;exports.Notification=xs;exports.NotificationType=fe;exports.NotificationVariant=te;exports.NumberInput=gs;exports.OutlinedButton=Gc;exports.PasswordInput=ga;exports.Popup=vs;exports.PopupSize=Ge;exports.PrimaryButton=ha;exports.ProgressBar=Tn;exports.RadioGroup=wt;exports.RadioGroupOrientation=_e;exports.RadioGroupPopupField=Vu;exports.ResizableContainer=Pa;exports.ResizableContainerSide=St;exports.ResizeHandle=ip;exports.SchemaDisplayMode=ur;exports.SchemaOrientation=fr;exports.SchemaRenderer=ld;exports.SchemaRendererVariant=at;exports.ScreenResolution=Xt;exports.SegmentedControl=rf;exports.Select=Ke;exports.SelectedEntityCard=Af;exports.SharedEntityIndicator=Aa;exports.SideDrawer=Lf;exports.Skeleton=Vt;exports.SkeletonAvatarShape=Yt;exports.SkeletonAvatarSize=yt;exports.SkeletonVariant=Ae;exports.Slider=Wf;exports.Spinner=Ve;exports.StarterButton=Wc;exports.StateScreen=cp;exports.StepStatus=be;exports.SuccessMessageNotification=Id;exports.SuccessToastNotification=gd;exports.Switch=xa;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Ba;exports.TabOrientation=Ze;exports.TabStatus=lt;exports.TabView=Ye;exports.Tabs=af;exports.Tag=Le;exports.TagAppearance=De;exports.TagInput=Mf;exports.Textarea=ma;exports.TextareaResize=hs;exports.ToggleIconButton=Gu;exports.TransferQueue=xp;exports.TransferQueueItemStatus=we;exports.WarningMessageNotification=Sd;exports.WarningToastNotification=xd;exports.editableContainerProps=rc;exports.extractInitials=_a;exports.getTimezoneLabel=ia;exports.matchesAccept=zr;exports.useEditableItem=sc;exports.wrapInRootFolder=cc;