@epam/ai-dial-ui-kit 0.15.0-dev.50 → 0.15.0-dev.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +8 -0
- package/dist/DateCellRenderer-CmgeZvYm.cjs +1 -0
- package/dist/JsonEditor-eAV7SaKu.cjs +1 -0
- package/dist/{MarkdownEditor-BKtFs714.cjs → MarkdownEditor-Cp-KX6-T.cjs} +1 -1
- package/dist/{MarkdownEditor-Bapd1ycU.cjs → MarkdownEditor-Dav_pp0T.cjs} +1 -1
- package/dist/MarkdownEditorContainer-96cKYmYd.cjs +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +144 -137
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +70 -66
- package/dist/components/New/Slider/Slider.js +115 -86
- package/dist/components/New/Slider/utils.js +14 -6
- package/dist/components-manifest.json +45 -4
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +60 -59
- package/dist/editor-BH6_A1k2.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/lazy-DMVYJhUR.cjs +1 -0
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +11 -0
- package/dist/src/components/New/InteractiveTooltip/InteractiveTooltip.d.ts +13 -2
- package/dist/src/components/New/Slider/Slider.d.ts +9 -0
- package/dist/src/components/New/Slider/utils.d.ts +11 -3
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types/tooltip.d.ts +4 -0
- package/dist/types/tooltip.js +3 -2
- package/package.json +1 -1
- package/dist/DateCellRenderer-X6vXPDIG.cjs +0 -1
- package/dist/JsonEditor-Bxui5wJH.cjs +0 -1
- package/dist/MarkdownEditorContainer-B5aHwoYF.cjs +0 -1
- package/dist/lazy-_W6FYhKg.cjs +0 -1
package/dist/dial-ui-kit.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./use-file-manager-tabs-Bzzwwcgk.cjs"),Ue=require("./Switch-DE6MrcqJ.cjs"),r=require("react/jsx-runtime"),g=require("react"),$=require("@tabler/icons-react"),ce=require("classnames"),O=require("./DateCellRenderer-CZNa4jVJ.cjs"),H=require("./icon-CrGVkVpG.cjs"),S=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-X6vXPDIG.cjs"),L=require("./IconButton-DHOFapLo.cjs"),aa=require("react-dom"),wt=require("./lazy-_W6FYhKg.cjs"),ne=require("@floating-ui/react"),re=require("./icon-DhjrDQ8I.cjs");function oa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Gr=oa(g),Xe=({label:e,className:t,icon:n,selected:s,closable:a,onClick:o,onRemove:i})=>{const l=S.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return r.jsxs("div",{className:l,onClick:o,children:[r.jsx(O.DialIcon,{icon:n}),r.jsx(O.DialEllipsisTooltip,{text:e}),a&&i&&r.jsx(v.DialButton,{className:"p-0",iconAfter:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>i(c)})]},e)},jr=({label:e="Error",className:t})=>r.jsx(Xe,{label:e,className:S.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var St=(e=>(e.Default="default",e.Compact="compact",e))(St||{});const ia={[St.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[St.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},la=({title:e,value:t,description:n,variant:s=St.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=ia[s],h=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return r.jsxs("div",{className:S.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),children:[l!==void 0?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:p.title,children:e}),r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",h?"bg-success text-success":"bg-error text-error"),children:u})]}):r.jsx("span",{className:p.title,children:e}),a?r.jsx(jr,{className:"self-start"}):o?r.jsx(v.DialLoader,{fullWidth:!1,className:"self-start"}):f?r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r.jsx(O.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),r.jsx("span",{className:p.value,children:f[0].value})]}),r.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r.jsx(O.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),r.jsx("span",{className:p.value,children:f[1].value})]})]}):r.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&n!=null&&n!==!1&&r.jsx("span",{className:"dial-tiny-text text-secondary",children:n})]})},Tr=[{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"}],ca=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),da=(e,t)=>{if(e<=0)return;let n;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(n=s.color);return n},kt=({value:e,maxValue:t=1,error:n,isLoading:s,title:a,valueLabel:o,colorMap:i=Tr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const h=e==null,u=!!(n||s||!h),m=ca(h?0:e,t),C=da(m,i),x=o??(h?"—":e),b=p??(typeof a=="string"?a:void 0),y=n||s,N=n?r.jsx(jr,{}):s?r.jsx(v.DialLoader,{fullWidth:!1}):r.jsx("span",{className:S.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),D=u?r.jsx("div",{role:"progressbar","aria-valuenow":n||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":b,className:S.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",n?"bg-error":"bg-layer-1"),children:!y&&r.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:C}})}):null,I=r.jsx("span",{className:S.mergeClasses("dial-small-text text-primary",c),children:a});return f?r.jsxs("div",{className:S.mergeClasses("flex flex-row items-center gap-2",l),children:[r.jsx("div",{className:"w-1/2 min-w-0",children:I}),r.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[r.jsx("div",{className:"min-w-0 flex-1",children:D}),N]})]}):r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-1",l),children:[r.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[I,N]}),D]})},zn=({title:e,description:t,children:n,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[h,u]=g.useState(a),m=i?!0:p?s:h,C=g.useId(),x=()=>{if(o)return;const b=!m;p||u(b),l?.(b)};return r.jsxs("div",{className:S.mergeClasses("rounded border border-secondary",c),children:[r.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":C,disabled:o||i,onClick:x,className:S.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",d),children:[!i&&r.jsx(O.DialIcon,{className:ce("text-secondary transition-transform",m&&"rotate-90"),icon:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),r.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&r.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&r.jsx("div",{id:C,role:"region",className:S.mergeClasses("px-4 pb-4",f),children:n})]})},ua=({title:e,titleTooltip:t,description:n,data:s,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:h,barTitleClassName:u,barValueClassName:m,barClassName:C,barDescriptions:x,className:b})=>{const y=Object.entries(s),N=h?S.mergeClasses("text-secondary",u):u,D=o?"dial-tiny-text text-secondary":void 0,I=t?r.jsx(L.DialTooltip,{tooltip:t,children:e}):e,j=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],_="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",w="group flex flex-col gap-1.5",A=S.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",C);return r.jsx(zn,{title:I,description:n,defaultExpanded:c,nonCollapsible:d,className:b,children:r.jsx("div",{className:S.mergeClasses("flex flex-col",a?"gap-4":h?"gap-2":"gap-3"),children:f?r.jsx(v.DialLoader,{fullWidth:!1,className:"self-center"}):a?j.map(E=>{const T=E in s?s[E]:null,R=E in a?a[E]:null,V=typeof T=="number"&&typeof R=="number"?parseFloat((R-T).toFixed(3)):null,X=V!=null&&V!==0,G=X&&V>0,B=X?G?`+${V}`:String(V):null,U=x?.[E],K=r.jsx("span",{className:"dial-small-text text-secondary",children:E}),Z=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[U?r.jsx(L.DialTooltip,{tooltip:U,children:K}):K,B!=null&&r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:B})]}),r.jsxs("div",{className:A,children:[r.jsx(kt,{title:o?.[0],value:T,maxValue:i,colorMap:l,inline:h,titleClassName:D,ariaLabel:E}),r.jsx(kt,{title:o?.[1],value:R,maxValue:i,colorMap:l,inline:h,titleClassName:D,ariaLabel:`${E} compare`})]})]});return p?r.jsx("button",{type:"button",onClick:()=>p(E,T),className:S.mergeClasses(w,_),children:Z},E):r.jsx("div",{className:w,children:Z},E)}):y.map(([E,T])=>{const R=r.jsx(kt,{title:E,value:T,maxValue:i,colorMap:l,inline:h,titleClassName:N,valueClassName:m,className:C}),M=p?r.jsx("button",{type:"button",onClick:()=>p(E,T),className:_,children:R}):R,V=x?.[E];return V?r.jsx(L.DialTooltip,{tooltip:V,triggerClassName:"flex flex-col",children:M},E):r.jsx(g.Fragment,{children:M},E)})})})},fa="#FF4E50",pa=(e,t)=>{let n=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(n=a)}),n},Ur=(e,t)=>{const n=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=pa(c,t);d>=0&&(n[d]+=1)});const a=Math.max(0,s,...n),o=c=>a>0?c/a:0,i={from:0,to:0,color:fa,count:s,ratio:o(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:n[d],ratio:o(n[d]),isZeroBucket:!1}));return[i,...l]},$n=e=>e<=0?2:e%2===0?e:e+1,ha=e=>{const t=$n(e);return[t,t/2,0]},rr=e=>`${Math.round(e*100)/100}`,Hn=(e,t)=>e===t?rr(e):`${rr(e)}-${rr(t)}`,nr=128,ma=(e,t)=>{const n=Hn(e,t);return e===t?`scored ${n}`:`scored between ${n}`},Zr=(e,t,n,s,a)=>r.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&r.jsx("strong",{children:e}),r.jsxs("span",{children:[t," out of ",n," ",s]}),r.jsx("span",{children:ma(a.from,a.to)})]}),ga=({title:e,values:t,colorMap:n=Tr,valueTitle:s="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=Ur(t,n),p=l?Ur(l,n):void 0,h=t.length,u=l?.length??0,m=Math.max(h,u),C=$n(m),x=ha(m),b=I=>I.map(j=>({...j,ratio:C>0?j.count/C:0})),y=b(f),N=p?b(p):void 0,D=(I,j,_,w)=>{if(I.count===0)return r.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:r.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${I.ratio*100}%`}})});const A=w?{backgroundImage:`repeating-linear-gradient(135deg, ${I.color} 0px, ${I.color} 1px, transparent 1px, transparent 4px)`,borderColor:I.color}:{backgroundColor:I.color};return r.jsx(L.DialTooltip,{placement:"bottom",tooltip:j,triggerClassName:"flex h-full flex-1 items-end",children:r.jsx("div",{role:"img","aria-label":_,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${I.ratio*100}%`,...A},children:a&&r.jsx("span",{className:"dial-tiny-semi-text text-primary",children:I.count})})})};return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",i),children:[r.jsx("span",{className:"dial-small-text text-primary",children:e}),o?r.jsx("div",{className:"flex items-center justify-center",style:{height:nr},children:r.jsx(v.DialLoader,{fullWidth:!1})}):r.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[r.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:nr},children:x.map((I,j)=>r.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${j/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:I},I))}),r.jsxs("div",{className:"relative min-w-0",children:[x.map((I,j)=>r.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${j/(x.length-1)*100}%`}},I)),r.jsx("div",{className:"relative flex items-end gap-1",style:{height:nr},children:N?y.map((I,j)=>{const _=N[j],w=`${I.count} out of ${h} ${s}`,A=`${_.count} out of ${u} ${s}`;return r.jsxs("div",{className:"flex h-full flex-1 items-end",children:[D(I,Zr(c,I.count,h,s,I),w,!0),D(_,Zr(d,_.count,u,s,_),A,!1)]},j)}):y.map((I,j)=>{const _=`${I.count} out of ${h} ${s}`;return I.count===0?r.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:r.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${I.ratio*100}%`}})},j):r.jsx(L.DialTooltip,{placement:"bottom",tooltip:_,triggerClassName:"flex h-full flex-1 items-end",children:r.jsx("div",{role:"img","aria-label":_,className:S.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${I.ratio*100}%`,backgroundColor:I.color},children:a&&I.count>0&&r.jsx("span",{className:"dial-tiny-semi-text text-primary",children:I.count})})},j)})})]}),r.jsx("div",{}),r.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:y.map((I,j)=>r.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Hn(I.from,I.to)},j))})]})]})},Kn=({value:e,max:t=100,size:n=L.ElementSize.Standard,labelProps:s,valueLabel:a,id:o,className:i,"aria-label":l,...c})=>{const d=g.useId(),f=o??d,p=!!s?.label,h=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,C=Math.min(Math.max(m,0),u),x=u>0?C/u*100:0,b=r.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":h,"aria-label":L.resolveAccessibleName(l,p?void 0:"Progress"),className:S.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",n===L.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&O.DIAL_KIT_CLASS.progressBar),children:r.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?b:r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-1",O.DIAL_KIT_CLASS.progressBar),children:[r.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&r.jsx(k.Label,{...s,id:h}),a&&r.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},xa=7,ba=2,Ca=e=>e<=0?[]:Array.from({length:e},(t,n)=>n+1);var Rt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(Rt||{});const ya=(e,t,n)=>e===t?"active":n<xa||Math.abs(e-t)<=ba?"adjacent":"far",va=({page:e,totalPages:t,onPageChange:n,className:s})=>{const a=Ca(t);return r.jsxs("nav",{"aria-label":"Pagination",className:S.mergeClasses("flex items-center gap-2",s),children:[r.jsx(L.DialIconButton,{icon:r.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:L.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>n(e-1),"aria-label":"Previous page"}),r.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(o=>{const i=ya(o,e,t);return r.jsx("button",{type:"button",onClick:()=>n(o),"aria-label":`Page ${o}`,"aria-current":o===e?"page":void 0,className:S.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",i===Rt.Active&&"h-[8px] w-[32px]",i===Rt.Adjacent&&"size-[8px]",i===Rt.Far&&"size-[4px]")},o)})}),r.jsx(L.DialIconButton,{icon:r.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:L.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>n(e+1),"aria-label":"Next page"})]})},gr=({label:e,id:t,checked:n,indeterminate:s,disabled:a,ariaLabel:o,onChange:i,className:l,...c})=>{const d=g.useCallback(u=>{i?.(u.target.checked,t)},[i,t]),f=ce("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${n||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),p=ce("border rounded",a?"bg-layer-4 border-icon-secondary":""),h=()=>s?r.jsx($.IconMinus,{className:p,...H.BASE_ICON_PROPS}):n?r.jsx($.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return r.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||O.ariaDescription,children:[h(),e&&(typeof e=="string"?r.jsx(O.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),r.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:n,"aria-checked":s?"mixed":n,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible size-0"})]})};var je=(e=>(e.VALID="valid",e.ERROR="error",e))(je||{});const Sa=(e,t)=>{if(t===e.id)switch(e.status){case je.VALID:return"border-accent-secondary text-primary";case je.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case je.VALID:return"border-primary text-primary";case je.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Ia=(e,t)=>{if(t===e.id)switch(e.status){case je.VALID:return"bg-accent-secondary";case je.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case je.VALID:return"bg-accent-secondary";case je.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Na=({step:e,index:t,currentStep:n,onChangeStep:s})=>{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 text-white",i=()=>n===e.id&&e.status===je.ERROR?r.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):n!==e.id&&e.status===je.VALID?r.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return r.jsxs("button",{className:ce(a,Sa(e,n)),onClick:()=>s(e.id),children:[r.jsx("span",{className:ce(o,Ia(e,n)),children:i()}),r.jsx("span",{children:e.name})]})},Da=({steps:e,currentStep:t,onChangeStep:n})=>{const s=a=>{const o=e.findIndex(c=>c.id===t),i=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,i).every(c=>c.status===je.VALID)||i<o)&&n(a)};return r.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>r.jsx(Na,{currentStep:t,onChangeStep:s,step:a,index:o},a.id))})},sr=e=>(e.toString().split(".")[1]??"").length,ja=({value:e,min:t=0,max:n=1,step:s=.1,disabled:a=!1,labelProps:o,labels:i,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:h,labelsClassName:u,"aria-label":m,"aria-labelledby":C,...x})=>{const b=g.useRef(null),y=Math.max(0,Math.min(100,(e-t)/(n-t)*100)),N=sr(s),D=l?l(e):e.toFixed(N),I=g.useCallback(A=>{const E=b.current;if(!E)return e;const T=E.getBoundingClientRect(),R=(A-T.left)/T.width,M=t+R*(n-t),V=sr(s),X=parseFloat((Math.round((M-t)/s)*s+t).toFixed(V));return Math.min(n,Math.max(t,X))},[t,n,s,e]),j=g.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(I(A.clientX)))},[a,I,c]),_=g.useCallback(A=>{a||A.buttons===0||c?.(I(A.clientX))},[a,I,c]),w=g.useCallback(A=>{if(a)return;const E=sr(s),T=V=>parseFloat((Math.round((V-t)/s)*s+t).toFixed(E)),R=V=>Math.min(n,Math.max(t,V));let M=e;switch(A.key){case"ArrowRight":case"ArrowUp":M=R(T(e+s));break;case"ArrowLeft":case"ArrowDown":M=R(T(e-s));break;case"Home":M=t;break;case"End":M=n;break;default:return}A.preventDefault(),M!==e&&c?.(M)},[a,e,s,t,n,c]);return r.jsxs("div",{className:S.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[o&&r.jsx(Ue.DialLabel,{...o,htmlFor:x.id}),r.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:j,onPointerMove:_,children:[r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${y}%`}}),r.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":C,className:S.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",h),style:{left:`${y}%`},onKeyDown:w,children:D})]}),i&&r.jsx("div",{className:S.mergeClasses("dial-tiny-text flex text-secondary",u),children:i.length===3?r.jsxs(r.Fragment,{children:[r.jsx("span",{children:i[0]}),r.jsx("span",{className:"flex-1 text-center",children:i[1]}),r.jsx("span",{children:i[2]})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:i[0]}),r.jsx("span",{className:"ml-auto",children:i[1]})]})})]})},Ta=({label:e,text:t,tooltip:n,children:s,postfix:a,className:o})=>r.jsxs("div",{className:S.mergeClasses("flex flex-col",s?"":"max-w-[200px]",o),children:[e&&r.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||r.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[r.jsx(L.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:n||t,children:t}),a||null]})]}),Vn=g.createContext({dragDropManager:void 0});function Te(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 Wr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),qr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Yr={INIT:"@@redux/INIT"+qr(),REPLACE:"@@redux/REPLACE"+qr()};function wa(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 Ea(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(_a(e))return"date";if(Aa(e))return"error";var n=Oa(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Oa(e){return typeof e.constructor=="function"?e.constructor.name:null}function Aa(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function _a(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function lt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ea(e)),t}function Gn(e,t,n){var s;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Te(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 n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Te(1):"Expected the enhancer to be a function. Instead, received: '"+lt(n)+"'");return n(Gn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Te(2):"Expected the root reducer to be a function. Instead, received: '"+lt(e)+"'");var a=e,o=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Te(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(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Te(4):"Expected the listener to be a function. Instead, received: '"+lt(C)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Te(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 x=!0;return d(),l.push(C),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Te(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.");x=!1,d();var y=l.indexOf(C);l.splice(y,1),i=null}}}function h(C){if(!wa(C))throw new Error(process.env.NODE_ENV==="production"?Te(7):"Actions must be plain objects. Instead, the actual type was: '"+lt(C)+"'. 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 C.type>"u")throw new Error(process.env.NODE_ENV==="production"?Te(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Te(9):"Reducers may not dispatch actions.");try{c=!0,o=a(o,C)}finally{c=!1}for(var x=i=l,b=0;b<x.length;b++){var y=x[b];y()}return C}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Te(10):"Expected the nextReducer to be a function. Instead, received: '"+lt(C));a=C,h({type:Yr.REPLACE})}function m(){var C,x=p;return C={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Te(11):"Expected the observer to be an object. Instead, received: '"+lt(y)+"'");function N(){y.next&&y.next(f())}N();var D=x(N);return{unsubscribe:D}}},C[Wr]=function(){return this},C}return h({type:Yr.INIT}),s={dispatch:h,subscribe:p,getState:f,replaceReducer:u},s[Wr]=m,s}function te(e,t,...n){if(La()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return n[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function La(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function ka(e,t,n){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:n||null,e)}function Ra(e,t){return e.filter(n=>n!==t)}function Un(e){return typeof e=="object"}function Pa(e,t){const n=new Map,s=o=>{n.set(o,n.has(o)?n.get(o)+1:1)};e.forEach(s),t.forEach(s);const a=[];return n.forEach((o,i)=>{o===1&&a.push(i)}),a}function Ma(e,t){return e.filter(n=>t.indexOf(n)>-1)}const wr="dnd-core/INIT_COORDS",Kt="dnd-core/BEGIN_DRAG",Er="dnd-core/PUBLISH_DRAG_SOURCE",Vt="dnd-core/HOVER",Gt="dnd-core/DROP",Ut="dnd-core/END_DRAG";function Xr(e,t){return{type:wr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Fa={type:wr,payload:{clientOffset:null,sourceClientOffset:null}};function Ba(e){return function(n=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Xr(o)),za(n,l,c);const d=Ka(n,l);if(d==null){e.dispatch(Fa);return}let f=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");$a(i),f=i(d)}e.dispatch(Xr(o,f));const h=c.getSource(d).beginDrag(l,d);if(h==null)return;Ha(h),c.pinSource(d);const u=c.getSourceType(d);return{type:Kt,payload:{itemType:u,item:h,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function za(e,t,n){te(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){te(n.getSource(s),"Expected sourceIds to be registered.")})}function $a(e){te(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ha(e){te(Un(e),"Item must be an object.")}function Ka(e,t){let n=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){n=e[s];break}return n}function Va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Va(e,a,n[a])})}return e}function Ua(e){return function(n={}){const s=e.getMonitor(),a=e.getRegistry();Za(s),Ya(s).forEach((i,l)=>{const c=Wa(i,l,a,s),d={type:Gt,payload:{dropResult:Ga({},n,c)}};e.dispatch(d)})}}function Za(e){te(e.isDragging(),"Cannot call drop while not dragging."),te(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Wa(e,t,n,s){const a=n.getTarget(e);let o=a?a.drop(s,e):void 0;return qa(o),typeof o>"u"&&(o=t===0?{}:s.getDropResult()),o}function qa(e){te(typeof e>"u"||Un(e),"Drop result must either be an object or undefined.")}function Ya(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Xa(e){return function(){const n=e.getMonitor(),s=e.getRegistry();Ja(n);const a=n.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(n,a),s.unpinSource()),{type:Ut}}}function Ja(e){te(e.isDragging(),"Cannot call endDrag while not dragging.")}function xr(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function Qa(e){return function(n,{clientOffset:s}={}){eo(n);const a=n.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return ro(a,i,l),to(a,o,i),no(a,o,i),{type:Vt,payload:{targetIds:a,clientOffset:s||null}}}}function eo(e){te(Array.isArray(e),"Expected targetIds to be an array.")}function to(e,t,n){te(t.isDragging(),"Cannot call hover while not dragging."),te(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];te(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const o=n.getTarget(a);te(o,"Expected targetIds to be registered.")}}function ro(e,t,n){for(let s=e.length-1;s>=0;s--){const a=e[s],o=t.getTargetType(a);xr(o,n)||e.splice(s,1)}}function no(e,t,n){e.forEach(function(s){n.getTarget(s).hover(t,s)})}function so(e){return function(){if(e.getMonitor().isDragging())return{type:Er}}}function ao(e){return{beginDrag:Ba(e),publishDragSource:so(e),hover:Qa(e),drop:Ua(e),endDrag:Xa(e)}}class oo{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function s(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&n(l)}}const a=ao(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=s(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function io(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Zn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lo(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:s}=e;return!t||!n||!s?null:Zn(io(t,s),n)}function co(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Zn(t,n)}const Ct=[],Or=[];Ct.__IS_NONE__=!0;Or.__IS_ALL__=!0;function uo(e,t){return e===Ct?!1:e===Or||typeof t>"u"?!0:Ma(t,e).length>0}class fo{subscribeToStateChange(t,n={}){const{handlerIds:s}=n;te(typeof t=="function","listener must be a function."),te(typeof s>"u"||Array.isArray(s),"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&&!uo(i.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){te(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return te(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(te(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return xr(s,a)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(te(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:s}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!xr(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return s?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 lo(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return co(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const Jr=typeof global<"u"?global:self,Wn=Jr.MutationObserver||Jr.WebKitMutationObserver;function qn(e){return function(){const n=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(n),clearInterval(s),e()}}}function po(e){let t=1;const n=new Wn(e),s=document.createTextNode("");return n.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ho=typeof Wn=="function"?po:qn;class mo{enqueueTask(t){const{queue:n,requestFlush:s}=this;n.length||(s(),this.flushing=!0),n[n.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 n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+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=ho(this.flush),this.requestErrorThrow=qn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class go{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class xo{create(t){const n=this.freeTasks,s=n.length?n.pop():new go(this.onError,a=>n[n.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const Yn=new mo,bo=new xo(Yn.registerPendingError);function Co(e){Yn.enqueueTask(bo.create(e))}const Ar="dnd-core/ADD_SOURCE",_r="dnd-core/ADD_TARGET",Lr="dnd-core/REMOVE_SOURCE",Zt="dnd-core/REMOVE_TARGET";function yo(e){return{type:Ar,payload:{sourceId:e}}}function vo(e){return{type:_r,payload:{targetId:e}}}function So(e){return{type:Lr,payload:{sourceId:e}}}function Io(e){return{type:Zt,payload:{targetId:e}}}function No(e){te(typeof e.canDrag=="function","Expected canDrag to be a function."),te(typeof e.beginDrag=="function","Expected beginDrag to be a function."),te(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Do(e){te(typeof e.canDrop=="function","Expected canDrop to be a function."),te(typeof e.hover=="function","Expected hover to be a function."),te(typeof e.drop=="function","Expected beginDrag to be a function.")}function br(e,t){if(t&&Array.isArray(e)){e.forEach(n=>br(n,!1));return}te(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 Ee;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ee||(Ee={}));let jo=0;function To(){return jo++}function wo(e){const t=To().toString();switch(e){case Ee.SOURCE:return`S${t}`;case Ee.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Qr(e){switch(e[0]){case"S":return Ee.SOURCE;case"T":return Ee.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function en(e,t){const n=e.entries();let s=!1;do{const{done:a,value:[,o]}=n.next();if(o===t)return!0;s=!!a}while(!s);return!1}class Eo{addSource(t,n){br(t),No(n);const s=this.addHandler(Ee.SOURCE,t,n);return this.store.dispatch(yo(s)),s}addTarget(t,n){br(t,!0),Do(n);const s=this.addHandler(Ee.TARGET,t,n);return this.store.dispatch(vo(s)),s}containsHandler(t){return en(this.dragSources,t)||en(this.dropTargets,t)}getSource(t,n=!1){return te(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return te(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return te(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return te(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Qr(t)===Ee.SOURCE}isTargetId(t){return Qr(t)===Ee.TARGET}removeSource(t){te(this.getSource(t),"Expected an existing source."),this.store.dispatch(So(t)),Co(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){te(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Io(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);te(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){te(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,s){const a=wo(t);return this.types.set(a,n),t===Ee.SOURCE?this.dragSources.set(a,s):t===Ee.TARGET&&this.dropTargets.set(a,s),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 Oo=(e,t)=>e===t;function Ao(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function _o(e,t,n=Oo){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!n(e[s],t[s]))return!1;return!0}function Lo(e=Ct,t){switch(t.type){case Vt:break;case Ar:case _r:case Zt:case Lr:return Ct;case Kt:case Er:case Ut:case Gt:default:return Or}const{targetIds:n=[],prevTargetIds:s=[]}=t.payload,a=Pa(n,s);if(!(a.length>0||!_o(n,s)))return Ct;const i=s[s.length-1],l=n[n.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function ko(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ro(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){ko(e,a,n[a])})}return e}const tn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Po(e=tn,t){const{payload:n}=t;switch(t.type){case wr:case Kt:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Vt:return Ao(e.clientOffset,n.clientOffset)?e:Ro({},e,{clientOffset:n.clientOffset});case Ut:case Gt:return tn;default:return e}}function Mo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Mo(e,a,n[a])})}return e}const Fo={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Bo(e=Fo,t){const{payload:n}=t;switch(t.type){case Kt:return ct({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Er:return ct({},e,{isSourcePublic:!0});case Vt:return ct({},e,{targetIds:n.targetIds});case Zt:return e.targetIds.indexOf(n.targetId)===-1?e:ct({},e,{targetIds:Ra(e.targetIds,n.targetId)});case Gt:return ct({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Ut:return ct({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function zo(e=0,t){switch(t.type){case Ar:case _r:return e+1;case Lr:case Zt:return e-1;default:return e}}function $o(e=0){return e+1}function Ho(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Ho(e,a,n[a])})}return e}function Vo(e={},t){return{dirtyHandlerIds:Lo(e.dirtyHandlerIds,{type:t.type,payload:Ko({},t.payload,{prevTargetIds:ka(e,"dragOperation.targetIds",[])})}),dragOffset:Po(e.dragOffset,t),refCount:zo(e.refCount,t),dragOperation:Bo(e.dragOperation,t),stateId:$o(e.stateId)}}function Go(e,t=void 0,n={},s=!1){const a=Uo(s),o=new fo(a,new Eo(a)),i=new oo(a,o),l=e(i,t,n);return i.receiveBackend(l),i}function Uo(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Gn(Vo,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Zo(e,t){if(e==null)return{};var n=Wo(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function Wo(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}let rn=0;const Pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var qo=g.memo(function(t){var{children:n}=t,s=Zo(t,["children"]);const[a,o]=Yo(s);return g.useEffect(()=>{if(o){const i=Xn();return++rn,()=>{--rn===0&&(i[Pt]=null)}}},[]),r.jsx(Vn.Provider,{value:a,children:n})});function Yo(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Xo(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function Xo(e,t=Xn(),n,s){const a=t;return a[Pt]||(a[Pt]={dragDropManager:Go(e,t,n,s)}),a[Pt]}function Xn(){return typeof global<"u"?global:window}var ar,nn;function Jo(){return nn||(nn=1,ar=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var s,a,o;if(Array.isArray(t)){if(s=t.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),ar}var Qo=Jo();const ei=v.getDefaultExportFromCjs(Qo),Je=typeof window<"u"?g.useLayoutEffect:g.useEffect;function ti(e,t,n){const[s,a]=g.useState(()=>t(e)),o=g.useCallback(()=>{const i=t(e);ei(s,i)||(a(i),n&&n())},[s,e,n]);return Je(o),[s,o]}function ri(e,t,n){const[s,a]=ti(e,t,n);return Je(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),s}function Jn(e,t,n){return ri(t,e||(()=>({})),()=>n.reconnect())}function Qn(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),g.useMemo(()=>typeof e=="function"?e():e,n)}function ni(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function si(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let or=!1,ir=!1;class ai{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){te(!or,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return or=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{or=!1}}isDragging(){if(!this.sourceId)return!1;te(!ir,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ir=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ir=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}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.sourceId=null,this.internalMonitor=t.getMonitor()}}let lr=!1;class oi{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;te(!lr,"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 lr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{lr=!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 ii(e,t,n){const s=n.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function li(e,t,n){const s=n.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Cr(e,t,n,s){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 c=0;c<o.length;c++){const d=o[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function yr(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ci(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 di(e){return(t=null,n=null)=>{if(!g.isValidElement(t)){const o=t;return e(o,n),o}const s=t;return ci(s),ui(s,n?o=>e(o,n):e)}}function es(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const a=di(s);t[n]=()=>a}}),t}function sn(e,t){typeof e=="function"?e(t):e.current=t}function ui(e,t){const n=e.ref;return te(typeof n!="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"),n?g.cloneElement(e,{ref:s=>{sn(n,s),sn(t,s)}}):g.cloneElement(e,{ref:t})}class fi{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Cr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Cr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=es({dragSource:(n,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,yr(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,yr(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class pi{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,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!Cr(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=es({dropTarget:(n,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,yr(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ft(){const{dragDropManager:e}=g.useContext(Vn);return te(e!=null,"Expected drag drop context"),e}function hi(e,t){const n=ft(),s=g.useMemo(()=>new fi(n.getBackend()),[n]);return Je(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Je(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function mi(){const e=ft();return g.useMemo(()=>new ai(e),[e])}class gi{beginDrag(){const t=this.spec,n=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(n):s={},s??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const s=this.spec,a=this.monitor,{isDragging:o}=s;return o?o(a):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,s=this.connector,{end:a}=t;a&&a(n.getItem(),n),s.reconnect()}constructor(t,n,s){this.spec=t,this.monitor=n,this.connector=s}}function xi(e,t,n){const s=g.useMemo(()=>new gi(e,t,n),[t,n]);return g.useEffect(()=>{s.spec=e},[e]),s}function bi(e){return g.useMemo(()=>{const t=e.type;return te(t!=null,"spec.type must be defined"),t},[e])}function Ci(e,t,n){const s=ft(),a=xi(e,t,n),o=bi(e);Je(function(){if(o!=null){const[l,c]=li(o,a,s);return t.receiveHandlerId(l),n.receiveHandlerId(l),c}},[s,t,n,a,o])}function yi(e,t){const n=Qn(e,t);te(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=mi(),a=hi(n.options,n.previewOptions);return Ci(n,s,a),[Jn(n.collect,s,a),ni(a),si(a)]}function vi(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function Si(e){const t=ft(),n=g.useMemo(()=>new pi(t.getBackend()),[t]);return Je(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function Ii(){const e=ft();return g.useMemo(()=>new oi(e),[e])}function Ni(e){const{accept:t}=e;return g.useMemo(()=>(te(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Di{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function ji(e,t){const n=g.useMemo(()=>new Di(e,t),[t]);return g.useEffect(()=>{n.spec=e},[e]),n}function Ti(e,t,n){const s=ft(),a=ji(e,t),o=Ni(e);Je(function(){const[l,c]=ii(o,a,s);return t.receiveHandlerId(l),n.receiveHandlerId(l),c},[s,t,a,n,o.map(i=>i.toString()).join("|")])}function kr(e,t){const n=Qn(e,t),s=Ii(),a=Si(n.options);return Ti(n,s,a),[Jn(n.collect,s,a),vi(a)]}const an="column",wi="flex items-center",Ei="mr-3 cursor-move text-secondary",Oi=({id:e,children:t,className:n,onFind:s,onMove:a,ariaLabel:o="Drag item"})=>{const i=g.useRef(null),l=g.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=yi(()=>({type:an,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,h]=kr(()=>({accept:an,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(h(l)),f(i),r.jsxs("div",{ref:l,className:S.mergeClasses(wi,n),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[r.jsx("div",{ref:i,className:Ei,"aria-label":o,children:r.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},Wt=({iconClassName:e,label:t,...n})=>t?r.jsx(v.DialDangerButton,{...n,label:t,appearance:L.ButtonAppearance.Ghost,iconBefore:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):r.jsx(O.DialDangerIconButton,{...n,appearance:L.ButtonAppearance.Ghost,icon:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),Ai=({className:e="",value:t,onChange:n,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=S.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",o?"resize":"resize-none",e);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-1",a),children:[i&&r.jsx(Ue.DialLabel,{...i,htmlFor:c}),r.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>n?.(p.currentTarget.value),...d}),r.jsx(v.DialErrorText,{text:s}),!s&&r.jsx(v.DialCaptionText,{text:l})]})},_i="inline-flex items-center rounded bg-layer-3",Li="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",ki="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ri="text-secondary hover:text-primary",Pi="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Mi=({options:e,value:t,onChange:n,disabled:s,className:a,ariaLabel:o})=>{const i=g.useCallback(l=>{if(s)return;const c=e.filter(h=>!h.disabled);if(c.length===0)return;const d=c.findIndex(h=>h.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&n(p.value)},[s,e,t,n]);return r.jsx("div",{role:"tablist","aria-label":o,className:S.mergeClasses(_i,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,h=s||l.disabled;return r.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:h,onClick:()=>n(l.value),onKeyDown:i,className:S.mergeClasses(Li,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ki:Ri,h&&Pi),children:[l.icon,l.label]},l.value)})})},cr=8,Fi=24,ts=({initialTags:e=[],label:t,required:n,elementId:s,placeholder:a,captionDescription:o,errorText:i,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:h,onChange:u})=>{const m=g.useRef(null),C=g.useRef([]),x=g.useRef(null),[b,y]=g.useState(e),[N,D]=g.useState(""),[I,j]=g.useState(!1),[_,w]=g.useState(e.length),A=g.useCallback(B=>U=>{C.current[B]=U},[]),E=g.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const U=B.offsetWidth;if(U===0)return;const K=x.current?.offsetWidth??0,oe=U-(f?0:Fi)-cr;let J=0,W=0;for(let se=0;se<b.length;se++){const ie=C.current[se];if(!ie)continue;const le=ie.offsetWidth+cr;if(J+le>oe)break;J+=le,W++}if(W<b.length&&W>0)for(;J+K>oe&&W>0;){W--;const se=C.current[W]?.offsetWidth??0;J-=se+cr}w(W)},[d,f,b.length]),T=B=>{const U=B.trim().replace(/,$/,"");if(U&&!b.includes(U)){const K=[U,...b];y(K),u?.(K)}},R=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),T(N),D(""))},M=()=>{N.trim()&&(T(N),D(""))},V=B=>{const U=b.filter((K,Z)=>Z!==B);y(U),u?.(U)},X=()=>i?r.jsx(v.DialErrorText,{text:i}):o?r.jsx(v.DialCaptionText,{text:o}):null;g.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const U=m.current.scrollHeight>m.current.clientHeight+10;j(U)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[b,d]),g.useEffect(()=>{if(!d){w(b.length);return}w(b.length);const B=new ResizeObserver(()=>{E()}),U=m.current;return U&&B.observe(U),E(),()=>B.disconnect()},[d,E,b]),g.useEffect(()=>{y(e)},[JSON.stringify(e)]);const G=r.jsxs("div",{ref:m,className:ce("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ce("flex-wrap",I?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,_):b).map((B,U)=>r.jsx(Xe,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>V(U):void 0},B+U)),d&&_<b.length&&r.jsx(L.DialTooltip,{tooltip:b.slice(_).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:r.jsx(Xe,{label:`+${b.length-_}`})}),!f&&r.jsx("input",{id:s,type:"text",value:N,onChange:B=>D(B.target.value),onKeyDown:R,onBlur:M,className:ce("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&r.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[b.map((B,U)=>r.jsx("div",{ref:A(U),className:"inline-flex shrink-0",children:r.jsx(Xe,{label:B,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>V(U):void 0})},`measure-${B}-${U}`)),r.jsx("div",{ref:x,className:"inline-flex shrink-0",children:r.jsx(Xe,{label:`+${b.length}`})})]})]});return f?G:r.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[r.jsx(Ue.DialLabel,{label:t,required:n,htmlFor:s}),r.jsx("div",{className:ce("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),X()]})},rs=({selectedItems:e,placeholder:t,collapseTagOverflow:n=!1,listClassName:s,listElementClassName:a})=>e?.length?r.jsx(ts,{readOnly:!0,initialTags:e,collapseTagOverflow:n,containerClassName:s,tagClassName:a}):t?r.jsx("span",{className:"text-secondary",children:t}):null,dr=e=>Gr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Gr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),ns=({children:e,open:t,disabled:n=!1,selectedValue:s,valueClassName:a,inputClassName:o,onOpen:i,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:h=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:C})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),y=x||b?s:p?void 0:f,N=n?void 0:i,D=g.useCallback(w=>{u?.(w.target.value)},[u]),I=()=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",o,n&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx("input",{type:"text",className:ce("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:p||f,onChange:D,disabled:n,id:l,"aria-label":"input-popup-field"})]}),!n&&r.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:i,"aria-label":"open-popup",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),r.jsx(v.DialErrorText,{text:c})]}),j=()=>r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:r.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",o,n&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx(L.DialTooltip,{tooltip:y==null?void 0:String(y),children:y||!p?r.jsx("span",{className:a,children:y}):r.jsx("span",{className:"text-secondary",children:p})})]}),!n&&r.jsx("div",{className:"shrink-0",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),r.jsx(v.DialErrorText,{text:c})]}),_=()=>r.jsx("div",{className:"w-full",onClick:N,children:r.jsxs("div",{className:ce("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",n&&"dial-input-disable"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx(rs,{placeholder:p,selectedItems:y,collapseTagOverflow:m})]}),!n&&r.jsx("div",{className:"ml-1",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return r.jsxs(r.Fragment,{children:[x?_():h?I():j(),t&&aa.createPortal(e,document.body)]})},Bi=({label:e,htmlFor:t,disabled:n,selectedValue:s,radioButtons:a,customInputValue:o,valueClassName:i,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:h,onApply:u,onCancel:m,cancelButtonTitle:C="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:y,onChangeRadioField:N,id:D,size:I=v.PopupSize.Md})=>{const[j,_]=g.useState(!1),w=g.useCallback(()=>{n||_(!0)},[n]),A=g.useCallback(()=>{_(!1),f?.()},[f]),E=g.useCallback(()=>{m?.(),A()},[m,A]),T=g.useCallback(()=>{u(),A()},[u,A]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Ue.DialLabel,{label:e,htmlFor:t}),r.jsx(ns,{disabled:n,open:j,selectedValue:o??a.find(R=>R.id===s)?.name,valueClassName:i,inputClassName:ce(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:w,children:r.jsx(v.DialPopup,{open:j,onClose:E,header:p,portalId:h,size:I,footer:r.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[r.jsx(v.DialNeutralButton,{label:C,onClick:E}),r.jsx(v.DialPrimaryButton,{label:x,onClick:T,disabled:!b})]}),children:r.jsx("div",{className:"px-6 py-4",children:r.jsx(v.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:y,onChange:N,elementId:D,orientation:v.RadioGroupOrientation.Column})})})})]})},zi="Create",$i="Cancel",Hi="flex items-center justify-end gap-2 px-6 py-3",Ki=({header:e,open:t=!1,submitLabel:n=zi,cancelLabel:s=$i,isLoading:a=!1,disableSubmitButton:o=!1,className:i,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:h=!0,size:u=v.PopupSize.Md,footer:m})=>{const C=a?null:r.jsxs("div",{className:Hi,children:[r.jsx(v.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),r.jsx(v.DialPrimaryButton,{className:l,label:n,disabled:o,onClick:()=>d()})]}),x=g.useCallback(()=>a?r.jsx("div",{className:"px-6 py-4 h-[120px]",children:r.jsx(v.DialLoader,{size:50})}):p??null,[p,a]);return r.jsx(v.DialPopup,{open:t,header:e,className:i,dividers:h,onClose:()=>c?.(),footer:m??C,size:u,children:x()})},Vi=/^0+\.(\d+)?$/,Gi=/^0+/,vr=({integer:e,onChange:t,min:n,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=f=>!f||f==="-"?f:String(f)?.match(Vi)?String(f)?.replace(Gi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}v.handleKeyDown(f,"number",n,s)},d=f=>{const p=f.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(f.preventDefault(),h)){const u=f.currentTarget,m=u.selectionStart??0,C=u.selectionEnd??0,x=u.value.slice(0,m)+h+u.value.slice(C);t?.(l(x))}};return r.jsx(v.DialInput,{type:"number",min:n,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:o,...i})},Ui=({onClick:e})=>r.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Zi=({onClick:e})=>r.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),ss=({...e})=>{const[t,n]=g.useState(!1),s=g.useCallback(a=>{n(a)},[]);return r.jsx(v.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?r.jsx(Ui,{onClick:()=>s(!1)}):r.jsx(Zi,{onClick:()=>s(!0)})})},as=({options:e,selectedValues:t,handleRemoveTag:n})=>r.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(i=>i.value===s)?.label??s,o=e.find(i=>i.value===s)?.icon;return r.jsx(Xe,{label:a,onRemove:i=>n?.(i,s),icon:o?r.jsx(O.DialIcon,{icon:o}):null,className:"max-w-full"},s)})});var Ft=(e=>(e.Sm="sm",e.Md="md",e))(Ft||{}),Bt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(Bt||{});const Wi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",qi="w-full rounded flex flex-col",yt="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Yi="bg-accent-primary-alpha",Sr="bg-accent-primary-alpha border-l border-accent-primary border-1",zt="opacity-75",Xi=352,Ji=4,Qi=r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),el=({opt:e,selectedValues:t,onSelect:n})=>{const{isOpen:s,refs:a,floatingStyles:o,context:i,getReferenceProps:l,getFloatingProps:c}=O.useSubMenuFloating(Ji,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.value));return r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ce(yt,d&&Sr,e.disabled&&zt),...l(),children:[r.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&r.jsx(O.DialIcon,{icon:e.icon}),r.jsx(O.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),r.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&r.jsx(O.SubMenuPanel,{refs:a,floatingStyles:o,context:i,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return r.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:ce(yt,p&&Sr,f.disabled&&zt),onClick:()=>!f.disabled&&n(f.value),children:r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&r.jsx(O.DialIcon,{icon:f.icon}),r.jsx(O.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Pe=({options:e,multiple:t=!1,elementId:n,value:s,defaultValue:a,variant:o=Bt.Primary,size:i=Ft.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=L.ElementSize.Standard,searchPlaceholder:h,selectAll:u=!1,invalid:m,selectAllLabel:C="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:y,disabled:N=!1,className:D,listClassName:I,closable:j=!1,header:_,footer:w,onClose:A,onChange:E,inlineSearch:T=!1,dismissRef:R,onFooterClick:M,open:V,onOpenChange:X,onInlineQueryChange:G,customMultiSelectTagsRenderer:B})=>{const U=g.useId(),[K,Z]=g.useState(!1),oe=V!==void 0,J=oe?!!V:K,W=g.useCallback(P=>{oe||Z(P),X?.(P)},[oe,X]),[se,ie]=g.useState(T&&c||""),le=g.useRef(null),ue=g.useCallback(P=>{P!==se&&(ie(P||""),G?.(P||""))},[G,se]),ge=s!==void 0,[ye,he]=g.useState(a),Y=ge?s:ye,ee=g.useMemo(()=>t?Array.isArray(Y)?Y:[]:typeof Y=="string"?[Y]:[],[Y,t]),Ae=g.useMemo(()=>{const P=se.trim().toLowerCase();return P?e.filter(ae=>ae.label.toLowerCase().includes(P)):e},[e,se]);g.useEffect(()=>{!J&&!T&&ue("")},[T,J,ue]);const $e=g.useRef(c);g.useEffect(()=>{T&&c!==$e.current&&(J||($e.current=c,ue(c||"")))},[c,T,J,ue]);const Q=g.useCallback(P=>{ge||he(P),E?.(P)},[ge,E]),de=g.useCallback(P=>{if(t){const ae=new Set(ee);ae.has(P)?ae.delete(P):ae.add(P),Q(Array.from(ae));return}if(Q(P),T){const ae=e.find(Ie=>Ie.value===P)??e.flatMap(Ie=>Ie.children??[]).find(Ie=>Ie.value===P);ae&&ue(ae.label)}W(!1)},[t,Q,T,W,ee,e,ue]),_e=g.useCallback((P,ae)=>{if(P.stopPropagation(),!t){Q("");return}const Ie=ee.filter(er=>er!==ae);Q(Ie)},[t,ee,Q]),xe=g.useMemo(()=>Ae.filter(P=>!P.disabled),[Ae]),fe=g.useMemo(()=>xe.filter(P=>ee.includes(P.value)).length,[xe,ee]),at=g.useCallback(P=>{T&&!t&&!P&&de(se),W(P)},[de,T,t,se,W]),{allSelectedInFiltered:Se,someSelectedInFiltered:xt}=g.useMemo(()=>{const P=xe.length>0&&fe===xe.length;return{allSelectedInFiltered:P,someSelectedInFiltered:fe>0&&!P}},[xe,fe]),ot=g.useCallback(()=>{if(!(!t||xe.length===0))if(Se){const P=new Set(xe.map(ae=>ae.value));Q(ee.filter(ae=>!P.has(ae)))}else{const P=new Set(ee);xe.forEach(ae=>P.add(ae.value)),Q(Array.from(P))}},[Se,t,xe,ee,Q]),ve=ee.length>0;g.useEffect(()=>{J&&T&&!t&&!N&&requestAnimationFrame(()=>{const P=le.current;if(!P)return;P.focus();const ae=P.value?.length??0;P.setSelectionRange?.(ae,ae)})},[J,T,t,N]);const Ze=!t&&ve?ee[0]:void 0,Ce=g.useMemo(()=>Ze?e.find(P=>P.value===Ze)??e.flatMap(P=>P.children??[]).find(P=>P.value===Ze):void 0,[e,Ze]),Qt=g.useCallback(()=>t?ve?B?.(e,ee,_e)||r.jsx(as,{options:e,selectedValues:ee,handleRemoveTag:_e}):r.jsx("span",{className:"text-secondary truncate",children:d}):Ce?r.jsxs(r.Fragment,{children:[Ce.icon&&r.jsx(O.DialIcon,{icon:Ce.icon}),r.jsx(O.DialEllipsisTooltip,{text:Ce.labelNode??(l?`${l} ${Ce.label}`:Ce.label)}),Ce?.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:Ce.description})]}):c&&s?c:r.jsx("span",{className:"text-secondary truncate",children:d}),[ve,t,c,l,s,d,Ce,e,ee,_e,B]);g.useImperativeHandle(R,()=>({dismiss:()=>{W(!1)}}));const it=g.useCallback(()=>{ue(ee.length===1?Ce?.label??se:"")},[se,ee.length,ue,Ce?.label]),Ye=g.useCallback(()=>{N||(W(!J),T&&!t&&(it(),le.current?.focus()))},[N,T,J,t,it,W]);return r.jsx(O.DialDropdown,{open:J,onOpenChange:at,disabled:N,closable:j,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:Xi,listClassName:I,renderOverlay:()=>r.jsxs("div",{id:`list-${n||U}`,role:"listbox","aria-multiselectable":t||void 0,className:qi,children:[_&&r.jsx(r.Fragment,{children:typeof _=="function"?_():_}),(f||j)&&e.length>8&&r.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&r.jsx(v.DialSearch,{size:p,placeholder:h,onChange:ue,value:se,id:`search-${n||U}`,containerClassName:S.mergeClasses(v.SIZE_CONFIG[p].containerClassName,"w-full")}),j&&r.jsx(v.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:P=>{A?.(P),W(!1)}})]}),t&&u&&xe.length>0&&r.jsx("div",{className:ce(yt,"mt-2"),children:r.jsx(gr,{id:`${n||U}-selectAll`,label:C,checked:Se,indeterminate:xt,onChange:ot,ariaLabel:C})}),r.jsx("div",{className:ce("overflow-y-auto max-h-[352px]",T&&Ae.length===0?"":"py-1"),children:Ae.length===0?!T&&r.jsx("div",{className:"px-2 py-3",children:r.jsx(O.DialNoDataContent,{icon:y??r.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):Ae.map(P=>{const ae=ee.includes(P.value);return t?r.jsxs("div",{role:"option","aria-selected":ae,"aria-disabled":!!P.disabled,className:ce(yt,ae&&Yi,P.disabled&&zt,"w-full"),children:[r.jsx(gr,{id:`${n||U}-${P.value}`,label:r.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[P.icon&&r.jsx(O.DialIcon,{icon:P.icon}),r.jsx("span",{className:"truncate",children:P.labelNode??P.label})]}),checked:ae,disabled:P.disabled,onChange:()=>!P.disabled&&de(P.value),ariaLabel:P.label}),P.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:P.description})]},P.value):P.children?.length?r.jsx(el,{opt:P,selectedValues:ee,onSelect:de},P.value):r.jsx("button",{role:"option",type:"button","aria-selected":ae,"aria-disabled":!!P.disabled,disabled:P.disabled,className:ce(yt,ae&&Sr,P.disabled&&zt),onClick:()=>!P.disabled&&de(P.value),children:r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[P.icon&&r.jsx(O.DialIcon,{icon:P.icon}),r.jsx(O.DialEllipsisTooltip,{text:P.labelNode??P.label}),P.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:P.description})]})},P.value)})}),w&&r.jsx("div",{onClick:P=>{M?.(P),M&&W(!1)},children:typeof w=="function"?w():w})]}),children:r.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":J,"aria-controls":`list-${n||U}`,className:S.mergeClasses(Wi,N&&"opacity-75 !cursor-not-allowed !border-primary",i===Ft.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",o===Bt.Secondary?"!bg-layer-4 !h-auto":"",D),onMouseDown:P=>{N||T&&!t&&(it(),P.preventDefault())},onClick:()=>{Ye()},onKeyDown:P=>{(P.key===" "||P.code==="Space")&&(P.preventDefault(),Ye())},children:[T&&!t?r.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:r.jsx("input",{id:`inline-${n||U}`,type:"text",placeholder:h??d,value:se||"",onChange:P=>ue(P.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:P=>{it(),P.stopPropagation()},onClick:P=>{P.stopPropagation()},onKeyDown:P=>{P.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:N,"aria-disabled":N,autoComplete:"off"})}):r.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Qt()}),!T&&r.jsx(O.DialIcon,{icon:Qi,className:ce("text-primary",J&&"rotate-180")})]})})},tl=({label:e,required:t,captionDescription:n,containerClassName:s,selectClassName:a,error:o,id:i,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const h=g.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return r.jsx(as,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return r.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return r.jsx(v.DialFormItem,{id:i,label:e,required:t,description:l,error:o,captionDescription:n,className:s,readonly:c,value:h(),defaultEmptyText:f,children:r.jsx(Pe,{className:a,value:d,elementId:i,invalid:!!o,...p})})};function os(e){let t=null;return()=>(t==null&&(t=e()),t)}function rl(e,t){return e.filter(n=>n!==t)}function nl(e,t){const n=new Set,s=o=>n.add(o);e.forEach(s),t.forEach(s);const a=[];return n.forEach(o=>a.push(o)),a}class sl{enter(t){const n=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=nl(this.entered.filter(s),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=rl(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class al{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 n={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(n[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const qt="__NATIVE_FILE__",is="__NATIVE_URL__",ls="__NATIVE_TEXT__",cs="__NATIVE_HTML__",on=Object.freeze(Object.defineProperty({__proto__:null,FILE:qt,HTML:cs,TEXT:ls,URL:is},Symbol.toStringTag,{value:"Module"}));function ur(e,t,n){const s=t.reduce((a,o)=>a||e.getData(o),"");return s??n}const Ir={[qt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[cs]:{exposeProperties:{html:(e,t)=>ur(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[is]:{exposeProperties:{urls:(e,t)=>ur(e,t,"").split(`
|
|
2
|
-
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[ls]:{exposeProperties:{text:(e,t)=>ur(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function ol(e,t){const n=Ir[e];if(!n)throw new Error(`native type ${e} has no configuration`);const s=new al(n);return s.loadDataTransfer(t),s}function fr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ir).filter(n=>{const s=Ir[n];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const il=os(()=>/firefox/i.test(navigator.userAgent)),ds=os(()=>!!window.safari);class ln{interpolate(t){const{xs:n,ys:s,c1s:a,c2s:o,c3s:i}=this;let l=n.length-1;if(t===n[l])return s[l];let c=0,d=i.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=n[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-n[l],h=p*p;return s[l]+a[l]*p+o[l]*h+i[l]*p*h}constructor(t,n){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const o=[],i=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=n[u+1]-n[u],o.push(l),i.push(c/l);const d=[i[0]];for(let u=0;u<o.length-1;u++){const m=i[u],C=i[u+1];if(m*C<=0)d.push(0);else{l=o[u];const x=o[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/C))}}d.push(i[i.length-1]);const f=[],p=[];let h;for(let u=0;u<d.length-1;u++){h=i[u];const m=d[u],C=1/o[u],x=m+d[u+1]-h-h;f.push((h-m-x)*C),p.push(x*C*C)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=f,this.c3s=p}}const ll=1;function us(e){const t=e.nodeType===ll?e:e.parentElement;if(!t)return null;const{top:n,left:s}=t.getBoundingClientRect();return{x:s,y:n}}function At(e){return{x:e.clientX,y:e.clientY}}function cl(e){var t;return e.nodeName==="IMG"&&(il()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function dl(e,t,n,s){let a=e?t.width:n,o=e?t.height:s;return ds()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function ul(e,t,n,s,a){const o=cl(t),l=us(o?e:t),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:h}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=dl(o,t,d,f),C=()=>{let j=new ln([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(h);return ds()&&o&&(j+=(window.devicePixelRatio-1)*m),j},x=()=>new ln([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:y}=a,N=b===0||b,D=y===0||y;return{x:N?b:x(),y:D?y:C()}}class fl{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,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}}function pl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){pl(e,a,n[a])})}return e}class hl{profile(){var t,n;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:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.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 n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,s){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,s);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",o),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const s=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return n.addEventListener("dragenter",s),n.addEventListener("dragover",a),n.addEventListener("drop",o),()=>{n.removeEventListener("dragenter",s),n.removeEventListener("dragover",a),n.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(),n=this.sourceNodeOptions.get(t);return cn({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);return cn({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(on).some(n=>on[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=ol(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}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,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,s){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&&us(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=At(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,c=fr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),h=this.sourcePreviewNodes.get(f)||p;if(h){const{anchorX:u,anchorY:m,offsetX:C,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=ul(p,h,i,{anchorX:u,anchorY:m},{offsetX:C,offsetY:x});l.setDragImage(h,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);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,c=fr(l);c&&this.beginDragNativeItem(c,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:At(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=At(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 fr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:At(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 fl(n,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new sl(this.isNodeInDocument)}}const ml=function(t,n,s){return new hl(t,n,s)},gl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:n,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const h=g.useRef(null),u=g.useRef(null),[m,C]=g.useState([]),[x,b]=g.useState(!1),[y,N]=g.useState(!1),D=g.useCallback(G=>{const B=G.target.files;if(B&&B.length>0){const U=Array.from(B),K=f?.(U),Z=p?.(U);K?b(!0):Z?N(!0):e(U)}},[f,p,e]),I=g.useCallback(G=>o&&G?.length>o,[o]),j=g.useMemo(()=>x||y||I(m),[x,y,I,m]),_=()=>{C([]),b(!1),N(!1)},w=g.useMemo(()=>x?r.jsx(v.DialErrorText,{text:l}):y?r.jsx(v.DialErrorText,{text:d}):I(m)?r.jsx(v.DialErrorText,{text:c}):null,[c,l,d,m,I,x,y]);g.useEffect(()=>{_()},[a]);const[{isOver:A,canDrop:E},T]=kr(()=>({accept:[qt],drop(G){const B=G.files,U=f?.(B)??!1,K=p?.(B)??!1,Z=I?.(B)??!1;if(b(U),N(K),U||K||Z){C(B);return}e(B),_()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,I]),R=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},M=G=>{G?.preventDefault();const B=Array.from(G.dataTransfer?.items??[]);b(!!f?.(B)),N(!!p?.(B)),C(B)},V=G=>{G.target===G.currentTarget&&_()},X=ce("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!E&&!j&&"border-primary",E&&(A?"border-accent-primary":"border-hover"),j&&"border-error");return T(h),r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:X,ref:h,onDragOver:M,onDragLeave:V,children:[r.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:R,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&r.jsx("p",{className:"mb-1",children:t}),n&&r.jsx("p",{className:"mb-0.5",children:n}),s&&r.jsx(v.DialPrimaryButton,{appearance:L.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),r.jsx("input",{multiple:i,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:D})]}),r.jsx(r.Fragment,{children:w})]})},xl=({iconBefore:e,className:t,...n})=>{const s=n.invalid,a=()=>r.jsx("div",{className:"mr-2",children:s?r.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return r.jsx(v.DialInput,{...n,iconBefore:a(),containerClassName:ce("h-[40px] p-0",s&&"h-[60px]"),className:ce("rounded-r-none border-r-0",s&&"text-error",t)})},bl=({children:e,existingFiles:t,onDrop:n,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:c})=>{const d=g.useRef(null),[f,p]=g.useState(!1),[h,u]=g.useState(!1),[m,C]=g.useState(0),x=g.useCallback(()=>{p(!1),u(!1),C(0)},[]),b=g.useCallback(A=>!!(o&&t.length+A.length>o),[o,t.length]),y=f||h,[{isOver:N,canDrop:D},I]=kr(()=>({accept:[qt],drop(A){const E=A.files,T=[...t,...E],R=s?.(E)??!1,M=a?.(E)??!1,V=b?.(E)??!1;if(p(R),u(M),R||M||V){C(E.length);return}n(T),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,n,s,a,b,x]),j=A=>{A.preventDefault();const E=Array.from(A.dataTransfer?.items??[]);p(!!s?.(E)),u(!1),C(E.length)},_=A=>{A.target===A.currentTarget&&x()};I(d);const w=b(Array.from({length:m}));return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsx("div",{ref:d,onDragOver:j,onDragLeave:_,className:ce("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!y&&!w&&(D&&N?"border-accent-primary":"border-primary"),(y||w)&&"border-error"),children:e}),f&&r.jsx(v.DialErrorText,{text:i}),h&&r.jsx(v.DialErrorText,{text:l}),!f&&!h&&w&&r.jsx(v.DialErrorText,{text:c})]})},fs=e=>{const{files:t,iconBeforeInput:n,dynamicIcon:s,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h}=e,u=g.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(y=>y.name!==b)||[])},[a,t]),m=g.useCallback(x=>r.jsx(Wt,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),C=g.useMemo(()=>r.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>r.jsx(xl,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:n||s?.(x.name),invalid:o?.(x),error:o?.(x)?i:""},x.name+b))}),[t,n,s,o,i,m]);return r.jsx(qo,{backend:ml,children:!t||t.length===0?r.jsx(gl,{...e,onChange:a}):r.jsxs(r.Fragment,{children:[r.jsx(bl,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:C}),c?.(t)&&r.jsx(v.DialErrorText,{text:d})]})})},Cl=({onChange:e,fieldTitle:t,elementId:n,files:s,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:h,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:C,...x})=>{const b=g.useRef(null),y=()=>b.current?.click(),N=()=>{e([])},D=g.useCallback(w=>w?.some(A=>!(h==="/"||h?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[h]),I=g.useCallback(w=>{if(!o)return!1;const A=o*(1024*1024);return w?.some(E=>{const T=E.size;return!!T&&T>A})},[o]),j=g.useCallback(w=>{if(!i||!p)return!1;const A=i*1024*1024;return w.reduce((T,R)=>T+R.size,0)>A},[i,p]),_=g.useCallback(w=>{const A=w.target.files;if(A&&A.length>0){const E=Array.from(A),T=D(E),R=I(E);!T&&!R&&e([...s||[],...E])}},[D,I,e,s]);return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[r.jsx(Ue.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:n}),p&&!!s?.length&&r.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[r.jsx(v.DialNeutralButton,{label:u,iconBefore:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&r.jsx(v.DialPrimaryButton,{appearance:L.ButtonAppearance.Ghost,iconBefore:r.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:y}),C]})]}),s&&s.length>0&&r.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:h,onChange:_}),r.jsx(fs,{files:s,onChange:e,acceptTypes:h,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:D,getIsFileSizeError:I,getIsMultiFilesSizeError:j,...x})]})},yl=({icon:e,ariaLabel:t,size:n=L.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:o,iconClassName:i,caretIcon:l=r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:h,defaultOpen:u=!1,...m})=>{const C=n===L.ElementSize.Small,[x,b]=g.useState(u),y=p??x,N=C?"w-8 px-0":"w-10 px-0",D={[L.ElementSize.Small]:"size-5",[L.ElementSize.Standard]:"size-6",[L.ElementSize.Large]:"size-7"},I=j=>{b(j),h?.(j)};return r.jsx(O.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:y,onOpenChange:I,defaultOpen:u,children:r.jsxs("button",{type:"button","aria-label":t,disabled:s,className:S.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",C?"h-8 px-2":"h-10 px-2",c?void 0:N,o),children:[r.jsx(O.DialIcon,{icon:e,className:S.mergeClasses("flex items-center justify-center text-inherit",D[n],c&&"-mr-2",i,O.DIAL_KIT_CLASS.dropdownIcon)}),c&&r.jsxs("div",{className:S.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",O.DIAL_KIT_CLASS.dropdownIconCaret),children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),r.jsx(O.DialIcon,{icon:l,className:S.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",y&&"rotate-180")})]})]})})},vl="application/octet-stream";function Sl(e,t){if(!e||e.length===0)return[];const n=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!n)return[];const s=n.path||n.url||"",a=pr(s,!0),o=e.filter(c=>c!==n).map(c=>{const d=c.path||c.url||"",f=Il(c.nodeType),p=f===v.DialFileNodeType.FOLDER,h=pr(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=pr(c.parentPath,!0),{...c,originalPath:d,path:h,parentPath:u,nodeType:f}}),i=new Map;o.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Nl(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===v.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===v.DialFileNodeType.ITEM&&(d.extension=Dl(c.name),d.contentType=c.contentType||vl,d.contentLength=c.contentLength||0),i.set(c.path,d)});const l=[];return i.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=i.get(f);p&&p.nodeType===v.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function pr(e,t){try{let n=decodeURIComponent(e);return t?n.endsWith("/")||(n+="/"):n.endsWith("/")&&(n=n.slice(0,-1)),n}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function Il(e){return e.toUpperCase()==="FOLDER"?v.DialFileNodeType.FOLDER:v.DialFileNodeType.ITEM}function Nl(e){if(!e)return;const t=e.toUpperCase();return Object.values(v.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Dl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function jl(e,t="Prompts",n="prompts/public/",s="root"){const a=Sl(e,s);return[{id:s,name:t,path:n,parentPath:"",nodeType:v.DialFileNodeType.FOLDER,folderId:s,items:a}]}const ps=({locale:e,timeZone:t,date:n=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(n).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var ke=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(ke||{}),Qe=(e=>(e.Select="select",e.Radio="radio",e))(Qe||{}),pt=(e=>(e.Row="row",e.Column="column",e))(pt||{}),F=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(F||{});const hs={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"},ms=g.createContext(null);function Me(){const e=g.useContext(ms);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function dn(e,t){const n={...e,...t};return(e.properties||t.properties)&&(n.properties={...e.properties,...t.properties}),(e.required||t.required)&&(n.required=Array.from(new Set([...e.required??[],...t.required??[]]))),n}function q(e,t,n=0){if(n>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let o=t;for(const f of a)o=o?.[f];if(!o||typeof o!="object")return e;const{$ref:i,...l}=s,c=o;s={...c.$ref?q(c,t,n+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...o}=s;let i={};for(const l of a)i=dn(i,q(l,t,n+1));s=dn(i,o)}return s}function Yt(e){return e.map((t,n)=>({entry:t,index:n})).sort((t,n)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=n.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-n.index}).map(({entry:t})=>t)}function nt(e){return e==null||e===""}function Fe(e){return e.type===F.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function et(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const Et=e=>`"${e}" is required`;function Xt(e,t){return e.type===F.Null?"null":e.$ref?q(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 be(e,t,n=0){if(n>15)return;const s=q(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const o=q({$ref:s.discriminator.mapping[a]},t);return{...be(o,t,n+1)??{},[s.discriminator.propertyName]:a}}}if(Fe(s)){if(s.properties){const a={};let o=!1;for(const[i,l]of Object.entries(s.properties)){const c=be(l,t,n+1);c!==void 0&&(a[i]=c,o=!0)}return o?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function De(e,t,n,s="",a=0){if(a>15)return[];const o=[],i=q(t,n);if(i.anyOf){const d=i.anyOf.filter(f=>f.type!==F.Null);return e!=null&&d.length===1?De(e,d[0],n,s,a+1):o}if(i.oneOf&&i.discriminator){const d=i.discriminator.propertyName,f=e?.[d];if(f&&i.discriminator.mapping[f]){const p={$ref:i.discriminator.mapping[f]},h=q(p,n);return De(e,h,n,s,a+1)}return o}if(i.type===F.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let d=0;d<e.length;d++){const f=De(e[d],i.items,n,`${s}[${d}]`,a+1);o.push(...f)}return o}if(!Fe(i))return o;const l=i.required??[],c=e;for(const d of l){const f=i.properties?.[d];if(f&&q(f,n).isHidden)continue;const p=s?`${s}.${d}`:d,h=c?.[d];if(nt(h)){const u=f?.title??et(d);o.push({path:p,message:Et(u)})}}if(c&&i.properties)for(const[d,f]of Object.entries(i.properties)){if(q(f,n).isHidden)continue;const p=s?`${s}.${d}`:d,h=c[d];if(h!=null){const u=De(h,f,n,p,a+1);o.push(...u)}}if(c&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const d=i.additionalProperties;for(const[f,p]of Object.entries(c)){const h=s?`${s}.${f}`:f,u=De(p,d,n,h,a+1);o.push(...u)}}return o}function ht(e,t,n){const s=q(t,n);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Fe(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!q(c,n).isHidden),o=a.length,i=e;return`${a.filter(([c])=>{const d=i?.[c];return d!=null&&d!==""}).length}/${o} fields`}return""}function gs(e,t,n){if(e==null){const s=t.findIndex(a=>a.type===F.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>q(a,n).type===F.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>q(a,n).type===F.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const o=q(a,n);return o.type===F.Number||o.type===F.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>q(a,n).type===F.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const o=q(t[a],n);if(o.discriminator&&o.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const o=q(t[a],n);if(Fe(o)||o.oneOf)return a}return 0}return 0}function xs(e,t,n){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${n+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${n+1}: ${a}`}return`Item ${n+1}`}function Jt(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case F.String:return"";case F.Boolean:return!1;case F.Array:return[];case F.Integer:case F.Number:return;default:return{}}}const bs=[F.String,F.Number,F.Boolean,F.Null,F.Object,F.Array];function Cs(e){return Array.isArray(e)?F.Array:typeof e=="object"&&e!==null?F.Object:typeof e=="boolean"?F.Boolean:typeof e=="number"?F.Number:e===null?F.Null:F.String}const Tl={[F.String]:"",[F.Number]:0,[F.Boolean]:!1,[F.Null]:null,[F.Object]:{},[F.Array]:[]};function ys(e){return Tl[e]}const It=({title:e,description:t,summary:n,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=g.useState(l),p=a===0,h="rounded border border-secondary",u=S.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=S.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return r.jsxs("div",{className:h,children:[r.jsxs("div",{className:u,onClick:()=>f(C=>!C),role:"button","aria-expanded":d,children:[r.jsx("span",{className:"shrink-0 text-secondary",children:d?r.jsx($.IconChevronDown,{size:16,stroke:2}):r.jsx($.IconChevronRight,{size:16,stroke:2})}),r.jsx("span",{className:S.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&r.jsx(Ue.DialInfoButton,{caption:t}),n&&r.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:n}),s>0?r.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[r.jsx(O.DialIcon,{icon:r.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):r.jsx(O.DialIcon,{icon:r.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),i&&r.jsx(Wt,{size:L.ElementSize.Small,onClick:C=>{C.stopPropagation(),i()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&r.jsx("div",{className:m,children:o})]})},vs=({schema:e,value:t,onChange:n,path:s,level:a=0,required:o,label:i})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=Me(),p=q(e,l),h=Fe(p),u=p.type===F.Array;if(h||u){const x=ht(t,p,l),b=De(t,p,l,s.join(".")),y=s.join("."),N=y+".",D=!f||d.has(y)||[...d].some(I=>I.startsWith(N));return r.jsx(It,{title:i??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:D?b.length:0,defaultExpanded:c,children:r.jsx(Ke,{schema:p,value:t,onChange:n,path:s,level:a+1,required:o})})}const C=(!f||d.has(s.join(".")))&&o&&nt(t)?Et(i??"Field"):void 0;return r.jsx(v.DialFormItem,{label:i,required:o,description:p.description,error:C,children:r.jsx(Ke,{schema:p,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:!0})})},Mt=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i}=Me(),l=q(e,o),c=Yt(Object.entries(l.properties??{}).filter(([,p])=>!q(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noConfigurableProperties}):r.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,h])=>{const m=q(h,o).title??h.title??et(p),C=d.includes(p);return r.jsx(vs,{schema:h,value:f[p],onChange:x=>n({...f,[p]:x}),path:[...s,p],level:a,required:C,label:m},p)})})},wl=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=Me(),d=Array.isArray(t)?t:[],f=e.items,[p,h]=g.useState(void 0);if(!f)return r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemSchema});const u=g.useMemo(()=>q(f,o),[f,o]),m=g.useMemo(()=>u.discriminator,[u]),C=g.useMemo(()=>m?.propertyName,[m]),x=g.useMemo(()=>m?Object.keys(m.mapping).map(D=>({value:D,label:D})):[],[m]),b=()=>{const D=p??x[0]?.value;let I;if(m&&D){const j=q({$ref:m.mapping[D]},o);I={...be(j,o)??{},[m.propertyName]:D}}else I=be(u,o)??Jt(u);n([...d,I])},y=D=>{n(d.filter((I,j)=>j!==D))},N=(D,I)=>{n(d.map((j,_)=>_===D?I:j))};return r.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemsYet}),d.map((D,I)=>{const j=xs(D,C,I),_=ht(D,u,o),w=De(D,u,o,`${s.join(".")}[${I}]`);return r.jsx(It,{title:j,level:a,summary:_,errorCount:w.length,onRemove:l?void 0:()=>y(I),defaultExpanded:c,removeItemAriaLabel:i.removeItemAriaLabel,children:r.jsx(Ke,{schema:f,value:D,onChange:A=>N(I,A),path:[...s,String(I)],level:a+1})},I)}),!l&&r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Pe,{options:x,value:p??x[0]?.value,placeholder:i.selectTypeToAdd,onChange:D=>{const I=typeof D=="string"?D:D[0];h(I)}})}),r.jsx(v.DialGhostButton,{label:i.addItem,iconBefore:r.jsx($.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},El=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Me(),c=g.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,y=Object.keys(b).map(j=>({value:j,label:j})),N=typeof t=="object"&&t!==null?t[x]:void 0,D=N?q({$ref:b[N]},o):void 0,I=j=>{const _=q({$ref:b[j]},o),w=be(_,o)??{};n({...w,[x]:j})};if(e.discriminatorDisplay===Qe.Radio){const j=e.discriminatorOrientation===pt.Row,_=N?(()=>{const w=q({$ref:b[N]},o),{[x]:A,...E}=w.properties??{};return{...w,properties:E}})():void 0;return j?r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(b).map(w=>{const A=q({$ref:b[w]},o);return r.jsx(O.DialRadioButton,{name:c,value:w,inputId:`${c}-${w}`,label:A.title??w,checked:N===w,disabled:l,onChange:()=>I(w)},w)})}),_&&r.jsx(Mt,{schema:_,value:t,onChange:n,path:s,level:a})]}):r.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(w=>{const A=q({$ref:b[w]},o),E=N===w,{[x]:T,...R}=A.properties??{},M={...A,properties:R};return r.jsxs("div",{className:"flex flex-col",children:[r.jsx(O.DialRadioButton,{name:c,value:w,inputId:`${c}-${w}`,label:A.title??w,checked:E,disabled:l,onChange:()=>I(w)}),E&&r.jsx("div",{className:"ml-6 mt-2",children:r.jsx(Mt,{schema:M,value:t,onChange:n,path:s,level:a})})]},w)})})}return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Pe,{options:y,value:N,placeholder:i.selectTypePlaceholder,disabled:l,onChange:j=>{const _=typeof j=="string"?j:j[0];_&&I(_)}})}),D&&r.jsx("div",{className:"pl-3",children:r.jsx(Mt,{schema:D,value:t,onChange:n,path:s,level:a})})]})}const f=e.oneOf??[],h=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(q(f[x],o).required?.every(y=>y in t))return x}return 0})(),u=x=>{const b=q(f[x],o),y=be(b,o);n(y??null)},m=f[h];if(e.discriminatorDisplay===Qe.Radio)return r.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const y=q(x,o),N=Xt(x,o)??`Option ${b+1}`,D=h===b;return r.jsxs("div",{className:"flex flex-col",children:[r.jsx(O.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:N,checked:D,disabled:l,onChange:()=>u(b)}),D&&y&&r.jsx("div",{className:"ml-6 mt-2",children:r.jsx(Ke,{schema:y,value:t,onChange:n,path:s,level:a})})]},b)})});const C=f.map((x,b)=>{const y=q(x,o);return{value:String(b),label:y.title??`Option ${b+1}`}});return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Pe,{options:C,value:String(h),disabled:l,onChange:x=>{const b=typeof x=="string"?x:x[0];u(Number(b))}})}),m&&r.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:r.jsx(Ke,{schema:m,value:t,onChange:n,path:s,level:a})})]})},Ol=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,readonly:i=!1}=Me(),l=e.anyOf??[],c=l.map((m,C)=>({value:String(C),label:Xt(m,o)})),d=gs(t,l,o),f=l[d],h=q(f,o).type===F.Null,u=m=>{const C=q(l[m],o);if(C.type===F.Null){n(null);return}const x=be(C,o);if(x!==void 0){n(x);return}switch(C.type){case F.Array:n([]);break;case F.String:n("");break;case F.Boolean:n(!1);break;case F.Integer:case F.Number:n(0);break;default:n({});break}};return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Pe,{options:c,value:String(d),disabled:i,onChange:m=>{const C=typeof m=="string"?m:m[0];u(Number(C))}})}),!h&&f&&r.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:r.jsx(Ke,{schema:f,value:t,onChange:n,path:s,level:a})})]})},Ss=({schema:e,value:t,onChange:n,invalid:s})=>{const a=g.useId(),{texts:o,readonly:i=!1,inputClassName:l,acceptableResourceTypes:c}=Me(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===F.String||e.type===void 0)){const h=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(C=>{const x=String(C);return{value:x,label:x}}):[]});return r.jsx(Pe,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>n(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder,className:l})}if(d)return r.jsx(v.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===Qe.Radio){const h=e.enumOrientation===pt.Row;return r.jsx("div",{role:"radiogroup",className:h?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(u=>{const m=String(u);return r.jsx(O.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:i,onChange:C=>n(C)},m)})})}if(f){const h=e.enum.map(u=>({value:String(u),label:String(u)}));return r.jsx(Pe,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>n(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder})}switch(e.type){case F.Boolean:return r.jsx(Ue.DialSwitch,{switchId:a,isOn:!!t,disabled:i,onChange:h=>n(h)});case F.Integer:return r.jsx(vr,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h!==void 0?Number(h):void 0),placeholder:o.integerInputPlaceholder,containerClassName:l});case F.Number:return r.jsx(vr,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h!==void 0?Number(h):void 0),placeholder:o.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?r.jsx(ss,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l}):r.jsx(v.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l})}},Rr=({value:e,onChange:t,theme:n=wt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:o}=Me(),[i,l]=g.useState(null),[c,d]=g.useState(()=>JSON.stringify(e,null,2));g.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-Bxui5wJH.cjs")).then(h=>{l(()=>h.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=h=>{const u=h??"";d(u);try{t(JSON.parse(u))}catch{}};return r.jsxs("div",{children:[r.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&r.jsx(i,{value:c,currentTheme:n,onChange:p,options:{readOnly:a}})}),r.jsx(v.DialErrorText,{text:f?o.invalidJsonError:void 0})]})},un=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Is=e=>!!(e.oneOf||e.anyOf||e.type===F.Array||Fe(e)),Al={[F.String]:"entryTypeString",[F.Number]:"entryTypeNumber",[F.Boolean]:"entryTypeBoolean",[F.Null]:"entryTypeNull",[F.Object]:"entryTypeObject",[F.Array]:"entryTypeArray"},_l=({pairId:e,pairKey:t,pairValue:n,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:o,onKeyChange:i,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:h,readonly:u=!1,inputClassName:m})=>{const{rootSchema:C,texts:x,defaultExpanded:b=!0,touchedPaths:y=new Set,markTouched:N=()=>{},skipUntouched:D=!1}=Me(),[I,j]=g.useState(t),_=Is(s),[w,A]=g.useState(()=>Cs(n)),E=a&&(w===F.Object||w===F.Array),T=a&&w===F.Null,R=_||E,M=[...p,e,"key"].join("."),X=(!D||y.has(M))&&t==="",G=g.useCallback(ie=>{l(ys(ie)),A(ie)},[l]),B=g.useMemo(()=>bs.map(ie=>({value:ie,label:x[Al[ie]]})),[x]),U=g.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),K=`${e}-key-error`,Z=a&&w===F.Boolean,oe=r.jsxs("div",{className:"flex gap-2 items-start",children:[r.jsxs("div",{className:R?"flex-1 min-w-0":"w-2/5 min-w-0",children:[r.jsx(v.DialInput,{value:I,disabled:u,invalid:X,"aria-describedby":X?K:void 0,onChange:ie=>j(ie??""),onBlur:()=>{N(M),I!==t&&i(I)},placeholder:d,containerClassName:m}),r.jsx(v.DialErrorText,{id:K,text:X?`${x.keyColumnHeader} is required`:void 0})]}),!_&&!E&&r.jsx("div",{className:"flex-1 min-w-0",children:T?r.jsx(v.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):Z?r.jsx(Pe,{options:U,value:n?"true":"false",disabled:u,onChange:ie=>{const le=typeof ie=="string"?ie:ie[0];le&&l(le==="true")}}):r.jsx(Ss,{schema:a?{type:w}:s,value:n,onChange:l})}),a&&r.jsx("div",{className:"w-28 shrink-0",children:r.jsx(L.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:r.jsx(Pe,{options:B,value:w,disabled:u,onChange:ie=>{const le=typeof ie=="string"?ie:ie[0];le&&G(le)}})})}),!u&&r.jsx(Wt,{size:L.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!R)return oe;if(E)return r.jsxs("div",{className:"flex flex-col gap-2",children:[oe,r.jsx(Rr,{value:n,onChange:l,theme:o},w)]});const J=[...p,t],W=ht(n,s,C),se=De(n,s,C,J.join("."));return r.jsxs("div",{className:"flex flex-col gap-2",children:[oe,r.jsx(It,{title:t,level:h,summary:W,errorCount:se.length+(X?1:0),defaultExpanded:b,children:r.jsx(Ke,{schema:s,value:n,onChange:l,path:J,level:h+1})})]})},Ll=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=Me(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?q(e.additionalProperties,o):{type:"string"},h=Is(p),[u,m]=g.useState(()=>Object.entries(t??{}).map(([I,j])=>un(I,j))),C=I=>Object.fromEntries(I.filter(j=>j.key!=="").map(j=>[j.key,j.value])),x=(I,j)=>{const _=u.map((w,A)=>A===I?{...w,key:j}:w);m(_),n(C(_))},b=(I,j)=>{const _=u.map((w,A)=>A===I?{...w,value:j}:w);m(_),n(C(_))},y=()=>h?be(p,o)??Jt(p):"",N=()=>{m(I=>[...I,un("",y())])},D=I=>{const j=u.filter((_,w)=>w!==I);m(j),n(C(j))};return r.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noFieldsYet}),u.length>0&&!h&&r.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[r.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:i.keyColumnHeader}),r.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:i.valueColumnHeader}),f&&r.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:i.typeColumnHeader})]}),u.map((I,j)=>r.jsx(_l,{pairId:I.id,pairKey:I.key,pairValue:I.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:_=>x(j,_),onValueChange:_=>b(j,_),onRemove:()=>D(j),keyInputPlaceholder:i.keyInputPlaceholder,removeFieldAriaLabel:i.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},I.id)),!l&&r.jsx("div",{className:"pt-1",children:r.jsx(v.DialGhostButton,{label:i.addField,iconBefore:r.jsx($.IconPlus,{size:16,stroke:2}),onClick:N})})]})},Ke=({schema:e,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:i=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:h}=Me(),u=q(e,l),m=b=>{d(s.join(".")),n(b)},C=!p||f.has(s.join("."));let x;if(u.oneOf)x=r.jsx(El,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==F.Object)x=r.jsx(Ol,{schema:u,value:t,onChange:m,path:s,level:a});else if(Fe(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,y=!u.properties||Object.keys(u.properties).length===0;b&&y?x=r.jsx(Ll,{schema:u,value:t,onChange:m,path:s,level:a}):y&&u.additionalProperties!==!1?x=r.jsx(Rr,{value:t,onChange:m,theme:h}):x=r.jsx(Mt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===F.Array)x=r.jsx(wl,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=C&&o&&nt(t),y=!i&&b?Et(u.title??"Field"):void 0;x=r.jsxs(r.Fragment,{children:[r.jsx(Ss,{schema:u,value:t,onChange:m,invalid:b}),r.jsx(v.DialErrorText,{text:y})]})}return c?c(s,u,x):x},kl=({schema:e,defaultValue:t,texts:n,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=ke.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:h=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const C=g.useMemo(()=>({...hs,...n}),[n]),x=g.useMemo(()=>t||(be(e,e)??{}),[]),[b,y]=g.useState(x),[N,D]=g.useState(new Set),I=g.useCallback(T=>{D(R=>R.has(T)?R:new Set([...R,T]))},[]);g.useEffect(()=>{f?.(x)},[]);const j=(T,R)=>{const M={...b,[T]:R};y(M),c?.(M),d?.(T,R)},_=new Set(Object.keys(e.properties??{})),w=Object.keys(b).filter(T=>!_.has(T)),A=Yt(Object.entries(e.properties??{}).filter(([,T])=>!q(T,e).isHidden)),E=e.required??[];return r.jsx(ms.Provider,{value:{rootSchema:e,texts:C,readonly:a,defaultExpanded:o,inputClassName:i,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:I,skipUntouched:h},children:r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-4",s),children:[A.map(([T,R])=>{const M=q(R,e),V=M.title??R.title??et(T),X=E.includes(T),G=b[T];if(l===ke.Flat)return r.jsx(vs,{schema:R,value:G,onChange:Z=>j(T,Z),path:[T],level:0,required:X,label:V},T);if(l===ke.FlatSections)return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:"dial-small-semi-text text-primary",children:V}),r.jsx(Ke,{schema:R,value:G,onChange:Z=>j(T,Z),path:[T],level:0,required:X})]},T);const B=De(G,M,e,T),U=T+".",K=!h||N.has(T)||[...N].some(Z=>Z.startsWith(U));return r.jsx(It,{title:V,description:M.description,level:0,defaultExpanded:o,errorCount:K?X&&nt(G)?Math.max(B.length,1):B.length:0,children:r.jsx(Ke,{schema:R,value:G,onChange:Z=>j(T,Z),path:[T],level:1,required:X})},T)}),w.map(T=>{const R=et(T),M=r.jsx(Rr,{value:b[T],onChange:V=>j(T,V),theme:u});return l===ke.Sections?r.jsx(It,{title:R,level:0,defaultExpanded:o,children:M},T):r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:"dial-small-semi-text text-primary",children:R}),M]},T)})]})})},qe=({text:e,className:t,variant:n=v.CaptionType.Description,...s})=>e?r.jsx("span",{...s,role:"alert",className:S.mergeClasses("dial-tiny-text",n===v.CaptionType.Error?"text-error":"text-secondary",t,O.DIAL_KIT_CLASS.captionText,n===v.CaptionType.Error&&O.DIAL_KIT_CLASS.errorText),children:e}):null,Be=({...e})=>r.jsx(qe,{...e,variant:v.CaptionType.Error}),Ns=g.createContext(null),ze=()=>{const e=g.useContext(Ns);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},Nt=(e,t=new Set,n=!1,s=!1)=>{if(!n||t.has(e))return!0;if(!s)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},Rl="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",Pl={[L.ElementSize.Small]:"size-[24px]",[L.ElementSize.Standard]:"size-[40px]",[L.ElementSize.Large]:"size-[48px]"},Ml=({icon:e,onClick:t,disabled:n,size:s=L.ElementSize.Standard,className:a})=>r.jsx("div",{className:S.mergeClasses("border-l border-tertiary",Pl[s]),children:r.jsx(k.IconButton,{className:S.mergeClasses(Rl,s===L.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:n,size:s})}),Fl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Ds=(e,t,n,s)=>{if((t==="number"||n!==void 0||s!==void 0)&&!Fl.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((n!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const o=e.currentTarget.value,i=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??i,c=o.slice(0,i)+e.key+o.slice(l),d=parseFloat(c);if(!isNaN(d)){if(n!==void 0&&d<+n){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},js={[L.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[L.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[L.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Oe=({labelProps:e,error:t,caption:n,id:s,containerClassName:a,size:o=L.ElementSize.Standard,...i})=>r.jsxs("div",{className:S.mergeClasses("flex flex-col",js[o].stackGap,a),children:[e&&r.jsx(k.Label,{...e,htmlFor:s}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Ts,{id:s,size:o,...i}),r.jsx(Be,{text:t}),!t&&r.jsx(qe,{text:n})]})]}),Ts=({invalid:e,disabled:t,prefix:n,className:s,postfix:a,children:o,iconBefore:i,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:h,min:u,onChange:m,max:C,inputButtonProps:x,wrapperRef:b,size:y=L.ElementSize.Standard,...N})=>{const D=js[y],I=g.useRef(null),j=ne.useMergeRefs([f,I]),_=d==="number"||u!==void 0||C!==void 0;g.useEffect(()=>{const T=I.current;if(!T||!_||t)return;const R=M=>{M.preventDefault()};return T.addEventListener("wheel",R,{passive:!1}),()=>{T.removeEventListener("wheel",R)}},[t,_,d]);const w=T=>{Ds(T,d,u,C)},A=T=>{const R=T.currentTarget.value;if(_&&R!==""){const M=parseFloat(R);if(isNaN(M)&&R!=="-"&&R!=="."||!isNaN(M)&&(u!==void 0&&M<+u||C!==void 0&&M>+C))return}m?.(R||void 0)},E=()=>r.jsxs("div",{ref:b,className:S.mergeClasses("dial-kit-input flex flex-row items-center justify-between",D.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!n&&D.paddingStart,!x&&D.paddingEnd,c),"aria-label":"input-container",children:[n&&r.jsx("div",{className:"border-r border-secondary",children:r.jsx(Ts,{wrapperClassName:"!rounded-r-none",className:"truncate",value:n,disabled:!0,size:y,id:`${n}_textBefore`})}),r.jsx(O.DialIcon,{icon:i}),o,r.jsx("input",{ref:j,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:S.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:w,min:u,disabled:t,max:C,...N}),a&&r.jsxs("p",{className:S.mergeClasses("text-secondary",D.postfixText),children:[" ",a]}),r.jsx(O.DialIcon,{icon:l}),x&&r.jsx(Ml,{size:y,...x,disabled:t})]});return t&&d!=="password"?r.jsx(k.Tooltip,{tooltip:h||p,children:E()}):E()},ws=({availableWidth:e,tagWidths:t,overflowChipWidth:n,gap:s})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+s;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+n>e;)o--,a-=t[o]+s;return o};var tt=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(tt||{});const Bl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",zl={[tt.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[tt.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},$l="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Hl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Re=({label:e,icon:t,appearance:n=tt.Outlined,selected:s=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...h})=>{const u=n===tt.Selectable,m=!!d&&!a,C=o&&!!f&&!a,x=u&&s,b=y=>{p?.(y),!(!m||y.defaultPrevented)&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.currentTarget.click())};return r.jsxs("span",{...h,role:m?"button":h.role,tabIndex:m?0:h.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:S.mergeClasses(Bl,x?"dial-tiny-semi-text":"dial-tiny-text",zl[n][s?"selected":"default"],a&&"cursor-not-allowed",m&&[$l,Hl],l,O.DIAL_KIT_CLASS.tag),children:[t&&r.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),r.jsx("span",{className:"truncate",title:c??e,children:e}),C&&r.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:L.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:y=>{y.stopPropagation(),f?.(y)}})]})},$t="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",vt=({options:e,selectedValues:t,handleRemoveTag:n,tagClassName:s})=>r.jsx(r.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return r.jsx(Re,{label:o?.label??a,closable:!!n,onRemove:i=>n?.(i,a),icon:o?.icon,className:S.mergeClasses($t,s)},a)})}),Kl=8,Vl=e=>e.stopPropagation(),Gl=e=>{e.key!=="Escape"&&e.stopPropagation()},Ul=({options:e,selectedValues:t,handleRemoveTag:n})=>{const s=g.useRef(null),a=g.useRef(null),[o,i]=g.useState(null),l=g.useCallback(()=>{const p=s.current,h=a.current;if(!p||!h)return;const u=Array.from(h.children,C=>C.offsetWidth),m=u.pop()??0;i(ws({tagWidths:u,overflowChipWidth:m,availableWidth:p.clientWidth,gap:Kl}))},[]);g.useLayoutEffect(()=>{l()},[l,e,t]),g.useLayoutEffect(()=>{const p=s.current;return p?O.observeElementSize(p,l):void 0},[l]);const c=o??t.length,d=t.slice(0,c),f=t.slice(c);return r.jsxs("div",{ref:s,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[r.jsx(vt,{options:e,selectedValues:d,handleRemoveTag:n,tagClassName:"min-w-0"}),f.length>0&&r.jsx(k.InteractiveTooltip,{asChild:!0,placement:k.TooltipPlacement.Bottom,content:r.jsx("div",{className:"flex flex-wrap gap-2",onClick:Vl,onKeyDown:Gl,children:r.jsx(vt,{options:e,selectedValues:f,handleRemoveTag:n})}),children:r.jsx(Re,{label:`+${f.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${f.length} more selected: ${f.map(p=>e.find(h=>h.value===p)?.label??p).join(", ")}`,title:"",className:S.mergeClasses($t,"shrink-0")})}),r.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:[r.jsx(vt,{options:e,selectedValues:t,handleRemoveTag:n,tagClassName:"shrink-0"}),r.jsx(Re,{label:`+${t.length}`,className:S.mergeClasses($t,"shrink-0")})]})]})},Zl=S.mergeClasses("w-full flex flex-col"),Wl=k.overlayItemClassName,ql="!max-w-[var(--reference-width)]",Yl=S.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Xl=k.overlayGap,Jl=k.overlaySubMenuListClassName,Ql=r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),ec="text-secondary transition-transform",tc=8,rc=r.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),nc=r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),sc=r.jsx(k.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),ac=({opt:e,selectedValues:t,mark:n=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=O.useSubMenuFloating(Xl,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),h=r.jsx(k.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:Ql,...d()});return r.jsxs(ne.FloatingNode,{id:o,children:[e.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:h}):h,a&&r.jsx(O.SubMenuPanel,{refs:i,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Jl,children:e.children.map(u=>{const m=r.jsx(k.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:n,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return r.jsx(g.Fragment,{children:u.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},Ve=({options:e,multiple:t=!1,id:n,value:s,defaultValue:a,size:o=L.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:h,searchable:u=!1,searchSize:m=L.ElementSize.Standard,searchPlaceholder:C,selectAll:x=!1,invalid:b,selectAllLabel:y="Select all",collapseTagOverflow:N=!1,selectedOptionMark:D=k.MenuItemMark.Tint,emptyStateTitle:I="No options available",emptyStateDescription:j,emptyStateIcon:_,disabled:w=!1,className:A,fieldClassName:E,listClassName:T,closable:R=!1,header:M,footer:V,onClose:X,onChange:G,dismissRef:B,onFooterClick:U,open:K,onOpenChange:Z,onSearchQueryChange:oe,customMultiSelectTagsRenderer:J})=>{const W=g.useId(),se=n||W,ie=`list-${se}`,le=o===L.ElementSize.Small,[ue,ge]=g.useState(!1),ye=K!==void 0,he=ye?!!K:ue,Y=g.useCallback(z=>{ye||ge(z),Z?.(z)},[ye,Z]),[ee,Ae]=g.useState(""),$e=g.useCallback(z=>{z!==ee&&(Ae(z||""),oe?.(z||""))},[oe,ee]),Q=s!==void 0,[de,_e]=g.useState(a),xe=Q?s:de,fe=g.useMemo(()=>t?Array.isArray(xe)?xe:[]:typeof xe=="string"?[xe]:[],[xe,t]),at=g.useMemo(()=>{const z=ee.trim().toLowerCase();return z?e.filter(pe=>pe.label.toLowerCase().includes(z)):e},[e,ee]);g.useEffect(()=>{he||$e("")},[he,$e]);const Se=g.useCallback(z=>{Q||_e(z),G?.(z)},[Q,G]),xt=g.useCallback(z=>{if(t){const pe=new Set(fe);pe.has(z)?pe.delete(z):pe.add(z),Se(Array.from(pe));return}Se(z),Y(!1)},[t,Se,Y,fe]),ot=g.useCallback((z,pe)=>{if(z.stopPropagation(),!t){Se("");return}const Ot=fe.filter(sa=>sa!==pe);Se(Ot)},[t,fe,Se]),ve=g.useMemo(()=>at.filter(z=>!z.disabled),[at]),Ze=g.useMemo(()=>ve.filter(z=>fe.includes(z.value)).length,[ve,fe]),{allSelectedInFiltered:Ce,someSelectedInFiltered:Qt}=g.useMemo(()=>{const z=ve.length>0&&Ze===ve.length;return{allSelectedInFiltered:z,someSelectedInFiltered:Ze>0&&!z}},[ve,Ze]),it=g.useCallback(()=>{if(!(!t||ve.length===0))if(Ce){const z=new Set(ve.map(pe=>pe.value));Se(fe.filter(pe=>!z.has(pe)))}else{const z=new Set(fe);ve.forEach(pe=>z.add(pe.value)),Se(Array.from(z))}},[Ce,t,ve,fe,Se]),Ye=fe.length>0,P=!t&&Ye?fe[0]:void 0,ae=g.useMemo(()=>P?e.find(z=>z.value===P)??e.flatMap(z=>z.children??[]).find(z=>z.value===P):void 0,[e,P]),Ie=ae?i?`${i} ${ae.label}`:ae.label:void 0,er=O.useIsMobileScreen(),tr=t&&N&&!J&&!er,bt=g.useMemo(()=>t?Ye?tr?r.jsx(Ul,{options:e,selectedValues:fe,handleRemoveTag:ot}):r.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:J?.(e,fe,ot)??r.jsx(vt,{options:e,selectedValues:fe,handleRemoveTag:ot})}):null:!ae||!ae.labelNode&&!ae.description?null:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[r.jsx(k.EllipsisTooltip,{text:ae.labelNode??Ie}),ae.description&&r.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:ae.description})]}),[tr,J,ot,Ye,t,e,Ie,fe,ae]),Qs=t||bt?"":Ie||(l&&s?l:""),ea=typeof d?.label=="string"?d.label:void 0,ta=bt?[L.resolveAccessibleName(h,ea),t?fe.map(z=>e.find(pe=>pe.value===z)?.label??z).join(", "):Ie].filter(Boolean).join(", ")||void 0:L.resolveAccessibleName(h);g.useImperativeHandle(B,()=>({dismiss:()=>{Y(!1)}}));const ra=g.useCallback(z=>{w||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),he||Y(!0))},[w,he,Y]),na=()=>r.jsxs("div",{id:ie,role:"listbox","aria-multiselectable":t||void 0,className:Zl,children:[M&&r.jsx(r.Fragment,{children:typeof M=="function"?M():M}),(u||R)&&(e.length>tc||!!ee)&&r.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&r.jsx(Oe,{id:`search-${se}`,size:m,placeholder:C,"aria-label":C||"Search options",onChange:z=>$e(z),value:ee,iconBefore:rc,containerClassName:"w-full"}),R&&r.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:L.ElementSize.Small,icon:nc,onClick:z=>{X?.(z),Y(!1)}})]}),t&&x&&ve.length>0&&r.jsx("div",{className:S.mergeClasses(Wl,"mt-2"),children:r.jsx(k.Checkbox,{id:`${se}-selectAll`,labelProps:{label:y},isSelected:Ce,isIndeterminate:Qt,onChange:it})}),r.jsx("div",{role:"none",className:Yl,children:at.length===0?r.jsx("div",{className:"px-2 py-3",children:r.jsx(O.DialNoDataContent,{icon:_??sc,title:I,description:j})}):at.map(z=>{const pe=fe.includes(z.value);if(z.children?.length)return r.jsx(ac,{opt:z,selectedValues:fe,mark:t?k.MenuItemMark.Checkbox:D,onSelect:xt},z.value);const Ot=t?r.jsx(k.MenuItem,{id:`${se}-${z.value}`,role:"option","aria-selected":pe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:k.MenuItemMark.Checkbox,selected:pe,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>xt(z.value)}):r.jsx(k.MenuItem,{role:"option","aria-selected":pe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:D,selected:pe,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&xt(z.value)});return r.jsx(g.Fragment,{children:z.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:Ot}):Ot},z.value)})}),V&&r.jsx("div",{onClick:z=>{U?.(z),U&&Y(!1)},children:typeof V=="function"?V():V})]});return r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-2",A,O.DIAL_KIT_CLASS.select),children:[d&&r.jsx(k.Label,{...d,htmlFor:se}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(k.Dropdown,{open:he,onOpenChange:Y,disabled:w,closable:R,onClose:X,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:S.mergeClasses(ql,T),className:"w-full",renderOverlay:na,children:r.jsx(Oe,{id:se,size:o,disabled:w,invalid:b,value:Qs,placeholder:bt?void 0:c,readOnly:!0,iconBefore:t?void 0:ae?.icon,iconAfter:r.jsx($.IconChevronDown,{size:le?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses(ec,he&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":he,"aria-controls":ie,"aria-autocomplete":"none","aria-label":ta,containerClassName:"w-full",wrapperClassName:S.mergeClasses(!w&&"cursor-pointer",t&&Ye&&!tr&&["!h-auto flex-wrap py-2",le?"min-h-[24px]":"min-h-[40px]"],E),className:S.mergeClasses("cursor-pointer",bt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:ra,children:bt})}),r.jsx(Be,{text:f}),!f&&r.jsx(qe,{text:p})]})]})},fn={[F.Array]:[],[F.String]:"",[F.Boolean]:!1,[F.Integer]:0,[F.Number]:0},oc=({schema:e,value:t,onChange:n,path:s,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:c=!1}=ze(),d=e.anyOf??[],f=gs(t,d,i),p=d[f],h=!p||q(p,i).type===F.Null,u=m=>{const C=q(d[m],i);if(C.type===F.Null){n(null);return}const x=be(C,i);if(x!==void 0){n(x);return}const b=typeof C.type=="string"?C.type:"";n(b in fn?fn[b]:{})};return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:o??l.selectTypePlaceholder,options:d.map((m,C)=>({value:String(C),label:Xt(m,i)})),value:String(f),disabled:c,onChange:m=>u(Number(typeof m=="string"?m:m[0])),className:"max-w-[280px]"}),!h&&r.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:r.jsx(Ge,{schema:p,value:t,onChange:n,path:s,level:a,ariaLabel:o})})]})},st=({label:e,variant:t,appearance:n=L.ButtonAppearance.Solid,size:s=L.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:h,disabled:u,...m})=>{const C=S.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,n),s===L.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===L.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===L.ElementSize.Small&&"dial-kit-base-button-small",n!==L.ButtonAppearance.Link&&(s===L.ElementSize.Small?"px-2":"px-4"),s!==L.ElementSize.Small&&n!==L.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=L.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),y=r.jsxs(r.Fragment,{children:[r.jsx(O.DialIcon,{icon:l}),e&&r.jsx("span",{className:o,children:e}),r.jsx(O.DialIcon,{icon:i})]}),N=m,D=f!==void 0?r.jsx("a",{...N,href:u?void 0:f,target:p,rel:h??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:N.tabIndex,onClick:u?void 0:N.onClick,className:C,"aria-label":b,children:y}):r.jsx("button",{...m,...k.getDisabledButtonProps(u,d,m.onClick),type:c,className:C,"aria-label":b,children:y});return d?r.jsx(k.Tooltip,{asChild:!0,...d,children:D}):D},Pr=(e,t)=>({appearance:s,...a})=>r.jsx(st,{...a,variant:e,appearance:s||t}),Mr=(e,t)=>({variant:s,...a})=>r.jsx(st,{...a,variant:s||t,appearance:e}),Es=Pr(L.ButtonVariant.Primary,L.ButtonAppearance.Solid),Fr=Pr(L.ButtonVariant.Neutral,L.ButtonAppearance.Solid),ic=Pr(L.ButtonVariant.Danger,L.ButtonAppearance.Solid),dt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},lc=r.jsx($.IconSparkles,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),cc=({appearance:e=L.ButtonAppearance.Outlined,iconBefore:t=lc,iconAfter:n,style:s,...a})=>{const o=`dial-kit-starter-gradient-${g.useId().replace(/[^\w-]/g,"")}`,i=r.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:r.jsx("defs",{children:r.jsxs("linearGradient",{id:o,x1:dt.x1,y1:dt.y1,x2:dt.x2,y2:dt.y2,gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:dt.from}),r.jsx("stop",{offset:"1",stopColor:dt.to})]})})}),l=c=>r.jsxs(r.Fragment,{children:[i,c]});return r.jsx(st,{...a,variant:L.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:n&&!t?l(n):n,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...s}})},dc=Mr(L.ButtonAppearance.Link,L.ButtonVariant.Primary),Br=Mr(L.ButtonAppearance.Ghost,L.ButtonVariant.Primary),uc=Mr(L.ButtonAppearance.Outlined,L.ButtonVariant.Neutral),Dt=({title:e,description:t,summary:n,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=g.useState(l),p=g.useId(),h=a===0;return r.jsxs("div",{className:S.mergeClasses("flex flex-col border border-tertiary",h?"rounded-xl bg-layer-raised":"rounded-lg",O.DIAL_KIT_CLASS.schemaRendererSection),children:[r.jsxs("div",{className:S.mergeClasses("flex items-center gap-2",h?"px-4 py-3":"px-3 py-2"),children:[r.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":d?p:void 0,onClick:()=>f(u=>!u),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("shrink-0 text-secondary transition-transform",!d&&"-rotate-90")}),r.jsx("span",{className:S.mergeClasses("truncate",h?"dial-small-semi-text":"dial-small-text"),children:e})]}),r.jsx(k.InfoButton,{caption:t}),n&&r.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:n}),s>0?r.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[r.jsx($.IconAlertTriangle,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),s," error",s>1?"s":""]}):r.jsx($.IconCheck,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&r.jsx(k.DangerIconButton,{size:L.ElementSize.Small,icon:r.jsx($.IconTrash,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":c,onClick:i,className:"shrink-0"})]}),d&&r.jsx("div",{id:p,className:S.mergeClasses("border-t border-tertiary",h?"p-4":"p-3"),children:o})]})},fc=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=ze(),[d,f]=g.useState(),p=Array.isArray(t)?t:[],h=e.items;if(!h)return r.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const u=q(h,o),m=u.discriminator,C=m?Object.keys(m.mapping).map(D=>({value:D,label:D})):[],x=d??C[0]?.value,b=()=>{let D;if(m&&x){const I=q({$ref:m.mapping[x]},o);D={...be(I,o)??{},[m.propertyName]:x}}else D=be(u,o)??Jt(u);n([...p,D])},y=D=>{n(p.filter((I,j)=>j!==D))},N=(D,I)=>{n(p.map((j,_)=>_===D?I:j))};return r.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&r.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((D,I)=>{const j=xs(D,m?.propertyName,I),_=De(D,u,o,`${s.join(".")}[${I}]`);return r.jsx(Dt,{title:j,level:a,summary:ht(D,u,o),errorCount:_.length,onRemove:l?void 0:()=>y(I),defaultExpanded:c,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${j}`,children:r.jsx(Ge,{schema:h,value:D,onChange:w=>N(I,w),path:[...s,String(I)],level:a+1,ariaLabel:j})},I)}),!l&&r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[C.length>0&&r.jsx(Ve,{ariaLabel:i.selectTypeToAdd,options:C,value:x,placeholder:i.selectTypeToAdd,onChange:D=>f(typeof D=="string"?D:D[0]),className:"max-w-[280px] flex-1"}),r.jsx(Br,{label:i.addItem,iconBefore:r.jsx($.IconPlus,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:b})]})]})};var zr=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(zr||{});const pn={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},pc=e=>typeof e=="boolean"?pn[e?"both":"none"]:pn[e],Os=({className:e="",value:t,onChange:n,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,invalid:d,...f})=>{const p=S.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d&&"dial-kit-input-error",f.disabled&&"dial-kit-input-disable",pc(o),e);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",a),children:[i&&r.jsx(k.Label,{...i,htmlFor:c}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("textarea",{id:c,value:t||"",className:p,onChange:h=>n?.(h.currentTarget.value),...f}),r.jsx(Be,{text:s}),!s&&r.jsx(qe,{text:l})]})]})},hn=e=>{try{return JSON.parse(e),!0}catch{return!1}},$r=({value:e,onChange:t,id:n,ariaLabel:s})=>{const{readonly:a,texts:o}=ze(),[i,l]=g.useState(()=>JSON.stringify(e,null,2)??""),c=!hn(i),d=f=>{l(f),hn(f)&&t(JSON.parse(f))};return r.jsx(Os,{id:n,"aria-label":s,value:i,onChange:d,readOnly:a,invalid:c,error:c?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:zr.Vertical,className:"font-mono !whitespace-pre"})},hc=/^0+\.(\d+)?$/,mc=/^0+/,gc=[".","-","+","e","E"],mn=e=>!e||e==="-"?e:String(e).match(hc)?String(e).replace(mc,"0"):Number(e),As=({integer:e,onChange:t,min:n,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=d=>{if(e&&gc.includes(d.key)){d.preventDefault();return}Ds(d,"number",n,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const h=d.currentTarget,u=h.selectionStart??0,m=h.selectionEnd??0,C=h.value.slice(0,u)+p+h.value.slice(m);t?.(mn(C))}}o?.(d)};return r.jsx(Oe,{...i,wrapperClassName:S.mergeClasses(i.wrapperClassName,O.DIAL_KIT_CLASS.numberInput),type:"number",min:n,max:s,onChange:d=>t?.(mn(d)),onKeyDown:l,onPaste:c})},_s=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:n,size:s=L.ElementSize.Standard,...a})=>{const[o,i]=g.useState(!1),l=o&&!n;return g.useEffect(()=>{n&&i(!1)},[n]),r.jsx(Oe,{...a,wrapperClassName:S.mergeClasses(a.wrapperClassName,O.DIAL_KIT_CLASS.passwordInput),size:s,disabled:n,type:l?"text":"password",iconAfter:n?void 0:r.jsx(k.GhostIconButton,{size:L.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?r.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):r.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>i(c=>!c)})})},xc="flex flex-col gap-2",bc="flex",Cc="mt-2 ml-[26px]",yc={[v.RadioGroupOrientation.Column]:"flex-col gap-y-3",[v.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},jt=({items:e,value:t,onChange:n,name:s,id:a,orientation:o=v.RadioGroupOrientation.Column,labelProps:i,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:h,radioClassName:u,contentClassName:m})=>{const C=g.useId(),x=a??C,b=`${x}-label`,y=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,D=L.resolveAccessibleName(i?.label);return r.jsxs("div",{className:S.mergeClasses(xc,p,O.DIAL_KIT_CLASS.radioGroup),children:[i&&r.jsx(k.Label,{...i,id:b}),r.jsx("div",{role:"radiogroup","aria-labelledby":D?b:void 0,"aria-label":D?void 0:L.resolveAccessibleName(f),"aria-describedby":[y,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:S.mergeClasses(bc,yc[o],h),children:e.map(I=>{const j=I.value===t;return r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx(k.Radio,{id:`${x}-${I.value}`,name:s??x,value:I.value,labelProps:I.label==null?void 0:{label:I.label},"aria-label":I["aria-label"],caption:I.caption,isSelected:j,disabled:l||I.disabled,onChange:n,className:u}),j&&I.content?r.jsx("div",{className:S.mergeClasses(Cc,m),children:I.content}):null]},I.value)})}),r.jsx(Be,{id:y,text:c}),!c&&r.jsx(qe,{id:N,text:d})]})},Ls=({id:e,labelProps:t,isOn:n=!1,disabled:s,onChange:a,caption:o,className:i,...l})=>{const c=g.useId(),d=e??c,f=o?`${d}-caption`:void 0,p=g.useCallback(h=>{a?.(h.target.checked)},[a]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs("div",{className:S.mergeClasses("flex items-center gap-2",i,O.DIAL_KIT_CLASS.switch),children:[r.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:n,"aria-checked":n,disabled:s,onChange:p,"aria-label":L.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),r.jsx("label",{htmlFor:d,className:S.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",n?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":S.mergeClasses("cursor-pointer",n?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:r.jsx("span",{className:S.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&r.jsx(k.Label,{size:L.ElementSize.Standard,...t,htmlFor:d,className:S.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&r.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},gn=e=>typeof e=="string"?e:e[0],hr=e=>e!=null?String(e):"",vc=e=>e!==void 0?Number(e):void 0,ks=({schema:e,value:t,onChange:n,invalid:s,id:a,ariaLabel:o})=>{const{texts:i,readonly:l=!1,inputClassName:c,acceptableResourceTypes:d}=ze(),f=e.const!==void 0,p=Array.isArray(e.enum)?e.enum:[],h=p.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===F.String||e.type===void 0)){const m=(e.acceptableResourceTypes??[]).flatMap(C=>{const x=d?.[C];return Array.isArray(x)?x.map(b=>{const y=String(b);return{value:y,label:y}}):[]});return r.jsx(Ve,{id:a,ariaLabel:o,options:m,value:t!=null?String(t):void 0,invalid:s,disabled:l,onChange:C=>n(gn(C)),placeholder:i.enumSelectPlaceholder,className:c})}if(f)return r.jsx(Oe,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:c});if(h&&e.enumDisplay===Qe.Radio)return r.jsx(jt,{id:a,ariaLabel:o,items:p.map(m=>({value:String(m),label:String(m)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===pt.Row?v.RadioGroupOrientation.Row:v.RadioGroupOrientation.Column,disabled:l,onChange:m=>n(m)});if(h)return r.jsx(Ve,{id:a,ariaLabel:o,options:p.map(m=>({value:String(m),label:String(m)})),value:t!=null?String(t):void 0,invalid:s,disabled:l,onChange:m=>n(gn(m)),placeholder:i.enumSelectPlaceholder,className:c});switch(e.type){case F.Boolean:return r.jsx(Ls,{id:a,"aria-label":o,isOn:!!t,disabled:l,onChange:m=>n(m)});case F.Integer:case F.Number:return r.jsx(As,{id:a,"aria-label":o,integer:e.type===F.Integer,value:hr(t),invalid:s,disabled:l,onChange:m=>n(vc(m)),placeholder:e.type===F.Integer?i.integerInputPlaceholder:i.numberInputPlaceholder,containerClassName:c});default:return e.isProtected?r.jsx(_s,{id:a,"aria-label":o,value:hr(t),invalid:s,disabled:l,onChange:m=>n(m??void 0),placeholder:i.stringInputPlaceholder,containerClassName:c}):r.jsx(Oe,{id:a,"aria-label":o,value:hr(t),invalid:s,disabled:l,onChange:m=>n(m??void 0),placeholder:i.stringInputPlaceholder,containerClassName:c})}},xn=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Rs=e=>!!(e.oneOf||e.anyOf||e.type===F.Array||Fe(e)),Sc={[F.String]:"entryTypeString",[F.Number]:"entryTypeNumber",[F.Boolean]:"entryTypeBoolean",[F.Null]:"entryTypeNull",[F.Object]:"entryTypeObject",[F.Array]:"entryTypeArray"},bn=e=>typeof e=="string"?e:e[0],Ic=({pair:e,valueSchema:t,isUnschematizedValue:n,onKeyChange:s,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:c,texts:d,readonly:f=!1,inputClassName:p,defaultExpanded:h=!0,touchedPaths:u,markTouched:m,skipUntouched:C}=ze(),[x,b]=g.useState(e.key),[y,N]=g.useState(()=>Cs(e.value)),D=Rs(t),I=n&&(y===F.Object||y===F.Array),j=n&&y===F.Null,_=n&&y===F.Boolean,w=D||I,A=[...i,e.id,"key"].join("."),E=Nt(A,u,C)&&e.key==="",T=e.key||d.valueColumnHeader,R=K=>{a(ys(K)),N(K)},M=g.useMemo(()=>bs.map(K=>({value:K,label:d[Sc[K]]})),[d]),V=g.useMemo(()=>[{value:"true",label:d.booleanTrueOption},{value:"false",label:d.booleanFalseOption}],[d]),X=()=>j?r.jsx(Oe,{"aria-label":T,value:"null",disabled:!0}):_?r.jsx(Ve,{ariaLabel:T,options:V,value:e.value?"true":"false",disabled:f,onChange:K=>{const Z=bn(K);Z&&a(Z==="true")}}):r.jsx(ks,{schema:n?{type:y}:t,value:e.value,onChange:a,ariaLabel:T}),G=r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("div",{className:w?"min-w-0 flex-1":"w-2/5 min-w-0",children:r.jsx(Oe,{"aria-label":d.keyColumnHeader,value:x,disabled:f,invalid:E,error:E?`${d.keyColumnHeader} is required`:void 0,onChange:K=>b(K??""),onBlur:()=>{m?.(A),x!==e.key&&s(x)},placeholder:d.keyInputPlaceholder,containerClassName:p})}),!w&&r.jsx("div",{className:"min-w-0 flex-1",children:X()}),n&&r.jsx("div",{className:"w-28 shrink-0",children:r.jsx(k.Tooltip,{tooltip:d.entryTypeChangeWarning,triggerClassName:"block",children:r.jsx(Ve,{ariaLabel:d.typeColumnHeader,options:M,value:y,disabled:f,onChange:K=>{const Z=bn(K);Z&&R(Z)}})})}),!f&&r.jsx(k.DangerIconButton,{size:L.ElementSize.Small,icon:r.jsx($.IconTrash,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${d.removeFieldAriaLabel}: ${e.key}`:d.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!w)return G;if(I)return r.jsxs("div",{className:"flex flex-col gap-2",children:[G,r.jsx($r,{value:e.value,onChange:a,ariaLabel:T},y)]});const B=[...i,e.key],U=De(e.value,t,c,B.join("."));return r.jsxs("div",{className:"flex flex-col gap-2",children:[G,r.jsx(Dt,{title:e.key,level:l,summary:ht(e.value,t,c),errorCount:U.length+(E?1:0),defaultExpanded:h,children:r.jsx(Ge,{schema:t,value:e.value,onChange:a,path:B,level:l+1,ariaLabel:T})})]})},Nc=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=ze(),c=e.additionalProperties===!0||e.additionalProperties==null,d=!c&&typeof e.additionalProperties=="object"?q(e.additionalProperties,o):{type:F.String},f=Rs(d),[p,h]=g.useState(()=>Object.entries(t??{}).map(([x,b])=>xn(x,b))),u=x=>{h(x),n(Object.fromEntries(x.filter(b=>b.key!=="").map(b=>[b.key,b.value])))},m=(x,b)=>u(p.map((y,N)=>N===x?{...y,...b}:y)),C=()=>{const x=f?be(d,o)??Jt(d):"";h(b=>[...b,xn("",x)])};return r.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&r.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!f&&r.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[r.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),r.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),c&&r.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((x,b)=>r.jsx(Ic,{pair:x,valueSchema:d,isUnschematizedValue:c,onKeyChange:y=>m(b,{key:y}),onValueChange:y=>m(b,{value:y}),onRemove:()=>u(p.filter((y,N)=>N!==b)),path:s,level:a},x.id)),!l&&r.jsx("div",{className:"pt-1",children:r.jsx(Br,{label:i.addField,iconBefore:r.jsx($.IconPlus,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})})]})},Nr=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i}=ze(),l=q(e,o),c=Yt(Object.entries(l.properties??{}).filter(([,p])=>!q(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?r.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):r.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,h])=>{const u=q(h,o);return r.jsx(Ps,{schema:h,value:f[p],onChange:m=>n({...f,[p]:m}),path:[...s,p],level:a,required:d.includes(p),label:u.title??h.title??et(p)},p)})})},Cn=e=>typeof e=="string"?e:e[0],Dc=(e,t)=>{const{[t]:n,...s}=e.properties??{};return{...e,properties:s}},jc=({schema:e,value:t,onChange:n,path:s,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:c=!1}=ze(),d=g.useId(),f=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===Qe.Radio,h=e.discriminator;if(h){const y=h.propertyName,N=h.mapping,D=w=>q({$ref:N[w]},i),I=typeof t=="object"&&t!==null?t[y]:void 0,j=I?D(I):void 0,_=w=>{const A=be(D(w),i)??{};n({...A,[y]:w})};if(p){const w=e.discriminatorOrientation===pt.Row,A=T=>r.jsx(Nr,{schema:Dc(T,y),value:t,onChange:n,path:s,level:a}),E=r.jsx(jt,{id:d,ariaLabel:f,value:I,onChange:_,disabled:c,orientation:w?v.RadioGroupOrientation.Row:v.RadioGroupOrientation.Column,items:Object.keys(N).map(T=>{const R=D(T);return{value:T,label:R.title??T,content:w?void 0:A(R)}})});return w?r.jsxs("div",{className:"flex flex-col gap-3",children:[E,j&&A(j)]}):E}return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:f,options:Object.keys(N).map(w=>({value:w,label:w})),value:I,placeholder:l.selectTypePlaceholder,disabled:c,onChange:w=>{const A=Cn(w);A&&_(A)},className:"max-w-[280px]"}),j&&r.jsx("div",{className:"pl-3",children:r.jsx(Nr,{schema:j,value:t,onChange:n,path:s,level:a})})]})}const u=e.oneOf??[],C=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const y=u.findIndex(N=>q(N,i).required?.every(D=>D in t));return y>=0?y:0})(),x=u[C],b=y=>{const N=be(q(u[y],i),i);n(N??null)};return p?r.jsx(jt,{id:d,ariaLabel:f,value:String(C),onChange:y=>b(Number(y)),disabled:c,items:u.map((y,N)=>({value:String(N),label:Xt(y,i)??`Option ${N+1}`,content:r.jsx(Ge,{schema:q(y,i),value:t,onChange:n,path:s,level:a,ariaLabel:o})}))}):r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:f,options:u.map((y,N)=>({value:String(N),label:q(y,i).title??`Option ${N+1}`})),value:String(C),disabled:c,onChange:y=>b(Number(Cn(y))),className:"max-w-[280px]"}),x&&r.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:r.jsx(Ge,{schema:x,value:t,onChange:n,path:s,level:a,ariaLabel:o})})]})},Ge=({schema:e,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:c})=>{const{rootSchema:d,renderField:f,markTouched:p,touchedPaths:h,skipUntouched:u}=ze(),m=q(e,d),C=s.join("."),x=N=>{p?.(C),n(N)},b={schema:m,value:t,onChange:x,path:s,level:a};let y;if(m.oneOf)y=r.jsx(jc,{...b,ariaLabel:c});else if(m.anyOf&&m.type!==F.Object)y=r.jsx(oc,{...b,ariaLabel:c});else if(Fe(m)){const N=m.additionalProperties!=null&&m.additionalProperties!==!1,D=!m.properties||Object.keys(m.properties).length===0;N&&D?y=r.jsx(Nc,{...b}):D&&m.additionalProperties!==!1?y=r.jsx($r,{value:t,onChange:x,id:l,ariaLabel:c}):y=r.jsx(Nr,{...b})}else if(m.type===F.Array)y=r.jsx(fc,{...b});else{const N=Nt(C,h,u)&&!!o&&nt(t),D=!i&&N?Et(m.title??c??"Field"):void 0;y=r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(ks,{schema:m,value:t,onChange:x,invalid:N,id:l,ariaLabel:c}),r.jsx(Be,{text:D})]})}return f?f(s,m,y):y},Ps=({schema:e,value:t,onChange:n,path:s,level:a=0,required:o,label:i})=>{const l=g.useId(),{rootSchema:c,defaultExpanded:d=!0,touchedPaths:f,skipUntouched:p}=ze(),h=q(e,c),u=s.join(".");if(Fe(h)||h.type===F.Array){const C=De(t,h,c,u),x=i??h.title??s[s.length-1]??"Section";return r.jsx(Dt,{title:x,description:h.description,level:a,summary:ht(t,h,c),errorCount:Nt(u,f,p,!0)?C.length:0,defaultExpanded:d,children:r.jsx(Ge,{schema:h,value:t,onChange:n,path:s,level:a+1,required:o,ariaLabel:x})})}const m=Nt(u,f,p)&&o&&nt(t)?Et(i??"Field"):void 0;return r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(k.Label,{htmlFor:l,label:i,required:o,caption:h.description}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Ge,{schema:h,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i}),r.jsx(Be,{text:m})]})]})},yn="dial-small-semi-text text-primary",Tc=({schema:e,defaultValue:t,texts:n,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=ke.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:h=!1,acceptableResourceTypes:u})=>{const m=g.useMemo(()=>({...hs,...n}),[n]),C=g.useMemo(()=>t||(be(e,e)??{}),[]),[x,b]=g.useState(C),[y,N]=g.useState(()=>new Set),D=g.useCallback(E=>{N(T=>T.has(E)?T:new Set([...T,E]))},[]);g.useEffect(()=>{f?.(C)},[]);const I=(E,T)=>{const R={...x,[E]:T};b(R),c?.(R),d?.(E,T)},j=new Set(Object.keys(e.properties??{})),_=Object.keys(x).filter(E=>!j.has(E)),w=Yt(Object.entries(e.properties??{}).filter(([,E])=>!q(E,e).isHidden)),A=e.required??[];return r.jsx(Ns.Provider,{value:{rootSchema:e,texts:m,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:u,renderField:p,touchedPaths:y,markTouched:D,skipUntouched:h},children:r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-4",s,O.DIAL_KIT_CLASS.schemaRenderer),children:[w.map(([E,T])=>{const R=q(T,e),M=R.title??T.title??et(E),V=A.includes(E),X=x[E],G=K=>I(E,K);if(l===ke.Flat)return r.jsx(Ps,{schema:T,value:X,onChange:G,path:[E],level:0,required:V,label:M},E);if(l===ke.FlatSections)return r.jsxs("section",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:yn,children:M}),r.jsx(Ge,{schema:T,value:X,onChange:G,path:[E],level:0,required:V,ariaLabel:M})]},E);const B=De(X,R,e,E),U=V&&nt(X)?Math.max(B.length,1):B.length;return r.jsx(Dt,{title:M,description:R.description,level:0,defaultExpanded:o,errorCount:Nt(E,y,h,!0)?U:0,children:r.jsx(Ge,{schema:T,value:X,onChange:G,path:[E],level:1,required:V,ariaLabel:M})},E)}),_.map(E=>{const T=et(E),R=r.jsx($r,{value:x[E],onChange:M=>I(E,M),ariaLabel:T});return l===ke.Sections?r.jsx(Dt,{title:T,level:0,defaultExpanded:o,children:R},E):r.jsxs("section",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:yn,children:T}),R]},E)})]})})},wc=e=>({info:r.jsx($.IconInfoCircleFilled,{size:e.size}),error:r.jsx($.IconAlertCircleFilled,{size:e.size}),warning:r.jsx($.IconAlertTriangleFilled,{size:e.size}),success:r.jsx($.IconCircleCheckFilled,{size:e.size}),loading:r.jsx(v.Spinner,{size:e.size}),general:r.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),Ec={[v.NotificationVariant.Info]:"bg-info text-info",[v.NotificationVariant.Success]:"bg-success text-success",[v.NotificationVariant.Warning]:"bg-warning text-warning",[v.NotificationVariant.Error]:"bg-error text-error",[v.NotificationVariant.Loading]:"bg-layer-raised text-info",[v.NotificationVariant.General]:"bg-layer-sunken text-primary"},Oc={[v.NotificationVariant.Info]:"status",[v.NotificationVariant.Success]:"status",[v.NotificationVariant.Warning]:"alert",[v.NotificationVariant.Error]:"alert",[v.NotificationVariant.Loading]:"status",[v.NotificationVariant.General]:"status"},Ac="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",Hr=({variant:e=v.NotificationVariant.Info,type:t=v.NotificationType.Toast,title:n,message:s,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...h})=>{const u=g.useMemo(()=>wc({size:i,stroke:l})[e],[e,i,l]),m=p??(t===v.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return r.jsxs("div",{role:Oc[e],...h,className:S.mergeClasses(Ac,Ec[e],t===v.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===v.NotificationType.SectionMessage&&e===v.NotificationVariant.Loading&&"border-secondary",o,O.DIAL_KIT_CLASS.notification),children:[r.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[r.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:r.jsx(O.DialIcon,{icon:u})}),n?r.jsxs("div",{className:S.mergeClasses("flex min-w-0 text-primary break-words",m),children:[r.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:n}),r.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):r.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),a!=null&&r.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&r.jsx(k.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:C=>d?.(C)})]})},vn={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},_c=e=>e===1?"!truncate !whitespace-nowrap":`${vn[e]??vn[2]} !whitespace-normal`,Ms=({text:e,query:t,markClassName:n,className:s,maxLines:a=2})=>{const o=S.mergeClasses(_c(a),s,O.DIAL_KIT_CLASS.highlight);if(!t.trim())return r.jsx(k.EllipsisTooltip,{className:o,text:e});const i=e.toLowerCase().indexOf(t.toLowerCase()),l=i===-1?e:r.jsxs(r.Fragment,{children:[e.slice(0,i),r.jsx("mark",{className:S.mergeClasses("text-accent bg-control-accent-alpha-hover",n),children:e.slice(i,i+t.length)}),e.slice(i+t.length)]});return r.jsx(k.EllipsisTooltip,{className:o,text:l})},Lc=({className:e,children:t,...n})=>r.jsx("article",{...n,className:S.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,O.DIAL_KIT_CLASS.cardShell),children:t}),mt=(e,t)=>({type:s,...a})=>r.jsx(Hr,{...a,variant:e,type:s||t}),gt=(e,t)=>({variant:s,...a})=>r.jsx(Hr,{...a,variant:s||t,type:e}),kc=mt(v.NotificationVariant.Error,v.NotificationType.Toast),Rc=mt(v.NotificationVariant.Info,v.NotificationType.Toast),Pc=mt(v.NotificationVariant.Success,v.NotificationType.Toast),Mc=mt(v.NotificationVariant.Warning,v.NotificationType.Toast),Fc=mt(v.NotificationVariant.Loading,v.NotificationType.Toast),Bc=mt(v.NotificationVariant.General,v.NotificationType.Toast),zc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Error),$c=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Info),Hc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Success),Kc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Warning),Vc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Loading),Gc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.General);var Ne=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(Ne||{});const Uc="en-GB",Zc={[Ne.Date]:"Select date",[Ne.DateTime]:"Select date and time",[Ne.Time]:"--:--",[Ne.Weekday]:"Select day"},Fs="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-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",Bs="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",zs="!border-error",Wc="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",qc="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-none focus-visible:outline focus-visible:outline-focus",Yc="bg-control-accent text-control-permanent",Xc="text-accent dial-small-semi-text",Jc="text-control-disable-primary",$s="text-secondary",Qc=r.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:$s}),Sn={prev:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},ed=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},In=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Nn=(e,t,n)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(n){const a=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(s>a)return!0}return!1},td=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Dn=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),rd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),_t=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,jn=(e,t)=>{const[n,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(n||0,s||0,0,0),a},nd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),sd=e=>{const t=e.replace(/\D/g,"").slice(0,4);let n=t.slice(0,2);const s=t.slice(2,4);if(n.length===2&&(n=String(Math.min(Number(n),23)).padStart(2,"0")),s.length===0)return n;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${n}:${a}`},Hs=5,Ks=e=>e.charAt(0).toUpperCase()+e.slice(1),ad=e=>Array.from({length:7},(t,n)=>{const s=new Date(Date.UTC(1970,0,Hs+n));return Ks(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),od=e=>Array.from({length:7},(t,n)=>{const s=new Date(Date.UTC(1970,0,Hs+n));return{value:String(n+1),label:Ks(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),Tn=({id:e,disabled:t,invalid:n,trigger:s,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:c})=>{const d=O.useThemeScope(),[f,p]=g.useState(!1),{refs:h,floatingStyles:u,context:m}=ne.useFloating({open:f,onOpenChange:D=>p(t?!1:D),placement:"bottom-start",whileElementsMounted:ne.autoUpdate,middleware:[ne.offset(8),ne.flip({padding:8}),ne.shift({padding:8})]}),C=ne.useClick(m,{enabled:!t}),x=ne.useDismiss(m),b=ne.useRole(m,{role:"dialog"}),{getReferenceProps:y,getFloatingProps:N}=ne.useInteractions([C,x,b]);return r.jsxs(r.Fragment,{children:[r.jsx("div",{id:e,ref:h.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:S.mergeClasses(Fs,"focus-visible:outline focus-visible:outline-focus",n&&zs,t&&Bs,o),...y(),children:s}),f&&r.jsx(ne.FloatingPortal,{children:r.jsx(ne.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:r.jsx("div",{ref:h.setFloating,style:u,"aria-label":c,className:S.mergeClasses(Wc,d,a),...N(),children:i(()=>p(!1))})})})]})},wn=({id:e,value:t,onChange:n,onBlur:s,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=g.useState(t);g.useEffect(()=>{p(t)},[t]);const h=r.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=sd(u.target.value);p(m),nd(m)&&n(m)},onBlur:s,className:S.mergeClasses(Fs,o&&zs,a&&Bs,i)});return d?r.jsxs("div",{className:"relative w-full",children:[h,r.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):h},id=({mode:e=Ne.Date,value:t,onChange:n,onBlur:s,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:h=Uc,fieldClassName:u,showTimezone:m=!1})=>{const C=o??Zc[e],x=t instanceof Date?t:null,b=g.useId(),y=c??b,N=a?.id??`${y}-label`,D=!!a?.label,I=typeof a?.label=="string"?a.label:void 0,j=D?`${N} ${y}`:void 0,_=a?r.jsx(k.Label,{...a,id:N,htmlFor:y}):null,[w,A]=g.useState(()=>x??new Date),E=g.useMemo(()=>new Date,[]),T=g.useMemo(()=>m?ps({locale:h}):null,[m,h]),R=g.useMemo(()=>ad(h),[h]),M=g.useMemo(()=>od(h),[h]),V=g.useMemo(()=>ed(w.getFullYear(),w.getMonth()),[w]),X=K=>{A(Z=>new Date(Z.getFullYear(),Z.getMonth()+K,1))},G=(K,Z)=>{if(Nn(K,f,p))return;const oe=e===Ne.DateTime&&x?jn(K,_t(x)):K;n?.(oe),e===Ne.Date&&Z()},B=K=>{n?.(jn(x??new Date,K))},U=()=>x?e===Ne.DateTime?`${Dn(x,h)}, ${_t(x)}`:Dn(x,h):C;if(e===Ne.Time){const K=typeof t=="string"?t:x?_t(x):"";return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[_,r.jsx(wn,{id:y,value:K,onChange:Z=>n?.(Z),onBlur:s,disabled:i,invalid:l,placeholder:C,className:u,timezoneLabel:T})]})}if(e===Ne.Weekday){const K=typeof t=="string"?t:void 0,Z=M.find(oe=>oe.value===K);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[_,r.jsx(Tn,{id:y,disabled:i,invalid:l,labelledBy:j,panelLabel:I??C,fieldClassName:u,trigger:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:S.mergeClasses("truncate",!Z&&"text-secondary"),children:Z?.label??C}),r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:$s})]}),panel:oe=>r.jsx("div",{role:"listbox","aria-label":I??C,className:"flex flex-col gap-0.5",children:M.map(J=>r.jsx("button",{type:"button",role:"option","aria-selected":J.value===K,className:S.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",J.value===K&&"bg-control-accent-alpha-hover"),onClick:()=>{n?.(J.value),oe()},children:J.label},J.value))})})]})}return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[_,r.jsx(Tn,{id:y,disabled:i,invalid:l,labelledBy:j,panelLabel:I??C,fieldClassName:u,trigger:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:S.mergeClasses("truncate",!x&&"text-secondary"),children:U()}),Qc]}),panel:K=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:Sn.prev,size:L.ElementSize.Small,onClick:()=>X(-1)}),r.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:td(w,h)}),r.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:Sn.next,size:L.ElementSize.Small,onClick:()=>X(1)})]}),r.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[R.map(Z=>r.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:Z},Z)),V.map(Z=>{const oe=Z.getMonth()!==w.getMonth(),J=In(Z,x),W=In(Z,E),se=Nn(Z,f,p);return r.jsx("button",{type:"button",disabled:se,"aria-label":rd(Z,h),"aria-pressed":J,"aria-current":W?"date":void 0,className:S.mergeClasses(qc,oe&&Jc,W&&!J&&Xc,J&&Yc,se&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(Z,K),children:Z.getDate()},Z.toISOString())})]}),e===Ne.DateTime&&r.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[r.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),r.jsx(wn,{ariaLabel:"Time",value:x?_t(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},ld=({segments:e,labelClassName:t="dial-small-text",leafClassName:n="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const o=r.jsx(O.DialIcon,{icon:r.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),i=e.map((l,c)=>({label:c===e.length-1?r.jsx("span",{className:n,children:l}):l,disabled:!0,...c===0?{iconBefore:o}:{}}));return r.jsx(v.DialBreadcrumb,{className:S.mergeClasses(s,O.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:r.jsx(O.DialIcon,{icon:r.jsx($.IconChevronRight,{size:14,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:i,labelClassName:S.mergeClasses(t,"text-secondary","!cursor-default")})};var rt=(e=>(e.Small="small",e.Heading="heading",e))(rt||{});const cd="w-full overflow-hidden",dd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",En="flex min-w-0 items-center gap-2",On={[rt.Small]:"dial-small-text",[rt.Heading]:"dial-h2-text"},ud={[rt.Small]:"dial-small-semi-text",[rt.Heading]:"dial-h2-text"},fd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},pd="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",hd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",md="cursor-default text-primary",gd="cursor-default text-secondary",An="inline-flex flex-none items-center leading-none text-secondary",xd="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",bd=3,Cd=4,yd=r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),vd=({items:e,maxVisibleItems:t=Cd,size:n=rt.Small,separator:s=yd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const c=Math.max(t,bd),d=g.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=g.useMemo(()=>d.map((m,C)=>({key:String(C),label:m.label,icon:m.icon})),[d]),p=g.useCallback(({key:m,domEvent:C})=>{const x=d[Number(m)];x&&(x.onClick?.(C),!x.onClick&&x.href&&!C.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const h=e.slice(d.length+1),u=(m,{index:C,isFirst:x,isCurrent:b})=>{const y=!b&&(!!m.href||!!m.onClick),N=S.mergeClasses(pd,y?hd:b?S.mergeClasses(md,ud[n]):gd,l,O.DIAL_KIT_CLASS.breadcrumbsItem),D=r.jsxs(r.Fragment,{children:[m.icon,r.jsx(k.EllipsisTooltip,{text:m.label})]});return r.jsxs("li",{className:S.mergeClasses(En,On[n],fd[b?"last":x?"first":"middle"]),children:[y?m.href?r.jsx("a",{href:m.href,onClick:m.onClick,className:N,children:D}):r.jsx("button",{type:"button",onClick:m.onClick,className:N,children:D}):r.jsx("span",{className:N,"aria-current":b?"page":void 0,children:D}),!b&&r.jsx("span",{className:An,"aria-hidden":"true",children:s})]},`segment-${C}`)};return r.jsx("nav",{"aria-label":a,className:S.mergeClasses(cd,i,O.DIAL_KIT_CLASS.breadcrumbs),children:r.jsxs("ol",{className:dd,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&r.jsxs("li",{className:S.mergeClasses(En,On[n],"shrink-0"),children:[r.jsx(k.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:r.jsx("button",{type:"button","aria-label":o,className:xd,children:r.jsx($.IconDots,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),r.jsx("span",{className:An,"aria-hidden":"true",children:s})]}),h.map((m,C)=>u(m,{index:e.length-h.length+C,isFirst:!1,isCurrent:C===h.length-1}))]})})},Sd=({className:e,icon:t,tooltipProps:n,type:s="button",...a})=>{const o=S.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=r.jsx("button",{...a,type:s,className:o,"aria-label":L.resolveAccessibleName(a["aria-label"],n?.tooltip),children:t||r.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return n?r.jsx(L.DialTooltip,{...n,children:i}):i},Id=e=>r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:S.mergeClasses("transition-transform",e&&"rotate-180")}),Nd=({variant:e,appearance:t,items:n,dropdownProps:s,...a})=>{const[o,i]=g.useState(!1),l=g.useMemo(()=>Id(o),[o]);return r.jsx("div",{className:O.DIAL_KIT_CLASS.buttonDropdown,children:r.jsx(k.Dropdown,{...s,items:n,onOpenChange:c=>i(c),children:r.jsx(st,{...a,iconAfter:l,variant:e||L.ButtonVariant.Primary,appearance:t||L.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Vs=({label:e,size:t,isOpen:n=!1,labelClassName:s,className:a,"aria-label":o,...i})=>{const l=t===L.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return r.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":n,"aria-label":o?`${o} ${e}`:void 0,className:S.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,O.DIAL_KIT_CLASS.inlineSelect),children:[r.jsx("span",{className:s,children:e}),r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:S.mergeClasses("transition-transform",n&&"rotate-180")})]})},Dd=({items:e,selectedKey:t,defaultSelectedKey:n,onSelect:s,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:c,listStyle:d,ariaLabel:f,triggerClassName:p,triggerLabelClassName:h,open:u,onOpenChange:m})=>{const[C,x]=g.useState(!1),b=u!==void 0,y=b?u:C,N=g.useCallback(E=>{b||x(E),m?.(E)},[b,m]),[D,I]=g.useState(n??e[0]?.key),j=t!==void 0,_=j?t:D,w=g.useMemo(()=>{const E=e.find(T=>T.key===_);return E?.label?String(E.label):""},[e,_]),A=g.useCallback(({key:E})=>{const T=e.find(R=>R.key===E);T&&(j||I(E),s?.(T))},[e,j,s]);return r.jsx(k.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:c,listStyle:d,disabled:o,open:b?u:void 0,onOpenChange:N,onItemClick:A,children:r.jsx(Vs,{label:w,size:a,isOpen:y,disabled:o,"aria-label":f,className:p,labelClassName:h})})},jd="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Td="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",wd="flex flex-row items-center justify-between px-6 py-4",Ed="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Od="border-b border-tertiary",Ad="flex flex-row items-center gap-2 px-6 py-4",_d="border-t border-tertiary",mr="flex shrink-0 flex-row items-center gap-2",Ld={[v.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[v.PopupSize.Md]:"max-w-full md:max-w-[800px]",[v.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},Kr=({open:e=!1,header:t,ariaLabel:n,portalId:s,className:a,overlayClassName:o,titleClassName:i,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:h,onBack:u,backAriaLabel:m="Back",headerActions:C,headerDivider:x=!1,mainButtons:b,additionalButtons:y,additionalButtonsOnLeft:N=!1,footerDivider:D=!1,size:I=v.PopupSize.Md,hideClose:j=!1,closeAriaLabel:_="Close dialog",closeOnOutsideClick:w=!0,preventKeyboardOnOpen:A=!1})=>{const E=O.useThemeScope(),T=g.useRef(null),R=g.useId(),{refs:M,context:V}=ne.useFloating({open:e,onOpenChange:W=>{W||h?.(null)}}),X=ne.useRole(V,{role:"dialog"}),G=ne.useDismiss(V,{outsidePress:w}),{getFloatingProps:B}=ne.useInteractions([X,G]);if(!e)return null;const U=typeof t=="string"?`popup-heading-${R}`:void 0,K=W=>W?typeof W=="string"?r.jsx("h2",{id:U,className:S.mergeClasses(Ed,i),children:r.jsx(k.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:r.jsx("span",{}),Z=j?null:r.jsx(k.CloseButton,{ariaLabel:_,onClose:W=>h?.(W)}),oe=(W,se=[])=>se.map(({variant:ie=L.ButtonVariant.Neutral,...le},ue)=>r.jsx(st,{variant:ie,...le},`${W}-${ue}`)),J=()=>{if(f!==void 0)return f;if(!b?.length&&!y?.length)return null;const W=oe("additional",y);return r.jsxs("div",{className:S.mergeClasses(Ad,D&&_d,p),children:[N&&W.length>0&&r.jsx("div",{className:mr,children:W}),r.jsxs("div",{className:S.mergeClasses(mr,"ml-auto"),children:[!N&&W,oe("main",b)]})]})};return r.jsx(ne.FloatingPortal,{id:s,children:r.jsx(ne.FloatingOverlay,{className:S.mergeClasses(jd,E,o),children:r.jsx(ne.FloatingFocusManager,{context:V,initialFocus:A?T:M.floating,children:r.jsxs("div",{ref:M.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":U,"aria-label":U?void 0:n,className:S.mergeClasses(Td,Ld[I],a,O.DIAL_KIT_CLASS.popup),children:[A&&r.jsx("div",{ref:T,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),r.jsxs("div",{className:S.mergeClasses(wd,x&&Od,l),children:[u&&r.jsx(k.GhostIconButton,{"aria-label":m,size:L.ElementSize.Small,className:"mr-2",onClick:u,icon:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),K(t),C?r.jsxs("div",{className:mr,children:[C,Z]}):Z]}),r.jsx("div",{className:S.mergeClasses("grow overflow-auto",c),children:d}),J()]})})})})},kd="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Rd="text-secondary dial-small-paragraph-text px-6 pb-4",Pd="px-6 py-4 h-[120px]",Md="Cancel",Fd="Ok",_n={[v.ConfirmationPopupVariant.Info]:{confirm:{variant:L.ButtonVariant.Primary,appearance:L.ButtonAppearance.Solid}},[v.ConfirmationPopupVariant.Danger]:{confirm:{variant:L.ButtonVariant.Danger,appearance:L.ButtonAppearance.Solid}}},Gs=({header:e,description:t,descriptionClassName:n,open:s=!1,confirmLabel:a=Fd,cancelLabel:o=Md,isLoading:i=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:h,children:u,variant:m=v.ConfirmationPopupVariant.Info,size:C=v.PopupSize.Sm,footer:x,hideClose:b,...y})=>{const N=i?null:r.jsxs("div",{className:kd,children:[r.jsx(Fr,{label:o,onClick:()=>h?h():f?.()}),r.jsx(st,{variant:_n[m].confirm.variant,appearance:_n[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),D=g.useCallback(()=>i?r.jsx("div",{className:Pd,children:r.jsx(v.Spinner,{size:40})}):u??(t?r.jsx("div",{className:S.mergeClasses(Rd,n),children:t}):null),[u,t,i,n]);return r.jsx(Kr,{...y,open:s,header:e,className:S.mergeClasses(c,O.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??N,size:C,hideClose:b??(!i&&x===void 0),children:D()})};var Ht=(e=>(e.Start="start",e.End="end",e))(Ht||{});const Bd=({title:e,description:t,children:n,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:c,caretPosition:d=Ht.End,className:f,headerClassName:p,contentClassName:h})=>{const u=s!==void 0,[m,C]=g.useState(a),x=i?!0:u?s:m,b=g.useId(),y=`accordion-header-${b}`,N=`accordion-content-${b}`,D=()=>{if(o)return;const A=!x;u||C(A),c?.(A)},I=d===Ht.Start,j=i?null:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",x?"rotate-90":"rtl:rotate-180")}),_=r.jsxs(r.Fragment,{children:[I&&j,r.jsxs("span",{className:"flex min-w-0 flex-col",children:[r.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?r.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!I&&j]}),w=I?"justify-start gap-2":"justify-between";return r.jsxs("div",{className:S.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,O.DIAL_KIT_CLASS.accordion),children:[i?r.jsx("div",{id:y,className:S.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",w,p),children:_}):r.jsx("button",{id:y,type:"button","aria-expanded":x,"aria-controls":N,"aria-label":L.resolveAccessibleName(l),disabled:o,onClick:D,className:S.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",w,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:_}),r.jsx("div",{inert:!x,className:S.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:r.jsx("div",{className:"min-h-0 overflow-hidden",children:r.jsx("div",{className:"pt-3",children:r.jsx("div",{id:N,role:"region","aria-labelledby":y,className:S.mergeClasses("px-4 dial-small-text text-primary",h),children:n})})})})]})},zd="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",$d="min-w-0 flex-1 truncate text-primary",Hd="min-w-0 flex-1 truncate text-secondary",Kd="shrink-0 text-secondary",Vd="px-6 pb-4",Gd="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Ud="Cancel",Zd="Apply",Wd=({items:e,value:t,customValue:n,header:s,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:h=!0,applyButtonLabel:u=Zd,cancelButtonLabel:m=Ud,size:C=v.PopupSize.Md,portalId:x,disabled:b,invalid:y,error:N,caption:D,ariaLabel:I,className:j,fieldClassName:_})=>{const w=g.useId(),A=o??w,E=`${A}-label`,T=`${A}-value`,R=N?`${A}-error`:void 0,M=!N&&D?`${A}-caption`:void 0,[V,X]=g.useState(!1),G=c!==void 0,[B,U]=g.useState(t),K=G?c:B,Z=g.useCallback(()=>{b||(G||U(t),X(!0))},[b,G,t]),oe=g.useCallback(()=>{X(!1),p?.()},[p]),J=g.useCallback(()=>{f?.(),oe()},[f,oe]),W=g.useCallback(()=>{a(K),oe()},[a,K,oe]),se=g.useCallback(Y=>{G||U(Y),d?.(Y)},[G,d]),ie=L.resolveAccessibleName(i?.label),le=ie?void 0:L.resolveAccessibleName(I),ue=ie?E:le&&`${A}-name`,ge=L.resolveAccessibleName(s),ye=e.find(Y=>Y.value===t)?.label,he=n??ye;return r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-2",j,O.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&r.jsx(k.Label,{...i,id:E,htmlFor:A}),r.jsxs("div",{className:"flex flex-col gap-1",children:[le&&r.jsx("span",{id:ue,className:"sr-only",children:le}),r.jsxs("button",{type:"button",id:A,disabled:b,"aria-haspopup":"dialog","aria-expanded":V,"aria-labelledby":ue?`${ue} ${T}`:void 0,"aria-describedby":[R,M].filter(Boolean).join(" ")||void 0,onClick:Z,className:S.mergeClasses(zd,y&&"dial-kit-input-error",b&&"dial-kit-input-disable",_),children:[r.jsx("span",{id:T,className:he==null?Hd:$d,children:he??l}),r.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Kd})]}),r.jsx(Be,{id:R,text:N}),!N&&r.jsx(qe,{id:M,text:D})]}),r.jsx(Kr,{open:V,header:s,ariaLabel:ge?void 0:ie,portalId:x,size:C,onClose:J,footer:r.jsxs("div",{className:Gd,children:[r.jsx(Fr,{label:m,onClick:J}),r.jsx(Es,{label:u,disabled:!h,onClick:W})]}),children:r.jsx("div",{className:Vd,children:r.jsx(jt,{id:`${A}-options`,items:e,value:K,onChange:se,orientation:v.RadioGroupOrientation.Column,ariaLabel:ie??ge})})})]})},qd=({icon:e,selectedIcon:t,isSelected:n=!1,onToggle:s,onClick:a,tooltipProps:o,size:i=L.ElementSize.Small,className:l,...c})=>{const d=g.useCallback(p=>{a?.(p),s?.(!n)},[a,s,n]),f=r.jsx(k.IconButton,{...c,size:i,variant:L.ButtonVariant.Primary,appearance:L.ButtonAppearance.Ghost,icon:n?t??e:e,"aria-pressed":n,"aria-label":L.resolveAccessibleName(c["aria-label"],o?.tooltip),onClick:d,className:S.mergeClasses("!rounded","[&_svg]:size-4",n&&"!text-accent",l,O.DIAL_KIT_CLASS.toggleIconButton)});return o?r.jsx(k.Tooltip,{asChild:!0,...o,children:f}):f},Yd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Xd="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Jd="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",Qd="bg-layer-raised text-accent shadow-xs",eu="bg-transparent text-secondary",tu="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",ru="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",nu="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",su="cursor-not-allowed bg-transparent text-control-disable-primary",au=({items:e,value:t,onChange:n,disabled:s,className:a,segmentClassName:o,"aria-label":i})=>{const l=g.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=g.useCallback(p=>{if(s||!Yd.includes(p.key))return;const h=e.filter(b=>!b.disabled);if(h.length===0)return;const u=Math.max(h.findIndex(b=>b.value===t),0),m=h.length-1;let C=u;switch(p.key){case"ArrowRight":case"ArrowDown":C=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":C=u===0?m:u-1;break;case"Home":C=0;break;case"End":C=m;break}p.preventDefault();const x=h[C];l.current[x.value]?.focus(),x.value!==t&&n(x.value)},[s,e,t,n]);return r.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,onKeyDown:f,className:S.mergeClasses(Xd,a,O.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const h=p.value===t,u=s||p.disabled;return r.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":h,"aria-label":L.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>n(p.value),className:S.mergeClasses(Jd,h?Qd:eu,u?h?nu:su:h?tu:ru,o,O.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},ou={[v.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[v.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},iu=({tabs:e,activeTabId:t,onTabChange:n,orientation:s=v.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=g.useRef({}),p=g.useId(),h=s===v.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,C=g.useCallback(b=>{const{next:y,previous:N}=ou[s];if(![y,N,"Home","End"].includes(b.key)||e.length===0)return;const D=e.filter(A=>!A.disabled);if(D.length===0)return;const I=Math.max(D.findIndex(A=>A.id===t),0),j=D.length-1;let _=I;b.key===y?_=I===j?0:I+1:b.key===N?_=I===0?j:I-1:b.key==="Home"?_=0:_=j,b.preventDefault();const w=D[_];f.current[w.id]?.focus(),w.id!==t&&n(w.id)},[e,t,n,s]),x=r.jsx("div",{role:"tablist","aria-orientation":h?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:C,className:S.mergeClasses(h?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,O.DIAL_KIT_CLASS.tabList,!a&&O.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const y=t===b.id,N=!!b.disabled;return r.jsxs("button",{ref:D=>{f.current[b.id]=D},type:"button",role:"tab","aria-selected":y,disabled:N,tabIndex:b.id===m?0:-1,onClick:()=>n(b.id),className:S.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",h?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",y?"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&&(h?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(h?y?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":y?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,O.DIAL_KIT_CLASS.tab,y&&O.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&r.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),r.jsx("span",{className:S.mergeClasses(h&&!y&&!N&&"text-primary"),children:b.label}),b.count!=null&&r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",h&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(y?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-3",i,O.DIAL_KIT_CLASS.tabs),children:[r.jsx("div",{className:S.mergeClasses("flex h-16 shrink-0 items-center",h?"px-4":"px-3"),children:r.jsx("span",{id:p,className:S.mergeClasses("dial-h1-text text-primary",d,O.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},lu="flex flex-nowrap items-center gap-1",cu="min-w-max flex-1 justify-center",du=({items:e,value:t,onChange:n,stretch:s=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>r.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:S.mergeClasses(lu,a,O.DIAL_KIT_CLASS.filterChips),children:e.map(c=>r.jsx(Re,{label:c.label,icon:c.icon,appearance:tt.Selectable,selected:c.value===t,onClick:()=>n(c.value),className:S.mergeClasses(s&&cu,o)},c.value))}),Dr=(e,t)=>{const n=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return n.some(o=>{if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},uu=({labelProps:e,label:t,description:n,onChange:s,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:h})=>{const u=g.useId(),m=f??`file-dropzone-${u}`,C=c?`${m}-error`:void 0,[x,b]=g.useState(!1),y=g.useRef(0),N=g.useCallback(E=>{if(E.length===0)return;const T=i?E:E.slice(0,1),R=T.filter(V=>Dr(V,o)),M=T.filter(V=>!Dr(V,o));M.length>0&&a?.(M),R.length>0&&s(R)},[o,i,s,a]),D=g.useCallback(E=>{N(Array.from(E.target.files??[])),E.target.value=""},[N]),I=g.useCallback(()=>{y.current=0,b(!1)},[]),j=g.useCallback(E=>{l||(E.preventDefault(),y.current+=1,b(!0))},[l]),_=g.useCallback(E=>{l||(E.preventDefault(),E.dataTransfer.dropEffect="copy")},[l]),w=g.useCallback(()=>{l||(y.current-=1,y.current<=0&&I())},[l,I]),A=g.useCallback(E=>{E.preventDefault(),!l&&(I(),N(Array.from(E.dataTransfer?.files??[])))},[l,I,N]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[e&&r.jsx(k.Label,{...e,htmlFor:m}),r.jsx("input",{id:m,type:"file",accept:o,multiple:i,disabled:l,onChange:D,"aria-label":L.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":C,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),r.jsxs("label",{htmlFor:m,onDragEnter:j,onDragOver:_,onDragLeave:w,onDrop:A,className:S.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&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",h,O.DIAL_KIT_CLASS.fileDropzone),children:[d??r.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),r.jsxs("span",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:S.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),n&&r.jsx("span",{className:S.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:n})]})]}),r.jsx(Be,{id:C,text:c})]})},Us=({label:e="Shared",tooltip:t,size:n=12,className:s})=>r.jsx(k.Tooltip,{tooltip:t||"Shared",asChild:!0,children:r.jsx("span",{role:"img","aria-label":e,className:S.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,O.DIAL_KIT_CLASS.sharedEntityIndicator),children:r.jsx($.IconArrowUpRight,{size:n,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var we=(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))(we||{});const fu={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"]},pu=new Map(Object.entries(fu).flatMap(([e,t])=>t.map(n=>[n,e]))),hu=e=>pu.get(e)??"other",Ln="var(--text-control-permanent, #FCFCFC)",Lt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},mu="#1B212D",gu={[we.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:Lt},[we.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:mu}},[we.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)"}},[we.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)"}},[we.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)"}},[we.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:Lt},[we.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:Lt},[we.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)"}},[we.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)"}},[we.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)"},[we.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Lt}},xu=({size:e,kind:t})=>{const n=`dial-kit-file-gradient-${g.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:o}=gu[t],i=typeof o=="string";return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.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(#${n})`}),s&&r.jsx("path",{d:s,stroke:Ln,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&r.jsx("path",{d:a,fill:Ln}),!i&&r.jsx("defs",{children:r.jsxs("linearGradient",{id:n,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:o.from}),r.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},bu=({size:e})=>{const t=`dial-kit-folder-gradient-${g.useId().replace(/[^\w-]/g,"")}`;return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.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)"}),r.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})`}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),r.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Cu=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),yu=(e,t)=>e===v.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",vu=(e,t,n)=>e===v.DialItemType.Folder?r.jsx(bu,{size:n}):r.jsx(xu,{size:n,kind:hu(t)}),Vr=({type:e,name:t,fileExtension:n,shared:s=!1,loading:a=!1,size:o=H.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==v.DialItemType.File&&e!==v.DialItemType.Folder)return null;const h=e===v.DialItemType.File?Cu(t,n):"",u=yu(e,h),m=c??(s?`${u}, shared`:u),C=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return r.jsxs("span",{className:S.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,O.DIAL_KIT_CLASS.fileIcon),...C,children:[a?r.jsx(v.Spinner,{size:o,ariaLabel:d}):vu(e,h,o),s&&r.jsx(Us,{tooltip:p,className:S.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},Zs=({name:e,type:t=v.DialItemType.File,fileExtension:n,shared:s=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:h,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:C})=>r.jsxs("div",{className:S.mergeClasses("flex w-full min-w-0 items-center gap-2",d,O.DIAL_KIT_CLASS.fileName),children:[r.jsx(Vr,{name:e,type:t,fileExtension:n,shared:s,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:h,decorative:!a}),r.jsxs("div",{className:S.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[r.jsx(k.EllipsisTooltip,{className:S.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:C}),s&&r.jsx("span",{className:"sr-only",children:u}),l]})]}),Su=({className:e,...t})=>r.jsx(Zs,{...t,type:v.DialItemType.Folder,className:S.mergeClasses(e,O.DIAL_KIT_CLASS.folderName)}),Iu=({open:e,onClose:t,title:n,ariaLabel:s,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:c,className:d,overlayClassName:f,headerClassName:p,style:h,overlayStyle:u,bodyClassName:m,titleClassName:C,portalId:x})=>{const b=O.useThemeScope(),y=`bottom-sheet-title-${g.useId()}`,{refs:N,context:D}=ne.useFloating({open:e,onOpenChange:w=>{w||t()}}),I=ne.useRole(D,{role:"dialog"}),j=ne.useDismiss(D,{outsidePress:l}),{getFloatingProps:_}=ne.useInteractions([I,j]);return e?r.jsx(ne.FloatingPortal,{id:x,children:r.jsx(ne.FloatingOverlay,{lockScroll:!0,style:u,className:S.mergeClasses("z-popup flex items-end bg-backdrop",b,f),children:r.jsx(ne.FloatingFocusManager,{context:D,initialFocus:N.floating,children:r.jsxs("div",{ref:N.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":n?y:void 0,"aria-label":n?void 0:s,style:h,className:S.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none","animate-slideUp motion-reduce:animate-none",d,O.DIAL_KIT_CLASS.bottomSheet),children:[n&&r.jsxs("div",{className:S.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&r.jsx(k.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:r.jsx($.IconArrowLeft,{size:H.DIAL_ICON_SIZE.LG,stroke:re.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),r.jsx("h2",{id:y,className:S.mergeClasses("min-w-0 truncate text-primary",C??"dial-body-semi-text"),children:n}),r.jsx(k.CloseButton,{ariaLabel:i,onClose:t,size:L.ElementSize.Standard,className:"absolute end-4"})]}),r.jsx("div",{className:S.mergeClasses("min-h-0 overflow-y-auto",m),children:c})]})})})}):null};var We=(e=>(e.Outlined="outlined",e.Filled="filled",e))(We||{}),He=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(He||{});const Nu={[He.Blue]:"bg-blue text-blue",[He.Green]:"bg-green-2 text-green-1",[He.Violet]:"bg-violet-2 text-violet-1",[He.Indigo]:"bg-violet-1 text-violet-2",[He.Brown]:"bg-brown text-brown-2",[He.Red]:"bg-red text-red"},Du={[We.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[We.Filled]:"rounded-full"},ju={[We.Outlined]:"dial-tiny-text",[We.Filled]:"dial-caption-lead-semi-text"},Tu=({label:e,variant:t=We.Outlined,color:n=He.Blue,icon:s,textClassName:a,className:o,...i})=>r.jsxs("span",{...i,className:S.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",Du[t],t===We.Filled&&Nu[n],o,O.DIAL_KIT_CLASS.badge),children:[s&&r.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:s}),r.jsx("span",{className:a??ju[t],children:e})]});var ut=(e=>(e.Circle="circle",e.Square="square",e))(ut||{});const kn=[{background:"bg-green-1",foreground:"text-green-2"},{background:"bg-violet-2",foreground:"text-violet-1"},{background:"bg-brown",foreground:"text-brown-2"},{background:"bg-red",foreground:"text-red"},{background:"bg-green-2",foreground:"text-green-3"},{background:"bg-blue",foreground:"text-accent"},{background:"bg-violet-1",foreground:"text-violet-2"}],wu=e=>{let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return kn[t%kn.length]},Rn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Ws=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(Rn(t[0])+Rn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Eu={[ut.Circle]:"rounded-full",[ut.Square]:"rounded-md"},qs=({name:e,initials:t,src:n,alt:s="",size:a=32,shape:o=ut.Circle,className:i,textClassName:l,onImageError:c})=>{const[d,f]=g.useState(),p=!!n&&d!==n,h=s!=="",u=x=>S.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Eu[o],x,i,O.DIAL_KIT_CLASS.avatar);if(p)return r.jsx("img",{src:n,alt:s,width:a,height:a,className:S.mergeClasses(u(),"object-cover"),onError:x=>{f(n),c?.(x)}});const{background:m,foreground:C}=wu(e);return r.jsx("span",{role:h?"img":void 0,"aria-label":h?s:void 0,"aria-hidden":h?void 0:!0,className:u(S.mergeClasses(m,C)),style:{width:a,height:a,fontSize:l?void 0:Math.round(a*.4)},children:r.jsx("span",{className:S.mergeClasses("leading-none",l??"font-semibold"),children:t??Ws(e)})})};var me=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(me||{});const Ou={[me.Model]:"Model",[me.Agent]:"Agent",[me.Toolset]:"Toolset",[me.Skill]:"Skill",[me.Prompt]:"Prompt"},Pn={[me.Model]:"text-blue",[me.Agent]:"text-green-1",[me.Toolset]:"text-brown-2",[me.Skill]:"text-violet-1",[me.Prompt]:"text-violet-2"},Au={[me.Model]:"bg-blue",[me.Agent]:"bg-green-2",[me.Toolset]:"bg-brown",[me.Skill]:"bg-violet-2",[me.Prompt]:"bg-violet-1"},_u=["h1","h2","h3","h4","h5","h6"],Lu=e=>_u[Math.min(6,Math.max(1,Math.round(e)))-1],ku=({item:e,labels:t,showVersion:n=!0,hasFeaturedTag:s=!0,iconSize:a=48,headingLevel:o=3,query:i,footer:l,statusBadge:c,className:d,nameClassName:f="dial-h3-text",typeClassName:p="dial-caption-lead-semi-text",versionClassName:h="dial-tiny-text",iconClassName:u,featuredChipClassName:m})=>{const C=Lu(o),x=s&&!!e.isFeatured,b=c!=null||x,y=n?e.version:void 0;return r.jsxs("div",{className:S.mergeClasses("flex items-start gap-2",d,O.DIAL_KIT_CLASS.entityIdentity),children:[r.jsx(qs,{name:e.name,src:e.iconUrl,size:a,shape:ut.Square,className:S.mergeClasses("rounded-[14px]",u)}),r.jsxs("div",{className:S.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",l!=null&&"self-stretch"),children:[r.jsxs("div",{className:"relative flex items-center justify-between",children:[r.jsx("span",{className:S.mergeClasses("uppercase",p,Pn[e.type]),children:t?.type??Ou[e.type]}),b&&r.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[c,x&&r.jsx("span",{className:S.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",Au[e.type],Pn[e.type],m),children:t?.featured??"Featured"})]})]}),r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(C,{className:S.mergeClasses("min-w-0 shrink text-primary",f),children:i?r.jsx(Ms,{text:e.name,query:i,maxLines:1}):r.jsx(k.EllipsisTooltip,{text:e.name})}),y!=null&&r.jsx(k.EllipsisTooltip,{className:S.mergeClasses("max-w-[30%] shrink-0 text-secondary",h),text:y})]}),l!=null&&r.jsx("div",{className:"mt-auto pt-1",children:l})]})]})},Ru=({open:e,onClose:t,header:n,ariaLabel:s,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:c="Close",closeDisabled:d=!1,hideClose:f=!1,closeOnOutsideClick:p=!0,children:h,className:u,overlayClassName:m,headerClassName:C,style:x,overlayStyle:b,bodyClassName:y,titleClassName:N,portalId:D})=>{const I=O.useThemeScope(),j=`side-drawer-title-${g.useId()}`,_=typeof n=="string",{refs:w,context:A}=ne.useFloating({open:e,onOpenChange:V=>{V||t()}}),E=ne.useRole(A,{role:"dialog"}),T=ne.useDismiss(A,{outsidePress:p}),{getFloatingProps:R}=ne.useInteractions([E,T]),M=n!=null||o!=null||!f;return r.jsx(ne.FloatingPortal,{id:D,children:r.jsx(ne.FloatingOverlay,{lockScroll:e,style:b,className:S.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",I,m),children:r.jsx(ne.FloatingFocusManager,{context:A,disabled:!e,initialFocus:w.floating,children:r.jsxs("div",{ref:w.setFloating,...R(),role:"dialog","aria-modal":"true","aria-labelledby":_?j:void 0,"aria-label":_?void 0:s,inert:!e,style:x,className:S.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none","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",u,O.DIAL_KIT_CLASS.sideDrawer),children:[M&&r.jsxs("div",{className:S.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",C),children:[o&&r.jsx(k.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),_?r.jsx("h2",{id:j,className:S.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:n}):r.jsx("div",{className:"min-w-0 flex-1",children:n}),a,!f&&r.jsx(k.CloseButton,{ariaLabel:c,onClose:t,disabled:d,size:L.ElementSize.Standard})]}),r.jsx("div",{className:S.mergeClasses("min-h-0 flex-1 overflow-y-auto",y),children:h})]})})})})},Pu=4,Mu=24,Mn=e=>parseFloat(e)||0,Fu=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Bu=()=>{},zu=({id:e,value:t,defaultValue:n,size:s=L.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:h,tagListLabel:u="Tags",className:m,fieldClassName:C,tagClassName:x,onChange:b})=>{const y=g.useId(),N=e||y,D=s===L.ElementSize.Small,I=g.useRef(null),j=g.useRef([]),_=g.useRef(null),w=t!==void 0,[A,E]=g.useState(n??[]),T=w?t:A,R=T.length,[M,V]=g.useState(""),[X,G]=g.useState(R),B=!f&&!d,U=g.useCallback(Y=>{w||E(Y),b?.(Y)},[w,b]),K=g.useCallback(Y=>ee=>{j.current[Y]=ee},[]),Z=g.useCallback(()=>{const Y=I.current;if(!Y||Y.clientWidth===0){G(T.length);return}const{paddingLeft:ee,paddingRight:Ae}=getComputedStyle(Y);G(ws({availableWidth:Y.clientWidth-Mn(ee)-Mn(Ae)-(f?0:Mu),tagWidths:T.map(($e,Q)=>j.current[Q]?.offsetWidth??0),overflowChipWidth:_.current?.offsetWidth??0,gap:Pu}))},[f,T]);g.useEffect(()=>{if(!p){G(R);return}const Y=I.current;if(!Y)return;const ee=new ResizeObserver(()=>Z());return ee.observe(Y),Z(),()=>ee.disconnect()},[p,Z,R]);const oe=S.mergeClasses(p?"shrink-0":"min-w-0",x),J=Y=>{const ee=Fu(Y.trim()).trim();!ee||T.includes(ee)||U([...T,ee])},W=Y=>{U(T.filter(ee=>ee!==Y))},se=()=>{J(M),V("")},ie=Y=>{if(B){if(Y.key==="Enter"||Y.key===","){Y.preventDefault(),se();return}Y.key==="Backspace"&&!M&&R>0&&(Y.preventDefault(),U(T.slice(0,-1)))}},le=()=>{B&&M.trim()&&se()},ue=p?T.slice(0,X):T,ge=p?T.slice(X):[],ye=ge.join(", "),he=R>0&&r.jsxs("span",{role:"list","aria-label":u,className:S.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(Y=>r.jsx(Re,{role:"listitem",label:Y,className:oe,disabled:d,closable:B,onRemove:B?()=>W(Y):void 0},Y)),ge.length>0&&r.jsx(Re,{role:"listitem",label:`+${ge.length}`,"aria-label":ye,title:ye,className:S.mergeClasses("shrink-0",x),disabled:d}),p&&r.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[T.map((Y,ee)=>r.jsx("span",{ref:K(ee),className:"inline-flex",children:r.jsx(Re,{label:Y,className:x,disabled:d,closable:B,onRemove:B?Bu:void 0})},Y)),r.jsx("span",{ref:_,className:"inline-flex",children:r.jsx(Re,{label:`+${R}`,className:x})})]})]});return r.jsx(Oe,{id:N,size:s,labelProps:a,caption:i,error:l,invalid:c,disabled:d,readOnly:f,value:M,placeholder:R>0?void 0:o,"aria-label":h,wrapperRef:I,onChange:Y=>V(Y??""),onKeyDown:ie,onBlur:le,containerClassName:S.mergeClasses("w-full",m),wrapperClassName:S.mergeClasses(R>0&&["!h-auto",D?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],C,O.DIAL_KIT_CLASS.tagInput),className:S.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:he})},$u=(e,t,n,s)=>{const a=t.trim().toLowerCase(),o=new Set(n);return e.filter(({value:i,label:l,description:c})=>!o.has(i)&&[l,i,c].some(d=>d?.toLowerCase().includes(a))).slice(0,Math.max(s,0))},Hu=5,Ku=({id:e,value:t,defaultValue:n,suggestions:s,maxSuggestions:a=Hu,size:o=L.ElementSize.Standard,labelProps:i,placeholder:l,caption:c,error:d,invalid:f=!1,disabled:p=!1,readOnly:h=!1,ariaLabel:u,tagListLabel:m="Tags",getRemoveTagLabel:C,className:x,fieldClassName:b,tagClassName:y,listClassName:N,onChange:D})=>{const I=g.useId(),j=e||I,_=`${j}-listbox`,w=O.useThemeScope(),A=o===L.ElementSize.Small,E=t!==void 0,[T,R]=g.useState(n??[]),M=E?t:T,V=M.length>0,X=!h&&!p,[G,B]=g.useState(""),[U,K]=g.useState(!1),[Z,oe]=g.useState(0),J=g.useMemo(()=>$u(s,G,M,a),[G,a,s,M]),W=U&&X&&J.length>0,se=Math.min(Z,J.length-1),ie=Q=>`${_}-option-${Q}`,{refs:le,floatingStyles:ue}=ne.useFloating({open:W,placement:"bottom-start",whileElementsMounted:ne.autoUpdate,middleware:[ne.offset(k.overlayGap),ne.flip({padding:k.overlayGap}),ne.size({padding:k.overlayGap,apply({rects:Q,availableHeight:de,elements:_e}){_e.floating.style.width=`${Math.round(Q.reference.width)}px`,_e.floating.style.maxHeight=`${Math.floor(de)}px`}})]}),ge=g.useCallback(Q=>{E||R(Q),D?.(Q)},[E,D]),ye=()=>{K(!1),oe(0)},he=Q=>{const de=Q.trim();de&&!M.includes(de)&&ge([...M,de]),B(""),ye()},Y=Q=>ge(M.filter(de=>de!==Q)),ee=Q=>{const de=Q??"";B(de),K(!!de.trim()),oe(0)},Ae=Q=>{if(X)switch(Q.key){case"ArrowDown":case"ArrowUp":{if(Q.preventDefault(),K(!0),!W)return;const de=Q.key==="ArrowDown"?1:-1;oe((se+de+J.length)%J.length);return}case"Enter":case",":Q.preventDefault(),he(W?J[se].value:G);return;case"Escape":W&&Q.preventDefault(),ye();return;case"Backspace":!G&&V&&(Q.preventDefault(),ge(M.slice(0,-1)));return}},$e=Q=>Q.preventDefault();return r.jsxs(r.Fragment,{children:[r.jsx(Oe,{id:j,role:"combobox","aria-autocomplete":"list","aria-expanded":W,"aria-controls":_,"aria-activedescendant":W?ie(se):void 0,"aria-invalid":f||void 0,"aria-label":u,size:o,labelProps:i,caption:c,error:d,invalid:f,disabled:p,readOnly:h,value:G,placeholder:V?void 0:l,wrapperRef:le.setReference,onChange:ee,onKeyDown:Ae,onBlur:ye,containerClassName:S.mergeClasses("w-full",x),wrapperClassName:S.mergeClasses(V&&["!h-auto flex-wrap gap-1 py-2",A?"min-h-[24px]":"min-h-[40px]"],b,O.DIAL_KIT_CLASS.autocompleteTagInput),className:S.mergeClasses("w-auto min-w-[100px] flex-1",h&&"cursor-default"),children:V&&r.jsx("span",{role:"list","aria-label":m,className:"flex min-w-0 flex-wrap items-center gap-1",children:M.map(Q=>r.jsx(Re,{role:"listitem",label:Q,className:S.mergeClasses($t,"min-w-0",y),disabled:p,closable:X,removeLabel:C?.(Q),onRemove:X?()=>Y(Q):void 0},Q))})}),r.jsx(ne.FloatingPortal,{children:r.jsx("div",{ref:le.setFloating,id:_,role:"listbox","aria-label":m,hidden:!W,style:ue,className:S.mergeClasses("z-floating overflow-y-auto",k.overlaySurfaceClassName,k.overlayListClassName,!W&&"hidden",w,N),children:W&&J.map((Q,de)=>{const _e=de===se;return r.jsx(k.MenuItem,{id:ie(de),role:"option","aria-selected":_e,tabIndex:-1,label:Q.label,description:Q.description,mark:k.MenuItemMark.Tint,selected:_e,onMouseDown:$e,onMouseEnter:()=>oe(de),onClick:()=>he(Q.value)},Q.value)})})})]})},Vu={[L.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[L.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[L.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},Gu=({size:e=L.ElementSize.Standard,placeholder:t="Search...",withoutBorder:n=!1,clearLabel:s="Clear search",disabled:a,value:o,onChange:i,wrapperClassName:l,inputRef:c,...d})=>{const f=g.useRef(null),p=ne.useMergeRefs([c,f]),h=!!o&&!a,u=g.useCallback(()=>{i?.(void 0),f.current?.focus()},[i]);return r.jsx(Oe,{...d,size:e,value:o,disabled:a,onChange:i,placeholder:t,inputRef:p,wrapperClassName:S.mergeClasses(n&&"dial-kit-input-borderless",l,O.DIAL_KIT_CLASS.search),iconBefore:r.jsx($.IconSearch,{size:Vu[e],stroke:re.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:h?r.jsx(k.GhostIconButton,{size:L.ElementSize.Small,"aria-label":s,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},Uu=(e,t)=>{if(e<=0||t<=0)return[];const n=Math.floor(e/t+1e-9);return Array.from({length:n+1},(s,a)=>a*t/e*100)},Zu=12,Wu=e=>(e.toString().split(".")[1]??"").length,Fn=e=>`calc(${e}% + ${(.5-e/100)*Zu}px)`,qu=(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)]",Yu=({id:e,value:t,min:n=0,max:s=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:c,showValue:d=!1,showTooltip:f=!1,showTicks:p=!1,leftContent:h,rightContent:u,caption:m,error:C,onChange:x,containerClassName:b,trackClassName:y,fillClassName:N,className:D,...I})=>{const j=g.useId(),_=e??j,w=m&&!C?`${_}-caption`:void 0,A=C?`${_}-error`:void 0,E=s-n,T=E>0?Math.min(100,Math.max(0,(t-n)/E*100)):0,R=Fn(T),M=p&&!o?Uu(E,a):[],V=f&&!o,X=h!=null,G=u!=null,B=c?c(t):t.toFixed(Wu(a)),U=g.useCallback(K=>{x?.(Number(K.target.value))},[x]);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",b),children:[(i||d)&&r.jsxs("div",{className:"flex items-center gap-2",children:[i&&r.jsx(k.Label,{...i,htmlFor:_}),d&&r.jsx("span",{"aria-hidden":"true",className:S.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:B})]}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs("div",{className:S.mergeClasses("grid items-center gap-x-3 gap-y-1",qu(X,G),V&&"mt-7"),children:[X&&r.jsx("div",{className:"flex items-center",children:h}),r.jsxs("div",{className:"relative flex h-6 items-center",children:[r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",y)}),M.map(K=>r.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full bg-control-neutral-default",style:{left:Fn(K)}},K)),r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",N),style:{width:R}}),V&&r.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:R},children:[r.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:B}),r.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:r.jsx("path",{d:"M0 0h8L4 4z"})})]}),r.jsx("input",{...I,type:"range",id:_,value:t,min:n,max:s,step:a,disabled:o,onChange:U,"aria-label":L.resolveAccessibleName(typeof i?.label!="string"?I["aria-label"]:void 0),"aria-valuetext":c?B:void 0,"aria-describedby":A??w,className:S.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",D)})]}),G&&r.jsx("div",{className:"flex items-center",children:u}),l&&r.jsx("div",{className:S.mergeClasses("dial-tiny-text flex text-secondary",X&&"col-start-2"),children:l.length===3?r.jsxs(r.Fragment,{children:[r.jsx("span",{children:l[0]}),r.jsx("span",{className:"flex-1 text-center",children:l[1]}),r.jsx("span",{children:l[2]})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:l[0]}),r.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),r.jsx(Be,{id:A,text:C}),!C&&r.jsx(qe,{id:w,text:m})]})]})},Xu=48,Ju=({children:e,title:t,width:n=280,collapsedWidth:s=Xu,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:h,contentClassName:u,footerClassName:m})=>{const C=a!==void 0,[x,b]=g.useState(o),y=C?a:x,N=`collapsible-sidebar-content-${g.useId()}`,D=y?d:f,I=j=>{const _=!y;C||b(_),i?.(_,j)};return r.jsxs("aside",{"aria-label":c,style:{width:`${y?n:s}px`},className:S.mergeClasses("flex flex-col justify-between",p,O.DIAL_KIT_CLASS.collapsibleSidebar),children:[r.jsx("div",{id:N,hidden:!y,className:S.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),r.jsx("div",{hidden:y,className:S.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",h),children:t}),r.jsxs("div",{className:S.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",y?"justify-end px-2":"justify-center",m),children:[y&&l,r.jsx(k.IconButton,{variant:L.ButtonVariant.Primary,appearance:L.ButtonAppearance.Ghost,size:L.ElementSize.Standard,onClick:I,"aria-label":D,"aria-expanded":y,"aria-controls":N,tooltipProps:{tooltip:D},icon:y?r.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):r.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Qu=({side:e,isResizing:t,width:n,minWidth:s,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===v.ResizableContainerSide.Left,p=f?$.IconChevronLeft:$.IconChevronRight,h=u=>{let m;switch(u.key){case"ArrowLeft":m=n+(f?o:-o);break;case"ArrowRight":m=n+(f?-o:o);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.preventDefault(),l(m)};return r.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":n,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:h,className:S.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",d),children:c??r.jsx(p,{size:H.DIAL_ICON_SIZE.MD,stroke:re.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},ef=16,Ys=({children:e,minWidth:t,maxWidth:n,width:s,defaultWidth:a,onResizeStop:o,onResize:i,side:l=v.ResizableContainerSide.Right,keyboardStep:c=ef,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:h})=>{const[u,m]=g.useState(!1),[C,x]=g.useState(a??t),b=s!==void 0,y=b?s:C,N=g.useRef(null),D=g.useCallback(()=>{m(!0)},[]),I=g.useCallback(()=>{m(!1);const w=N.current?.resizable?.getBoundingClientRect(),A=w?Math.round(w.width):t;b||x(A),o?.(A)},[o,b,t]),j=g.useCallback(w=>{const A=Math.min(n,Math.max(t,w));A!==y&&(b||(x(A),N.current?.updateSize({width:A,height:"100%"})),i?.(A),o?.(A))},[n,t,y,b,i,o]),_=g.useMemo(()=>{const w=l===v.ResizableContainerSide.Left,A=r.jsx(Qu,{side:l,isResizing:u,width:y,minWidth:t,maxWidth:n,step:c,ariaLabel:d,onWidthChange:j,customHandler:h,handlerClassName:p});return{size:b?{width:y,height:"100%"}:void 0,defaultSize:b?void 0:{width:y,height:"100%"},minWidth:t,maxWidth:n,enable:{left:w,right:!w},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:w?A:void 0,right:w?void 0:A},onResizeStart:D,onResize:(E,T,R)=>{i?.(Math.round(R.offsetWidth))},onResizeStop:I}},[l,b,y,t,n,c,d,j,h,p,u,D,I,i]);return r.jsx(v.Resizable,{ref:N,..._,children:r.jsx("div",{className:S.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,O.DIAL_KIT_CLASS.resizableContainer),children:e})})},tf=({enabled:e=!0,children:t,...n})=>e?r.jsx(Ys,{...n,children:t}):t;var Le=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(Le||{});const Xs=8e3,Tt="flex size-7 shrink-0 items-center justify-center",Js={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"},rf=({title:e,failedCount:t,isCollapsed:n,itemsId:s,labels:a,onToggleCollapse:o,onClose:i})=>{const l=n?$.IconChevronUp:$.IconChevronDown;return r.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&r.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[r.jsx(k.GhostIconButton,{"aria-label":n?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!n,"aria-controls":s,size:L.ElementSize.Small,icon:r.jsx(l,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Tt}),r.jsx(k.GhostIconButton,{"aria-label":a.closeAriaLabel,size:L.ElementSize.Small,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:Tt})]})]})},Bn=({message:e,isError:t})=>{const n=t?$.IconAlertCircleFilled:$.IconAlertTriangleFilled;return r.jsx(k.Tooltip,{tooltip:e,asChild:!0,children:r.jsx("span",{className:Tt,role:"img","aria-label":e,tabIndex:0,children:r.jsx(n,{size:H.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},nf=({item:e,labels:t,onCancel:n})=>{const s=e.status===Le.Canceled;return r.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[r.jsx(Vr,{type:v.DialItemType.File,name:e.name,size:H.DIAL_ICON_SIZE.MD,className:S.mergeClasses(s&&"opacity-50"),decorative:!0}),r.jsx(k.EllipsisTooltip,{text:e.name,className:S.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===Le.InProgress&&r.jsxs("div",{className:S.mergeClasses(Tt,"grid"),children:[r.jsx(v.Spinner,{size:H.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:S.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",n&&"group-focus-within:opacity-0 group-hover:opacity-0")}),n&&r.jsx(k.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:L.ElementSize.Small,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>n(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===Le.Success&&r.jsx("span",{className:Tt,role:"img","aria-label":t.successLabel,children:r.jsx($.IconCheck,{size:H.DIAL_ICON_SIZE.SM,stroke:re.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===Le.Warning&&r.jsx(Bn,{message:e.message||t.warningMessage,isError:!1}),e.status===Le.Failed&&r.jsx(Bn,{message:e.message||t.failedMessage,isError:!0}),s&&r.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},sf=e=>Math.round(e.reduce((t,n)=>t+(n.percent??(n.status===Le.InProgress?0:100)),0)/e.length),af=(e,t,n)=>e&&t?n.closeConfirmDescriptionMixed:t?n.closeConfirmDescriptionFailed:n.closeConfirmDescriptionInProgress,of=({title:e,items:t,onClose:n,onCancelItem:s,labels:a,autoCloseDelay:o=Xs,className:i,bodyClassName:l})=>{const[c,d]=g.useState(!1),[f,p]=g.useState(!1),h=g.useId(),u={...Js,...a},m=t.filter(j=>j.status===Le.InProgress).length,C=m>0,x=t.filter(j=>j.status===Le.Failed).length,b=x>0,y=t.length>0&&t.every(j=>j.status===Le.Success),N=g.useCallback(()=>{C||b?p(!0):n()},[C,b,n]),D=g.useCallback(()=>{p(!1),n()},[n]),I=g.useCallback(()=>{d(j=>!j)},[]);return g.useEffect(()=>{if(!y||o<=0)return;const j=setTimeout(n,o);return()=>clearTimeout(j)},[y,o,n]),t.length===0?null:r.jsxs("div",{role:"status","aria-live":"polite",className:S.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,O.DIAL_KIT_CLASS.transferQueue),children:[r.jsx(rf,{title:e,failedCount:x,isCollapsed:c,itemsId:h,labels:u,onToggleCollapse:I,onClose:N}),c&&C&&r.jsx(Kn,{value:sf(t),size:L.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&r.jsx("div",{id:h,className:S.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(j=>r.jsx(nf,{item:j,labels:u,onCancel:s},j.id))}),r.jsx(Gs,{open:f,header:u.closeConfirmHeader,description:af(C,b,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:v.ConfirmationPopupVariant.Danger,onConfirm:D,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=v.ConfirmationPopupVariant;exports.DialBreadcrumb=v.DialBreadcrumb;exports.DialBreadcrumbItem=v.DialBreadcrumbItem;exports.DialButton=v.DialButton;exports.DialButtonDropdown=v.DialButtonDropdown;exports.DialCaptionText=v.DialCaptionText;exports.DialCollapsibleSidebar=v.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=v.DialConditionalResizableContainer;exports.DialConfirmationPopup=v.DialConfirmationPopup;exports.DialDangerButton=v.DialDangerButton;exports.DialDestinationFolderPopup=v.DialDestinationFolderPopup;exports.DialErrorText=v.DialErrorText;exports.DialFileIcon=v.DialFileIcon;exports.DialFileManager=v.DialFileManager;exports.DialFileManagerActions=v.DialFileManagerActions;exports.DialFileManagerTabs=v.DialFileManagerTabs;exports.DialFileName=v.DialFileName;exports.DialFileNodeType=v.DialFileNodeType;exports.DialFilePermission=v.DialFilePermission;exports.DialFileResourceType=v.DialFileResourceType;exports.DialFolderName=v.DialFolderName;exports.DialFoldersTree=v.DialFoldersTree;exports.DialFormItem=v.DialFormItem;exports.DialGhostButton=v.DialGhostButton;exports.DialInput=v.DialInput;exports.DialItemType=v.DialItemType;exports.DialLinkButton=v.DialLinkButton;exports.DialLoader=v.DialLoader;exports.DialNeutralButton=v.DialNeutralButton;exports.DialNotification=v.DialNotification;exports.DialPopup=v.DialPopup;exports.DialPrimaryButton=v.DialPrimaryButton;exports.DialRadioGroup=v.DialRadioGroup;exports.DialResizableContainer=v.DialResizableContainer;exports.DialSearch=v.DialSearch;exports.DialSharedEntityIndicator=v.DialSharedEntityIndicator;exports.DialTabs=v.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=v.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=v.FileManagerColumnKey;exports.FileManagerProvider=v.FileManagerProvider;exports.FlexibleActionsDirection=v.FlexibleActionsDirection;exports.FormItemOrientation=v.FormItemOrientation;exports.NAME_COLUMN=v.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=v.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=v.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=v.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=v.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=v.NotificationType;exports.NotificationVariant=v.NotificationVariant;exports.PopupSize=v.PopupSize;exports.RadioGroupOrientation=v.RadioGroupOrientation;exports.ResizableContainerSide=v.ResizableContainerSide;exports.SIZE_COLUMN=v.SIZE_COLUMN;exports.ScreenResolution=v.ScreenResolution;exports.Skeleton=v.Skeleton;exports.SkeletonAvatarShape=v.SkeletonAvatarShape;exports.SkeletonAvatarSize=v.SkeletonAvatarSize;exports.SkeletonVariant=v.SkeletonVariant;exports.Spinner=v.Spinner;exports.TabOrientation=v.TabOrientation;exports.TabView=v.TabView;exports.UPDATED_AT_COLUMN=v.UPDATED_AT_COLUMN;exports.editableContainerProps=v.editableContainerProps;exports.useDialFileManagerTabs=v.useDialFileManagerTabs;exports.useEditableItem=v.useEditableItem;exports.useFileManagerContext=v.useFileManagerContext;exports.DialLabel=Ue.DialLabel;exports.DialSwitch=Ue.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=O.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=O.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=O.DIAL_KIT_CLASS;exports.DialCloseButton=O.DialCloseButton;exports.DialDangerIconButton=O.DialDangerIconButton;exports.DialDateCellRenderer=O.DialDateCellRenderer;exports.DialDropdown=O.DialDropdown;exports.DialEllipsisTooltip=O.DialEllipsisTooltip;exports.DialGhostIconButton=O.DialGhostIconButton;exports.DialGrid=O.DialGrid;exports.DialIcon=O.DialIcon;exports.DialNeutralIconButton=O.DialNeutralIconButton;exports.DialNoDataContent=O.DialNoDataContent;exports.DialPrimaryIconButton=O.DialPrimaryIconButton;exports.DialRadioButton=O.DialRadioButton;exports.DialSecondaryIconButton=O.DialSecondaryIconButton;exports.DialSuccessIconButton=O.DialSuccessIconButton;exports.DialTertiaryIconButton=O.DialTertiaryIconButton;exports.DropdownItemType=O.DropdownItemType;exports.DropdownTrigger=O.DropdownTrigger;exports.DropdownType=O.DropdownType;exports.GridSelectionMode=O.GridSelectionMode;exports.ThemeScope=O.ThemeScope;exports.baseColumnComparator=O.baseColumnComparator;exports.checkColDefsChanges=O.checkColDefsChanges;exports.convertGridDateToDate=O.convertToDate;exports.convertToDate=O.convertToDate;exports.useThemeScope=O.useThemeScope;exports.BASE_ICON_PROPS=H.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=H.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=H.DIAL_ICON_SIZE;exports.mergeClasses=S.mergeClasses;exports.Checkbox=k.Checkbox;exports.CheckboxBox=k.CheckboxBox;exports.CloseButton=k.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=k.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=k.DEFAULT_LOCALE;exports.DangerIconButton=k.DangerIconButton;exports.DateCellRenderer=k.DateCellRenderer;exports.Dropdown=k.Dropdown;exports.EllipsisTooltip=k.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=k.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=k.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=k.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=k.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=k.GRID_THEME_PARAMS;exports.GhostIconButton=k.GhostIconButton;exports.Grid=k.Grid;exports.IconButton=k.IconButton;exports.InfoButton=k.InfoButton;exports.InteractiveTooltip=k.InteractiveTooltip;exports.Label=k.Label;exports.MenuItem=k.MenuItem;exports.MenuItemMark=k.MenuItemMark;exports.NeutralIconButton=k.NeutralIconButton;exports.NoDataContent=k.NoDataContent;exports.PrimaryIconButton=k.PrimaryIconButton;exports.Radio=k.Radio;exports.StaticIconButton=k.StaticIconButton;exports.Tooltip=k.Tooltip;exports.TooltipContainer=k.TooltipContainer;exports.TooltipContent=k.TooltipContent;exports.TooltipPlacement=k.TooltipPlacement;exports.TooltipTrigger=k.TooltipTrigger;exports.ButtonAppearance=L.ButtonAppearance;exports.ButtonVariant=L.ButtonVariant;exports.DialIconButton=L.DialIconButton;exports.DialTooltip=L.DialTooltip;exports.DialTooltipContainer=L.DialTooltipContainer;exports.DialTooltipContent=L.DialTooltipContent;exports.DialTooltipTrigger=L.DialTooltipTrigger;exports.ElementSize=L.ElementSize;exports.EditorThemes=wt.EditorThemes;exports.LazyDialJsonEditor=wt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=wt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=wt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=re.DIAL_KIT_ICON_STROKE;exports.Accordion=Bd;exports.AccordionCaretPosition=Ht;exports.AnalyticsCardVariant=St;exports.AutocompleteTagInput=Ku;exports.Avatar=qs;exports.AvatarShape=ut;exports.Badge=Tu;exports.BadgeColor=He;exports.BadgeVariant=We;exports.BottomSheet=Iu;exports.Breadcrumbs=vd;exports.BreadcrumbsSize=rt;exports.Button=st;exports.ButtonDropdown=Nd;exports.Calendar=id;exports.CalendarMode=Ne;exports.CaptionText=qe;exports.CardShell=Lc;exports.CollapsibleSidebar=Ju;exports.ConditionalResizableContainer=tf;exports.ConfirmationPopup=Gs;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=Tr;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Js;exports.DangerButton=ic;exports.DialAccordion=zn;exports.DialAnalyticsBar=kt;exports.DialAnalyticsBarGroup=ua;exports.DialAnalyticsCard=la;exports.DialAnalyticsErrorTag=jr;exports.DialAnalyticsHistogram=ga;exports.DialAutocompleteInputValue=rs;exports.DialCheckbox=gr;exports.DialDraggableItem=Oi;exports.DialDropdownIcon=yl;exports.DialFormPopup=Ki;exports.DialInputPopup=ns;exports.DialLabelledText=Ta;exports.DialLoadFileArea=fs;exports.DialLoadFileAreaField=Cl;exports.DialNumberInput=vr;exports.DialPagination=va;exports.DialPasswordInput=ss;exports.DialRadioGroupPopupField=Bi;exports.DialRemoveButton=Wt;exports.DialSchemaRenderer=kl;exports.DialSegmentedControl=Mi;exports.DialSelect=Pe;exports.DialSelectField=tl;exports.DialSlider=ja;exports.DialSteps=Da;exports.DialTag=Xe;exports.DialTagInput=ts;exports.DialTextarea=Ai;exports.EntityIdentity=ku;exports.EntityType=me;exports.ErrorMessageNotification=zc;exports.ErrorText=Be;exports.ErrorToastNotification=kc;exports.FabButton=Sd;exports.FileDropzone=uu;exports.FileIcon=Vr;exports.FileName=Zs;exports.FilterChips=du;exports.FolderName=Su;exports.FolderPath=ld;exports.GeneralMessageNotification=Gc;exports.GeneralToastNotification=Bc;exports.GhostButton=Br;exports.Highlight=Ms;exports.InfoMessageNotification=$c;exports.InfoToastNotification=Rc;exports.InlineSelect=Dd;exports.InlineSelectTrigger=Vs;exports.Input=Oe;exports.JsonSchemaType=F;exports.LinkButton=dc;exports.LoadingMessageNotification=Vc;exports.LoadingToastNotification=Fc;exports.MultiSelectTags=vt;exports.NeutralButton=Fr;exports.Notification=Hr;exports.NumberInput=As;exports.OutlinedButton=uc;exports.PasswordInput=_s;exports.Popup=Kr;exports.PrimaryButton=Es;exports.ProgressBar=Kn;exports.RadioGroup=jt;exports.RadioGroupPopupField=Wd;exports.ResizableContainer=Ys;exports.SchemaDisplayMode=Qe;exports.SchemaOrientation=pt;exports.SchemaRenderer=Tc;exports.SchemaRendererVariant=ke;exports.Search=Gu;exports.SegmentedControl=au;exports.Select=Ve;exports.SelectSize=Ft;exports.SelectVariant=Bt;exports.SharedEntityIndicator=Us;exports.SideDrawer=Ru;exports.Slider=Yu;exports.StarterButton=cc;exports.StepStatus=je;exports.SuccessMessageNotification=Hc;exports.SuccessToastNotification=Pc;exports.Switch=Ls;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Xs;exports.Tabs=iu;exports.Tag=Re;exports.TagAppearance=tt;exports.TagInput=zu;exports.Textarea=Os;exports.TextareaResize=zr;exports.ToggleIconButton=qd;exports.TransferQueue=of;exports.TransferQueueItemStatus=Le;exports.WarningMessageNotification=Kc;exports.WarningToastNotification=Mc;exports.extractInitials=Ws;exports.getTimezoneLabel=ps;exports.matchesAccept=Dr;exports.wrapInRootFolder=jl;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./use-file-manager-tabs-Bzzwwcgk.cjs"),Ue=require("./Switch-DE6MrcqJ.cjs"),r=require("react/jsx-runtime"),g=require("react"),$=require("@tabler/icons-react"),de=require("classnames"),O=require("./DateCellRenderer-CZNa4jVJ.cjs"),H=require("./icon-CrGVkVpG.cjs"),S=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-CmgeZvYm.cjs"),_=require("./IconButton-DHOFapLo.cjs"),oa=require("react-dom"),wt=require("./lazy-DMVYJhUR.cjs"),ae=require("@floating-ui/react"),se=require("./icon-DhjrDQ8I.cjs");function ia(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ur=ia(g),Je=({label:e,className:t,icon:n,selected:s,closable:a,onClick:o,onRemove:i})=>{const l=S.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return r.jsxs("div",{className:l,onClick:o,children:[r.jsx(O.DialIcon,{icon:n}),r.jsx(O.DialEllipsisTooltip,{text:e}),a&&i&&r.jsx(v.DialButton,{className:"p-0",iconAfter:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>i(c)})]},e)},jr=({label:e="Error",className:t})=>r.jsx(Je,{label:e,className:S.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var St=(e=>(e.Default="default",e.Compact="compact",e))(St||{});const la={[St.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[St.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},ca=({title:e,value:t,description:n,variant:s=St.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=la[s],h=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return r.jsxs("div",{className:S.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),children:[l!==void 0?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:p.title,children:e}),r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",h?"bg-success text-success":"bg-error text-error"),children:u})]}):r.jsx("span",{className:p.title,children:e}),a?r.jsx(jr,{className:"self-start"}):o?r.jsx(v.DialLoader,{fullWidth:!1,className:"self-start"}):f?r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r.jsx(O.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),r.jsx("span",{className:p.value,children:f[0].value})]}),r.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r.jsx(O.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),r.jsx("span",{className:p.value,children:f[1].value})]})]}):r.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&n!=null&&n!==!1&&r.jsx("span",{className:"dial-tiny-text text-secondary",children:n})]})},Tr=[{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"}],da=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),ua=(e,t)=>{if(e<=0)return;let n;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(n=s.color);return n},kt=({value:e,maxValue:t=1,error:n,isLoading:s,title:a,valueLabel:o,colorMap:i=Tr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const h=e==null,u=!!(n||s||!h),m=da(h?0:e,t),C=ua(m,i),x=o??(h?"—":e),b=p??(typeof a=="string"?a:void 0),y=n||s,N=n?r.jsx(jr,{}):s?r.jsx(v.DialLoader,{fullWidth:!1}):r.jsx("span",{className:S.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),D=u?r.jsx("div",{role:"progressbar","aria-valuenow":n||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":b,className:S.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",n?"bg-error":"bg-layer-1"),children:!y&&r.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:C}})}):null,I=r.jsx("span",{className:S.mergeClasses("dial-small-text text-primary",c),children:a});return f?r.jsxs("div",{className:S.mergeClasses("flex flex-row items-center gap-2",l),children:[r.jsx("div",{className:"w-1/2 min-w-0",children:I}),r.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[r.jsx("div",{className:"min-w-0 flex-1",children:D}),N]})]}):r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-1",l),children:[r.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[I,N]}),D]})},$n=({title:e,description:t,children:n,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[h,u]=g.useState(a),m=i?!0:p?s:h,C=g.useId(),x=()=>{if(o)return;const b=!m;p||u(b),l?.(b)};return r.jsxs("div",{className:S.mergeClasses("rounded border border-secondary",c),children:[r.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":C,disabled:o||i,onClick:x,className:S.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",d),children:[!i&&r.jsx(O.DialIcon,{className:de("text-secondary transition-transform",m&&"rotate-90"),icon:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),r.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&r.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&r.jsx("div",{id:C,role:"region",className:S.mergeClasses("px-4 pb-4",f),children:n})]})},fa=({title:e,titleTooltip:t,description:n,data:s,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:h,barTitleClassName:u,barValueClassName:m,barClassName:C,barDescriptions:x,className:b})=>{const y=Object.entries(s),N=h?S.mergeClasses("text-secondary",u):u,D=o?"dial-tiny-text text-secondary":void 0,I=t?r.jsx(_.DialTooltip,{tooltip:t,children:e}):e,j=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],L="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",w="group flex flex-col gap-1.5",A=S.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",C);return r.jsx($n,{title:I,description:n,defaultExpanded:c,nonCollapsible:d,className:b,children:r.jsx("div",{className:S.mergeClasses("flex flex-col",a?"gap-4":h?"gap-2":"gap-3"),children:f?r.jsx(v.DialLoader,{fullWidth:!1,className:"self-center"}):a?j.map(E=>{const T=E in s?s[E]:null,R=E in a?a[E]:null,K=typeof T=="number"&&typeof R=="number"?parseFloat((R-T).toFixed(3)):null,Q=K!=null&&K!==0,G=Q&&K>0,F=Q?G?`+${K}`:String(K):null,V=x?.[E],Z=r.jsx("span",{className:"dial-small-text text-secondary",children:E}),U=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[V?r.jsx(_.DialTooltip,{tooltip:V,children:Z}):Z,F!=null&&r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:F})]}),r.jsxs("div",{className:A,children:[r.jsx(kt,{title:o?.[0],value:T,maxValue:i,colorMap:l,inline:h,titleClassName:D,ariaLabel:E}),r.jsx(kt,{title:o?.[1],value:R,maxValue:i,colorMap:l,inline:h,titleClassName:D,ariaLabel:`${E} compare`})]})]});return p?r.jsx("button",{type:"button",onClick:()=>p(E,T),className:S.mergeClasses(w,L),children:U},E):r.jsx("div",{className:w,children:U},E)}):y.map(([E,T])=>{const R=r.jsx(kt,{title:E,value:T,maxValue:i,colorMap:l,inline:h,titleClassName:N,valueClassName:m,className:C}),B=p?r.jsx("button",{type:"button",onClick:()=>p(E,T),className:L,children:R}):R,K=x?.[E];return K?r.jsx(_.DialTooltip,{tooltip:K,triggerClassName:"flex flex-col",children:B},E):r.jsx(g.Fragment,{children:B},E)})})})},pa="#FF4E50",ha=(e,t)=>{let n=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(n=a)}),n},Zr=(e,t)=>{const n=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=ha(c,t);d>=0&&(n[d]+=1)});const a=Math.max(0,s,...n),o=c=>a>0?c/a:0,i={from:0,to:0,color:pa,count:s,ratio:o(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:n[d],ratio:o(n[d]),isZeroBucket:!1}));return[i,...l]},Hn=e=>e<=0?2:e%2===0?e:e+1,ma=e=>{const t=Hn(e);return[t,t/2,0]},rr=e=>`${Math.round(e*100)/100}`,Kn=(e,t)=>e===t?rr(e):`${rr(e)}-${rr(t)}`,nr=128,ga=(e,t)=>{const n=Kn(e,t);return e===t?`scored ${n}`:`scored between ${n}`},Wr=(e,t,n,s,a)=>r.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&r.jsx("strong",{children:e}),r.jsxs("span",{children:[t," out of ",n," ",s]}),r.jsx("span",{children:ga(a.from,a.to)})]}),xa=({title:e,values:t,colorMap:n=Tr,valueTitle:s="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=Zr(t,n),p=l?Zr(l,n):void 0,h=t.length,u=l?.length??0,m=Math.max(h,u),C=Hn(m),x=ma(m),b=I=>I.map(j=>({...j,ratio:C>0?j.count/C:0})),y=b(f),N=p?b(p):void 0,D=(I,j,L,w)=>{if(I.count===0)return r.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:r.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${I.ratio*100}%`}})});const A=w?{backgroundImage:`repeating-linear-gradient(135deg, ${I.color} 0px, ${I.color} 1px, transparent 1px, transparent 4px)`,borderColor:I.color}:{backgroundColor:I.color};return r.jsx(_.DialTooltip,{placement:"bottom",tooltip:j,triggerClassName:"flex h-full flex-1 items-end",children:r.jsx("div",{role:"img","aria-label":L,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${I.ratio*100}%`,...A},children:a&&r.jsx("span",{className:"dial-tiny-semi-text text-primary",children:I.count})})})};return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",i),children:[r.jsx("span",{className:"dial-small-text text-primary",children:e}),o?r.jsx("div",{className:"flex items-center justify-center",style:{height:nr},children:r.jsx(v.DialLoader,{fullWidth:!1})}):r.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[r.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:nr},children:x.map((I,j)=>r.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${j/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:I},I))}),r.jsxs("div",{className:"relative min-w-0",children:[x.map((I,j)=>r.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${j/(x.length-1)*100}%`}},I)),r.jsx("div",{className:"relative flex items-end gap-1",style:{height:nr},children:N?y.map((I,j)=>{const L=N[j],w=`${I.count} out of ${h} ${s}`,A=`${L.count} out of ${u} ${s}`;return r.jsxs("div",{className:"flex h-full flex-1 items-end",children:[D(I,Wr(c,I.count,h,s,I),w,!0),D(L,Wr(d,L.count,u,s,L),A,!1)]},j)}):y.map((I,j)=>{const L=`${I.count} out of ${h} ${s}`;return I.count===0?r.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:r.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${I.ratio*100}%`}})},j):r.jsx(_.DialTooltip,{placement:"bottom",tooltip:L,triggerClassName:"flex h-full flex-1 items-end",children:r.jsx("div",{role:"img","aria-label":L,className:S.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${I.ratio*100}%`,backgroundColor:I.color},children:a&&I.count>0&&r.jsx("span",{className:"dial-tiny-semi-text text-primary",children:I.count})})},j)})})]}),r.jsx("div",{}),r.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:y.map((I,j)=>r.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Kn(I.from,I.to)},j))})]})]})},Vn=({value:e,max:t=100,size:n=_.ElementSize.Standard,labelProps:s,valueLabel:a,id:o,className:i,"aria-label":l,...c})=>{const d=g.useId(),f=o??d,p=!!s?.label,h=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,C=Math.min(Math.max(m,0),u),x=u>0?C/u*100:0,b=r.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":h,"aria-label":_.resolveAccessibleName(l,p?void 0:"Progress"),className:S.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",n===_.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&O.DIAL_KIT_CLASS.progressBar),children:r.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?b:r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-1",O.DIAL_KIT_CLASS.progressBar),children:[r.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&r.jsx(k.Label,{...s,id:h}),a&&r.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},ba=7,Ca=2,ya=e=>e<=0?[]:Array.from({length:e},(t,n)=>n+1);var Rt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(Rt||{});const va=(e,t,n)=>e===t?"active":n<ba||Math.abs(e-t)<=Ca?"adjacent":"far",Sa=({page:e,totalPages:t,onPageChange:n,className:s})=>{const a=ya(t);return r.jsxs("nav",{"aria-label":"Pagination",className:S.mergeClasses("flex items-center gap-2",s),children:[r.jsx(_.DialIconButton,{icon:r.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:_.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>n(e-1),"aria-label":"Previous page"}),r.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(o=>{const i=va(o,e,t);return r.jsx("button",{type:"button",onClick:()=>n(o),"aria-label":`Page ${o}`,"aria-current":o===e?"page":void 0,className:S.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",i===Rt.Active&&"h-[8px] w-[32px]",i===Rt.Adjacent&&"size-[8px]",i===Rt.Far&&"size-[4px]")},o)})}),r.jsx(_.DialIconButton,{icon:r.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:_.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>n(e+1),"aria-label":"Next page"})]})},gr=({label:e,id:t,checked:n,indeterminate:s,disabled:a,ariaLabel:o,onChange:i,className:l,...c})=>{const d=g.useCallback(u=>{i?.(u.target.checked,t)},[i,t]),f=de("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${n||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),p=de("border rounded",a?"bg-layer-4 border-icon-secondary":""),h=()=>s?r.jsx($.IconMinus,{className:p,...H.BASE_ICON_PROPS}):n?r.jsx($.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return r.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||O.ariaDescription,children:[h(),e&&(typeof e=="string"?r.jsx(O.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),r.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:n,"aria-checked":s?"mixed":n,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible size-0"})]})};var je=(e=>(e.VALID="valid",e.ERROR="error",e))(je||{});const Ia=(e,t)=>{if(t===e.id)switch(e.status){case je.VALID:return"border-accent-secondary text-primary";case je.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case je.VALID:return"border-primary text-primary";case je.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Na=(e,t)=>{if(t===e.id)switch(e.status){case je.VALID:return"bg-accent-secondary";case je.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case je.VALID:return"bg-accent-secondary";case je.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Da=({step:e,index:t,currentStep:n,onChangeStep:s})=>{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 text-white",i=()=>n===e.id&&e.status===je.ERROR?r.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):n!==e.id&&e.status===je.VALID?r.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return r.jsxs("button",{className:de(a,Ia(e,n)),onClick:()=>s(e.id),children:[r.jsx("span",{className:de(o,Na(e,n)),children:i()}),r.jsx("span",{children:e.name})]})},ja=({steps:e,currentStep:t,onChangeStep:n})=>{const s=a=>{const o=e.findIndex(c=>c.id===t),i=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,i).every(c=>c.status===je.VALID)||i<o)&&n(a)};return r.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>r.jsx(Da,{currentStep:t,onChangeStep:s,step:a,index:o},a.id))})},sr=e=>(e.toString().split(".")[1]??"").length,Ta=({value:e,min:t=0,max:n=1,step:s=.1,disabled:a=!1,labelProps:o,labels:i,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:h,labelsClassName:u,"aria-label":m,"aria-labelledby":C,...x})=>{const b=g.useRef(null),y=Math.max(0,Math.min(100,(e-t)/(n-t)*100)),N=sr(s),D=l?l(e):e.toFixed(N),I=g.useCallback(A=>{const E=b.current;if(!E)return e;const T=E.getBoundingClientRect(),R=(A-T.left)/T.width,B=t+R*(n-t),K=sr(s),Q=parseFloat((Math.round((B-t)/s)*s+t).toFixed(K));return Math.min(n,Math.max(t,Q))},[t,n,s,e]),j=g.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(I(A.clientX)))},[a,I,c]),L=g.useCallback(A=>{a||A.buttons===0||c?.(I(A.clientX))},[a,I,c]),w=g.useCallback(A=>{if(a)return;const E=sr(s),T=K=>parseFloat((Math.round((K-t)/s)*s+t).toFixed(E)),R=K=>Math.min(n,Math.max(t,K));let B=e;switch(A.key){case"ArrowRight":case"ArrowUp":B=R(T(e+s));break;case"ArrowLeft":case"ArrowDown":B=R(T(e-s));break;case"Home":B=t;break;case"End":B=n;break;default:return}A.preventDefault(),B!==e&&c?.(B)},[a,e,s,t,n,c]);return r.jsxs("div",{className:S.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[o&&r.jsx(Ue.DialLabel,{...o,htmlFor:x.id}),r.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:j,onPointerMove:L,children:[r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${y}%`}}),r.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":C,className:S.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",h),style:{left:`${y}%`},onKeyDown:w,children:D})]}),i&&r.jsx("div",{className:S.mergeClasses("dial-tiny-text flex text-secondary",u),children:i.length===3?r.jsxs(r.Fragment,{children:[r.jsx("span",{children:i[0]}),r.jsx("span",{className:"flex-1 text-center",children:i[1]}),r.jsx("span",{children:i[2]})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:i[0]}),r.jsx("span",{className:"ml-auto",children:i[1]})]})})]})},wa=({label:e,text:t,tooltip:n,children:s,postfix:a,className:o})=>r.jsxs("div",{className:S.mergeClasses("flex flex-col",s?"":"max-w-[200px]",o),children:[e&&r.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||r.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[r.jsx(_.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:n||t,children:t}),a||null]})]}),Gn=g.createContext({dragDropManager:void 0});function we(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 qr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Yr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Xr={INIT:"@@redux/INIT"+Yr(),REPLACE:"@@redux/REPLACE"+Yr()};function Ea(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 Oa(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(La(e))return"date";if(_a(e))return"error";var n=Aa(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Aa(e){return typeof e.constructor=="function"?e.constructor.name:null}function _a(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function La(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function lt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Oa(e)),t}function Un(e,t,n){var s;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?we(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 n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?we(1):"Expected the enhancer to be a function. Instead, received: '"+lt(n)+"'");return n(Un)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?we(2):"Expected the root reducer to be a function. Instead, received: '"+lt(e)+"'");var a=e,o=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?we(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(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?we(4):"Expected the listener to be a function. Instead, received: '"+lt(C)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?we(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 x=!0;return d(),l.push(C),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?we(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.");x=!1,d();var y=l.indexOf(C);l.splice(y,1),i=null}}}function h(C){if(!Ea(C))throw new Error(process.env.NODE_ENV==="production"?we(7):"Actions must be plain objects. Instead, the actual type was: '"+lt(C)+"'. 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 C.type>"u")throw new Error(process.env.NODE_ENV==="production"?we(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?we(9):"Reducers may not dispatch actions.");try{c=!0,o=a(o,C)}finally{c=!1}for(var x=i=l,b=0;b<x.length;b++){var y=x[b];y()}return C}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?we(10):"Expected the nextReducer to be a function. Instead, received: '"+lt(C));a=C,h({type:Xr.REPLACE})}function m(){var C,x=p;return C={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?we(11):"Expected the observer to be an object. Instead, received: '"+lt(y)+"'");function N(){y.next&&y.next(f())}N();var D=x(N);return{unsubscribe:D}}},C[qr]=function(){return this},C}return h({type:Xr.INIT}),s={dispatch:h,subscribe:p,getState:f,replaceReducer:u},s[qr]=m,s}function ne(e,t,...n){if(ka()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return n[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function ka(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ra(e,t,n){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:n||null,e)}function Ma(e,t){return e.filter(n=>n!==t)}function Zn(e){return typeof e=="object"}function Pa(e,t){const n=new Map,s=o=>{n.set(o,n.has(o)?n.get(o)+1:1)};e.forEach(s),t.forEach(s);const a=[];return n.forEach((o,i)=>{o===1&&a.push(i)}),a}function Fa(e,t){return e.filter(n=>t.indexOf(n)>-1)}const wr="dnd-core/INIT_COORDS",Kt="dnd-core/BEGIN_DRAG",Er="dnd-core/PUBLISH_DRAG_SOURCE",Vt="dnd-core/HOVER",Gt="dnd-core/DROP",Ut="dnd-core/END_DRAG";function Jr(e,t){return{type:wr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ba={type:wr,payload:{clientOffset:null,sourceClientOffset:null}};function za(e){return function(n=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Jr(o)),$a(n,l,c);const d=Va(n,l);if(d==null){e.dispatch(Ba);return}let f=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Ha(i),f=i(d)}e.dispatch(Jr(o,f));const h=c.getSource(d).beginDrag(l,d);if(h==null)return;Ka(h),c.pinSource(d);const u=c.getSourceType(d);return{type:Kt,payload:{itemType:u,item:h,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function $a(e,t,n){ne(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){ne(n.getSource(s),"Expected sourceIds to be registered.")})}function Ha(e){ne(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ka(e){ne(Zn(e),"Item must be an object.")}function Va(e,t){let n=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){n=e[s];break}return n}function Ga(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Ga(e,a,n[a])})}return e}function Za(e){return function(n={}){const s=e.getMonitor(),a=e.getRegistry();Wa(s),Xa(s).forEach((i,l)=>{const c=qa(i,l,a,s),d={type:Gt,payload:{dropResult:Ua({},n,c)}};e.dispatch(d)})}}function Wa(e){ne(e.isDragging(),"Cannot call drop while not dragging."),ne(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function qa(e,t,n,s){const a=n.getTarget(e);let o=a?a.drop(s,e):void 0;return Ya(o),typeof o>"u"&&(o=t===0?{}:s.getDropResult()),o}function Ya(e){ne(typeof e>"u"||Zn(e),"Drop result must either be an object or undefined.")}function Xa(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Ja(e){return function(){const n=e.getMonitor(),s=e.getRegistry();Qa(n);const a=n.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(n,a),s.unpinSource()),{type:Ut}}}function Qa(e){ne(e.isDragging(),"Cannot call endDrag while not dragging.")}function xr(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function eo(e){return function(n,{clientOffset:s}={}){to(n);const a=n.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return no(a,i,l),ro(a,o,i),so(a,o,i),{type:Vt,payload:{targetIds:a,clientOffset:s||null}}}}function to(e){ne(Array.isArray(e),"Expected targetIds to be an array.")}function ro(e,t,n){ne(t.isDragging(),"Cannot call hover while not dragging."),ne(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];ne(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const o=n.getTarget(a);ne(o,"Expected targetIds to be registered.")}}function no(e,t,n){for(let s=e.length-1;s>=0;s--){const a=e[s],o=t.getTargetType(a);xr(o,n)||e.splice(s,1)}}function so(e,t,n){e.forEach(function(s){n.getTarget(s).hover(t,s)})}function ao(e){return function(){if(e.getMonitor().isDragging())return{type:Er}}}function oo(e){return{beginDrag:za(e),publishDragSource:ao(e),hover:eo(e),drop:Za(e),endDrag:Ja(e)}}class io{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function s(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&n(l)}}const a=oo(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=s(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function lo(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Wn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function co(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:s}=e;return!t||!n||!s?null:Wn(lo(t,s),n)}function uo(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Wn(t,n)}const Ct=[],Or=[];Ct.__IS_NONE__=!0;Or.__IS_ALL__=!0;function fo(e,t){return e===Ct?!1:e===Or||typeof t>"u"?!0:Fa(t,e).length>0}class po{subscribeToStateChange(t,n={}){const{handlerIds:s}=n;ne(typeof t=="function","listener must be a function."),ne(typeof s>"u"||Array.isArray(s),"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&&!fo(i.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){ne(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return ne(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(ne(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return xr(s,a)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(ne(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:s}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!xr(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return s?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 co(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return uo(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const Qr=typeof global<"u"?global:self,qn=Qr.MutationObserver||Qr.WebKitMutationObserver;function Yn(e){return function(){const n=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(n),clearInterval(s),e()}}}function ho(e){let t=1;const n=new qn(e),s=document.createTextNode("");return n.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const mo=typeof qn=="function"?ho:Yn;class go{enqueueTask(t){const{queue:n,requestFlush:s}=this;n.length||(s(),this.flushing=!0),n[n.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 n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+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=mo(this.flush),this.requestErrorThrow=Yn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class xo{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class bo{create(t){const n=this.freeTasks,s=n.length?n.pop():new xo(this.onError,a=>n[n.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const Xn=new go,Co=new bo(Xn.registerPendingError);function yo(e){Xn.enqueueTask(Co.create(e))}const Ar="dnd-core/ADD_SOURCE",_r="dnd-core/ADD_TARGET",Lr="dnd-core/REMOVE_SOURCE",Zt="dnd-core/REMOVE_TARGET";function vo(e){return{type:Ar,payload:{sourceId:e}}}function So(e){return{type:_r,payload:{targetId:e}}}function Io(e){return{type:Lr,payload:{sourceId:e}}}function No(e){return{type:Zt,payload:{targetId:e}}}function Do(e){ne(typeof e.canDrag=="function","Expected canDrag to be a function."),ne(typeof e.beginDrag=="function","Expected beginDrag to be a function."),ne(typeof e.endDrag=="function","Expected endDrag to be a function.")}function jo(e){ne(typeof e.canDrop=="function","Expected canDrop to be a function."),ne(typeof e.hover=="function","Expected hover to be a function."),ne(typeof e.drop=="function","Expected beginDrag to be a function.")}function br(e,t){if(t&&Array.isArray(e)){e.forEach(n=>br(n,!1));return}ne(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 Oe;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Oe||(Oe={}));let To=0;function wo(){return To++}function Eo(e){const t=wo().toString();switch(e){case Oe.SOURCE:return`S${t}`;case Oe.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function en(e){switch(e[0]){case"S":return Oe.SOURCE;case"T":return Oe.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function tn(e,t){const n=e.entries();let s=!1;do{const{done:a,value:[,o]}=n.next();if(o===t)return!0;s=!!a}while(!s);return!1}class Oo{addSource(t,n){br(t),Do(n);const s=this.addHandler(Oe.SOURCE,t,n);return this.store.dispatch(vo(s)),s}addTarget(t,n){br(t,!0),jo(n);const s=this.addHandler(Oe.TARGET,t,n);return this.store.dispatch(So(s)),s}containsHandler(t){return tn(this.dragSources,t)||tn(this.dropTargets,t)}getSource(t,n=!1){return ne(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return ne(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return ne(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return ne(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return en(t)===Oe.SOURCE}isTargetId(t){return en(t)===Oe.TARGET}removeSource(t){ne(this.getSource(t),"Expected an existing source."),this.store.dispatch(Io(t)),yo(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){ne(this.getTarget(t),"Expected an existing target."),this.store.dispatch(No(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);ne(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){ne(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,s){const a=Eo(t);return this.types.set(a,n),t===Oe.SOURCE?this.dragSources.set(a,s):t===Oe.TARGET&&this.dropTargets.set(a,s),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 Ao=(e,t)=>e===t;function _o(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Lo(e,t,n=Ao){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!n(e[s],t[s]))return!1;return!0}function ko(e=Ct,t){switch(t.type){case Vt:break;case Ar:case _r:case Zt:case Lr:return Ct;case Kt:case Er:case Ut:case Gt:default:return Or}const{targetIds:n=[],prevTargetIds:s=[]}=t.payload,a=Pa(n,s);if(!(a.length>0||!Lo(n,s)))return Ct;const i=s[s.length-1],l=n[n.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function Ro(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Ro(e,a,n[a])})}return e}const rn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Po(e=rn,t){const{payload:n}=t;switch(t.type){case wr:case Kt:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Vt:return _o(e.clientOffset,n.clientOffset)?e:Mo({},e,{clientOffset:n.clientOffset});case Ut:case Gt:return rn;default:return e}}function Fo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Fo(e,a,n[a])})}return e}const Bo={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function zo(e=Bo,t){const{payload:n}=t;switch(t.type){case Kt:return ct({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Er:return ct({},e,{isSourcePublic:!0});case Vt:return ct({},e,{targetIds:n.targetIds});case Zt:return e.targetIds.indexOf(n.targetId)===-1?e:ct({},e,{targetIds:Ma(e.targetIds,n.targetId)});case Gt:return ct({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Ut:return ct({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function $o(e=0,t){switch(t.type){case Ar:case _r:return e+1;case Lr:case Zt:return e-1;default:return e}}function Ho(e=0){return e+1}function Ko(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){Ko(e,a,n[a])})}return e}function Go(e={},t){return{dirtyHandlerIds:ko(e.dirtyHandlerIds,{type:t.type,payload:Vo({},t.payload,{prevTargetIds:Ra(e,"dragOperation.targetIds",[])})}),dragOffset:Po(e.dragOffset,t),refCount:$o(e.refCount,t),dragOperation:zo(e.dragOperation,t),stateId:Ho(e.stateId)}}function Uo(e,t=void 0,n={},s=!1){const a=Zo(s),o=new po(a,new Oo(a)),i=new io(a,o),l=e(i,t,n);return i.receiveBackend(l),i}function Zo(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Un(Go,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Wo(e,t){if(e==null)return{};var n=qo(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function qo(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}let nn=0;const Mt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Yo=g.memo(function(t){var{children:n}=t,s=Wo(t,["children"]);const[a,o]=Xo(s);return g.useEffect(()=>{if(o){const i=Jn();return++nn,()=>{--nn===0&&(i[Mt]=null)}}},[]),r.jsx(Gn.Provider,{value:a,children:n})});function Xo(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Jo(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function Jo(e,t=Jn(),n,s){const a=t;return a[Mt]||(a[Mt]={dragDropManager:Uo(e,t,n,s)}),a[Mt]}function Jn(){return typeof global<"u"?global:window}var ar,sn;function Qo(){return sn||(sn=1,ar=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var s,a,o;if(Array.isArray(t)){if(s=t.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),ar}var ei=Qo();const ti=v.getDefaultExportFromCjs(ei),Qe=typeof window<"u"?g.useLayoutEffect:g.useEffect;function ri(e,t,n){const[s,a]=g.useState(()=>t(e)),o=g.useCallback(()=>{const i=t(e);ti(s,i)||(a(i),n&&n())},[s,e,n]);return Qe(o),[s,o]}function ni(e,t,n){const[s,a]=ri(e,t,n);return Qe(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),s}function Qn(e,t,n){return ni(t,e||(()=>({})),()=>n.reconnect())}function es(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),g.useMemo(()=>typeof e=="function"?e():e,n)}function si(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function ai(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let or=!1,ir=!1;class oi{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){ne(!or,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return or=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{or=!1}}isDragging(){if(!this.sourceId)return!1;ne(!ir,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return ir=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{ir=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}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.sourceId=null,this.internalMonitor=t.getMonitor()}}let lr=!1;class ii{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;ne(!lr,"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 lr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{lr=!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 li(e,t,n){const s=n.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function ci(e,t,n){const s=n.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Cr(e,t,n,s){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 c=0;c<o.length;c++){const d=o[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function yr(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function di(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 ui(e){return(t=null,n=null)=>{if(!g.isValidElement(t)){const o=t;return e(o,n),o}const s=t;return di(s),fi(s,n?o=>e(o,n):e)}}function ts(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const a=ui(s);t[n]=()=>a}}),t}function an(e,t){typeof e=="function"?e(t):e.current=t}function fi(e,t){const n=e.ref;return ne(typeof n!="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"),n?g.cloneElement(e,{ref:s=>{an(n,s),an(t,s)}}):g.cloneElement(e,{ref:t})}class pi{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Cr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Cr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=ts({dragSource:(n,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,yr(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,yr(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class hi{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,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!Cr(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=ts({dropTarget:(n,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,yr(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ft(){const{dragDropManager:e}=g.useContext(Gn);return ne(e!=null,"Expected drag drop context"),e}function mi(e,t){const n=ft(),s=g.useMemo(()=>new pi(n.getBackend()),[n]);return Qe(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Qe(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function gi(){const e=ft();return g.useMemo(()=>new oi(e),[e])}class xi{beginDrag(){const t=this.spec,n=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(n):s={},s??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const s=this.spec,a=this.monitor,{isDragging:o}=s;return o?o(a):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,s=this.connector,{end:a}=t;a&&a(n.getItem(),n),s.reconnect()}constructor(t,n,s){this.spec=t,this.monitor=n,this.connector=s}}function bi(e,t,n){const s=g.useMemo(()=>new xi(e,t,n),[t,n]);return g.useEffect(()=>{s.spec=e},[e]),s}function Ci(e){return g.useMemo(()=>{const t=e.type;return ne(t!=null,"spec.type must be defined"),t},[e])}function yi(e,t,n){const s=ft(),a=bi(e,t,n),o=Ci(e);Qe(function(){if(o!=null){const[l,c]=ci(o,a,s);return t.receiveHandlerId(l),n.receiveHandlerId(l),c}},[s,t,n,a,o])}function vi(e,t){const n=es(e,t);ne(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=gi(),a=mi(n.options,n.previewOptions);return yi(n,s,a),[Qn(n.collect,s,a),si(a),ai(a)]}function Si(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function Ii(e){const t=ft(),n=g.useMemo(()=>new hi(t.getBackend()),[t]);return Qe(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function Ni(){const e=ft();return g.useMemo(()=>new ii(e),[e])}function Di(e){const{accept:t}=e;return g.useMemo(()=>(ne(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class ji{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function Ti(e,t){const n=g.useMemo(()=>new ji(e,t),[t]);return g.useEffect(()=>{n.spec=e},[e]),n}function wi(e,t,n){const s=ft(),a=Ti(e,t),o=Di(e);Qe(function(){const[l,c]=li(o,a,s);return t.receiveHandlerId(l),n.receiveHandlerId(l),c},[s,t,a,n,o.map(i=>i.toString()).join("|")])}function kr(e,t){const n=es(e,t),s=Ni(),a=Ii(n.options);return wi(n,s,a),[Qn(n.collect,s,a),Si(a)]}const on="column",Ei="flex items-center",Oi="mr-3 cursor-move text-secondary",Ai=({id:e,children:t,className:n,onFind:s,onMove:a,ariaLabel:o="Drag item"})=>{const i=g.useRef(null),l=g.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=vi(()=>({type:on,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,h]=kr(()=>({accept:on,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(h(l)),f(i),r.jsxs("div",{ref:l,className:S.mergeClasses(Ei,n),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[r.jsx("div",{ref:i,className:Oi,"aria-label":o,children:r.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},Wt=({iconClassName:e,label:t,...n})=>t?r.jsx(v.DialDangerButton,{...n,label:t,appearance:_.ButtonAppearance.Ghost,iconBefore:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):r.jsx(O.DialDangerIconButton,{...n,appearance:_.ButtonAppearance.Ghost,icon:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),_i=({className:e="",value:t,onChange:n,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=S.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",o?"resize":"resize-none",e);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-1",a),children:[i&&r.jsx(Ue.DialLabel,{...i,htmlFor:c}),r.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>n?.(p.currentTarget.value),...d}),r.jsx(v.DialErrorText,{text:s}),!s&&r.jsx(v.DialCaptionText,{text:l})]})},Li="inline-flex items-center rounded bg-layer-3",ki="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",Ri="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Mi="text-secondary hover:text-primary",Pi="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Fi=({options:e,value:t,onChange:n,disabled:s,className:a,ariaLabel:o})=>{const i=g.useCallback(l=>{if(s)return;const c=e.filter(h=>!h.disabled);if(c.length===0)return;const d=c.findIndex(h=>h.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&n(p.value)},[s,e,t,n]);return r.jsx("div",{role:"tablist","aria-label":o,className:S.mergeClasses(Li,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,h=s||l.disabled;return r.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:h,onClick:()=>n(l.value),onKeyDown:i,className:S.mergeClasses(ki,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?Ri:Mi,h&&Pi),children:[l.icon,l.label]},l.value)})})},cr=8,Bi=24,rs=({initialTags:e=[],label:t,required:n,elementId:s,placeholder:a,captionDescription:o,errorText:i,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:h,onChange:u})=>{const m=g.useRef(null),C=g.useRef([]),x=g.useRef(null),[b,y]=g.useState(e),[N,D]=g.useState(""),[I,j]=g.useState(!1),[L,w]=g.useState(e.length),A=g.useCallback(F=>V=>{C.current[F]=V},[]),E=g.useCallback(()=>{if(!d)return;const F=m.current;if(!F)return;const V=F.offsetWidth;if(V===0)return;const Z=x.current?.offsetWidth??0,le=V-(f?0:Bi)-cr;let X=0,J=0;for(let ee=0;ee<b.length;ee++){const re=C.current[ee];if(!re)continue;const oe=re.offsetWidth+cr;if(X+oe>le)break;X+=oe,J++}if(J<b.length&&J>0)for(;X+Z>le&&J>0;){J--;const ee=C.current[J]?.offsetWidth??0;X-=ee+cr}w(J)},[d,f,b.length]),T=F=>{const V=F.trim().replace(/,$/,"");if(V&&!b.includes(V)){const Z=[V,...b];y(Z),u?.(Z)}},R=F=>{(F.key===","||F.key==="Enter")&&(F.preventDefault(),T(N),D(""))},B=()=>{N.trim()&&(T(N),D(""))},K=F=>{const V=b.filter((Z,U)=>U!==F);y(V),u?.(V)},Q=()=>i?r.jsx(v.DialErrorText,{text:i}):o?r.jsx(v.DialCaptionText,{text:o}):null;g.useEffect(()=>{if(d)return;const F=new ResizeObserver(()=>{if(m.current){const V=m.current.scrollHeight>m.current.clientHeight+10;j(V)}});return m.current&&F.observe(m.current),()=>F.disconnect()},[b,d]),g.useEffect(()=>{if(!d){w(b.length);return}w(b.length);const F=new ResizeObserver(()=>{E()}),V=m.current;return V&&F.observe(V),E(),()=>F.disconnect()},[d,E,b]),g.useEffect(()=>{y(e)},[JSON.stringify(e)]);const G=r.jsxs("div",{ref:m,className:de("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":de("flex-wrap",I?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,L):b).map((F,V)=>r.jsx(Je,{label:F,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>K(V):void 0},F+V)),d&&L<b.length&&r.jsx(_.DialTooltip,{tooltip:b.slice(L).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:r.jsx(Je,{label:`+${b.length-L}`})}),!f&&r.jsx("input",{id:s,type:"text",value:N,onChange:F=>D(F.target.value),onKeyDown:R,onBlur:B,className:de("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&r.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[b.map((F,V)=>r.jsx("div",{ref:A(V),className:"inline-flex shrink-0",children:r.jsx(Je,{label:F,className:h,closable:!c&&!f,onRemove:!c&&!f?()=>K(V):void 0})},`measure-${F}-${V}`)),r.jsx("div",{ref:x,className:"inline-flex shrink-0",children:r.jsx(Je,{label:`+${b.length}`})})]})]});return f?G:r.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[r.jsx(Ue.DialLabel,{label:t,required:n,htmlFor:s}),r.jsx("div",{className:de("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),Q()]})},ns=({selectedItems:e,placeholder:t,collapseTagOverflow:n=!1,listClassName:s,listElementClassName:a})=>e?.length?r.jsx(rs,{readOnly:!0,initialTags:e,collapseTagOverflow:n,containerClassName:s,tagClassName:a}):t?r.jsx("span",{className:"text-secondary",children:t}):null,dr=e=>Ur.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ur.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),ss=({children:e,open:t,disabled:n=!1,selectedValue:s,valueClassName:a,inputClassName:o,onOpen:i,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:h=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:C})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),y=x||b?s:p?void 0:f,N=n?void 0:i,D=g.useCallback(w=>{u?.(w.target.value)},[u]),I=()=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:de("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",o,n&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx("input",{type:"text",className:de("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:p||f,onChange:D,disabled:n,id:l,"aria-label":"input-popup-field"})]}),!n&&r.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:i,"aria-label":"open-popup",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),r.jsx(v.DialErrorText,{text:c})]}),j=()=>r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:r.jsxs("div",{className:de("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",o,n&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx(_.DialTooltip,{tooltip:y==null?void 0:String(y),children:y||!p?r.jsx("span",{className:a,children:y}):r.jsx("span",{className:"text-secondary",children:p})})]}),!n&&r.jsx("div",{className:"shrink-0",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),r.jsx(v.DialErrorText,{text:c})]}),L=()=>r.jsx("div",{className:"w-full",onClick:N,children:r.jsxs("div",{className:de("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",n&&"dial-input-disable"),children:[r.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&r.jsx(O.DialIcon,{icon:C}),r.jsx(ns,{placeholder:p,selectedItems:y,collapseTagOverflow:m})]}),!n&&r.jsx("div",{className:"ml-1",children:r.jsx(O.DialIcon,{icon:r.jsx(dr,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return r.jsxs(r.Fragment,{children:[x?L():h?I():j(),t&&oa.createPortal(e,document.body)]})},zi=({label:e,htmlFor:t,disabled:n,selectedValue:s,radioButtons:a,customInputValue:o,valueClassName:i,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:h,onApply:u,onCancel:m,cancelButtonTitle:C="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:y,onChangeRadioField:N,id:D,size:I=v.PopupSize.Md})=>{const[j,L]=g.useState(!1),w=g.useCallback(()=>{n||L(!0)},[n]),A=g.useCallback(()=>{L(!1),f?.()},[f]),E=g.useCallback(()=>{m?.(),A()},[m,A]),T=g.useCallback(()=>{u(),A()},[u,A]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Ue.DialLabel,{label:e,htmlFor:t}),r.jsx(ss,{disabled:n,open:j,selectedValue:o??a.find(R=>R.id===s)?.name,valueClassName:i,inputClassName:de(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:w,children:r.jsx(v.DialPopup,{open:j,onClose:E,header:p,portalId:h,size:I,footer:r.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[r.jsx(v.DialNeutralButton,{label:C,onClick:E}),r.jsx(v.DialPrimaryButton,{label:x,onClick:T,disabled:!b})]}),children:r.jsx("div",{className:"px-6 py-4",children:r.jsx(v.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:y,onChange:N,elementId:D,orientation:v.RadioGroupOrientation.Column})})})})]})},$i="Create",Hi="Cancel",Ki="flex items-center justify-end gap-2 px-6 py-3",Vi=({header:e,open:t=!1,submitLabel:n=$i,cancelLabel:s=Hi,isLoading:a=!1,disableSubmitButton:o=!1,className:i,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:h=!0,size:u=v.PopupSize.Md,footer:m})=>{const C=a?null:r.jsxs("div",{className:Ki,children:[r.jsx(v.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),r.jsx(v.DialPrimaryButton,{className:l,label:n,disabled:o,onClick:()=>d()})]}),x=g.useCallback(()=>a?r.jsx("div",{className:"px-6 py-4 h-[120px]",children:r.jsx(v.DialLoader,{size:50})}):p??null,[p,a]);return r.jsx(v.DialPopup,{open:t,header:e,className:i,dividers:h,onClose:()=>c?.(),footer:m??C,size:u,children:x()})},Gi=/^0+\.(\d+)?$/,Ui=/^0+/,vr=({integer:e,onChange:t,min:n,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=f=>!f||f==="-"?f:String(f)?.match(Gi)?String(f)?.replace(Ui,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}v.handleKeyDown(f,"number",n,s)},d=f=>{const p=f.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(f.preventDefault(),h)){const u=f.currentTarget,m=u.selectionStart??0,C=u.selectionEnd??0,x=u.value.slice(0,m)+h+u.value.slice(C);t?.(l(x))}};return r.jsx(v.DialInput,{type:"number",min:n,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:o,...i})},Zi=({onClick:e})=>r.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Wi=({onClick:e})=>r.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),as=({...e})=>{const[t,n]=g.useState(!1),s=g.useCallback(a=>{n(a)},[]);return r.jsx(v.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?r.jsx(Zi,{onClick:()=>s(!1)}):r.jsx(Wi,{onClick:()=>s(!0)})})},os=({options:e,selectedValues:t,handleRemoveTag:n})=>r.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(i=>i.value===s)?.label??s,o=e.find(i=>i.value===s)?.icon;return r.jsx(Je,{label:a,onRemove:i=>n?.(i,s),icon:o?r.jsx(O.DialIcon,{icon:o}):null,className:"max-w-full"},s)})});var Ft=(e=>(e.Sm="sm",e.Md="md",e))(Ft||{}),Bt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(Bt||{});const qi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Yi="w-full rounded flex flex-col",yt="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Xi="bg-accent-primary-alpha",Sr="bg-accent-primary-alpha border-l border-accent-primary border-1",zt="opacity-75",Ji=352,Qi=4,el=r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),tl=({opt:e,selectedValues:t,onSelect:n})=>{const{isOpen:s,refs:a,floatingStyles:o,context:i,getReferenceProps:l,getFloatingProps:c}=O.useSubMenuFloating(Qi,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.value));return r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:de(yt,d&&Sr,e.disabled&&zt),...l(),children:[r.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&r.jsx(O.DialIcon,{icon:e.icon}),r.jsx(O.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),r.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&r.jsx(O.SubMenuPanel,{refs:a,floatingStyles:o,context:i,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return r.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:de(yt,p&&Sr,f.disabled&&zt),onClick:()=>!f.disabled&&n(f.value),children:r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&r.jsx(O.DialIcon,{icon:f.icon}),r.jsx(O.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},Me=({options:e,multiple:t=!1,elementId:n,value:s,defaultValue:a,variant:o=Bt.Primary,size:i=Ft.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=_.ElementSize.Standard,searchPlaceholder:h,selectAll:u=!1,invalid:m,selectAllLabel:C="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:y,disabled:N=!1,className:D,listClassName:I,closable:j=!1,header:L,footer:w,onClose:A,onChange:E,inlineSearch:T=!1,dismissRef:R,onFooterClick:B,open:K,onOpenChange:Q,onInlineQueryChange:G,customMultiSelectTagsRenderer:F})=>{const V=g.useId(),[Z,U]=g.useState(!1),le=K!==void 0,X=le?!!K:Z,J=g.useCallback(M=>{le||U(M),Q?.(M)},[le,Q]),[ee,re]=g.useState(T&&c||""),oe=g.useRef(null),ce=g.useCallback(M=>{M!==ee&&(re(M||""),G?.(M||""))},[G,ee]),he=s!==void 0,[Se,be]=g.useState(a),W=he?s:Se,te=g.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),Te=g.useMemo(()=>{const M=ee.trim().toLowerCase();return M?e.filter(ie=>ie.label.toLowerCase().includes(M)):e},[e,ee]);g.useEffect(()=>{!X&&!T&&ce("")},[T,X,ce]);const Le=g.useRef(c);g.useEffect(()=>{T&&c!==Le.current&&(X||(Le.current=c,ce(c||"")))},[c,T,X,ce]);const ge=g.useCallback(M=>{he||be(M),E?.(M)},[he,E]),$e=g.useCallback(M=>{if(t){const ie=new Set(te);ie.has(M)?ie.delete(M):ie.add(M),ge(Array.from(ie));return}if(ge(M),T){const ie=e.find(Ie=>Ie.value===M)??e.flatMap(Ie=>Ie.children??[]).find(Ie=>Ie.value===M);ie&&ce(ie.label)}J(!1)},[t,ge,T,J,te,e,ce]),Ye=g.useCallback((M,ie)=>{if(M.stopPropagation(),!t){ge("");return}const Ie=te.filter(er=>er!==ie);ge(Ie)},[t,te,ge]),me=g.useMemo(()=>Te.filter(M=>!M.disabled),[Te]),Y=g.useMemo(()=>me.filter(M=>te.includes(M.value)).length,[me,te]),ue=g.useCallback(M=>{T&&!t&&!M&&$e(ee),J(M)},[$e,T,t,ee,J]),{allSelectedInFiltered:fe,someSelectedInFiltered:xt}=g.useMemo(()=>{const M=me.length>0&&Y===me.length;return{allSelectedInFiltered:M,someSelectedInFiltered:Y>0&&!M}},[me,Y]),ot=g.useCallback(()=>{if(!(!t||me.length===0))if(fe){const M=new Set(me.map(ie=>ie.value));ge(te.filter(ie=>!M.has(ie)))}else{const M=new Set(te);me.forEach(ie=>M.add(ie.value)),ge(Array.from(M))}},[fe,t,me,te,ge]),ve=te.length>0;g.useEffect(()=>{X&&T&&!t&&!N&&requestAnimationFrame(()=>{const M=oe.current;if(!M)return;M.focus();const ie=M.value?.length??0;M.setSelectionRange?.(ie,ie)})},[X,T,t,N]);const Ze=!t&&ve?te[0]:void 0,ye=g.useMemo(()=>Ze?e.find(M=>M.value===Ze)??e.flatMap(M=>M.children??[]).find(M=>M.value===Ze):void 0,[e,Ze]),Qt=g.useCallback(()=>t?ve?F?.(e,te,Ye)||r.jsx(os,{options:e,selectedValues:te,handleRemoveTag:Ye}):r.jsx("span",{className:"text-secondary truncate",children:d}):ye?r.jsxs(r.Fragment,{children:[ye.icon&&r.jsx(O.DialIcon,{icon:ye.icon}),r.jsx(O.DialEllipsisTooltip,{text:ye.labelNode??(l?`${l} ${ye.label}`:ye.label)}),ye?.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:ye.description})]}):c&&s?c:r.jsx("span",{className:"text-secondary truncate",children:d}),[ve,t,c,l,s,d,ye,e,te,Ye,F]);g.useImperativeHandle(R,()=>({dismiss:()=>{J(!1)}}));const it=g.useCallback(()=>{ce(te.length===1?ye?.label??ee:"")},[ee,te.length,ce,ye?.label]),Xe=g.useCallback(()=>{N||(J(!X),T&&!t&&(it(),oe.current?.focus()))},[N,T,X,t,it,J]);return r.jsx(O.DialDropdown,{open:X,onOpenChange:ue,disabled:N,closable:j,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:Ji,listClassName:I,renderOverlay:()=>r.jsxs("div",{id:`list-${n||V}`,role:"listbox","aria-multiselectable":t||void 0,className:Yi,children:[L&&r.jsx(r.Fragment,{children:typeof L=="function"?L():L}),(f||j)&&e.length>8&&r.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&r.jsx(v.DialSearch,{size:p,placeholder:h,onChange:ce,value:ee,id:`search-${n||V}`,containerClassName:S.mergeClasses(v.SIZE_CONFIG[p].containerClassName,"w-full")}),j&&r.jsx(v.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:M=>{A?.(M),J(!1)}})]}),t&&u&&me.length>0&&r.jsx("div",{className:de(yt,"mt-2"),children:r.jsx(gr,{id:`${n||V}-selectAll`,label:C,checked:fe,indeterminate:xt,onChange:ot,ariaLabel:C})}),r.jsx("div",{className:de("overflow-y-auto max-h-[352px]",T&&Te.length===0?"":"py-1"),children:Te.length===0?!T&&r.jsx("div",{className:"px-2 py-3",children:r.jsx(O.DialNoDataContent,{icon:y??r.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):Te.map(M=>{const ie=te.includes(M.value);return t?r.jsxs("div",{role:"option","aria-selected":ie,"aria-disabled":!!M.disabled,className:de(yt,ie&&Xi,M.disabled&&zt,"w-full"),children:[r.jsx(gr,{id:`${n||V}-${M.value}`,label:r.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[M.icon&&r.jsx(O.DialIcon,{icon:M.icon}),r.jsx("span",{className:"truncate",children:M.labelNode??M.label})]}),checked:ie,disabled:M.disabled,onChange:()=>!M.disabled&&$e(M.value),ariaLabel:M.label}),M.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:M.description})]},M.value):M.children?.length?r.jsx(tl,{opt:M,selectedValues:te,onSelect:$e},M.value):r.jsx("button",{role:"option",type:"button","aria-selected":ie,"aria-disabled":!!M.disabled,disabled:M.disabled,className:de(yt,ie&&Sr,M.disabled&&zt),onClick:()=>!M.disabled&&$e(M.value),children:r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[M.icon&&r.jsx(O.DialIcon,{icon:M.icon}),r.jsx(O.DialEllipsisTooltip,{text:M.labelNode??M.label}),M.description&&r.jsx("div",{className:"text-secondary dial-small-text",children:M.description})]})},M.value)})}),w&&r.jsx("div",{onClick:M=>{B?.(M),B&&J(!1)},children:typeof w=="function"?w():w})]}),children:r.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":X,"aria-controls":`list-${n||V}`,className:S.mergeClasses(qi,N&&"opacity-75 !cursor-not-allowed !border-primary",i===Ft.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",o===Bt.Secondary?"!bg-layer-4 !h-auto":"",D),onMouseDown:M=>{N||T&&!t&&(it(),M.preventDefault())},onClick:()=>{Xe()},onKeyDown:M=>{(M.key===" "||M.code==="Space")&&(M.preventDefault(),Xe())},children:[T&&!t?r.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:r.jsx("input",{id:`inline-${n||V}`,type:"text",placeholder:h??d,value:ee||"",onChange:M=>ce(M.currentTarget.value.trimStart()),onFocus:()=>!N&&J(!0),onMouseDown:M=>{it(),M.stopPropagation()},onClick:M=>{M.stopPropagation()},onKeyDown:M=>{M.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:oe,disabled:N,"aria-disabled":N,autoComplete:"off"})}):r.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Qt()}),!T&&r.jsx(O.DialIcon,{icon:el,className:de("text-primary",X&&"rotate-180")})]})})},rl=({label:e,required:t,captionDescription:n,containerClassName:s,selectClassName:a,error:o,id:i,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const h=g.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return r.jsx(os,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return r.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return r.jsx(v.DialFormItem,{id:i,label:e,required:t,description:l,error:o,captionDescription:n,className:s,readonly:c,value:h(),defaultEmptyText:f,children:r.jsx(Me,{className:a,value:d,elementId:i,invalid:!!o,...p})})};function is(e){let t=null;return()=>(t==null&&(t=e()),t)}function nl(e,t){return e.filter(n=>n!==t)}function sl(e,t){const n=new Set,s=o=>n.add(o);e.forEach(s),t.forEach(s);const a=[];return n.forEach(o=>a.push(o)),a}class al{enter(t){const n=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=sl(this.entered.filter(s),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=nl(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class ol{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 n={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(n[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const qt="__NATIVE_FILE__",ls="__NATIVE_URL__",cs="__NATIVE_TEXT__",ds="__NATIVE_HTML__",ln=Object.freeze(Object.defineProperty({__proto__:null,FILE:qt,HTML:ds,TEXT:cs,URL:ls},Symbol.toStringTag,{value:"Module"}));function ur(e,t,n){const s=t.reduce((a,o)=>a||e.getData(o),"");return s??n}const Ir={[qt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[ds]:{exposeProperties:{html:(e,t)=>ur(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[ls]:{exposeProperties:{urls:(e,t)=>ur(e,t,"").split(`
|
|
2
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[cs]:{exposeProperties:{text:(e,t)=>ur(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function il(e,t){const n=Ir[e];if(!n)throw new Error(`native type ${e} has no configuration`);const s=new ol(n);return s.loadDataTransfer(t),s}function fr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ir).filter(n=>{const s=Ir[n];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const ll=is(()=>/firefox/i.test(navigator.userAgent)),us=is(()=>!!window.safari);class cn{interpolate(t){const{xs:n,ys:s,c1s:a,c2s:o,c3s:i}=this;let l=n.length-1;if(t===n[l])return s[l];let c=0,d=i.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=n[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-n[l],h=p*p;return s[l]+a[l]*p+o[l]*h+i[l]*p*h}constructor(t,n){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const o=[],i=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=n[u+1]-n[u],o.push(l),i.push(c/l);const d=[i[0]];for(let u=0;u<o.length-1;u++){const m=i[u],C=i[u+1];if(m*C<=0)d.push(0);else{l=o[u];const x=o[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/C))}}d.push(i[i.length-1]);const f=[],p=[];let h;for(let u=0;u<d.length-1;u++){h=i[u];const m=d[u],C=1/o[u],x=m+d[u+1]-h-h;f.push((h-m-x)*C),p.push(x*C*C)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=f,this.c3s=p}}const cl=1;function fs(e){const t=e.nodeType===cl?e:e.parentElement;if(!t)return null;const{top:n,left:s}=t.getBoundingClientRect();return{x:s,y:n}}function At(e){return{x:e.clientX,y:e.clientY}}function dl(e){var t;return e.nodeName==="IMG"&&(ll()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function ul(e,t,n,s){let a=e?t.width:n,o=e?t.height:s;return us()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function fl(e,t,n,s,a){const o=dl(t),l=fs(o?e:t),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:h}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=ul(o,t,d,f),C=()=>{let j=new cn([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(h);return us()&&o&&(j+=(window.devicePixelRatio-1)*m),j},x=()=>new cn([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:y}=a,N=b===0||b,D=y===0||y;return{x:N?b:x(),y:D?y:C()}}class pl{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,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}}function hl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},s=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.forEach(function(a){hl(e,a,n[a])})}return e}class ml{profile(){var t,n;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:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.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 n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,s){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,s);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",o),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const s=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return n.addEventListener("dragenter",s),n.addEventListener("dragover",a),n.addEventListener("drop",o),()=>{n.removeEventListener("dragenter",s),n.removeEventListener("dragover",a),n.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(),n=this.sourceNodeOptions.get(t);return dn({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);return dn({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(ln).some(n=>ln[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=il(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}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,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,s){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&&fs(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=At(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,c=fr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),h=this.sourcePreviewNodes.get(f)||p;if(h){const{anchorX:u,anchorY:m,offsetX:C,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=fl(p,h,i,{anchorX:u,anchorY:m},{offsetX:C,offsetY:x});l.setDragImage(h,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);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,c=fr(l);c&&this.beginDragNativeItem(c,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:At(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=At(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 fr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:At(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 pl(n,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new al(this.isNodeInDocument)}}const gl=function(t,n,s){return new ml(t,n,s)},xl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:n,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const h=g.useRef(null),u=g.useRef(null),[m,C]=g.useState([]),[x,b]=g.useState(!1),[y,N]=g.useState(!1),D=g.useCallback(G=>{const F=G.target.files;if(F&&F.length>0){const V=Array.from(F),Z=f?.(V),U=p?.(V);Z?b(!0):U?N(!0):e(V)}},[f,p,e]),I=g.useCallback(G=>o&&G?.length>o,[o]),j=g.useMemo(()=>x||y||I(m),[x,y,I,m]),L=()=>{C([]),b(!1),N(!1)},w=g.useMemo(()=>x?r.jsx(v.DialErrorText,{text:l}):y?r.jsx(v.DialErrorText,{text:d}):I(m)?r.jsx(v.DialErrorText,{text:c}):null,[c,l,d,m,I,x,y]);g.useEffect(()=>{L()},[a]);const[{isOver:A,canDrop:E},T]=kr(()=>({accept:[qt],drop(G){const F=G.files,V=f?.(F)??!1,Z=p?.(F)??!1,U=I?.(F)??!1;if(b(V),N(Z),V||Z||U){C(F);return}e(F),L()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,I]),R=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},B=G=>{G?.preventDefault();const F=Array.from(G.dataTransfer?.items??[]);b(!!f?.(F)),N(!!p?.(F)),C(F)},K=G=>{G.target===G.currentTarget&&L()},Q=de("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!E&&!j&&"border-primary",E&&(A?"border-accent-primary":"border-hover"),j&&"border-error");return T(h),r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:Q,ref:h,onDragOver:B,onDragLeave:K,children:[r.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:R,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&r.jsx("p",{className:"mb-1",children:t}),n&&r.jsx("p",{className:"mb-0.5",children:n}),s&&r.jsx(v.DialPrimaryButton,{appearance:_.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),r.jsx("input",{multiple:i,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:D})]}),r.jsx(r.Fragment,{children:w})]})},bl=({iconBefore:e,className:t,...n})=>{const s=n.invalid,a=()=>r.jsx("div",{className:"mr-2",children:s?r.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return r.jsx(v.DialInput,{...n,iconBefore:a(),containerClassName:de("h-[40px] p-0",s&&"h-[60px]"),className:de("rounded-r-none border-r-0",s&&"text-error",t)})},Cl=({children:e,existingFiles:t,onDrop:n,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:c})=>{const d=g.useRef(null),[f,p]=g.useState(!1),[h,u]=g.useState(!1),[m,C]=g.useState(0),x=g.useCallback(()=>{p(!1),u(!1),C(0)},[]),b=g.useCallback(A=>!!(o&&t.length+A.length>o),[o,t.length]),y=f||h,[{isOver:N,canDrop:D},I]=kr(()=>({accept:[qt],drop(A){const E=A.files,T=[...t,...E],R=s?.(E)??!1,B=a?.(E)??!1,K=b?.(E)??!1;if(p(R),u(B),R||B||K){C(E.length);return}n(T),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,n,s,a,b,x]),j=A=>{A.preventDefault();const E=Array.from(A.dataTransfer?.items??[]);p(!!s?.(E)),u(!1),C(E.length)},L=A=>{A.target===A.currentTarget&&x()};I(d);const w=b(Array.from({length:m}));return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsx("div",{ref:d,onDragOver:j,onDragLeave:L,className:de("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!y&&!w&&(D&&N?"border-accent-primary":"border-primary"),(y||w)&&"border-error"),children:e}),f&&r.jsx(v.DialErrorText,{text:i}),h&&r.jsx(v.DialErrorText,{text:l}),!f&&!h&&w&&r.jsx(v.DialErrorText,{text:c})]})},ps=e=>{const{files:t,iconBeforeInput:n,dynamicIcon:s,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h}=e,u=g.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(y=>y.name!==b)||[])},[a,t]),m=g.useCallback(x=>r.jsx(Wt,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),C=g.useMemo(()=>r.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>r.jsx(bl,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:n||s?.(x.name),invalid:o?.(x),error:o?.(x)?i:""},x.name+b))}),[t,n,s,o,i,m]);return r.jsx(Yo,{backend:gl,children:!t||t.length===0?r.jsx(xl,{...e,onChange:a}):r.jsxs(r.Fragment,{children:[r.jsx(Cl,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:h,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:C}),c?.(t)&&r.jsx(v.DialErrorText,{text:d})]})})},yl=({onChange:e,fieldTitle:t,elementId:n,files:s,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:h,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:C,...x})=>{const b=g.useRef(null),y=()=>b.current?.click(),N=()=>{e([])},D=g.useCallback(w=>w?.some(A=>!(h==="/"||h?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[h]),I=g.useCallback(w=>{if(!o)return!1;const A=o*(1024*1024);return w?.some(E=>{const T=E.size;return!!T&&T>A})},[o]),j=g.useCallback(w=>{if(!i||!p)return!1;const A=i*1024*1024;return w.reduce((T,R)=>T+R.size,0)>A},[i,p]),L=g.useCallback(w=>{const A=w.target.files;if(A&&A.length>0){const E=Array.from(A),T=D(E),R=I(E);!T&&!R&&e([...s||[],...E])}},[D,I,e,s]);return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[r.jsx(Ue.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:n}),p&&!!s?.length&&r.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[r.jsx(v.DialNeutralButton,{label:u,iconBefore:r.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&r.jsx(v.DialPrimaryButton,{appearance:_.ButtonAppearance.Ghost,iconBefore:r.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:y}),C]})]}),s&&s.length>0&&r.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:h,onChange:L}),r.jsx(ps,{files:s,onChange:e,acceptTypes:h,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:D,getIsFileSizeError:I,getIsMultiFilesSizeError:j,...x})]})},vl=({icon:e,ariaLabel:t,size:n=_.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:o,iconClassName:i,caretIcon:l=r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:h,defaultOpen:u=!1,...m})=>{const C=n===_.ElementSize.Small,[x,b]=g.useState(u),y=p??x,N=C?"w-8 px-0":"w-10 px-0",D={[_.ElementSize.Small]:"size-5",[_.ElementSize.Standard]:"size-6",[_.ElementSize.Large]:"size-7"},I=j=>{b(j),h?.(j)};return r.jsx(O.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:y,onOpenChange:I,defaultOpen:u,children:r.jsxs("button",{type:"button","aria-label":t,disabled:s,className:S.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",C?"h-8 px-2":"h-10 px-2",c?void 0:N,o),children:[r.jsx(O.DialIcon,{icon:e,className:S.mergeClasses("flex items-center justify-center text-inherit",D[n],c&&"-mr-2",i,O.DIAL_KIT_CLASS.dropdownIcon)}),c&&r.jsxs("div",{className:S.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",O.DIAL_KIT_CLASS.dropdownIconCaret),children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),r.jsx(O.DialIcon,{icon:l,className:S.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",y&&"rotate-180")})]})]})})},Sl="application/octet-stream";function Il(e,t){if(!e||e.length===0)return[];const n=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!n)return[];const s=n.path||n.url||"",a=pr(s,!0),o=e.filter(c=>c!==n).map(c=>{const d=c.path||c.url||"",f=Nl(c.nodeType),p=f===v.DialFileNodeType.FOLDER,h=pr(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=pr(c.parentPath,!0),{...c,originalPath:d,path:h,parentPath:u,nodeType:f}}),i=new Map;o.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Dl(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===v.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===v.DialFileNodeType.ITEM&&(d.extension=jl(c.name),d.contentType=c.contentType||Sl,d.contentLength=c.contentLength||0),i.set(c.path,d)});const l=[];return i.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=i.get(f);p&&p.nodeType===v.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function pr(e,t){try{let n=decodeURIComponent(e);return t?n.endsWith("/")||(n+="/"):n.endsWith("/")&&(n=n.slice(0,-1)),n}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function Nl(e){return e.toUpperCase()==="FOLDER"?v.DialFileNodeType.FOLDER:v.DialFileNodeType.ITEM}function Dl(e){if(!e)return;const t=e.toUpperCase();return Object.values(v.DialFileResourceType).find(s=>s.toUpperCase()===t)}function jl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function Tl(e,t="Prompts",n="prompts/public/",s="root"){const a=Il(e,s);return[{id:s,name:t,path:n,parentPath:"",nodeType:v.DialFileNodeType.FOLDER,folderId:s,items:a}]}const hs=({locale:e,timeZone:t,date:n=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(n).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var ke=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(ke||{}),et=(e=>(e.Select="select",e.Radio="radio",e))(et||{}),pt=(e=>(e.Row="row",e.Column="column",e))(pt||{}),P=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(P||{});const ms={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"},gs=g.createContext(null);function Pe(){const e=g.useContext(gs);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function un(e,t){const n={...e,...t};return(e.properties||t.properties)&&(n.properties={...e.properties,...t.properties}),(e.required||t.required)&&(n.required=Array.from(new Set([...e.required??[],...t.required??[]]))),n}function q(e,t,n=0){if(n>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let o=t;for(const f of a)o=o?.[f];if(!o||typeof o!="object")return e;const{$ref:i,...l}=s,c=o;s={...c.$ref?q(c,t,n+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...o}=s;let i={};for(const l of a)i=un(i,q(l,t,n+1));s=un(i,o)}return s}function Yt(e){return e.map((t,n)=>({entry:t,index:n})).sort((t,n)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=n.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-n.index}).map(({entry:t})=>t)}function st(e){return e==null||e===""}function Fe(e){return e.type===P.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function tt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const Et=e=>`"${e}" is required`;function Xt(e,t){return e.type===P.Null?"null":e.$ref?q(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 Ce(e,t,n=0){if(n>15)return;const s=q(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const o=q({$ref:s.discriminator.mapping[a]},t);return{...Ce(o,t,n+1)??{},[s.discriminator.propertyName]:a}}}if(Fe(s)){if(s.properties){const a={};let o=!1;for(const[i,l]of Object.entries(s.properties)){const c=Ce(l,t,n+1);c!==void 0&&(a[i]=c,o=!0)}return o?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function De(e,t,n,s="",a=0){if(a>15)return[];const o=[],i=q(t,n);if(i.anyOf){const d=i.anyOf.filter(f=>f.type!==P.Null);return e!=null&&d.length===1?De(e,d[0],n,s,a+1):o}if(i.oneOf&&i.discriminator){const d=i.discriminator.propertyName,f=e?.[d];if(f&&i.discriminator.mapping[f]){const p={$ref:i.discriminator.mapping[f]},h=q(p,n);return De(e,h,n,s,a+1)}return o}if(i.type===P.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let d=0;d<e.length;d++){const f=De(e[d],i.items,n,`${s}[${d}]`,a+1);o.push(...f)}return o}if(!Fe(i))return o;const l=i.required??[],c=e;for(const d of l){const f=i.properties?.[d];if(f&&q(f,n).isHidden)continue;const p=s?`${s}.${d}`:d,h=c?.[d];if(st(h)){const u=f?.title??tt(d);o.push({path:p,message:Et(u)})}}if(c&&i.properties)for(const[d,f]of Object.entries(i.properties)){if(q(f,n).isHidden)continue;const p=s?`${s}.${d}`:d,h=c[d];if(h!=null){const u=De(h,f,n,p,a+1);o.push(...u)}}if(c&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const d=i.additionalProperties;for(const[f,p]of Object.entries(c)){const h=s?`${s}.${f}`:f,u=De(p,d,n,h,a+1);o.push(...u)}}return o}function ht(e,t,n){const s=q(t,n);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Fe(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!q(c,n).isHidden),o=a.length,i=e;return`${a.filter(([c])=>{const d=i?.[c];return d!=null&&d!==""}).length}/${o} fields`}return""}function xs(e,t,n){if(e==null){const s=t.findIndex(a=>a.type===P.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>q(a,n).type===P.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>q(a,n).type===P.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const o=q(a,n);return o.type===P.Number||o.type===P.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>q(a,n).type===P.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const o=q(t[a],n);if(o.discriminator&&o.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const o=q(t[a],n);if(Fe(o)||o.oneOf)return a}return 0}return 0}function bs(e,t,n){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${n+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${n+1}: ${a}`}return`Item ${n+1}`}function Jt(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case P.String:return"";case P.Boolean:return!1;case P.Array:return[];case P.Integer:case P.Number:return;default:return{}}}const Cs=[P.String,P.Number,P.Boolean,P.Null,P.Object,P.Array];function ys(e){return Array.isArray(e)?P.Array:typeof e=="object"&&e!==null?P.Object:typeof e=="boolean"?P.Boolean:typeof e=="number"?P.Number:e===null?P.Null:P.String}const wl={[P.String]:"",[P.Number]:0,[P.Boolean]:!1,[P.Null]:null,[P.Object]:{},[P.Array]:[]};function vs(e){return wl[e]}const It=({title:e,description:t,summary:n,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=g.useState(l),p=a===0,h="rounded border border-secondary",u=S.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=S.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return r.jsxs("div",{className:h,children:[r.jsxs("div",{className:u,onClick:()=>f(C=>!C),role:"button","aria-expanded":d,children:[r.jsx("span",{className:"shrink-0 text-secondary",children:d?r.jsx($.IconChevronDown,{size:16,stroke:2}):r.jsx($.IconChevronRight,{size:16,stroke:2})}),r.jsx("span",{className:S.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&r.jsx(Ue.DialInfoButton,{caption:t}),n&&r.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:n}),s>0?r.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[r.jsx(O.DialIcon,{icon:r.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):r.jsx(O.DialIcon,{icon:r.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),i&&r.jsx(Wt,{size:_.ElementSize.Small,onClick:C=>{C.stopPropagation(),i()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&r.jsx("div",{className:m,children:o})]})},Ss=({schema:e,value:t,onChange:n,path:s,level:a=0,required:o,label:i})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=Pe(),p=q(e,l),h=Fe(p),u=p.type===P.Array;if(h||u){const x=ht(t,p,l),b=De(t,p,l,s.join(".")),y=s.join("."),N=y+".",D=!f||d.has(y)||[...d].some(I=>I.startsWith(N));return r.jsx(It,{title:i??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:D?b.length:0,defaultExpanded:c,children:r.jsx(Ke,{schema:p,value:t,onChange:n,path:s,level:a+1,required:o})})}const C=(!f||d.has(s.join(".")))&&o&&st(t)?Et(i??"Field"):void 0;return r.jsx(v.DialFormItem,{label:i,required:o,description:p.description,error:C,children:r.jsx(Ke,{schema:p,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:!0})})},Pt=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i}=Pe(),l=q(e,o),c=Yt(Object.entries(l.properties??{}).filter(([,p])=>!q(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noConfigurableProperties}):r.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,h])=>{const m=q(h,o).title??h.title??tt(p),C=d.includes(p);return r.jsx(Ss,{schema:h,value:f[p],onChange:x=>n({...f,[p]:x}),path:[...s,p],level:a,required:C,label:m},p)})})},El=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=Pe(),d=Array.isArray(t)?t:[],f=e.items,[p,h]=g.useState(void 0);if(!f)return r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemSchema});const u=g.useMemo(()=>q(f,o),[f,o]),m=g.useMemo(()=>u.discriminator,[u]),C=g.useMemo(()=>m?.propertyName,[m]),x=g.useMemo(()=>m?Object.keys(m.mapping).map(D=>({value:D,label:D})):[],[m]),b=()=>{const D=p??x[0]?.value;let I;if(m&&D){const j=q({$ref:m.mapping[D]},o);I={...Ce(j,o)??{},[m.propertyName]:D}}else I=Ce(u,o)??Jt(u);n([...d,I])},y=D=>{n(d.filter((I,j)=>j!==D))},N=(D,I)=>{n(d.map((j,L)=>L===D?I:j))};return r.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemsYet}),d.map((D,I)=>{const j=bs(D,C,I),L=ht(D,u,o),w=De(D,u,o,`${s.join(".")}[${I}]`);return r.jsx(It,{title:j,level:a,summary:L,errorCount:w.length,onRemove:l?void 0:()=>y(I),defaultExpanded:c,removeItemAriaLabel:i.removeItemAriaLabel,children:r.jsx(Ke,{schema:f,value:D,onChange:A=>N(I,A),path:[...s,String(I)],level:a+1})},I)}),!l&&r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Me,{options:x,value:p??x[0]?.value,placeholder:i.selectTypeToAdd,onChange:D=>{const I=typeof D=="string"?D:D[0];h(I)}})}),r.jsx(v.DialGhostButton,{label:i.addItem,iconBefore:r.jsx($.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},Ol=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Pe(),c=g.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,y=Object.keys(b).map(j=>({value:j,label:j})),N=typeof t=="object"&&t!==null?t[x]:void 0,D=N?q({$ref:b[N]},o):void 0,I=j=>{const L=q({$ref:b[j]},o),w=Ce(L,o)??{};n({...w,[x]:j})};if(e.discriminatorDisplay===et.Radio){const j=e.discriminatorOrientation===pt.Row,L=N?(()=>{const w=q({$ref:b[N]},o),{[x]:A,...E}=w.properties??{};return{...w,properties:E}})():void 0;return j?r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(b).map(w=>{const A=q({$ref:b[w]},o);return r.jsx(O.DialRadioButton,{name:c,value:w,inputId:`${c}-${w}`,label:A.title??w,checked:N===w,disabled:l,onChange:()=>I(w)},w)})}),L&&r.jsx(Pt,{schema:L,value:t,onChange:n,path:s,level:a})]}):r.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(w=>{const A=q({$ref:b[w]},o),E=N===w,{[x]:T,...R}=A.properties??{},B={...A,properties:R};return r.jsxs("div",{className:"flex flex-col",children:[r.jsx(O.DialRadioButton,{name:c,value:w,inputId:`${c}-${w}`,label:A.title??w,checked:E,disabled:l,onChange:()=>I(w)}),E&&r.jsx("div",{className:"ml-6 mt-2",children:r.jsx(Pt,{schema:B,value:t,onChange:n,path:s,level:a})})]},w)})})}return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Me,{options:y,value:N,placeholder:i.selectTypePlaceholder,disabled:l,onChange:j=>{const L=typeof j=="string"?j:j[0];L&&I(L)}})}),D&&r.jsx("div",{className:"pl-3",children:r.jsx(Pt,{schema:D,value:t,onChange:n,path:s,level:a})})]})}const f=e.oneOf??[],h=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(q(f[x],o).required?.every(y=>y in t))return x}return 0})(),u=x=>{const b=q(f[x],o),y=Ce(b,o);n(y??null)},m=f[h];if(e.discriminatorDisplay===et.Radio)return r.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const y=q(x,o),N=Xt(x,o)??`Option ${b+1}`,D=h===b;return r.jsxs("div",{className:"flex flex-col",children:[r.jsx(O.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:N,checked:D,disabled:l,onChange:()=>u(b)}),D&&y&&r.jsx("div",{className:"ml-6 mt-2",children:r.jsx(Ke,{schema:y,value:t,onChange:n,path:s,level:a})})]},b)})});const C=f.map((x,b)=>{const y=q(x,o);return{value:String(b),label:y.title??`Option ${b+1}`}});return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Me,{options:C,value:String(h),disabled:l,onChange:x=>{const b=typeof x=="string"?x:x[0];u(Number(b))}})}),m&&r.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:r.jsx(Ke,{schema:m,value:t,onChange:n,path:s,level:a})})]})},Al=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,readonly:i=!1}=Pe(),l=e.anyOf??[],c=l.map((m,C)=>({value:String(C),label:Xt(m,o)})),d=xs(t,l,o),f=l[d],h=q(f,o).type===P.Null,u=m=>{const C=q(l[m],o);if(C.type===P.Null){n(null);return}const x=Ce(C,o);if(x!==void 0){n(x);return}switch(C.type){case P.Array:n([]);break;case P.String:n("");break;case P.Boolean:n(!1);break;case P.Integer:case P.Number:n(0);break;default:n({});break}};return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("div",{className:"flex-1 max-w-[280px]",children:r.jsx(Me,{options:c,value:String(d),disabled:i,onChange:m=>{const C=typeof m=="string"?m:m[0];u(Number(C))}})}),!h&&f&&r.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:r.jsx(Ke,{schema:f,value:t,onChange:n,path:s,level:a})})]})},Is=({schema:e,value:t,onChange:n,invalid:s})=>{const a=g.useId(),{texts:o,readonly:i=!1,inputClassName:l,acceptableResourceTypes:c}=Pe(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===P.String||e.type===void 0)){const h=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(C=>{const x=String(C);return{value:x,label:x}}):[]});return r.jsx(Me,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>n(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder,className:l})}if(d)return r.jsx(v.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===et.Radio){const h=e.enumOrientation===pt.Row;return r.jsx("div",{role:"radiogroup",className:h?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(u=>{const m=String(u);return r.jsx(O.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:i,onChange:C=>n(C)},m)})})}if(f){const h=e.enum.map(u=>({value:String(u),label:String(u)}));return r.jsx(Me,{options:h,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>n(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder})}switch(e.type){case P.Boolean:return r.jsx(Ue.DialSwitch,{switchId:a,isOn:!!t,disabled:i,onChange:h=>n(h)});case P.Integer:return r.jsx(vr,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h!==void 0?Number(h):void 0),placeholder:o.integerInputPlaceholder,containerClassName:l});case P.Number:return r.jsx(vr,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h!==void 0?Number(h):void 0),placeholder:o.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?r.jsx(as,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l}):r.jsx(v.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:h=>n(h??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l})}},Rr=({value:e,onChange:t,theme:n=wt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:o}=Pe(),[i,l]=g.useState(null),[c,d]=g.useState(()=>JSON.stringify(e,null,2));g.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-eAV7SaKu.cjs")).then(h=>{l(()=>h.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=h=>{const u=h??"";d(u);try{t(JSON.parse(u))}catch{}};return r.jsxs("div",{children:[r.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&r.jsx(i,{value:c,currentTheme:n,onChange:p,options:{readOnly:a}})}),r.jsx(v.DialErrorText,{text:f?o.invalidJsonError:void 0})]})},fn=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Ns=e=>!!(e.oneOf||e.anyOf||e.type===P.Array||Fe(e)),_l={[P.String]:"entryTypeString",[P.Number]:"entryTypeNumber",[P.Boolean]:"entryTypeBoolean",[P.Null]:"entryTypeNull",[P.Object]:"entryTypeObject",[P.Array]:"entryTypeArray"},Ll=({pairId:e,pairKey:t,pairValue:n,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:o,onKeyChange:i,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:h,readonly:u=!1,inputClassName:m})=>{const{rootSchema:C,texts:x,defaultExpanded:b=!0,touchedPaths:y=new Set,markTouched:N=()=>{},skipUntouched:D=!1}=Pe(),[I,j]=g.useState(t),L=Ns(s),[w,A]=g.useState(()=>ys(n)),E=a&&(w===P.Object||w===P.Array),T=a&&w===P.Null,R=L||E,B=[...p,e,"key"].join("."),Q=(!D||y.has(B))&&t==="",G=g.useCallback(re=>{l(vs(re)),A(re)},[l]),F=g.useMemo(()=>Cs.map(re=>({value:re,label:x[_l[re]]})),[x]),V=g.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),Z=`${e}-key-error`,U=a&&w===P.Boolean,le=r.jsxs("div",{className:"flex gap-2 items-start",children:[r.jsxs("div",{className:R?"flex-1 min-w-0":"w-2/5 min-w-0",children:[r.jsx(v.DialInput,{value:I,disabled:u,invalid:Q,"aria-describedby":Q?Z:void 0,onChange:re=>j(re??""),onBlur:()=>{N(B),I!==t&&i(I)},placeholder:d,containerClassName:m}),r.jsx(v.DialErrorText,{id:Z,text:Q?`${x.keyColumnHeader} is required`:void 0})]}),!L&&!E&&r.jsx("div",{className:"flex-1 min-w-0",children:T?r.jsx(v.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):U?r.jsx(Me,{options:V,value:n?"true":"false",disabled:u,onChange:re=>{const oe=typeof re=="string"?re:re[0];oe&&l(oe==="true")}}):r.jsx(Is,{schema:a?{type:w}:s,value:n,onChange:l})}),a&&r.jsx("div",{className:"w-28 shrink-0",children:r.jsx(_.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:r.jsx(Me,{options:F,value:w,disabled:u,onChange:re=>{const oe=typeof re=="string"?re:re[0];oe&&G(oe)}})})}),!u&&r.jsx(Wt,{size:_.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!R)return le;if(E)return r.jsxs("div",{className:"flex flex-col gap-2",children:[le,r.jsx(Rr,{value:n,onChange:l,theme:o},w)]});const X=[...p,t],J=ht(n,s,C),ee=De(n,s,C,X.join("."));return r.jsxs("div",{className:"flex flex-col gap-2",children:[le,r.jsx(It,{title:t,level:h,summary:J,errorCount:ee.length+(Q?1:0),defaultExpanded:b,children:r.jsx(Ke,{schema:s,value:n,onChange:l,path:X,level:h+1})})]})},kl=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=Pe(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?q(e.additionalProperties,o):{type:"string"},h=Ns(p),[u,m]=g.useState(()=>Object.entries(t??{}).map(([I,j])=>fn(I,j))),C=I=>Object.fromEntries(I.filter(j=>j.key!=="").map(j=>[j.key,j.value])),x=(I,j)=>{const L=u.map((w,A)=>A===I?{...w,key:j}:w);m(L),n(C(L))},b=(I,j)=>{const L=u.map((w,A)=>A===I?{...w,value:j}:w);m(L),n(C(L))},y=()=>h?Ce(p,o)??Jt(p):"",N=()=>{m(I=>[...I,fn("",y())])},D=I=>{const j=u.filter((L,w)=>w!==I);m(j),n(C(j))};return r.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&r.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noFieldsYet}),u.length>0&&!h&&r.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[r.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:i.keyColumnHeader}),r.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:i.valueColumnHeader}),f&&r.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:i.typeColumnHeader})]}),u.map((I,j)=>r.jsx(Ll,{pairId:I.id,pairKey:I.key,pairValue:I.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:L=>x(j,L),onValueChange:L=>b(j,L),onRemove:()=>D(j),keyInputPlaceholder:i.keyInputPlaceholder,removeFieldAriaLabel:i.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},I.id)),!l&&r.jsx("div",{className:"pt-1",children:r.jsx(v.DialGhostButton,{label:i.addField,iconBefore:r.jsx($.IconPlus,{size:16,stroke:2}),onClick:N})})]})},Ke=({schema:e,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:i=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:h}=Pe(),u=q(e,l),m=b=>{d(s.join(".")),n(b)},C=!p||f.has(s.join("."));let x;if(u.oneOf)x=r.jsx(Ol,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==P.Object)x=r.jsx(Al,{schema:u,value:t,onChange:m,path:s,level:a});else if(Fe(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,y=!u.properties||Object.keys(u.properties).length===0;b&&y?x=r.jsx(kl,{schema:u,value:t,onChange:m,path:s,level:a}):y&&u.additionalProperties!==!1?x=r.jsx(Rr,{value:t,onChange:m,theme:h}):x=r.jsx(Pt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===P.Array)x=r.jsx(El,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=C&&o&&st(t),y=!i&&b?Et(u.title??"Field"):void 0;x=r.jsxs(r.Fragment,{children:[r.jsx(Is,{schema:u,value:t,onChange:m,invalid:b}),r.jsx(v.DialErrorText,{text:y})]})}return c?c(s,u,x):x},Rl=({schema:e,defaultValue:t,texts:n,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=ke.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:h=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const C=g.useMemo(()=>({...ms,...n}),[n]),x=g.useMemo(()=>t||(Ce(e,e)??{}),[]),[b,y]=g.useState(x),[N,D]=g.useState(new Set),I=g.useCallback(T=>{D(R=>R.has(T)?R:new Set([...R,T]))},[]);g.useEffect(()=>{f?.(x)},[]);const j=(T,R)=>{const B={...b,[T]:R};y(B),c?.(B),d?.(T,R)},L=new Set(Object.keys(e.properties??{})),w=Object.keys(b).filter(T=>!L.has(T)),A=Yt(Object.entries(e.properties??{}).filter(([,T])=>!q(T,e).isHidden)),E=e.required??[];return r.jsx(gs.Provider,{value:{rootSchema:e,texts:C,readonly:a,defaultExpanded:o,inputClassName:i,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:I,skipUntouched:h},children:r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-4",s),children:[A.map(([T,R])=>{const B=q(R,e),K=B.title??R.title??tt(T),Q=E.includes(T),G=b[T];if(l===ke.Flat)return r.jsx(Ss,{schema:R,value:G,onChange:U=>j(T,U),path:[T],level:0,required:Q,label:K},T);if(l===ke.FlatSections)return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:"dial-small-semi-text text-primary",children:K}),r.jsx(Ke,{schema:R,value:G,onChange:U=>j(T,U),path:[T],level:0,required:Q})]},T);const F=De(G,B,e,T),V=T+".",Z=!h||N.has(T)||[...N].some(U=>U.startsWith(V));return r.jsx(It,{title:K,description:B.description,level:0,defaultExpanded:o,errorCount:Z?Q&&st(G)?Math.max(F.length,1):F.length:0,children:r.jsx(Ke,{schema:R,value:G,onChange:U=>j(T,U),path:[T],level:1,required:Q})},T)}),w.map(T=>{const R=tt(T),B=r.jsx(Rr,{value:b[T],onChange:K=>j(T,K),theme:u});return l===ke.Sections?r.jsx(It,{title:R,level:0,defaultExpanded:o,children:B},T):r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:"dial-small-semi-text text-primary",children:R}),B]},T)})]})})},qe=({text:e,className:t,variant:n=v.CaptionType.Description,...s})=>e?r.jsx("span",{...s,role:"alert",className:S.mergeClasses("dial-tiny-text",n===v.CaptionType.Error?"text-error":"text-secondary",t,O.DIAL_KIT_CLASS.captionText,n===v.CaptionType.Error&&O.DIAL_KIT_CLASS.errorText),children:e}):null,Be=({...e})=>r.jsx(qe,{...e,variant:v.CaptionType.Error}),Ds=g.createContext(null),ze=()=>{const e=g.useContext(Ds);if(!e)throw new Error("useSchemaContext must be used inside SchemaRenderer");return e},Nt=(e,t=new Set,n=!1,s=!1)=>{if(!n||t.has(e))return!0;if(!s)return!1;const a=e+".";return[...t].some(o=>o.startsWith(a))},Ml="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",Pl={[_.ElementSize.Small]:"size-[24px]",[_.ElementSize.Standard]:"size-[40px]",[_.ElementSize.Large]:"size-[48px]"},Fl=({icon:e,onClick:t,disabled:n,size:s=_.ElementSize.Standard,className:a})=>r.jsx("div",{className:S.mergeClasses("border-l border-tertiary",Pl[s]),children:r.jsx(k.IconButton,{className:S.mergeClasses(Ml,s===_.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:n,size:s})}),Bl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],js=(e,t,n,s)=>{if((t==="number"||n!==void 0||s!==void 0)&&!Bl.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((n!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const o=e.currentTarget.value,i=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??i,c=o.slice(0,i)+e.key+o.slice(l),d=parseFloat(c);if(!isNaN(d)){if(n!==void 0&&d<+n){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},Ts={[_.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[_.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[_.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ae=({labelProps:e,error:t,caption:n,id:s,containerClassName:a,size:o=_.ElementSize.Standard,...i})=>r.jsxs("div",{className:S.mergeClasses("flex flex-col",Ts[o].stackGap,a),children:[e&&r.jsx(k.Label,{...e,htmlFor:s}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(ws,{id:s,size:o,...i}),r.jsx(Be,{text:t}),!t&&r.jsx(qe,{text:n})]})]}),ws=({invalid:e,disabled:t,prefix:n,className:s,postfix:a,children:o,iconBefore:i,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:h,min:u,onChange:m,max:C,inputButtonProps:x,wrapperRef:b,size:y=_.ElementSize.Standard,...N})=>{const D=Ts[y],I=g.useRef(null),j=ae.useMergeRefs([f,I]),L=d==="number"||u!==void 0||C!==void 0;g.useEffect(()=>{const T=I.current;if(!T||!L||t)return;const R=B=>{B.preventDefault()};return T.addEventListener("wheel",R,{passive:!1}),()=>{T.removeEventListener("wheel",R)}},[t,L,d]);const w=T=>{js(T,d,u,C)},A=T=>{const R=T.currentTarget.value;if(L&&R!==""){const B=parseFloat(R);if(isNaN(B)&&R!=="-"&&R!=="."||!isNaN(B)&&(u!==void 0&&B<+u||C!==void 0&&B>+C))return}m?.(R||void 0)},E=()=>r.jsxs("div",{ref:b,className:S.mergeClasses("dial-kit-input flex flex-row items-center justify-between",D.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!n&&D.paddingStart,!x&&D.paddingEnd,c),"aria-label":"input-container",children:[n&&r.jsx("div",{className:"border-r border-secondary",children:r.jsx(ws,{wrapperClassName:"!rounded-r-none",className:"truncate",value:n,disabled:!0,size:y,id:`${n}_textBefore`})}),r.jsx(O.DialIcon,{icon:i}),o,r.jsx("input",{ref:j,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:S.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:w,min:u,disabled:t,max:C,...N}),a&&r.jsxs("p",{className:S.mergeClasses("text-secondary",D.postfixText),children:[" ",a]}),r.jsx(O.DialIcon,{icon:l}),x&&r.jsx(Fl,{size:y,...x,disabled:t})]});return t&&d!=="password"?r.jsx(k.Tooltip,{tooltip:h||p,children:E()}):E()},Es=({availableWidth:e,tagWidths:t,overflowChipWidth:n,gap:s})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+s;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+n>e;)o--,a-=t[o]+s;return o};var rt=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(rt||{});const zl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",$l={[rt.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[rt.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Hl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Kl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Re=({label:e,icon:t,appearance:n=rt.Outlined,selected:s=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...h})=>{const u=n===rt.Selectable,m=!!d&&!a,C=o&&!!f&&!a,x=u&&s,b=y=>{p?.(y),!(!m||y.defaultPrevented)&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.currentTarget.click())};return r.jsxs("span",{...h,role:m?"button":h.role,tabIndex:m?0:h.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:S.mergeClasses(zl,x?"dial-tiny-semi-text":"dial-tiny-text",$l[n][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Hl,Kl],l,O.DIAL_KIT_CLASS.tag),children:[t&&r.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),r.jsx("span",{className:"truncate",title:c??e,children:e}),C&&r.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:_.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:y=>{y.stopPropagation(),f?.(y)}})]})},$t="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",vt=({options:e,selectedValues:t,handleRemoveTag:n,tagClassName:s})=>r.jsx(r.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return r.jsx(Re,{label:o?.label??a,closable:!!n,onRemove:i=>n?.(i,a),icon:o?.icon,className:S.mergeClasses($t,s)},a)})}),Vl=8,Gl=e=>e.stopPropagation(),Ul=e=>{e.key!=="Escape"&&e.stopPropagation()},Zl=({options:e,selectedValues:t,handleRemoveTag:n})=>{const s=g.useRef(null),a=g.useRef(null),[o,i]=g.useState(null),l=g.useCallback(()=>{const p=s.current,h=a.current;if(!p||!h)return;const u=Array.from(h.children,C=>C.offsetWidth),m=u.pop()??0;i(Es({tagWidths:u,overflowChipWidth:m,availableWidth:p.clientWidth,gap:Vl}))},[]);g.useLayoutEffect(()=>{l()},[l,e,t]),g.useLayoutEffect(()=>{const p=s.current;return p?O.observeElementSize(p,l):void 0},[l]);const c=o??t.length,d=t.slice(0,c),f=t.slice(c);return r.jsxs("div",{ref:s,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[r.jsx(vt,{options:e,selectedValues:d,handleRemoveTag:n,tagClassName:"min-w-0"}),f.length>0&&r.jsx(k.InteractiveTooltip,{asChild:!0,placement:k.TooltipPlacement.Bottom,content:r.jsx("div",{className:"flex flex-wrap gap-2",onClick:Gl,onKeyDown:Ul,children:r.jsx(vt,{options:e,selectedValues:f,handleRemoveTag:n})}),children:r.jsx(Re,{label:`+${f.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${f.length} more selected: ${f.map(p=>e.find(h=>h.value===p)?.label??p).join(", ")}`,title:"",className:S.mergeClasses($t,"shrink-0")})}),r.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:[r.jsx(vt,{options:e,selectedValues:t,handleRemoveTag:n,tagClassName:"shrink-0"}),r.jsx(Re,{label:`+${t.length}`,className:S.mergeClasses($t,"shrink-0")})]})]})},Wl=S.mergeClasses("w-full flex flex-col"),ql=k.overlayItemClassName,Yl="!max-w-[var(--reference-width)]",Xl=S.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Jl=k.overlayGap,Ql=k.overlaySubMenuListClassName,ec=r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),tc="text-secondary transition-transform",rc=8,nc=r.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),sc=r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),ac=r.jsx(k.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),oc=({opt:e,selectedValues:t,mark:n=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=O.useSubMenuFloating(Jl,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),h=r.jsx(k.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:ec,...d()});return r.jsxs(ae.FloatingNode,{id:o,children:[e.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:h}):h,a&&r.jsx(O.SubMenuPanel,{refs:i,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Ql,children:e.children.map(u=>{const m=r.jsx(k.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:n,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return r.jsx(g.Fragment,{children:u.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},Ve=({options:e,multiple:t=!1,id:n,value:s,defaultValue:a,size:o=_.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:h,searchable:u=!1,searchSize:m=_.ElementSize.Standard,searchPlaceholder:C,selectAll:x=!1,invalid:b,selectAllLabel:y="Select all",collapseTagOverflow:N=!1,selectedOptionMark:D=k.MenuItemMark.Tint,emptyStateTitle:I="No options available",emptyStateDescription:j,emptyStateIcon:L,disabled:w=!1,className:A,fieldClassName:E,listClassName:T,closable:R=!1,header:B,footer:K,onClose:Q,onChange:G,dismissRef:F,onFooterClick:V,open:Z,onOpenChange:U,onSearchQueryChange:le,customMultiSelectTagsRenderer:X})=>{const J=g.useId(),ee=n||J,re=`list-${ee}`,oe=o===_.ElementSize.Small,[ce,he]=g.useState(!1),Se=Z!==void 0,be=Se?!!Z:ce,W=g.useCallback(z=>{Se||he(z),U?.(z)},[Se,U]),[te,Te]=g.useState(""),Le=g.useCallback(z=>{z!==te&&(Te(z||""),le?.(z||""))},[le,te]),ge=s!==void 0,[$e,Ye]=g.useState(a),me=ge?s:$e,Y=g.useMemo(()=>t?Array.isArray(me)?me:[]:typeof me=="string"?[me]:[],[me,t]),ue=g.useMemo(()=>{const z=te.trim().toLowerCase();return z?e.filter(pe=>pe.label.toLowerCase().includes(z)):e},[e,te]);g.useEffect(()=>{be||Le("")},[be,Le]);const fe=g.useCallback(z=>{ge||Ye(z),G?.(z)},[ge,G]),xt=g.useCallback(z=>{if(t){const pe=new Set(Y);pe.has(z)?pe.delete(z):pe.add(z),fe(Array.from(pe));return}fe(z),W(!1)},[t,fe,W,Y]),ot=g.useCallback((z,pe)=>{if(z.stopPropagation(),!t){fe("");return}const Ot=Y.filter(aa=>aa!==pe);fe(Ot)},[t,Y,fe]),ve=g.useMemo(()=>ue.filter(z=>!z.disabled),[ue]),Ze=g.useMemo(()=>ve.filter(z=>Y.includes(z.value)).length,[ve,Y]),{allSelectedInFiltered:ye,someSelectedInFiltered:Qt}=g.useMemo(()=>{const z=ve.length>0&&Ze===ve.length;return{allSelectedInFiltered:z,someSelectedInFiltered:Ze>0&&!z}},[ve,Ze]),it=g.useCallback(()=>{if(!(!t||ve.length===0))if(ye){const z=new Set(ve.map(pe=>pe.value));fe(Y.filter(pe=>!z.has(pe)))}else{const z=new Set(Y);ve.forEach(pe=>z.add(pe.value)),fe(Array.from(z))}},[ye,t,ve,Y,fe]),Xe=Y.length>0,M=!t&&Xe?Y[0]:void 0,ie=g.useMemo(()=>M?e.find(z=>z.value===M)??e.flatMap(z=>z.children??[]).find(z=>z.value===M):void 0,[e,M]),Ie=ie?i?`${i} ${ie.label}`:ie.label:void 0,er=O.useIsMobileScreen(),tr=t&&N&&!X&&!er,bt=g.useMemo(()=>t?Xe?tr?r.jsx(Zl,{options:e,selectedValues:Y,handleRemoveTag:ot}):r.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:X?.(e,Y,ot)??r.jsx(vt,{options:e,selectedValues:Y,handleRemoveTag:ot})}):null:!ie||!ie.labelNode&&!ie.description?null:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[r.jsx(k.EllipsisTooltip,{text:ie.labelNode??Ie}),ie.description&&r.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:ie.description})]}),[tr,X,ot,Xe,t,e,Ie,Y,ie]),ea=t||bt?"":Ie||(l&&s?l:""),ta=typeof d?.label=="string"?d.label:void 0,ra=bt?[_.resolveAccessibleName(h,ta),t?Y.map(z=>e.find(pe=>pe.value===z)?.label??z).join(", "):Ie].filter(Boolean).join(", ")||void 0:_.resolveAccessibleName(h);g.useImperativeHandle(F,()=>({dismiss:()=>{W(!1)}}));const na=g.useCallback(z=>{w||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),be||W(!0))},[w,be,W]),sa=()=>r.jsxs("div",{id:re,role:"listbox","aria-multiselectable":t||void 0,className:Wl,children:[B&&r.jsx(r.Fragment,{children:typeof B=="function"?B():B}),(u||R)&&(e.length>rc||!!te)&&r.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&r.jsx(Ae,{id:`search-${ee}`,size:m,placeholder:C,"aria-label":C||"Search options",onChange:z=>Le(z),value:te,iconBefore:nc,containerClassName:"w-full"}),R&&r.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:_.ElementSize.Small,icon:sc,onClick:z=>{Q?.(z),W(!1)}})]}),t&&x&&ve.length>0&&r.jsx("div",{className:S.mergeClasses(ql,"mt-2"),children:r.jsx(k.Checkbox,{id:`${ee}-selectAll`,labelProps:{label:y},isSelected:ye,isIndeterminate:Qt,onChange:it})}),r.jsx("div",{role:"none",className:Xl,children:ue.length===0?r.jsx("div",{className:"px-2 py-3",children:r.jsx(O.DialNoDataContent,{icon:L??ac,title:I,description:j})}):ue.map(z=>{const pe=Y.includes(z.value);if(z.children?.length)return r.jsx(oc,{opt:z,selectedValues:Y,mark:t?k.MenuItemMark.Checkbox:D,onSelect:xt},z.value);const Ot=t?r.jsx(k.MenuItem,{id:`${ee}-${z.value}`,role:"option","aria-selected":pe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:k.MenuItemMark.Checkbox,selected:pe,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>xt(z.value)}):r.jsx(k.MenuItem,{role:"option","aria-selected":pe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:D,selected:pe,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&xt(z.value)});return r.jsx(g.Fragment,{children:z.interactiveTooltip?r.jsx(k.InteractiveTooltip,{asChild:!0,placement:z.interactiveTooltip.placement,content:z.interactiveTooltip.content,contentClassName:z.interactiveTooltip.contentClassName,children:Ot}):Ot},z.value)})}),K&&r.jsx("div",{onClick:z=>{V?.(z),V&&W(!1)},children:typeof K=="function"?K():K})]});return r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-2",A,O.DIAL_KIT_CLASS.select),children:[d&&r.jsx(k.Label,{...d,htmlFor:ee}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(k.Dropdown,{open:be,onOpenChange:W,disabled:w,closable:R,onClose:Q,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:S.mergeClasses(Yl,T),className:"w-full",renderOverlay:sa,children:r.jsx(Ae,{id:ee,size:o,disabled:w,invalid:b,value:ea,placeholder:bt?void 0:c,readOnly:!0,iconBefore:t?void 0:ie?.icon,iconAfter:r.jsx($.IconChevronDown,{size:oe?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses(tc,be&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":be,"aria-controls":re,"aria-autocomplete":"none","aria-label":ra,containerClassName:"w-full",wrapperClassName:S.mergeClasses(!w&&"cursor-pointer",t&&Xe&&!tr&&["!h-auto flex-wrap py-2",oe?"min-h-[24px]":"min-h-[40px]"],E),className:S.mergeClasses("cursor-pointer",bt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:na,children:bt})}),r.jsx(Be,{text:f}),!f&&r.jsx(qe,{text:p})]})]})},pn={[P.Array]:[],[P.String]:"",[P.Boolean]:!1,[P.Integer]:0,[P.Number]:0},ic=({schema:e,value:t,onChange:n,path:s,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:c=!1}=ze(),d=e.anyOf??[],f=xs(t,d,i),p=d[f],h=!p||q(p,i).type===P.Null,u=m=>{const C=q(d[m],i);if(C.type===P.Null){n(null);return}const x=Ce(C,i);if(x!==void 0){n(x);return}const b=typeof C.type=="string"?C.type:"";n(b in pn?pn[b]:{})};return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:o??l.selectTypePlaceholder,options:d.map((m,C)=>({value:String(C),label:Xt(m,i)})),value:String(f),disabled:c,onChange:m=>u(Number(typeof m=="string"?m:m[0])),className:"max-w-[280px]"}),!h&&r.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:r.jsx(Ge,{schema:p,value:t,onChange:n,path:s,level:a,ariaLabel:o})})]})},at=({label:e,variant:t,appearance:n=_.ButtonAppearance.Solid,size:s=_.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:h,disabled:u,...m})=>{const C=S.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,n),s===_.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===_.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===_.ElementSize.Small&&"dial-kit-base-button-small",n!==_.ButtonAppearance.Link&&(s===_.ElementSize.Small?"px-2":"px-4"),s!==_.ElementSize.Small&&n!==_.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=_.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),y=r.jsxs(r.Fragment,{children:[r.jsx(O.DialIcon,{icon:l}),e&&r.jsx("span",{className:o,children:e}),r.jsx(O.DialIcon,{icon:i})]}),N=m,D=f!==void 0?r.jsx("a",{...N,href:u?void 0:f,target:p,rel:h??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:N.tabIndex,onClick:u?void 0:N.onClick,className:C,"aria-label":b,children:y}):r.jsx("button",{...m,...k.getDisabledButtonProps(u,d,m.onClick),type:c,className:C,"aria-label":b,children:y});return d?r.jsx(k.Tooltip,{asChild:!0,...d,children:D}):D},Mr=(e,t)=>({appearance:s,...a})=>r.jsx(at,{...a,variant:e,appearance:s||t}),Pr=(e,t)=>({variant:s,...a})=>r.jsx(at,{...a,variant:s||t,appearance:e}),Os=Mr(_.ButtonVariant.Primary,_.ButtonAppearance.Solid),Fr=Mr(_.ButtonVariant.Neutral,_.ButtonAppearance.Solid),lc=Mr(_.ButtonVariant.Danger,_.ButtonAppearance.Solid),dt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},cc=r.jsx($.IconSparkles,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),dc=({appearance:e=_.ButtonAppearance.Outlined,iconBefore:t=cc,iconAfter:n,style:s,...a})=>{const o=`dial-kit-starter-gradient-${g.useId().replace(/[^\w-]/g,"")}`,i=r.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:r.jsx("defs",{children:r.jsxs("linearGradient",{id:o,x1:dt.x1,y1:dt.y1,x2:dt.x2,y2:dt.y2,gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:dt.from}),r.jsx("stop",{offset:"1",stopColor:dt.to})]})})}),l=c=>r.jsxs(r.Fragment,{children:[i,c]});return r.jsx(at,{...a,variant:_.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:n&&!t?l(n):n,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...s}})},uc=Pr(_.ButtonAppearance.Link,_.ButtonVariant.Primary),Br=Pr(_.ButtonAppearance.Ghost,_.ButtonVariant.Primary),fc=Pr(_.ButtonAppearance.Outlined,_.ButtonVariant.Neutral),Dt=({title:e,description:t,summary:n,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=g.useState(l),p=g.useId(),h=a===0;return r.jsxs("div",{className:S.mergeClasses("flex flex-col border border-tertiary",h?"rounded-xl bg-layer-raised":"rounded-lg",O.DIAL_KIT_CLASS.schemaRendererSection),children:[r.jsxs("div",{className:S.mergeClasses("flex items-center gap-2",h?"px-4 py-3":"px-3 py-2"),children:[r.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":d?p:void 0,onClick:()=>f(u=>!u),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-left text-primary focus-visible:outline focus-visible:outline-focus",children:[r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("shrink-0 text-secondary transition-transform",!d&&"-rotate-90")}),r.jsx("span",{className:S.mergeClasses("truncate",h?"dial-small-semi-text":"dial-small-text"),children:e})]}),r.jsx(k.InfoButton,{caption:t}),n&&r.jsx("span",{className:"dial-tiny-text whitespace-nowrap text-secondary",children:n}),s>0?r.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap dial-tiny-text text-error",children:[r.jsx($.IconAlertTriangle,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0"}),s," error",s>1?"s":""]}):r.jsx($.IconCheck,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"shrink-0 text-success"}),i&&r.jsx(k.DangerIconButton,{size:_.ElementSize.Small,icon:r.jsx($.IconTrash,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":c,onClick:i,className:"shrink-0"})]}),d&&r.jsx("div",{id:p,className:S.mergeClasses("border-t border-tertiary",h?"p-4":"p-3"),children:o})]})},pc=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=ze(),[d,f]=g.useState(),p=Array.isArray(t)?t:[],h=e.items;if(!h)return r.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const u=q(h,o),m=u.discriminator,C=m?Object.keys(m.mapping).map(D=>({value:D,label:D})):[],x=d??C[0]?.value,b=()=>{let D;if(m&&x){const I=q({$ref:m.mapping[x]},o);D={...Ce(I,o)??{},[m.propertyName]:x}}else D=Ce(u,o)??Jt(u);n([...p,D])},y=D=>{n(p.filter((I,j)=>j!==D))},N=(D,I)=>{n(p.map((j,L)=>L===D?I:j))};return r.jsxs("div",{className:"flex flex-col gap-3",children:[p.length===0&&r.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),p.map((D,I)=>{const j=bs(D,m?.propertyName,I),L=De(D,u,o,`${s.join(".")}[${I}]`);return r.jsx(Dt,{title:j,level:a,summary:ht(D,u,o),errorCount:L.length,onRemove:l?void 0:()=>y(I),defaultExpanded:c,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${j}`,children:r.jsx(Ge,{schema:h,value:D,onChange:w=>N(I,w),path:[...s,String(I)],level:a+1,ariaLabel:j})},I)}),!l&&r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[C.length>0&&r.jsx(Ve,{ariaLabel:i.selectTypeToAdd,options:C,value:x,placeholder:i.selectTypeToAdd,onChange:D=>f(typeof D=="string"?D:D[0]),className:"max-w-[280px] flex-1"}),r.jsx(Br,{label:i.addItem,iconBefore:r.jsx($.IconPlus,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:b})]})]})};var zr=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(zr||{});const hn={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},hc=e=>typeof e=="boolean"?hn[e?"both":"none"]:hn[e],As=({className:e="",value:t,onChange:n,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,invalid:d,...f})=>{const p=S.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d&&"dial-kit-input-error",f.disabled&&"dial-kit-input-disable",hc(o),e);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",a),children:[i&&r.jsx(k.Label,{...i,htmlFor:c}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("textarea",{id:c,value:t||"",className:p,onChange:h=>n?.(h.currentTarget.value),...f}),r.jsx(Be,{text:s}),!s&&r.jsx(qe,{text:l})]})]})},mn=e=>{try{return JSON.parse(e),!0}catch{return!1}},$r=({value:e,onChange:t,id:n,ariaLabel:s})=>{const{readonly:a,texts:o}=ze(),[i,l]=g.useState(()=>JSON.stringify(e,null,2)??""),c=!mn(i),d=f=>{l(f),mn(f)&&t(JSON.parse(f))};return r.jsx(As,{id:n,"aria-label":s,value:i,onChange:d,readOnly:a,invalid:c,error:c?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:zr.Vertical,className:"font-mono !whitespace-pre"})},mc=/^0+\.(\d+)?$/,gc=/^0+/,xc=[".","-","+","e","E"],gn=e=>!e||e==="-"?e:String(e).match(mc)?String(e).replace(gc,"0"):Number(e),Hr=({integer:e,onChange:t,min:n,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=d=>{if(e&&xc.includes(d.key)){d.preventDefault();return}js(d,"number",n,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const h=d.currentTarget,u=h.selectionStart??0,m=h.selectionEnd??0,C=h.value.slice(0,u)+p+h.value.slice(m);t?.(gn(C))}}o?.(d)};return r.jsx(Ae,{...i,wrapperClassName:S.mergeClasses(i.wrapperClassName,O.DIAL_KIT_CLASS.numberInput),type:"number",min:n,max:s,onChange:d=>t?.(gn(d)),onKeyDown:l,onPaste:c})},_s=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:n,size:s=_.ElementSize.Standard,...a})=>{const[o,i]=g.useState(!1),l=o&&!n;return g.useEffect(()=>{n&&i(!1)},[n]),r.jsx(Ae,{...a,wrapperClassName:S.mergeClasses(a.wrapperClassName,O.DIAL_KIT_CLASS.passwordInput),size:s,disabled:n,type:l?"text":"password",iconAfter:n?void 0:r.jsx(k.GhostIconButton,{size:_.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?r.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):r.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>i(c=>!c)})})},bc="flex flex-col gap-2",Cc="flex",yc="mt-2 ml-[26px]",vc={[v.RadioGroupOrientation.Column]:"flex-col gap-y-3",[v.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},jt=({items:e,value:t,onChange:n,name:s,id:a,orientation:o=v.RadioGroupOrientation.Column,labelProps:i,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:h,radioClassName:u,contentClassName:m})=>{const C=g.useId(),x=a??C,b=`${x}-label`,y=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,D=_.resolveAccessibleName(i?.label);return r.jsxs("div",{className:S.mergeClasses(bc,p,O.DIAL_KIT_CLASS.radioGroup),children:[i&&r.jsx(k.Label,{...i,id:b}),r.jsx("div",{role:"radiogroup","aria-labelledby":D?b:void 0,"aria-label":D?void 0:_.resolveAccessibleName(f),"aria-describedby":[y,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:S.mergeClasses(Cc,vc[o],h),children:e.map(I=>{const j=I.value===t;return r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx(k.Radio,{id:`${x}-${I.value}`,name:s??x,value:I.value,labelProps:I.label==null?void 0:{label:I.label},"aria-label":I["aria-label"],caption:I.caption,isSelected:j,disabled:l||I.disabled,onChange:n,className:u}),j&&I.content?r.jsx("div",{className:S.mergeClasses(yc,m),children:I.content}):null]},I.value)})}),r.jsx(Be,{id:y,text:c}),!c&&r.jsx(qe,{id:N,text:d})]})},Ls=({id:e,labelProps:t,isOn:n=!1,disabled:s,onChange:a,caption:o,className:i,...l})=>{const c=g.useId(),d=e??c,f=o?`${d}-caption`:void 0,p=g.useCallback(h=>{a?.(h.target.checked)},[a]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs("div",{className:S.mergeClasses("flex items-center gap-2",i,O.DIAL_KIT_CLASS.switch),children:[r.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:n,"aria-checked":n,disabled:s,onChange:p,"aria-label":_.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),r.jsx("label",{htmlFor:d,className:S.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",n?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":S.mergeClasses("cursor-pointer",n?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:r.jsx("span",{className:S.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&r.jsx(k.Label,{size:_.ElementSize.Standard,...t,htmlFor:d,className:S.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&r.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},xn=e=>typeof e=="string"?e:e[0],hr=e=>e!=null?String(e):"",Sc=e=>e!==void 0?Number(e):void 0,ks=({schema:e,value:t,onChange:n,invalid:s,id:a,ariaLabel:o})=>{const{texts:i,readonly:l=!1,inputClassName:c,acceptableResourceTypes:d}=ze(),f=e.const!==void 0,p=Array.isArray(e.enum)?e.enum:[],h=p.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===P.String||e.type===void 0)){const m=(e.acceptableResourceTypes??[]).flatMap(C=>{const x=d?.[C];return Array.isArray(x)?x.map(b=>{const y=String(b);return{value:y,label:y}}):[]});return r.jsx(Ve,{id:a,ariaLabel:o,options:m,value:t!=null?String(t):void 0,invalid:s,disabled:l,onChange:C=>n(xn(C)),placeholder:i.enumSelectPlaceholder,className:c})}if(f)return r.jsx(Ae,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:c});if(h&&e.enumDisplay===et.Radio)return r.jsx(jt,{id:a,ariaLabel:o,items:p.map(m=>({value:String(m),label:String(m)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===pt.Row?v.RadioGroupOrientation.Row:v.RadioGroupOrientation.Column,disabled:l,onChange:m=>n(m)});if(h)return r.jsx(Ve,{id:a,ariaLabel:o,options:p.map(m=>({value:String(m),label:String(m)})),value:t!=null?String(t):void 0,invalid:s,disabled:l,onChange:m=>n(xn(m)),placeholder:i.enumSelectPlaceholder,className:c});switch(e.type){case P.Boolean:return r.jsx(Ls,{id:a,"aria-label":o,isOn:!!t,disabled:l,onChange:m=>n(m)});case P.Integer:case P.Number:return r.jsx(Hr,{id:a,"aria-label":o,integer:e.type===P.Integer,value:hr(t),invalid:s,disabled:l,onChange:m=>n(Sc(m)),placeholder:e.type===P.Integer?i.integerInputPlaceholder:i.numberInputPlaceholder,containerClassName:c});default:return e.isProtected?r.jsx(_s,{id:a,"aria-label":o,value:hr(t),invalid:s,disabled:l,onChange:m=>n(m??void 0),placeholder:i.stringInputPlaceholder,containerClassName:c}):r.jsx(Ae,{id:a,"aria-label":o,value:hr(t),invalid:s,disabled:l,onChange:m=>n(m??void 0),placeholder:i.stringInputPlaceholder,containerClassName:c})}},bn=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Rs=e=>!!(e.oneOf||e.anyOf||e.type===P.Array||Fe(e)),Ic={[P.String]:"entryTypeString",[P.Number]:"entryTypeNumber",[P.Boolean]:"entryTypeBoolean",[P.Null]:"entryTypeNull",[P.Object]:"entryTypeObject",[P.Array]:"entryTypeArray"},Cn=e=>typeof e=="string"?e:e[0],Nc=({pair:e,valueSchema:t,isUnschematizedValue:n,onKeyChange:s,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:c,texts:d,readonly:f=!1,inputClassName:p,defaultExpanded:h=!0,touchedPaths:u,markTouched:m,skipUntouched:C}=ze(),[x,b]=g.useState(e.key),[y,N]=g.useState(()=>ys(e.value)),D=Rs(t),I=n&&(y===P.Object||y===P.Array),j=n&&y===P.Null,L=n&&y===P.Boolean,w=D||I,A=[...i,e.id,"key"].join("."),E=Nt(A,u,C)&&e.key==="",T=e.key||d.valueColumnHeader,R=Z=>{a(vs(Z)),N(Z)},B=g.useMemo(()=>Cs.map(Z=>({value:Z,label:d[Ic[Z]]})),[d]),K=g.useMemo(()=>[{value:"true",label:d.booleanTrueOption},{value:"false",label:d.booleanFalseOption}],[d]),Q=()=>j?r.jsx(Ae,{"aria-label":T,value:"null",disabled:!0}):L?r.jsx(Ve,{ariaLabel:T,options:K,value:e.value?"true":"false",disabled:f,onChange:Z=>{const U=Cn(Z);U&&a(U==="true")}}):r.jsx(ks,{schema:n?{type:y}:t,value:e.value,onChange:a,ariaLabel:T}),G=r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("div",{className:w?"min-w-0 flex-1":"w-2/5 min-w-0",children:r.jsx(Ae,{"aria-label":d.keyColumnHeader,value:x,disabled:f,invalid:E,error:E?`${d.keyColumnHeader} is required`:void 0,onChange:Z=>b(Z??""),onBlur:()=>{m?.(A),x!==e.key&&s(x)},placeholder:d.keyInputPlaceholder,containerClassName:p})}),!w&&r.jsx("div",{className:"min-w-0 flex-1",children:Q()}),n&&r.jsx("div",{className:"w-28 shrink-0",children:r.jsx(k.Tooltip,{tooltip:d.entryTypeChangeWarning,triggerClassName:"block",children:r.jsx(Ve,{ariaLabel:d.typeColumnHeader,options:B,value:y,disabled:f,onChange:Z=>{const U=Cn(Z);U&&R(U)}})})}),!f&&r.jsx(k.DangerIconButton,{size:_.ElementSize.Small,icon:r.jsx($.IconTrash,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),"aria-label":e.key?`${d.removeFieldAriaLabel}: ${e.key}`:d.removeFieldAriaLabel,onClick:o,className:"mt-2 shrink-0"})]});if(!w)return G;if(I)return r.jsxs("div",{className:"flex flex-col gap-2",children:[G,r.jsx($r,{value:e.value,onChange:a,ariaLabel:T},y)]});const F=[...i,e.key],V=De(e.value,t,c,F.join("."));return r.jsxs("div",{className:"flex flex-col gap-2",children:[G,r.jsx(Dt,{title:e.key,level:l,summary:ht(e.value,t,c),errorCount:V.length+(E?1:0),defaultExpanded:h,children:r.jsx(Ge,{schema:t,value:e.value,onChange:a,path:F,level:l+1,ariaLabel:T})})]})},Dc=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=ze(),c=e.additionalProperties===!0||e.additionalProperties==null,d=!c&&typeof e.additionalProperties=="object"?q(e.additionalProperties,o):{type:P.String},f=Rs(d),[p,h]=g.useState(()=>Object.entries(t??{}).map(([x,b])=>bn(x,b))),u=x=>{h(x),n(Object.fromEntries(x.filter(b=>b.key!=="").map(b=>[b.key,b.value])))},m=(x,b)=>u(p.map((y,N)=>N===x?{...y,...b}:y)),C=()=>{const x=f?Ce(d,o)??Jt(d):"";h(b=>[...b,bn("",x)])};return r.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&r.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),p.length>0&&!f&&r.jsxs("div",{"aria-hidden":"true",className:"flex gap-2 pr-8",children:[r.jsx("span",{className:"w-2/5 dial-tiny-semi-text text-secondary",children:i.keyColumnHeader}),r.jsx("span",{className:"flex-1 dial-tiny-semi-text text-secondary",children:i.valueColumnHeader}),c&&r.jsx("span",{className:"w-28 shrink-0 dial-tiny-semi-text text-secondary",children:i.typeColumnHeader})]}),p.map((x,b)=>r.jsx(Nc,{pair:x,valueSchema:d,isUnschematizedValue:c,onKeyChange:y=>m(b,{key:y}),onValueChange:y=>m(b,{value:y}),onRemove:()=>u(p.filter((y,N)=>N!==b)),path:s,level:a},x.id)),!l&&r.jsx("div",{className:"pt-1",children:r.jsx(Br,{label:i.addField,iconBefore:r.jsx($.IconPlus,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:C})})]})},Nr=({schema:e,value:t,onChange:n,path:s,level:a})=>{const{rootSchema:o,texts:i}=ze(),l=q(e,o),c=Yt(Object.entries(l.properties??{}).filter(([,p])=>!q(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?r.jsx("p",{className:"dial-small-text text-secondary",children:i.noConfigurableProperties}):r.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,h])=>{const u=q(h,o);return r.jsx(Ms,{schema:h,value:f[p],onChange:m=>n({...f,[p]:m}),path:[...s,p],level:a,required:d.includes(p),label:u.title??h.title??tt(p)},p)})})},yn=e=>typeof e=="string"?e:e[0],jc=(e,t)=>{const{[t]:n,...s}=e.properties??{};return{...e,properties:s}},Tc=({schema:e,value:t,onChange:n,path:s,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:c=!1}=ze(),d=g.useId(),f=o??l.selectTypePlaceholder,p=e.discriminatorDisplay===et.Radio,h=e.discriminator;if(h){const y=h.propertyName,N=h.mapping,D=w=>q({$ref:N[w]},i),I=typeof t=="object"&&t!==null?t[y]:void 0,j=I?D(I):void 0,L=w=>{const A=Ce(D(w),i)??{};n({...A,[y]:w})};if(p){const w=e.discriminatorOrientation===pt.Row,A=T=>r.jsx(Nr,{schema:jc(T,y),value:t,onChange:n,path:s,level:a}),E=r.jsx(jt,{id:d,ariaLabel:f,value:I,onChange:L,disabled:c,orientation:w?v.RadioGroupOrientation.Row:v.RadioGroupOrientation.Column,items:Object.keys(N).map(T=>{const R=D(T);return{value:T,label:R.title??T,content:w?void 0:A(R)}})});return w?r.jsxs("div",{className:"flex flex-col gap-3",children:[E,j&&A(j)]}):E}return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:f,options:Object.keys(N).map(w=>({value:w,label:w})),value:I,placeholder:l.selectTypePlaceholder,disabled:c,onChange:w=>{const A=yn(w);A&&L(A)},className:"max-w-[280px]"}),j&&r.jsx("div",{className:"pl-3",children:r.jsx(Nr,{schema:j,value:t,onChange:n,path:s,level:a})})]})}const u=e.oneOf??[],C=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const y=u.findIndex(N=>q(N,i).required?.every(D=>D in t));return y>=0?y:0})(),x=u[C],b=y=>{const N=Ce(q(u[y],i),i);n(N??null)};return p?r.jsx(jt,{id:d,ariaLabel:f,value:String(C),onChange:y=>b(Number(y)),disabled:c,items:u.map((y,N)=>({value:String(N),label:Xt(y,i)??`Option ${N+1}`,content:r.jsx(Ge,{schema:q(y,i),value:t,onChange:n,path:s,level:a,ariaLabel:o})}))}):r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(Ve,{ariaLabel:f,options:u.map((y,N)=>({value:String(N),label:q(y,i).title??`Option ${N+1}`})),value:String(C),disabled:c,onChange:y=>b(Number(yn(y))),className:"max-w-[280px]"}),x&&r.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:r.jsx(Ge,{schema:x,value:t,onChange:n,path:s,level:a,ariaLabel:o})})]})},Ge=({schema:e,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:c})=>{const{rootSchema:d,renderField:f,markTouched:p,touchedPaths:h,skipUntouched:u}=ze(),m=q(e,d),C=s.join("."),x=N=>{p?.(C),n(N)},b={schema:m,value:t,onChange:x,path:s,level:a};let y;if(m.oneOf)y=r.jsx(Tc,{...b,ariaLabel:c});else if(m.anyOf&&m.type!==P.Object)y=r.jsx(ic,{...b,ariaLabel:c});else if(Fe(m)){const N=m.additionalProperties!=null&&m.additionalProperties!==!1,D=!m.properties||Object.keys(m.properties).length===0;N&&D?y=r.jsx(Dc,{...b}):D&&m.additionalProperties!==!1?y=r.jsx($r,{value:t,onChange:x,id:l,ariaLabel:c}):y=r.jsx(Nr,{...b})}else if(m.type===P.Array)y=r.jsx(pc,{...b});else{const N=Nt(C,h,u)&&!!o&&st(t),D=!i&&N?Et(m.title??c??"Field"):void 0;y=r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(ks,{schema:m,value:t,onChange:x,invalid:N,id:l,ariaLabel:c}),r.jsx(Be,{text:D})]})}return f?f(s,m,y):y},Ms=({schema:e,value:t,onChange:n,path:s,level:a=0,required:o,label:i})=>{const l=g.useId(),{rootSchema:c,defaultExpanded:d=!0,touchedPaths:f,skipUntouched:p}=ze(),h=q(e,c),u=s.join(".");if(Fe(h)||h.type===P.Array){const C=De(t,h,c,u),x=i??h.title??s[s.length-1]??"Section";return r.jsx(Dt,{title:x,description:h.description,level:a,summary:ht(t,h,c),errorCount:Nt(u,f,p,!0)?C.length:0,defaultExpanded:d,children:r.jsx(Ge,{schema:h,value:t,onChange:n,path:s,level:a+1,required:o,ariaLabel:x})})}const m=Nt(u,f,p)&&o&&st(t)?Et(i??"Field"):void 0;return r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(k.Label,{htmlFor:l,label:i,required:o,caption:h.description}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Ge,{schema:h,value:t,onChange:n,path:s,level:a,required:o,suppressInlineError:!0,fieldId:l,ariaLabel:i}),r.jsx(Be,{text:m})]})]})},vn="dial-small-semi-text text-primary",wc=({schema:e,defaultValue:t,texts:n,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=ke.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:h=!1,acceptableResourceTypes:u})=>{const m=g.useMemo(()=>({...ms,...n}),[n]),C=g.useMemo(()=>t||(Ce(e,e)??{}),[]),[x,b]=g.useState(C),[y,N]=g.useState(()=>new Set),D=g.useCallback(E=>{N(T=>T.has(E)?T:new Set([...T,E]))},[]);g.useEffect(()=>{f?.(C)},[]);const I=(E,T)=>{const R={...x,[E]:T};b(R),c?.(R),d?.(E,T)},j=new Set(Object.keys(e.properties??{})),L=Object.keys(x).filter(E=>!j.has(E)),w=Yt(Object.entries(e.properties??{}).filter(([,E])=>!q(E,e).isHidden)),A=e.required??[];return r.jsx(Ds.Provider,{value:{rootSchema:e,texts:m,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:u,renderField:p,touchedPaths:y,markTouched:D,skipUntouched:h},children:r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-4",s,O.DIAL_KIT_CLASS.schemaRenderer),children:[w.map(([E,T])=>{const R=q(T,e),B=R.title??T.title??tt(E),K=A.includes(E),Q=x[E],G=Z=>I(E,Z);if(l===ke.Flat)return r.jsx(Ms,{schema:T,value:Q,onChange:G,path:[E],level:0,required:K,label:B},E);if(l===ke.FlatSections)return r.jsxs("section",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:vn,children:B}),r.jsx(Ge,{schema:T,value:Q,onChange:G,path:[E],level:0,required:K,ariaLabel:B})]},E);const F=De(Q,R,e,E),V=K&&st(Q)?Math.max(F.length,1):F.length;return r.jsx(Dt,{title:B,description:R.description,level:0,defaultExpanded:o,errorCount:Nt(E,y,h,!0)?V:0,children:r.jsx(Ge,{schema:T,value:Q,onChange:G,path:[E],level:1,required:K,ariaLabel:B})},E)}),L.map(E=>{const T=tt(E),R=r.jsx($r,{value:x[E],onChange:B=>I(E,B),ariaLabel:T});return l===ke.Sections?r.jsx(Dt,{title:T,level:0,defaultExpanded:o,children:R},E):r.jsxs("section",{className:"flex flex-col gap-3",children:[r.jsx("h2",{className:vn,children:T}),R]},E)})]})})},Ec=e=>({info:r.jsx($.IconInfoCircleFilled,{size:e.size}),error:r.jsx($.IconAlertCircleFilled,{size:e.size}),warning:r.jsx($.IconAlertTriangleFilled,{size:e.size}),success:r.jsx($.IconCircleCheckFilled,{size:e.size}),loading:r.jsx(v.Spinner,{size:e.size}),general:r.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),Oc={[v.NotificationVariant.Info]:"bg-info text-info",[v.NotificationVariant.Success]:"bg-success text-success",[v.NotificationVariant.Warning]:"bg-warning text-warning",[v.NotificationVariant.Error]:"bg-error text-error",[v.NotificationVariant.Loading]:"bg-layer-raised text-info",[v.NotificationVariant.General]:"bg-layer-sunken text-primary"},Ac={[v.NotificationVariant.Info]:"status",[v.NotificationVariant.Success]:"status",[v.NotificationVariant.Warning]:"alert",[v.NotificationVariant.Error]:"alert",[v.NotificationVariant.Loading]:"status",[v.NotificationVariant.General]:"status"},_c="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",Kr=({variant:e=v.NotificationVariant.Info,type:t=v.NotificationType.Toast,title:n,message:s,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...h})=>{const u=g.useMemo(()=>Ec({size:i,stroke:l})[e],[e,i,l]),m=p??(t===v.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return r.jsxs("div",{role:Ac[e],...h,className:S.mergeClasses(_c,Oc[e],t===v.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===v.NotificationType.SectionMessage&&e===v.NotificationVariant.Loading&&"border-secondary",o,O.DIAL_KIT_CLASS.notification),children:[r.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[r.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:r.jsx(O.DialIcon,{icon:u})}),n?r.jsxs("div",{className:S.mergeClasses("flex min-w-0 text-primary break-words",m),children:[r.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:n}),r.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):r.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),a!=null&&r.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&r.jsx(k.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:C=>d?.(C)})]})},Sn={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Lc=e=>e===1?"!truncate !whitespace-nowrap":`${Sn[e]??Sn[2]} !whitespace-normal`,Ps=({text:e,query:t,markClassName:n,className:s,maxLines:a=2})=>{const o=S.mergeClasses(Lc(a),s,O.DIAL_KIT_CLASS.highlight);if(!t.trim())return r.jsx(k.EllipsisTooltip,{className:o,text:e});const i=e.toLowerCase().indexOf(t.toLowerCase()),l=i===-1?e:r.jsxs(r.Fragment,{children:[e.slice(0,i),r.jsx("mark",{className:S.mergeClasses("text-accent bg-control-accent-alpha-hover",n),children:e.slice(i,i+t.length)}),e.slice(i+t.length)]});return r.jsx(k.EllipsisTooltip,{className:o,text:l})},kc=({className:e,children:t,...n})=>r.jsx("article",{...n,className:S.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,O.DIAL_KIT_CLASS.cardShell),children:t}),mt=(e,t)=>({type:s,...a})=>r.jsx(Kr,{...a,variant:e,type:s||t}),gt=(e,t)=>({variant:s,...a})=>r.jsx(Kr,{...a,variant:s||t,type:e}),Rc=mt(v.NotificationVariant.Error,v.NotificationType.Toast),Mc=mt(v.NotificationVariant.Info,v.NotificationType.Toast),Pc=mt(v.NotificationVariant.Success,v.NotificationType.Toast),Fc=mt(v.NotificationVariant.Warning,v.NotificationType.Toast),Bc=mt(v.NotificationVariant.Loading,v.NotificationType.Toast),zc=mt(v.NotificationVariant.General,v.NotificationType.Toast),$c=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Error),Hc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Info),Kc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Success),Vc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Warning),Gc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.Loading),Uc=gt(v.NotificationType.SectionMessage,v.NotificationVariant.General);var Ne=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(Ne||{});const Zc="en-GB",Wc={[Ne.Date]:"Select date",[Ne.DateTime]:"Select date and time",[Ne.Time]:"--:--",[Ne.Weekday]:"Select day"},Fs="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-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",Bs="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",zs="!border-error",qc="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Yc="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-none focus-visible:outline focus-visible:outline-focus",Xc="bg-control-accent text-control-permanent",Jc="text-accent dial-small-semi-text",Qc="text-control-disable-primary",$s="text-secondary",ed=r.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:$s}),In={prev:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},td=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Nn=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Dn=(e,t,n)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(n){const a=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(s>a)return!0}return!1},rd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),jn=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),nd=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),_t=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Tn=(e,t)=>{const[n,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(n||0,s||0,0,0),a},sd=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),ad=e=>{const t=e.replace(/\D/g,"").slice(0,4);let n=t.slice(0,2);const s=t.slice(2,4);if(n.length===2&&(n=String(Math.min(Number(n),23)).padStart(2,"0")),s.length===0)return n;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${n}:${a}`},Hs=5,Ks=e=>e.charAt(0).toUpperCase()+e.slice(1),od=e=>Array.from({length:7},(t,n)=>{const s=new Date(Date.UTC(1970,0,Hs+n));return Ks(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),id=e=>Array.from({length:7},(t,n)=>{const s=new Date(Date.UTC(1970,0,Hs+n));return{value:String(n+1),label:Ks(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),wn=({id:e,disabled:t,invalid:n,trigger:s,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:c})=>{const d=O.useThemeScope(),[f,p]=g.useState(!1),{refs:h,floatingStyles:u,context:m}=ae.useFloating({open:f,onOpenChange:D=>p(t?!1:D),placement:"bottom-start",whileElementsMounted:ae.autoUpdate,middleware:[ae.offset(8),ae.flip({padding:8}),ae.shift({padding:8})]}),C=ae.useClick(m,{enabled:!t}),x=ae.useDismiss(m),b=ae.useRole(m,{role:"dialog"}),{getReferenceProps:y,getFloatingProps:N}=ae.useInteractions([C,x,b]);return r.jsxs(r.Fragment,{children:[r.jsx("div",{id:e,ref:h.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:S.mergeClasses(Fs,"focus-visible:outline focus-visible:outline-focus",n&&zs,t&&Bs,o),...y(),children:s}),f&&r.jsx(ae.FloatingPortal,{children:r.jsx(ae.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:r.jsx("div",{ref:h.setFloating,style:u,"aria-label":c,className:S.mergeClasses(qc,d,a),...N(),children:i(()=>p(!1))})})})]})},En=({id:e,value:t,onChange:n,onBlur:s,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=g.useState(t);g.useEffect(()=>{p(t)},[t]);const h=r.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=ad(u.target.value);p(m),sd(m)&&n(m)},onBlur:s,className:S.mergeClasses(Fs,o&&zs,a&&Bs,i)});return d?r.jsxs("div",{className:"relative w-full",children:[h,r.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):h},ld=({mode:e=Ne.Date,value:t,onChange:n,onBlur:s,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:h=Zc,fieldClassName:u,showTimezone:m=!1})=>{const C=o??Wc[e],x=t instanceof Date?t:null,b=g.useId(),y=c??b,N=a?.id??`${y}-label`,D=!!a?.label,I=typeof a?.label=="string"?a.label:void 0,j=D?`${N} ${y}`:void 0,L=a?r.jsx(k.Label,{...a,id:N,htmlFor:y}):null,[w,A]=g.useState(()=>x??new Date),E=g.useMemo(()=>new Date,[]),T=g.useMemo(()=>m?hs({locale:h}):null,[m,h]),R=g.useMemo(()=>od(h),[h]),B=g.useMemo(()=>id(h),[h]),K=g.useMemo(()=>td(w.getFullYear(),w.getMonth()),[w]),Q=Z=>{A(U=>new Date(U.getFullYear(),U.getMonth()+Z,1))},G=(Z,U)=>{if(Dn(Z,f,p))return;const le=e===Ne.DateTime&&x?Tn(Z,_t(x)):Z;n?.(le),e===Ne.Date&&U()},F=Z=>{n?.(Tn(x??new Date,Z))},V=()=>x?e===Ne.DateTime?`${jn(x,h)}, ${_t(x)}`:jn(x,h):C;if(e===Ne.Time){const Z=typeof t=="string"?t:x?_t(x):"";return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[L,r.jsx(En,{id:y,value:Z,onChange:U=>n?.(U),onBlur:s,disabled:i,invalid:l,placeholder:C,className:u,timezoneLabel:T})]})}if(e===Ne.Weekday){const Z=typeof t=="string"?t:void 0,U=B.find(le=>le.value===Z);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[L,r.jsx(wn,{id:y,disabled:i,invalid:l,labelledBy:j,panelLabel:I??C,fieldClassName:u,trigger:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:S.mergeClasses("truncate",!U&&"text-secondary"),children:U?.label??C}),r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:$s})]}),panel:le=>r.jsx("div",{role:"listbox","aria-label":I??C,className:"flex flex-col gap-0.5",children:B.map(X=>r.jsx("button",{type:"button",role:"option","aria-selected":X.value===Z,className:S.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",X.value===Z&&"bg-control-accent-alpha-hover"),onClick:()=>{n?.(X.value),le()},children:X.label},X.value))})})]})}return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-y-3",d,O.DIAL_KIT_CLASS.calendar),children:[L,r.jsx(wn,{id:y,disabled:i,invalid:l,labelledBy:j,panelLabel:I??C,fieldClassName:u,trigger:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:S.mergeClasses("truncate",!x&&"text-secondary"),children:V()}),ed]}),panel:Z=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:In.prev,size:_.ElementSize.Small,onClick:()=>Q(-1)}),r.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:rd(w,h)}),r.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:In.next,size:_.ElementSize.Small,onClick:()=>Q(1)})]}),r.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[R.map(U=>r.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:U},U)),K.map(U=>{const le=U.getMonth()!==w.getMonth(),X=Nn(U,x),J=Nn(U,E),ee=Dn(U,f,p);return r.jsx("button",{type:"button",disabled:ee,"aria-label":nd(U,h),"aria-pressed":X,"aria-current":J?"date":void 0,className:S.mergeClasses(Yc,le&&Qc,J&&!X&&Jc,X&&Xc,ee&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(U,Z),children:U.getDate()},U.toISOString())})]}),e===Ne.DateTime&&r.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[r.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),r.jsx(En,{ariaLabel:"Time",value:x?_t(x):"",onChange:F,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},cd=({segments:e,labelClassName:t="dial-small-text",leafClassName:n="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const o=r.jsx(O.DialIcon,{icon:r.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),i=e.map((l,c)=>({label:c===e.length-1?r.jsx("span",{className:n,children:l}):l,disabled:!0,...c===0?{iconBefore:o}:{}}));return r.jsx(v.DialBreadcrumb,{className:S.mergeClasses(s,O.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:r.jsx(O.DialIcon,{icon:r.jsx($.IconChevronRight,{size:14,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:i,labelClassName:S.mergeClasses(t,"text-secondary","!cursor-default")})};var nt=(e=>(e.Small="small",e.Heading="heading",e))(nt||{});const dd="w-full overflow-hidden",ud="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",On="flex min-w-0 items-center gap-2",An={[nt.Small]:"dial-small-text",[nt.Heading]:"dial-h2-text"},fd={[nt.Small]:"dial-small-semi-text",[nt.Heading]:"dial-h2-text"},pd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},hd="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",md="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",gd="cursor-default text-primary",xd="cursor-default text-secondary",_n="inline-flex flex-none items-center leading-none text-secondary",bd="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Cd=3,yd=4,vd=r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),Sd=({items:e,maxVisibleItems:t=yd,size:n=nt.Small,separator:s=vd,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const c=Math.max(t,Cd),d=g.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=g.useMemo(()=>d.map((m,C)=>({key:String(C),label:m.label,icon:m.icon})),[d]),p=g.useCallback(({key:m,domEvent:C})=>{const x=d[Number(m)];x&&(x.onClick?.(C),!x.onClick&&x.href&&!C.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const h=e.slice(d.length+1),u=(m,{index:C,isFirst:x,isCurrent:b})=>{const y=!b&&(!!m.href||!!m.onClick),N=S.mergeClasses(hd,y?md:b?S.mergeClasses(gd,fd[n]):xd,l,O.DIAL_KIT_CLASS.breadcrumbsItem),D=r.jsxs(r.Fragment,{children:[m.icon,r.jsx(k.EllipsisTooltip,{text:m.label})]});return r.jsxs("li",{className:S.mergeClasses(On,An[n],pd[b?"last":x?"first":"middle"]),children:[y?m.href?r.jsx("a",{href:m.href,onClick:m.onClick,className:N,children:D}):r.jsx("button",{type:"button",onClick:m.onClick,className:N,children:D}):r.jsx("span",{className:N,"aria-current":b?"page":void 0,children:D}),!b&&r.jsx("span",{className:_n,"aria-hidden":"true",children:s})]},`segment-${C}`)};return r.jsx("nav",{"aria-label":a,className:S.mergeClasses(dd,i,O.DIAL_KIT_CLASS.breadcrumbs),children:r.jsxs("ol",{className:ud,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&r.jsxs("li",{className:S.mergeClasses(On,An[n],"shrink-0"),children:[r.jsx(k.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:r.jsx("button",{type:"button","aria-label":o,className:bd,children:r.jsx($.IconDots,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),r.jsx("span",{className:_n,"aria-hidden":"true",children:s})]}),h.map((m,C)=>u(m,{index:e.length-h.length+C,isFirst:!1,isCurrent:C===h.length-1}))]})})},Id=({className:e,icon:t,tooltipProps:n,type:s="button",...a})=>{const o=S.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=r.jsx("button",{...a,type:s,className:o,"aria-label":_.resolveAccessibleName(a["aria-label"],n?.tooltip),children:t||r.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return n?r.jsx(_.DialTooltip,{...n,children:i}):i},Nd=e=>r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:S.mergeClasses("transition-transform",e&&"rotate-180")}),Dd=({variant:e,appearance:t,items:n,dropdownProps:s,...a})=>{const[o,i]=g.useState(!1),l=g.useMemo(()=>Nd(o),[o]);return r.jsx("div",{className:O.DIAL_KIT_CLASS.buttonDropdown,children:r.jsx(k.Dropdown,{...s,items:n,onOpenChange:c=>i(c),children:r.jsx(at,{...a,iconAfter:l,variant:e||_.ButtonVariant.Primary,appearance:t||_.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},Vs=({label:e,size:t,isOpen:n=!1,labelClassName:s,className:a,"aria-label":o,...i})=>{const l=t===_.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return r.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":n,"aria-label":o?`${o} ${e}`:void 0,className:S.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,O.DIAL_KIT_CLASS.inlineSelect),children:[r.jsx("span",{className:s,children:e}),r.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:S.mergeClasses("transition-transform",n&&"rotate-180")})]})},jd=({items:e,selectedKey:t,defaultSelectedKey:n,onSelect:s,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:c,listStyle:d,ariaLabel:f,triggerClassName:p,triggerLabelClassName:h,open:u,onOpenChange:m})=>{const[C,x]=g.useState(!1),b=u!==void 0,y=b?u:C,N=g.useCallback(E=>{b||x(E),m?.(E)},[b,m]),[D,I]=g.useState(n??e[0]?.key),j=t!==void 0,L=j?t:D,w=g.useMemo(()=>{const E=e.find(T=>T.key===L);return E?.label?String(E.label):""},[e,L]),A=g.useCallback(({key:E})=>{const T=e.find(R=>R.key===E);T&&(j||I(E),s?.(T))},[e,j,s]);return r.jsx(k.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:c,listStyle:d,disabled:o,open:b?u:void 0,onOpenChange:N,onItemClick:A,children:r.jsx(Vs,{label:w,size:a,isOpen:y,disabled:o,"aria-label":f,className:p,labelClassName:h})})},Td="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",wd="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Ed="flex flex-row items-center justify-between px-6 py-4",Od="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Ad="border-b border-tertiary",_d="flex flex-row items-center gap-2 px-6 py-4",Ld="border-t border-tertiary",mr="flex shrink-0 flex-row items-center gap-2",kd={[v.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[v.PopupSize.Md]:"max-w-full md:max-w-[800px]",[v.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},Vr=({open:e=!1,header:t,ariaLabel:n,portalId:s,className:a,overlayClassName:o,titleClassName:i,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:h,onBack:u,backAriaLabel:m="Back",headerActions:C,headerDivider:x=!1,mainButtons:b,additionalButtons:y,additionalButtonsOnLeft:N=!1,footerDivider:D=!1,size:I=v.PopupSize.Md,hideClose:j=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:w=!0,preventKeyboardOnOpen:A=!1})=>{const E=O.useThemeScope(),T=g.useRef(null),R=g.useId(),{refs:B,context:K}=ae.useFloating({open:e,onOpenChange:J=>{J||h?.(null)}}),Q=ae.useRole(K,{role:"dialog"}),G=ae.useDismiss(K,{outsidePress:w}),{getFloatingProps:F}=ae.useInteractions([Q,G]);if(!e)return null;const V=typeof t=="string"?`popup-heading-${R}`:void 0,Z=J=>J?typeof J=="string"?r.jsx("h2",{id:V,className:S.mergeClasses(Od,i),children:r.jsx(k.Tooltip,{tooltip:J,triggerClassName:"truncate",children:J})}):J:r.jsx("span",{}),U=j?null:r.jsx(k.CloseButton,{ariaLabel:L,onClose:J=>h?.(J)}),le=(J,ee=[])=>ee.map(({variant:re=_.ButtonVariant.Neutral,...oe},ce)=>r.jsx(at,{variant:re,...oe},`${J}-${ce}`)),X=()=>{if(f!==void 0)return f;if(!b?.length&&!y?.length)return null;const J=le("additional",y);return r.jsxs("div",{className:S.mergeClasses(_d,D&&Ld,p),children:[N&&J.length>0&&r.jsx("div",{className:mr,children:J}),r.jsxs("div",{className:S.mergeClasses(mr,"ml-auto"),children:[!N&&J,le("main",b)]})]})};return r.jsx(ae.FloatingPortal,{id:s,children:r.jsx(ae.FloatingOverlay,{className:S.mergeClasses(Td,E,o),children:r.jsx(ae.FloatingFocusManager,{context:K,initialFocus:A?T:B.floating,children:r.jsxs("div",{ref:B.setFloating,...F(),role:"dialog","aria-modal":"true","aria-labelledby":V,"aria-label":V?void 0:n,className:S.mergeClasses(wd,kd[I],a,O.DIAL_KIT_CLASS.popup),children:[A&&r.jsx("div",{ref:T,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),r.jsxs("div",{className:S.mergeClasses(Ed,x&&Ad,l),children:[u&&r.jsx(k.GhostIconButton,{"aria-label":m,size:_.ElementSize.Small,className:"mr-2",onClick:u,icon:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Z(t),C?r.jsxs("div",{className:mr,children:[C,U]}):U]}),r.jsx("div",{className:S.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},Rd="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Md="text-secondary dial-small-paragraph-text px-6 pb-4",Pd="px-6 py-4 h-[120px]",Fd="Cancel",Bd="Ok",Ln={[v.ConfirmationPopupVariant.Info]:{confirm:{variant:_.ButtonVariant.Primary,appearance:_.ButtonAppearance.Solid}},[v.ConfirmationPopupVariant.Danger]:{confirm:{variant:_.ButtonVariant.Danger,appearance:_.ButtonAppearance.Solid}}},Gs=({header:e,description:t,descriptionClassName:n,open:s=!1,confirmLabel:a=Bd,cancelLabel:o=Fd,isLoading:i=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:h,children:u,variant:m=v.ConfirmationPopupVariant.Info,size:C=v.PopupSize.Sm,footer:x,hideClose:b,...y})=>{const N=i?null:r.jsxs("div",{className:Rd,children:[r.jsx(Fr,{label:o,onClick:()=>h?h():f?.()}),r.jsx(at,{variant:Ln[m].confirm.variant,appearance:Ln[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),D=g.useCallback(()=>i?r.jsx("div",{className:Pd,children:r.jsx(v.Spinner,{size:40})}):u??(t?r.jsx("div",{className:S.mergeClasses(Md,n),children:t}):null),[u,t,i,n]);return r.jsx(Vr,{...y,open:s,header:e,className:S.mergeClasses(c,O.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??N,size:C,hideClose:b??(!i&&x===void 0),children:D()})};var Ht=(e=>(e.Start="start",e.End="end",e))(Ht||{});const zd=({title:e,description:t,children:n,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:c,caretPosition:d=Ht.End,className:f,headerClassName:p,contentClassName:h})=>{const u=s!==void 0,[m,C]=g.useState(a),x=i?!0:u?s:m,b=g.useId(),y=`accordion-header-${b}`,N=`accordion-content-${b}`,D=()=>{if(o)return;const A=!x;u||C(A),c?.(A)},I=d===Ht.Start,j=i?null:r.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",x?"rotate-90":"rtl:rotate-180")}),L=r.jsxs(r.Fragment,{children:[I&&j,r.jsxs("span",{className:"flex min-w-0 flex-col",children:[r.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?r.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!I&&j]}),w=I?"justify-start gap-2":"justify-between";return r.jsxs("div",{className:S.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,O.DIAL_KIT_CLASS.accordion),children:[i?r.jsx("div",{id:y,className:S.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",w,p),children:L}):r.jsx("button",{id:y,type:"button","aria-expanded":x,"aria-controls":N,"aria-label":_.resolveAccessibleName(l),disabled:o,onClick:D,className:S.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",w,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:L}),r.jsx("div",{inert:!x,className:S.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:r.jsx("div",{className:"min-h-0 overflow-hidden",children:r.jsx("div",{className:"pt-3",children:r.jsx("div",{id:N,role:"region","aria-labelledby":y,className:S.mergeClasses("px-4 dial-small-text text-primary",h),children:n})})})})]})},$d="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Hd="min-w-0 flex-1 truncate text-primary",Kd="min-w-0 flex-1 truncate text-secondary",Vd="shrink-0 text-secondary",Gd="px-6 pb-4",Ud="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Zd="Cancel",Wd="Apply",qd=({items:e,value:t,customValue:n,header:s,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:h=!0,applyButtonLabel:u=Wd,cancelButtonLabel:m=Zd,size:C=v.PopupSize.Md,portalId:x,disabled:b,invalid:y,error:N,caption:D,ariaLabel:I,className:j,fieldClassName:L})=>{const w=g.useId(),A=o??w,E=`${A}-label`,T=`${A}-value`,R=N?`${A}-error`:void 0,B=!N&&D?`${A}-caption`:void 0,[K,Q]=g.useState(!1),G=c!==void 0,[F,V]=g.useState(t),Z=G?c:F,U=g.useCallback(()=>{b||(G||V(t),Q(!0))},[b,G,t]),le=g.useCallback(()=>{Q(!1),p?.()},[p]),X=g.useCallback(()=>{f?.(),le()},[f,le]),J=g.useCallback(()=>{a(Z),le()},[a,Z,le]),ee=g.useCallback(W=>{G||V(W),d?.(W)},[G,d]),re=_.resolveAccessibleName(i?.label),oe=re?void 0:_.resolveAccessibleName(I),ce=re?E:oe&&`${A}-name`,he=_.resolveAccessibleName(s),Se=e.find(W=>W.value===t)?.label,be=n??Se;return r.jsxs("div",{className:S.mergeClasses("flex w-full flex-col gap-2",j,O.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&r.jsx(k.Label,{...i,id:E,htmlFor:A}),r.jsxs("div",{className:"flex flex-col gap-1",children:[oe&&r.jsx("span",{id:ce,className:"sr-only",children:oe}),r.jsxs("button",{type:"button",id:A,disabled:b,"aria-haspopup":"dialog","aria-expanded":K,"aria-labelledby":ce?`${ce} ${T}`:void 0,"aria-describedby":[R,B].filter(Boolean).join(" ")||void 0,onClick:U,className:S.mergeClasses($d,y&&"dial-kit-input-error",b&&"dial-kit-input-disable",L),children:[r.jsx("span",{id:T,className:be==null?Kd:Hd,children:be??l}),r.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Vd})]}),r.jsx(Be,{id:R,text:N}),!N&&r.jsx(qe,{id:B,text:D})]}),r.jsx(Vr,{open:K,header:s,ariaLabel:he?void 0:re,portalId:x,size:C,onClose:X,footer:r.jsxs("div",{className:Ud,children:[r.jsx(Fr,{label:m,onClick:X}),r.jsx(Os,{label:u,disabled:!h,onClick:J})]}),children:r.jsx("div",{className:Gd,children:r.jsx(jt,{id:`${A}-options`,items:e,value:Z,onChange:ee,orientation:v.RadioGroupOrientation.Column,ariaLabel:re??he})})})]})},Yd=({icon:e,selectedIcon:t,isSelected:n=!1,onToggle:s,onClick:a,tooltipProps:o,size:i=_.ElementSize.Small,className:l,...c})=>{const d=g.useCallback(p=>{a?.(p),s?.(!n)},[a,s,n]),f=r.jsx(k.IconButton,{...c,size:i,variant:_.ButtonVariant.Primary,appearance:_.ButtonAppearance.Ghost,icon:n?t??e:e,"aria-pressed":n,"aria-label":_.resolveAccessibleName(c["aria-label"],o?.tooltip),onClick:d,className:S.mergeClasses("!rounded","[&_svg]:size-4",n&&"!text-accent",l,O.DIAL_KIT_CLASS.toggleIconButton)});return o?r.jsx(k.Tooltip,{asChild:!0,...o,children:f}):f},Xd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Jd="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Qd="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",eu="bg-layer-raised text-accent shadow-xs",tu="bg-transparent text-secondary",ru="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",nu="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",su="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",au="cursor-not-allowed bg-transparent text-control-disable-primary",ou=({items:e,value:t,onChange:n,disabled:s,className:a,segmentClassName:o,"aria-label":i})=>{const l=g.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=g.useCallback(p=>{if(s||!Xd.includes(p.key))return;const h=e.filter(b=>!b.disabled);if(h.length===0)return;const u=Math.max(h.findIndex(b=>b.value===t),0),m=h.length-1;let C=u;switch(p.key){case"ArrowRight":case"ArrowDown":C=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":C=u===0?m:u-1;break;case"Home":C=0;break;case"End":C=m;break}p.preventDefault();const x=h[C];l.current[x.value]?.focus(),x.value!==t&&n(x.value)},[s,e,t,n]);return r.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,onKeyDown:f,className:S.mergeClasses(Jd,a,O.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const h=p.value===t,u=s||p.disabled;return r.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":h,"aria-label":_.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>n(p.value),className:S.mergeClasses(Qd,h?eu:tu,u?h?su:au:h?ru:nu,o,O.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},iu={[v.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[v.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},lu=({tabs:e,activeTabId:t,onTabChange:n,orientation:s=v.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=g.useRef({}),p=g.useId(),h=s===v.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,C=g.useCallback(b=>{const{next:y,previous:N}=iu[s];if(![y,N,"Home","End"].includes(b.key)||e.length===0)return;const D=e.filter(A=>!A.disabled);if(D.length===0)return;const I=Math.max(D.findIndex(A=>A.id===t),0),j=D.length-1;let L=I;b.key===y?L=I===j?0:I+1:b.key===N?L=I===0?j:I-1:b.key==="Home"?L=0:L=j,b.preventDefault();const w=D[L];f.current[w.id]?.focus(),w.id!==t&&n(w.id)},[e,t,n,s]),x=r.jsx("div",{role:"tablist","aria-orientation":h?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:C,className:S.mergeClasses(h?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,O.DIAL_KIT_CLASS.tabList,!a&&O.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const y=t===b.id,N=!!b.disabled;return r.jsxs("button",{ref:D=>{f.current[b.id]=D},type:"button",role:"tab","aria-selected":y,disabled:N,tabIndex:b.id===m?0:-1,onClick:()=>n(b.id),className:S.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",h?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",y?"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&&(h?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(h?y?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":y?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,O.DIAL_KIT_CLASS.tab,y&&O.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&r.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),r.jsx("span",{className:S.mergeClasses(h&&!y&&!N&&"text-primary"),children:b.label}),b.count!=null&&r.jsx("span",{className:S.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",h&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(y?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-3",i,O.DIAL_KIT_CLASS.tabs),children:[r.jsx("div",{className:S.mergeClasses("flex h-16 shrink-0 items-center",h?"px-4":"px-3"),children:r.jsx("span",{id:p,className:S.mergeClasses("dial-h1-text text-primary",d,O.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},cu="flex flex-nowrap items-center gap-1",du="min-w-max flex-1 justify-center",uu=({items:e,value:t,onChange:n,stretch:s=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>r.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:S.mergeClasses(cu,a,O.DIAL_KIT_CLASS.filterChips),children:e.map(c=>r.jsx(Re,{label:c.label,icon:c.icon,appearance:rt.Selectable,selected:c.value===t,onClick:()=>n(c.value),className:S.mergeClasses(s&&du,o)},c.value))}),Dr=(e,t)=>{const n=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return n.some(o=>{if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},fu=({labelProps:e,label:t,description:n,onChange:s,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:h})=>{const u=g.useId(),m=f??`file-dropzone-${u}`,C=c?`${m}-error`:void 0,[x,b]=g.useState(!1),y=g.useRef(0),N=g.useCallback(E=>{if(E.length===0)return;const T=i?E:E.slice(0,1),R=T.filter(K=>Dr(K,o)),B=T.filter(K=>!Dr(K,o));B.length>0&&a?.(B),R.length>0&&s(R)},[o,i,s,a]),D=g.useCallback(E=>{N(Array.from(E.target.files??[])),E.target.value=""},[N]),I=g.useCallback(()=>{y.current=0,b(!1)},[]),j=g.useCallback(E=>{l||(E.preventDefault(),y.current+=1,b(!0))},[l]),L=g.useCallback(E=>{l||(E.preventDefault(),E.dataTransfer.dropEffect="copy")},[l]),w=g.useCallback(()=>{l||(y.current-=1,y.current<=0&&I())},[l,I]),A=g.useCallback(E=>{E.preventDefault(),!l&&(I(),N(Array.from(E.dataTransfer?.files??[])))},[l,I,N]);return r.jsxs("div",{className:"flex flex-col gap-1",children:[e&&r.jsx(k.Label,{...e,htmlFor:m}),r.jsx("input",{id:m,type:"file",accept:o,multiple:i,disabled:l,onChange:D,"aria-label":_.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":C,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),r.jsxs("label",{htmlFor:m,onDragEnter:j,onDragOver:L,onDragLeave:w,onDrop:A,className:S.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&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",h,O.DIAL_KIT_CLASS.fileDropzone),children:[d??r.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),r.jsxs("span",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:S.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),n&&r.jsx("span",{className:S.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:n})]})]}),r.jsx(Be,{id:C,text:c})]})},Us=({label:e="Shared",tooltip:t,size:n=12,className:s})=>r.jsx(k.Tooltip,{tooltip:t||"Shared",asChild:!0,children:r.jsx("span",{role:"img","aria-label":e,className:S.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,O.DIAL_KIT_CLASS.sharedEntityIndicator),children:r.jsx($.IconArrowUpRight,{size:n,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var Ee=(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))(Ee||{});const pu={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"]},hu=new Map(Object.entries(pu).flatMap(([e,t])=>t.map(n=>[n,e]))),mu=e=>hu.get(e)??"other",kn="var(--text-control-permanent, #FCFCFC)",Lt={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},gu="#1B212D",xu={[Ee.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:Lt},[Ee.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:gu}},[Ee.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)"}},[Ee.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)"}},[Ee.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)"}},[Ee.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:Lt},[Ee.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:Lt},[Ee.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)"}},[Ee.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)"}},[Ee.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)"},[Ee.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Lt}},bu=({size:e,kind:t})=>{const n=`dial-kit-file-gradient-${g.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:o}=xu[t],i=typeof o=="string";return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.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(#${n})`}),s&&r.jsx("path",{d:s,stroke:kn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&r.jsx("path",{d:a,fill:kn}),!i&&r.jsx("defs",{children:r.jsxs("linearGradient",{id:n,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:o.from}),r.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},Cu=({size:e})=>{const t=`dial-kit-folder-gradient-${g.useId().replace(/[^\w-]/g,"")}`;return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.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)"}),r.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})`}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),r.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},yu=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),vu=(e,t)=>e===v.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Su=(e,t,n)=>e===v.DialItemType.Folder?r.jsx(Cu,{size:n}):r.jsx(bu,{size:n,kind:mu(t)}),Gr=({type:e,name:t,fileExtension:n,shared:s=!1,loading:a=!1,size:o=H.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==v.DialItemType.File&&e!==v.DialItemType.Folder)return null;const h=e===v.DialItemType.File?yu(t,n):"",u=vu(e,h),m=c??(s?`${u}, shared`:u),C=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return r.jsxs("span",{className:S.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,O.DIAL_KIT_CLASS.fileIcon),...C,children:[a?r.jsx(v.Spinner,{size:o,ariaLabel:d}):Su(e,h,o),s&&r.jsx(Us,{tooltip:p,className:S.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},Zs=({name:e,type:t=v.DialItemType.File,fileExtension:n,shared:s=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:h,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:C})=>r.jsxs("div",{className:S.mergeClasses("flex w-full min-w-0 items-center gap-2",d,O.DIAL_KIT_CLASS.fileName),children:[r.jsx(Gr,{name:e,type:t,fileExtension:n,shared:s,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:h,decorative:!a}),r.jsxs("div",{className:S.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[r.jsx(k.EllipsisTooltip,{className:S.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:C}),s&&r.jsx("span",{className:"sr-only",children:u}),l]})]}),Iu=({className:e,...t})=>r.jsx(Zs,{...t,type:v.DialItemType.Folder,className:S.mergeClasses(e,O.DIAL_KIT_CLASS.folderName)}),Nu=({open:e,onClose:t,title:n,ariaLabel:s,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:c,className:d,overlayClassName:f,headerClassName:p,style:h,overlayStyle:u,bodyClassName:m,titleClassName:C,portalId:x})=>{const b=O.useThemeScope(),y=`bottom-sheet-title-${g.useId()}`,{refs:N,context:D}=ae.useFloating({open:e,onOpenChange:w=>{w||t()}}),I=ae.useRole(D,{role:"dialog"}),j=ae.useDismiss(D,{outsidePress:l}),{getFloatingProps:L}=ae.useInteractions([I,j]);return e?r.jsx(ae.FloatingPortal,{id:x,children:r.jsx(ae.FloatingOverlay,{lockScroll:!0,style:u,className:S.mergeClasses("z-popup flex items-end bg-backdrop",b,f),children:r.jsx(ae.FloatingFocusManager,{context:D,initialFocus:N.floating,children:r.jsxs("div",{ref:N.setFloating,...L(),role:"dialog","aria-modal":"true","aria-labelledby":n?y:void 0,"aria-label":n?void 0:s,style:h,className:S.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none","animate-slideUp motion-reduce:animate-none",d,O.DIAL_KIT_CLASS.bottomSheet),children:[n&&r.jsxs("div",{className:S.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&r.jsx(k.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:r.jsx($.IconArrowLeft,{size:H.DIAL_ICON_SIZE.LG,stroke:se.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),r.jsx("h2",{id:y,className:S.mergeClasses("min-w-0 truncate text-primary",C??"dial-body-semi-text"),children:n}),r.jsx(k.CloseButton,{ariaLabel:i,onClose:t,size:_.ElementSize.Standard,className:"absolute end-4"})]}),r.jsx("div",{className:S.mergeClasses("min-h-0 overflow-y-auto",m),children:c})]})})})}):null};var We=(e=>(e.Outlined="outlined",e.Filled="filled",e))(We||{}),He=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(He||{});const Du={[He.Blue]:"bg-blue text-blue",[He.Green]:"bg-green-2 text-green-1",[He.Violet]:"bg-violet-2 text-violet-1",[He.Indigo]:"bg-violet-1 text-violet-2",[He.Brown]:"bg-brown text-brown-2",[He.Red]:"bg-red text-red"},ju={[We.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[We.Filled]:"rounded-full"},Tu={[We.Outlined]:"dial-tiny-text",[We.Filled]:"dial-caption-lead-semi-text"},wu=({label:e,variant:t=We.Outlined,color:n=He.Blue,icon:s,textClassName:a,className:o,...i})=>r.jsxs("span",{...i,className:S.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",ju[t],t===We.Filled&&Du[n],o,O.DIAL_KIT_CLASS.badge),children:[s&&r.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:s}),r.jsx("span",{className:a??Tu[t],children:e})]});var ut=(e=>(e.Circle="circle",e.Square="square",e))(ut||{});const Rn=[{background:"bg-green-1",foreground:"text-green-2"},{background:"bg-violet-2",foreground:"text-violet-1"},{background:"bg-brown",foreground:"text-brown-2"},{background:"bg-red",foreground:"text-red"},{background:"bg-green-2",foreground:"text-green-3"},{background:"bg-blue",foreground:"text-accent"},{background:"bg-violet-1",foreground:"text-violet-2"}],Eu=e=>{let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return Rn[t%Rn.length]},Mn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",Ws=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(Mn(t[0])+Mn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Ou={[ut.Circle]:"rounded-full",[ut.Square]:"rounded-md"},qs=({name:e,initials:t,src:n,alt:s="",size:a=32,shape:o=ut.Circle,className:i,textClassName:l,onImageError:c})=>{const[d,f]=g.useState(),p=!!n&&d!==n,h=s!=="",u=x=>S.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Ou[o],x,i,O.DIAL_KIT_CLASS.avatar);if(p)return r.jsx("img",{src:n,alt:s,width:a,height:a,className:S.mergeClasses(u(),"object-cover"),onError:x=>{f(n),c?.(x)}});const{background:m,foreground:C}=Eu(e);return r.jsx("span",{role:h?"img":void 0,"aria-label":h?s:void 0,"aria-hidden":h?void 0:!0,className:u(S.mergeClasses(m,C)),style:{width:a,height:a,fontSize:l?void 0:Math.round(a*.4)},children:r.jsx("span",{className:S.mergeClasses("leading-none",l??"font-semibold"),children:t??Ws(e)})})};var xe=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(xe||{});const Au={[xe.Model]:"Model",[xe.Agent]:"Agent",[xe.Toolset]:"Toolset",[xe.Skill]:"Skill",[xe.Prompt]:"Prompt"},Pn={[xe.Model]:"text-blue",[xe.Agent]:"text-green-1",[xe.Toolset]:"text-brown-2",[xe.Skill]:"text-violet-1",[xe.Prompt]:"text-violet-2"},_u={[xe.Model]:"bg-blue",[xe.Agent]:"bg-green-2",[xe.Toolset]:"bg-brown",[xe.Skill]:"bg-violet-2",[xe.Prompt]:"bg-violet-1"},Lu=["h1","h2","h3","h4","h5","h6"],ku=e=>Lu[Math.min(6,Math.max(1,Math.round(e)))-1],Ru=({item:e,labels:t,showVersion:n=!0,hasFeaturedTag:s=!0,iconSize:a=48,headingLevel:o=3,query:i,footer:l,statusBadge:c,className:d,nameClassName:f="dial-h3-text",typeClassName:p="dial-caption-lead-semi-text",versionClassName:h="dial-tiny-text",iconClassName:u,featuredChipClassName:m})=>{const C=ku(o),x=s&&!!e.isFeatured,b=c!=null||x,y=n?e.version:void 0;return r.jsxs("div",{className:S.mergeClasses("flex items-start gap-2",d,O.DIAL_KIT_CLASS.entityIdentity),children:[r.jsx(qs,{name:e.name,src:e.iconUrl,size:a,shape:ut.Square,className:S.mergeClasses("rounded-[14px]",u)}),r.jsxs("div",{className:S.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",l!=null&&"self-stretch"),children:[r.jsxs("div",{className:"relative flex items-center justify-between",children:[r.jsx("span",{className:S.mergeClasses("uppercase",p,Pn[e.type]),children:t?.type??Au[e.type]}),b&&r.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[c,x&&r.jsx("span",{className:S.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",_u[e.type],Pn[e.type],m),children:t?.featured??"Featured"})]})]}),r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(C,{className:S.mergeClasses("min-w-0 shrink text-primary",f),children:i?r.jsx(Ps,{text:e.name,query:i,maxLines:1}):r.jsx(k.EllipsisTooltip,{text:e.name})}),y!=null&&r.jsx(k.EllipsisTooltip,{className:S.mergeClasses("max-w-[30%] shrink-0 text-secondary",h),text:y})]}),l!=null&&r.jsx("div",{className:"mt-auto pt-1",children:l})]})]})},Mu=({open:e,onClose:t,header:n,ariaLabel:s,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:c="Close",closeDisabled:d=!1,hideClose:f=!1,closeOnOutsideClick:p=!0,children:h,className:u,overlayClassName:m,headerClassName:C,style:x,overlayStyle:b,bodyClassName:y,titleClassName:N,portalId:D})=>{const I=O.useThemeScope(),j=`side-drawer-title-${g.useId()}`,L=typeof n=="string",{refs:w,context:A}=ae.useFloating({open:e,onOpenChange:K=>{K||t()}}),E=ae.useRole(A,{role:"dialog"}),T=ae.useDismiss(A,{outsidePress:p}),{getFloatingProps:R}=ae.useInteractions([E,T]),B=n!=null||o!=null||!f;return r.jsx(ae.FloatingPortal,{id:D,children:r.jsx(ae.FloatingOverlay,{lockScroll:e,style:b,className:S.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",I,m),children:r.jsx(ae.FloatingFocusManager,{context:A,disabled:!e,initialFocus:w.floating,children:r.jsxs("div",{ref:w.setFloating,...R(),role:"dialog","aria-modal":"true","aria-labelledby":L?j:void 0,"aria-label":L?void 0:s,inert:!e,style:x,className:S.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none","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",u,O.DIAL_KIT_CLASS.sideDrawer),children:[B&&r.jsxs("div",{className:S.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",C),children:[o&&r.jsx(k.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:r.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),L?r.jsx("h2",{id:j,className:S.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:n}):r.jsx("div",{className:"min-w-0 flex-1",children:n}),a,!f&&r.jsx(k.CloseButton,{ariaLabel:c,onClose:t,disabled:d,size:_.ElementSize.Standard})]}),r.jsx("div",{className:S.mergeClasses("min-h-0 flex-1 overflow-y-auto",y),children:h})]})})})})},Pu=4,Fu=24,Fn=e=>parseFloat(e)||0,Bu=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},zu=()=>{},$u=({id:e,value:t,defaultValue:n,size:s=_.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:h,tagListLabel:u="Tags",className:m,fieldClassName:C,tagClassName:x,onChange:b})=>{const y=g.useId(),N=e||y,D=s===_.ElementSize.Small,I=g.useRef(null),j=g.useRef([]),L=g.useRef(null),w=t!==void 0,[A,E]=g.useState(n??[]),T=w?t:A,R=T.length,[B,K]=g.useState(""),[Q,G]=g.useState(R),F=!f&&!d,V=g.useCallback(W=>{w||E(W),b?.(W)},[w,b]),Z=g.useCallback(W=>te=>{j.current[W]=te},[]),U=g.useCallback(()=>{const W=I.current;if(!W||W.clientWidth===0){G(T.length);return}const{paddingLeft:te,paddingRight:Te}=getComputedStyle(W);G(Es({availableWidth:W.clientWidth-Fn(te)-Fn(Te)-(f?0:Fu),tagWidths:T.map((Le,ge)=>j.current[ge]?.offsetWidth??0),overflowChipWidth:L.current?.offsetWidth??0,gap:Pu}))},[f,T]);g.useEffect(()=>{if(!p){G(R);return}const W=I.current;if(!W)return;const te=new ResizeObserver(()=>U());return te.observe(W),U(),()=>te.disconnect()},[p,U,R]);const le=S.mergeClasses(p?"shrink-0":"min-w-0",x),X=W=>{const te=Bu(W.trim()).trim();!te||T.includes(te)||V([...T,te])},J=W=>{V(T.filter(te=>te!==W))},ee=()=>{X(B),K("")},re=W=>{if(F){if(W.key==="Enter"||W.key===","){W.preventDefault(),ee();return}W.key==="Backspace"&&!B&&R>0&&(W.preventDefault(),V(T.slice(0,-1)))}},oe=()=>{F&&B.trim()&&ee()},ce=p?T.slice(0,Q):T,he=p?T.slice(Q):[],Se=he.join(", "),be=R>0&&r.jsxs("span",{role:"list","aria-label":u,className:S.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ce.map(W=>r.jsx(Re,{role:"listitem",label:W,className:le,disabled:d,closable:F,onRemove:F?()=>J(W):void 0},W)),he.length>0&&r.jsx(Re,{role:"listitem",label:`+${he.length}`,"aria-label":Se,title:Se,className:S.mergeClasses("shrink-0",x),disabled:d}),p&&r.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[T.map((W,te)=>r.jsx("span",{ref:Z(te),className:"inline-flex",children:r.jsx(Re,{label:W,className:x,disabled:d,closable:F,onRemove:F?zu:void 0})},W)),r.jsx("span",{ref:L,className:"inline-flex",children:r.jsx(Re,{label:`+${R}`,className:x})})]})]});return r.jsx(Ae,{id:N,size:s,labelProps:a,caption:i,error:l,invalid:c,disabled:d,readOnly:f,value:B,placeholder:R>0?void 0:o,"aria-label":h,wrapperRef:I,onChange:W=>K(W??""),onKeyDown:re,onBlur:oe,containerClassName:S.mergeClasses("w-full",m),wrapperClassName:S.mergeClasses(R>0&&["!h-auto",D?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],C,O.DIAL_KIT_CLASS.tagInput),className:S.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:be})},Hu=(e,t,n,s)=>{const a=t.trim().toLowerCase(),o=new Set(n);return e.filter(({value:i,label:l,description:c})=>!o.has(i)&&[l,i,c].some(d=>d?.toLowerCase().includes(a))).slice(0,Math.max(s,0))},Ku=5,Vu=({id:e,value:t,defaultValue:n,suggestions:s,maxSuggestions:a=Ku,openOnFocus:o=!1,size:i=_.ElementSize.Standard,labelProps:l,placeholder:c,caption:d,error:f,invalid:p=!1,disabled:h=!1,readOnly:u=!1,ariaLabel:m,tagListLabel:C="Tags",getRemoveTagLabel:x,className:b,fieldClassName:y,tagClassName:N,listClassName:D,onChange:I})=>{const j=g.useId(),L=e||j,w=`${L}-listbox`,A=O.useThemeScope(),E=i===_.ElementSize.Small,T=t!==void 0,[R,B]=g.useState(n??[]),K=T?t:R,Q=K.length>0,G=!u&&!h,[F,V]=g.useState(""),[Z,U]=g.useState(!1),[le,X]=g.useState(0),J=!F.trim(),ee=g.useMemo(()=>Hu(s,F,K,o&&J?s.length:a),[F,J,a,o,s,K]),re=Z&&G&&ee.length>0,oe=Math.min(le,ee.length-1),ce=re&&oe>=0,he=Y=>`${w}-option-${Y}`,{refs:Se,floatingStyles:be}=ae.useFloating({open:re,placement:"bottom-start",whileElementsMounted:ae.autoUpdate,middleware:[ae.offset(k.overlayGap),ae.flip({padding:k.overlayGap}),ae.size({padding:k.overlayGap,apply({rects:Y,availableHeight:ue,elements:fe}){fe.floating.style.width=`${Math.round(Y.reference.width)}px`,fe.floating.style.maxHeight=`${Math.floor(ue)}px`}})]}),W=g.useCallback(Y=>{T||B(Y),I?.(Y)},[T,I]),te=()=>{U(!1),X(0)},Te=()=>{!o||!G||(U(!0),X(J?-1:0))},Le=Y=>{const ue=Y.trim();ue&&!K.includes(ue)&&W([...K,ue]),V(""),o?X(-1):te()},ge=Y=>W(K.filter(ue=>ue!==Y)),$e=Y=>{const ue=Y??"",fe=!!ue.trim();V(ue),U(fe||o),X(fe?0:-1)},Ye=Y=>{if(G)switch(Y.key){case"ArrowDown":case"ArrowUp":{if(Y.preventDefault(),!re){U(!0),X(0);return}const ue=Y.key==="ArrowDown"?1:-1,fe=oe<0?Math.min(-ue,0):oe;X((fe+ue+ee.length)%ee.length);return}case"Enter":case",":Y.preventDefault(),Le(ce?ee[oe].value:F);return;case"Escape":re&&Y.preventDefault(),te();return;case"Backspace":!F&&Q&&(Y.preventDefault(),W(K.slice(0,-1)));return}},me=Y=>Y.preventDefault();return r.jsxs(r.Fragment,{children:[r.jsx(Ae,{id:L,role:"combobox","aria-autocomplete":"list","aria-expanded":re,"aria-controls":w,"aria-activedescendant":ce?he(oe):void 0,"aria-invalid":p||void 0,"aria-label":m,size:i,labelProps:l,caption:d,error:f,invalid:p,disabled:h,readOnly:u,value:F,placeholder:Q?void 0:c,wrapperRef:Se.setReference,onChange:$e,onKeyDown:Ye,onFocus:Te,onClick:Te,onBlur:te,containerClassName:S.mergeClasses("w-full",b),wrapperClassName:S.mergeClasses(Q&&["!h-auto flex-wrap gap-1 py-2",E?"min-h-[24px]":"min-h-[40px]"],y,O.DIAL_KIT_CLASS.autocompleteTagInput),className:S.mergeClasses("w-auto min-w-[100px] flex-1",u&&"cursor-default"),children:Q&&r.jsx("span",{role:"list","aria-label":C,className:"flex min-w-0 flex-wrap items-center gap-1",children:K.map(Y=>r.jsx(Re,{role:"listitem",label:Y,className:S.mergeClasses($t,"min-w-0",N),disabled:h,closable:G,removeLabel:x?.(Y),onRemove:G?()=>ge(Y):void 0},Y))})}),r.jsx(ae.FloatingPortal,{children:r.jsx("div",{ref:Se.setFloating,id:w,role:"listbox","aria-label":C,hidden:!re,style:be,className:S.mergeClasses("z-floating overflow-y-auto",k.overlaySurfaceClassName,k.overlayListClassName,!re&&"hidden",A,D),children:re&&ee.map((Y,ue)=>{const fe=ue===oe;return r.jsx(k.MenuItem,{id:he(ue),role:"option","aria-selected":fe,tabIndex:-1,label:Y.label,description:Y.description,mark:k.MenuItemMark.Tint,selected:fe,onMouseDown:me,onMouseEnter:()=>X(ue),onClick:()=>Le(Y.value)},Y.value)})})})]})},Gu={[_.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[_.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[_.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},Uu=({size:e=_.ElementSize.Standard,placeholder:t="Search...",withoutBorder:n=!1,clearLabel:s="Clear search",disabled:a,value:o,onChange:i,wrapperClassName:l,inputRef:c,...d})=>{const f=g.useRef(null),p=ae.useMergeRefs([c,f]),h=!!o&&!a,u=g.useCallback(()=>{i?.(void 0),f.current?.focus()},[i]);return r.jsx(Ae,{...d,size:e,value:o,disabled:a,onChange:i,placeholder:t,inputRef:p,wrapperClassName:S.mergeClasses(n&&"dial-kit-input-borderless",l,O.DIAL_KIT_CLASS.search),iconBefore:r.jsx($.IconSearch,{size:Gu[e],stroke:se.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:h?r.jsx(k.GhostIconButton,{size:_.ElementSize.Small,"aria-label":s,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},Zu=(e,t)=>{if(e<=0||t<=0)return[];const n=Math.floor(e/t+1e-9);return Array.from({length:n},(s,a)=>(a+1)*t/e*100)},Ys=e=>(e.toString().split(".")[1]??"").length,Wu=(e,t,n,s)=>{const a=Math.min(n,Math.max(t,e));if(s<=0)return a;const o=Math.round(Number(((a-t)/s).toFixed(9))),i=t+o*s;return Number(Math.min(n,i).toFixed(Ys(s)))},qu=12,Bn=e=>`calc(${e}% + ${(.5-e/100)*qu}px)`,Yu=(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)]",Xu=({id:e,value:t,min:n=0,max:s=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:c,showValue:d=!1,showTooltip:f=!1,showTicks:p=!1,leftContent:h,rightContent:u,showValueInput:m=!1,valueInputAriaLabel:C,caption:x,error:b,onChange:y,containerClassName:N,trackClassName:D,fillClassName:I,className:j,...L})=>{const w=g.useId(),A=e??w,E=x&&!b?`${A}-caption`:void 0,T=b?`${A}-error`:void 0,R=s-n,B=R>0?Math.min(100,Math.max(0,(t-n)/R*100)):0,K=Bn(B),Q=p&&!o?Zu(R,a):[],G=f&&!o,F=h!=null,V=m||u!=null,Z=Ys(a),[U,le]=g.useState(null),X=c?c(t):t.toFixed(Z),J=g.useCallback(oe=>{y?.(Number(oe.target.value))},[y]),ee=g.useCallback(oe=>{const ce=oe==null?"":String(oe);le(ce);const he=Number(ce);ce!==""&&Number.isFinite(he)&&y?.(Wu(he,n,s,a))},[s,n,y,a]),re=g.useCallback(()=>le(null),[]);return r.jsxs("div",{className:S.mergeClasses("flex flex-col gap-2",N),children:[(i||d)&&r.jsxs("div",{className:"flex items-center gap-2",children:[i&&r.jsx(k.Label,{...i,htmlFor:A}),d&&r.jsx("span",{"aria-hidden":"true",className:S.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:X})]}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs("div",{className:S.mergeClasses("grid items-center gap-x-3 gap-y-1",Yu(F,V),G&&"mt-7"),children:[F&&r.jsx("div",{className:"flex items-center",children:h}),r.jsxs("div",{className:"relative flex h-6 items-center",children:[r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-accent-muted",D)}),Q.map(oe=>r.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:Bn(oe)}},oe)),r.jsx("div",{className:S.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",I),style:{width:K}}),G&&r.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:K},children:[r.jsx("span",{className:"whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs",children:X}),r.jsx("svg",{width:"8",height:"4",viewBox:"0 0 8 4",className:"fill-control-inverted",children:r.jsx("path",{d:"M0 0h8L4 4z"})})]}),r.jsx("input",{...L,type:"range",id:A,value:t,min:n,max:s,step:a,disabled:o,onChange:J,"aria-label":_.resolveAccessibleName(typeof i?.label!="string"?L["aria-label"]:void 0),"aria-valuetext":c?X:void 0,"aria-describedby":T??E,className:S.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",j)})]}),V&&r.jsx("div",{className:"flex items-center",children:m?r.jsx(Hr,{"aria-label":_.resolveAccessibleName(C??(typeof i?.label=="string"?i.label:void 0)),value:U??t.toFixed(Z),min:n,max:s,step:a,disabled:o,size:_.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:ee,onBlur:re}):u}),l&&r.jsx("div",{className:S.mergeClasses("dial-tiny-text flex text-secondary",F&&"col-start-2"),children:l.length===3?r.jsxs(r.Fragment,{children:[r.jsx("span",{children:l[0]}),r.jsx("span",{className:"flex-1 text-center",children:l[1]}),r.jsx("span",{children:l[2]})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:l[0]}),r.jsx("span",{className:"ml-auto",children:l[1]})]})})]}),r.jsx(Be,{id:T,text:b}),!b&&r.jsx(qe,{id:E,text:x})]})]})},Ju=48,Qu=({children:e,title:t,width:n=280,collapsedWidth:s=Ju,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:h,contentClassName:u,footerClassName:m})=>{const C=a!==void 0,[x,b]=g.useState(o),y=C?a:x,N=`collapsible-sidebar-content-${g.useId()}`,D=y?d:f,I=j=>{const L=!y;C||b(L),i?.(L,j)};return r.jsxs("aside",{"aria-label":c,style:{width:`${y?n:s}px`},className:S.mergeClasses("flex flex-col justify-between",p,O.DIAL_KIT_CLASS.collapsibleSidebar),children:[r.jsx("div",{id:N,hidden:!y,className:S.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),r.jsx("div",{hidden:y,className:S.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",h),children:t}),r.jsxs("div",{className:S.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",y?"justify-end px-2":"justify-center",m),children:[y&&l,r.jsx(k.IconButton,{variant:_.ButtonVariant.Primary,appearance:_.ButtonAppearance.Ghost,size:_.ElementSize.Standard,onClick:I,"aria-label":D,"aria-expanded":y,"aria-controls":N,tooltipProps:{tooltip:D},icon:y?r.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):r.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},ef=({side:e,isResizing:t,width:n,minWidth:s,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===v.ResizableContainerSide.Left,p=f?$.IconChevronLeft:$.IconChevronRight,h=u=>{let m;switch(u.key){case"ArrowLeft":m=n+(f?o:-o);break;case"ArrowRight":m=n+(f?-o:o);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.preventDefault(),l(m)};return r.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":n,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:h,className:S.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",d),children:c??r.jsx(p,{size:H.DIAL_ICON_SIZE.MD,stroke:se.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:S.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},tf=16,Xs=({children:e,minWidth:t,maxWidth:n,width:s,defaultWidth:a,onResizeStop:o,onResize:i,side:l=v.ResizableContainerSide.Right,keyboardStep:c=tf,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:h})=>{const[u,m]=g.useState(!1),[C,x]=g.useState(a??t),b=s!==void 0,y=b?s:C,N=g.useRef(null),D=g.useCallback(()=>{m(!0)},[]),I=g.useCallback(()=>{m(!1);const w=N.current?.resizable?.getBoundingClientRect(),A=w?Math.round(w.width):t;b||x(A),o?.(A)},[o,b,t]),j=g.useCallback(w=>{const A=Math.min(n,Math.max(t,w));A!==y&&(b||(x(A),N.current?.updateSize({width:A,height:"100%"})),i?.(A),o?.(A))},[n,t,y,b,i,o]),L=g.useMemo(()=>{const w=l===v.ResizableContainerSide.Left,A=r.jsx(ef,{side:l,isResizing:u,width:y,minWidth:t,maxWidth:n,step:c,ariaLabel:d,onWidthChange:j,customHandler:h,handlerClassName:p});return{size:b?{width:y,height:"100%"}:void 0,defaultSize:b?void 0:{width:y,height:"100%"},minWidth:t,maxWidth:n,enable:{left:w,right:!w},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:w?A:void 0,right:w?void 0:A},onResizeStart:D,onResize:(E,T,R)=>{i?.(Math.round(R.offsetWidth))},onResizeStop:I}},[l,b,y,t,n,c,d,j,h,p,u,D,I,i]);return r.jsx(v.Resizable,{ref:N,...L,children:r.jsx("div",{className:S.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,O.DIAL_KIT_CLASS.resizableContainer),children:e})})},rf=({enabled:e=!0,children:t,...n})=>e?r.jsx(Xs,{...n,children:t}):t;var _e=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(_e||{});const Js=8e3,Tt="flex size-7 shrink-0 items-center justify-center",Qs={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"},nf=({title:e,failedCount:t,isCollapsed:n,itemsId:s,labels:a,onToggleCollapse:o,onClose:i})=>{const l=n?$.IconChevronUp:$.IconChevronDown;return r.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&r.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[r.jsx(k.GhostIconButton,{"aria-label":n?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!n,"aria-controls":s,size:_.ElementSize.Small,icon:r.jsx(l,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:Tt}),r.jsx(k.GhostIconButton,{"aria-label":a.closeAriaLabel,size:_.ElementSize.Small,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:Tt})]})]})},zn=({message:e,isError:t})=>{const n=t?$.IconAlertCircleFilled:$.IconAlertTriangleFilled;return r.jsx(k.Tooltip,{tooltip:e,asChild:!0,children:r.jsx("span",{className:Tt,role:"img","aria-label":e,tabIndex:0,children:r.jsx(n,{size:H.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},sf=({item:e,labels:t,onCancel:n})=>{const s=e.status===_e.Canceled;return r.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[r.jsx(Gr,{type:v.DialItemType.File,name:e.name,size:H.DIAL_ICON_SIZE.MD,className:S.mergeClasses(s&&"opacity-50"),decorative:!0}),r.jsx(k.EllipsisTooltip,{text:e.name,className:S.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===_e.InProgress&&r.jsxs("div",{className:S.mergeClasses(Tt,"grid"),children:[r.jsx(v.Spinner,{size:H.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:S.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",n&&"group-focus-within:opacity-0 group-hover:opacity-0")}),n&&r.jsx(k.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:_.ElementSize.Small,icon:r.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>n(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===_e.Success&&r.jsx("span",{className:Tt,role:"img","aria-label":t.successLabel,children:r.jsx($.IconCheck,{size:H.DIAL_ICON_SIZE.SM,stroke:se.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===_e.Warning&&r.jsx(zn,{message:e.message||t.warningMessage,isError:!1}),e.status===_e.Failed&&r.jsx(zn,{message:e.message||t.failedMessage,isError:!0}),s&&r.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},af=e=>Math.round(e.reduce((t,n)=>t+(n.percent??(n.status===_e.InProgress?0:100)),0)/e.length),of=(e,t,n)=>e&&t?n.closeConfirmDescriptionMixed:t?n.closeConfirmDescriptionFailed:n.closeConfirmDescriptionInProgress,lf=({title:e,items:t,onClose:n,onCancelItem:s,labels:a,autoCloseDelay:o=Js,className:i,bodyClassName:l})=>{const[c,d]=g.useState(!1),[f,p]=g.useState(!1),h=g.useId(),u={...Qs,...a},m=t.filter(j=>j.status===_e.InProgress).length,C=m>0,x=t.filter(j=>j.status===_e.Failed).length,b=x>0,y=t.length>0&&t.every(j=>j.status===_e.Success),N=g.useCallback(()=>{C||b?p(!0):n()},[C,b,n]),D=g.useCallback(()=>{p(!1),n()},[n]),I=g.useCallback(()=>{d(j=>!j)},[]);return g.useEffect(()=>{if(!y||o<=0)return;const j=setTimeout(n,o);return()=>clearTimeout(j)},[y,o,n]),t.length===0?null:r.jsxs("div",{role:"status","aria-live":"polite",className:S.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,O.DIAL_KIT_CLASS.transferQueue),children:[r.jsx(nf,{title:e,failedCount:x,isCollapsed:c,itemsId:h,labels:u,onToggleCollapse:I,onClose:N}),c&&C&&r.jsx(Vn,{value:af(t),size:_.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&r.jsx("div",{id:h,className:S.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(j=>r.jsx(sf,{item:j,labels:u,onCancel:s},j.id))}),r.jsx(Gs,{open:f,header:u.closeConfirmHeader,description:of(C,b,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:v.ConfirmationPopupVariant.Danger,onConfirm:D,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=v.ConfirmationPopupVariant;exports.DialBreadcrumb=v.DialBreadcrumb;exports.DialBreadcrumbItem=v.DialBreadcrumbItem;exports.DialButton=v.DialButton;exports.DialButtonDropdown=v.DialButtonDropdown;exports.DialCaptionText=v.DialCaptionText;exports.DialCollapsibleSidebar=v.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=v.DialConditionalResizableContainer;exports.DialConfirmationPopup=v.DialConfirmationPopup;exports.DialDangerButton=v.DialDangerButton;exports.DialDestinationFolderPopup=v.DialDestinationFolderPopup;exports.DialErrorText=v.DialErrorText;exports.DialFileIcon=v.DialFileIcon;exports.DialFileManager=v.DialFileManager;exports.DialFileManagerActions=v.DialFileManagerActions;exports.DialFileManagerTabs=v.DialFileManagerTabs;exports.DialFileName=v.DialFileName;exports.DialFileNodeType=v.DialFileNodeType;exports.DialFilePermission=v.DialFilePermission;exports.DialFileResourceType=v.DialFileResourceType;exports.DialFolderName=v.DialFolderName;exports.DialFoldersTree=v.DialFoldersTree;exports.DialFormItem=v.DialFormItem;exports.DialGhostButton=v.DialGhostButton;exports.DialInput=v.DialInput;exports.DialItemType=v.DialItemType;exports.DialLinkButton=v.DialLinkButton;exports.DialLoader=v.DialLoader;exports.DialNeutralButton=v.DialNeutralButton;exports.DialNotification=v.DialNotification;exports.DialPopup=v.DialPopup;exports.DialPrimaryButton=v.DialPrimaryButton;exports.DialRadioGroup=v.DialRadioGroup;exports.DialResizableContainer=v.DialResizableContainer;exports.DialSearch=v.DialSearch;exports.DialSharedEntityIndicator=v.DialSharedEntityIndicator;exports.DialTabs=v.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=v.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=v.FileManagerColumnKey;exports.FileManagerProvider=v.FileManagerProvider;exports.FlexibleActionsDirection=v.FlexibleActionsDirection;exports.FormItemOrientation=v.FormItemOrientation;exports.NAME_COLUMN=v.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=v.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=v.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=v.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=v.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=v.NotificationType;exports.NotificationVariant=v.NotificationVariant;exports.PopupSize=v.PopupSize;exports.RadioGroupOrientation=v.RadioGroupOrientation;exports.ResizableContainerSide=v.ResizableContainerSide;exports.SIZE_COLUMN=v.SIZE_COLUMN;exports.ScreenResolution=v.ScreenResolution;exports.Skeleton=v.Skeleton;exports.SkeletonAvatarShape=v.SkeletonAvatarShape;exports.SkeletonAvatarSize=v.SkeletonAvatarSize;exports.SkeletonVariant=v.SkeletonVariant;exports.Spinner=v.Spinner;exports.TabOrientation=v.TabOrientation;exports.TabView=v.TabView;exports.UPDATED_AT_COLUMN=v.UPDATED_AT_COLUMN;exports.editableContainerProps=v.editableContainerProps;exports.useDialFileManagerTabs=v.useDialFileManagerTabs;exports.useEditableItem=v.useEditableItem;exports.useFileManagerContext=v.useFileManagerContext;exports.DialLabel=Ue.DialLabel;exports.DialSwitch=Ue.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=O.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=O.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=O.DIAL_KIT_CLASS;exports.DialCloseButton=O.DialCloseButton;exports.DialDangerIconButton=O.DialDangerIconButton;exports.DialDateCellRenderer=O.DialDateCellRenderer;exports.DialDropdown=O.DialDropdown;exports.DialEllipsisTooltip=O.DialEllipsisTooltip;exports.DialGhostIconButton=O.DialGhostIconButton;exports.DialGrid=O.DialGrid;exports.DialIcon=O.DialIcon;exports.DialNeutralIconButton=O.DialNeutralIconButton;exports.DialNoDataContent=O.DialNoDataContent;exports.DialPrimaryIconButton=O.DialPrimaryIconButton;exports.DialRadioButton=O.DialRadioButton;exports.DialSecondaryIconButton=O.DialSecondaryIconButton;exports.DialSuccessIconButton=O.DialSuccessIconButton;exports.DialTertiaryIconButton=O.DialTertiaryIconButton;exports.DropdownItemType=O.DropdownItemType;exports.DropdownTrigger=O.DropdownTrigger;exports.DropdownType=O.DropdownType;exports.GridSelectionMode=O.GridSelectionMode;exports.ThemeScope=O.ThemeScope;exports.baseColumnComparator=O.baseColumnComparator;exports.checkColDefsChanges=O.checkColDefsChanges;exports.convertGridDateToDate=O.convertToDate;exports.convertToDate=O.convertToDate;exports.useThemeScope=O.useThemeScope;exports.BASE_ICON_PROPS=H.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=H.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=H.DIAL_ICON_SIZE;exports.mergeClasses=S.mergeClasses;exports.Checkbox=k.Checkbox;exports.CheckboxBox=k.CheckboxBox;exports.CloseButton=k.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=k.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=k.DEFAULT_LOCALE;exports.DangerIconButton=k.DangerIconButton;exports.DateCellRenderer=k.DateCellRenderer;exports.Dropdown=k.Dropdown;exports.EllipsisTooltip=k.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=k.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=k.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=k.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=k.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=k.GRID_THEME_PARAMS;exports.GhostIconButton=k.GhostIconButton;exports.Grid=k.Grid;exports.IconButton=k.IconButton;exports.InfoButton=k.InfoButton;exports.InteractiveTooltip=k.InteractiveTooltip;exports.InteractiveTooltipTrigger=k.InteractiveTooltipTrigger;exports.Label=k.Label;exports.MenuItem=k.MenuItem;exports.MenuItemMark=k.MenuItemMark;exports.NeutralIconButton=k.NeutralIconButton;exports.NoDataContent=k.NoDataContent;exports.PrimaryIconButton=k.PrimaryIconButton;exports.Radio=k.Radio;exports.StaticIconButton=k.StaticIconButton;exports.Tooltip=k.Tooltip;exports.TooltipContainer=k.TooltipContainer;exports.TooltipContent=k.TooltipContent;exports.TooltipPlacement=k.TooltipPlacement;exports.TooltipTrigger=k.TooltipTrigger;exports.ButtonAppearance=_.ButtonAppearance;exports.ButtonVariant=_.ButtonVariant;exports.DialIconButton=_.DialIconButton;exports.DialTooltip=_.DialTooltip;exports.DialTooltipContainer=_.DialTooltipContainer;exports.DialTooltipContent=_.DialTooltipContent;exports.DialTooltipTrigger=_.DialTooltipTrigger;exports.ElementSize=_.ElementSize;exports.EditorThemes=wt.EditorThemes;exports.LazyDialJsonEditor=wt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=wt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=wt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=se.DIAL_KIT_ICON_STROKE;exports.Accordion=zd;exports.AccordionCaretPosition=Ht;exports.AnalyticsCardVariant=St;exports.AutocompleteTagInput=Vu;exports.Avatar=qs;exports.AvatarShape=ut;exports.Badge=wu;exports.BadgeColor=He;exports.BadgeVariant=We;exports.BottomSheet=Nu;exports.Breadcrumbs=Sd;exports.BreadcrumbsSize=nt;exports.Button=at;exports.ButtonDropdown=Dd;exports.Calendar=ld;exports.CalendarMode=Ne;exports.CaptionText=qe;exports.CardShell=kc;exports.CollapsibleSidebar=Qu;exports.ConditionalResizableContainer=rf;exports.ConfirmationPopup=Gs;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=Tr;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Qs;exports.DangerButton=lc;exports.DialAccordion=$n;exports.DialAnalyticsBar=kt;exports.DialAnalyticsBarGroup=fa;exports.DialAnalyticsCard=ca;exports.DialAnalyticsErrorTag=jr;exports.DialAnalyticsHistogram=xa;exports.DialAutocompleteInputValue=ns;exports.DialCheckbox=gr;exports.DialDraggableItem=Ai;exports.DialDropdownIcon=vl;exports.DialFormPopup=Vi;exports.DialInputPopup=ss;exports.DialLabelledText=wa;exports.DialLoadFileArea=ps;exports.DialLoadFileAreaField=yl;exports.DialNumberInput=vr;exports.DialPagination=Sa;exports.DialPasswordInput=as;exports.DialRadioGroupPopupField=zi;exports.DialRemoveButton=Wt;exports.DialSchemaRenderer=Rl;exports.DialSegmentedControl=Fi;exports.DialSelect=Me;exports.DialSelectField=rl;exports.DialSlider=Ta;exports.DialSteps=ja;exports.DialTag=Je;exports.DialTagInput=rs;exports.DialTextarea=_i;exports.EntityIdentity=Ru;exports.EntityType=xe;exports.ErrorMessageNotification=$c;exports.ErrorText=Be;exports.ErrorToastNotification=Rc;exports.FabButton=Id;exports.FileDropzone=fu;exports.FileIcon=Gr;exports.FileName=Zs;exports.FilterChips=uu;exports.FolderName=Iu;exports.FolderPath=cd;exports.GeneralMessageNotification=Uc;exports.GeneralToastNotification=zc;exports.GhostButton=Br;exports.Highlight=Ps;exports.InfoMessageNotification=Hc;exports.InfoToastNotification=Mc;exports.InlineSelect=jd;exports.InlineSelectTrigger=Vs;exports.Input=Ae;exports.JsonSchemaType=P;exports.LinkButton=uc;exports.LoadingMessageNotification=Gc;exports.LoadingToastNotification=Bc;exports.MultiSelectTags=vt;exports.NeutralButton=Fr;exports.Notification=Kr;exports.NumberInput=Hr;exports.OutlinedButton=fc;exports.PasswordInput=_s;exports.Popup=Vr;exports.PrimaryButton=Os;exports.ProgressBar=Vn;exports.RadioGroup=jt;exports.RadioGroupPopupField=qd;exports.ResizableContainer=Xs;exports.SchemaDisplayMode=et;exports.SchemaOrientation=pt;exports.SchemaRenderer=wc;exports.SchemaRendererVariant=ke;exports.Search=Uu;exports.SegmentedControl=ou;exports.Select=Ve;exports.SelectSize=Ft;exports.SelectVariant=Bt;exports.SharedEntityIndicator=Us;exports.SideDrawer=Mu;exports.Slider=Xu;exports.StarterButton=dc;exports.StepStatus=je;exports.SuccessMessageNotification=Kc;exports.SuccessToastNotification=Pc;exports.Switch=Ls;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Js;exports.Tabs=lu;exports.Tag=Re;exports.TagAppearance=rt;exports.TagInput=$u;exports.Textarea=As;exports.TextareaResize=zr;exports.ToggleIconButton=Yd;exports.TransferQueue=lf;exports.TransferQueueItemStatus=_e;exports.WarningMessageNotification=Vc;exports.WarningToastNotification=Fc;exports.extractInitials=Ws;exports.getTimezoneLabel=hs;exports.matchesAccept=Dr;exports.wrapInRootFolder=Tl;
|