@epam/ai-dial-ui-kit 0.15.0-dev.4 → 0.15.0-dev.6
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/components/New/Calendar/Calendar.js +155 -150
- package/dist/components/New/Notification/Notification.js +18 -18
- package/dist/components/ProgressBar/ProgressBar.js +1 -3
- package/dist/components-manifest.json +8 -2
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/src/components/New/Calendar/Calendar.d.ts +7 -1
- package/package.json +1 -1
package/dist/dial-ui-kit.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./use-file-manager-tabs-DjdR_mYM.cjs"),Ae=require("./Switch-CUKClcEz.cjs"),n=require("react/jsx-runtime"),h=require("react"),$=require("@tabler/icons-react"),ae=require("classnames"),M=require("./DateCellRenderer-BVM-Q8yx.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),P=require("./DateCellRenderer-ssp7eaZY.cjs"),T=require("./IconButton-DWqoaBWf.cjs"),Wn=require("react-dom"),ot=require("./lazy-tfN4sKhq.cjs"),le=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function qn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=qn(h),He=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.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 n.jsxs("div",{className:l,onClick:i,children:[n.jsx(M.DialIcon,{icon:r}),n.jsx(M.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(x.DialButton,{className:"p-0",iconAfter:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(He,{label:e,className:I.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 Zn={[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}},Yn=({title:e,value:t,description:r,variant:s=st.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:u,compareValues:d})=>{const f=Zn[s],g=c!==void 0?c:(l??0)>=0,p=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",f.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:f.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:p})]}):n.jsx("span",{className:f.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-start"}):d?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:d[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:d[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[1].value})]})]}):n.jsx("span",{className:f.value,children:t}),!a&&!i&&f.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},er=[{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"}],Xn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Qn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:u,inline:d,ariaLabel:f})=>{const g=e==null,p=!!(r||s||!g),m=Xn(g?0:e,t),b=Qn(m,o),v=i??(g?"—":e),y=f??(typeof a=="string"?a:void 0),D=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(x.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",d?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:v}),S=p?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",d?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!D&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:b}})}):null,C=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return d?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:C}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[C,N]}),S]})},Ur=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:u,contentClassName:d})=>{const f=s!==void 0,[g,p]=h.useState(a),m=o?!0:f?s:g,b=h.useId(),v=()=>{if(i)return;const y=!m;f||p(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":b,disabled:i||o,onClick:v,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",u),children:[!o&&n.jsx(M.DialIcon,{className:ae("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:b,role:"region",className:I.mergeClasses("px-4 pb-4",d),children:r})]})},Jn=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:u,isLoading:d,onBarClick:f,inline:g,barTitleClassName:p,barValueClassName:m,barClassName:b,barDescriptions:v,className:y})=>{const D=Object.entries(s),N=g?I.mergeClasses("text-secondary",p):p,S=i?"dial-tiny-text text-secondary":void 0,C=t?n.jsx(T.DialTooltip,{tooltip:t,children:e}):e,w=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],R="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",_="group flex flex-col gap-1.5",O=I.mergeClasses("flex flex-col gap-1.5 pl-2",f&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",b);return n.jsx(Ur,{title:C,description:r,defaultExpanded:c,nonCollapsible:u,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:d?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-center"}):a?w.map(A=>{const j=A in s?s[A]:null,k=A in a?a[A]:null,V=typeof j=="number"&&typeof k=="number"?parseFloat((k-j).toFixed(3)):null,ee=V!=null&&V!==0,U=ee&&V>0,B=ee?U?`+${V}`:String(V):null,F=v?.[A],G=n.jsx("span",{className:"dial-small-text text-secondary",children:A}),Z=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[F?n.jsx(T.DialTooltip,{tooltip:F,children:G}):G,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:O,children:[n.jsx(ut,{title:i?.[0],value:j,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:A}),n.jsx(ut,{title:i?.[1],value:k,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:`${A} compare`})]})]});return f?n.jsx("button",{type:"button",onClick:()=>f(A,j),className:I.mergeClasses(_,R),children:Z},A):n.jsx("div",{className:_,children:Z},A)}):D.map(([A,j])=>{const k=n.jsx(ut,{title:A,value:j,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:b}),z=f?n.jsx("button",{type:"button",onClick:()=>f(A,j),className:R,children:k}):k,V=v?.[A];return V?n.jsx(T.DialTooltip,{tooltip:V,triggerClassName:"flex flex-col",children:z},A):n.jsx(h.Fragment,{children:z},A)})})})},es="#FF4E50",ts=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const u=ts(c,t);u>=0&&(r[u]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:es,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,u)=>({from:c.from,to:c.to,color:c.color,count:r[u],ratio:i(r[u]),isZeroBucket:!1}));return[o,...l]},Kr=e=>e<=0?2:e%2===0?e:e+1,rs=e=>{const t=Kr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,Wr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ns=(e,t)=>{const r=Wr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ns(a.from,a.to)})]}),ss=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:u})=>{const d=hr(t,r),f=l?hr(l,r):void 0,g=t.length,p=l?.length??0,m=Math.max(g,p),b=Kr(m),v=rs(m),y=C=>C.map(w=>({...w,ratio:b>0?w.count/b:0})),D=y(d),N=f?y(f):void 0,S=(C,w,R,_)=>{if(C.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})});const O=_?{backgroundImage:`repeating-linear-gradient(135deg, ${C.color} 0px, ${C.color} 1px, transparent 1px, transparent 4px)`,borderColor:C.color}:{backgroundColor:C.color};return n.jsx(T.DialTooltip,{placement:"bottom",tooltip:w,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${C.ratio*100}%`,...O},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(x.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:At},children:v.map((C,w)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${w/(v.length-1)*100}%`,transform:"translateY(-50%)"},children:C},C))}),n.jsxs("div",{className:"relative min-w-0",children:[v.map((C,w)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${w/(v.length-1)*100}%`}},C)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?D.map((C,w)=>{const R=N[w],_=`${C.count} out of ${g} ${s}`,O=`${R.count} out of ${p} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(C,mr(c,C.count,g,s,C),_,!0),S(R,mr(u,R.count,p,s,R),O,!1)]},w)}):D.map((C,w)=>{const R=`${C.count} out of ${g} ${s}`;return C.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})},w):n.jsx(T.DialTooltip,{placement:"bottom",tooltip:R,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${C.ratio*100}%`,backgroundColor:C.color},children:a&&C.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})},w)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:D.map((C,w)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Wr(C.from,C.to)},w))})]})]})},as=({value:e,max:t=100,size:r=T.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const u=h.useId(),d=i??u,f=!!s?.label,g=f?s?.id??`${d}-label`:void 0,p=t>0?t:0,m=Number.isFinite(e)?e:0,b=Math.min(Math.max(m,0),p),v=p>0?b/p*100:0,y=n.jsx("div",{...c,id:d,role:"progressbar","aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":p,"aria-labelledby":g,"aria-label":T.resolveAccessibleName(l,f?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===T.ElementSize.Small?"h-1":"h-2",o),children:n.jsx("div",{style:{width:`${v}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!f&&!a?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(P.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},is=7,os=2,ls=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const cs=(e,t,r)=>e===t?"active":r<is||Math.abs(e-t)<=os?"adjacent":"far",ds=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=ls(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=cs(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const u=h.useCallback(p=>{o?.(p.target.checked,t)},[o,t]),d=ae("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||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),f=ae("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx($.IconMinus,{className:f,...H.BASE_ICON_PROPS}):r?n.jsx($.IconCheck,{className:f,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:d,htmlFor:t,"aria-description":c["aria-description"]||M.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(M.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ve=(e=>(e.VALID="valid",e.ERROR="error",e))(ve||{});const us=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"border-accent-secondary text-primary";case ve.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ve.VALID:return"border-primary text-primary";case ve.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},fs=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ps=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===ve.ERROR?n.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ve.VALID?n.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ae(a,us(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ae(i,fs(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},gs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===ve.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(ps,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,hs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:u,trackClassName:d,fillClassName:f,thumbClassName:g,labelsClassName:p,"aria-label":m,"aria-labelledby":b,...v})=>{const y=h.useRef(null),D=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),C=h.useCallback(O=>{const A=y.current;if(!A)return e;const j=A.getBoundingClientRect(),k=(O-j.left)/j.width,z=t+k*(r-t),V=_t(s),ee=parseFloat((Math.round((z-t)/s)*s+t).toFixed(V));return Math.min(r,Math.max(t,ee))},[t,r,s,e]),w=h.useCallback(O=>{a||(O.currentTarget.setPointerCapture(O.pointerId),c?.(C(O.clientX)))},[a,C,c]),R=h.useCallback(O=>{a||O.buttons===0||c?.(C(O.clientX))},[a,C,c]),_=h.useCallback(O=>{if(a)return;const A=_t(s),j=V=>parseFloat((Math.round((V-t)/s)*s+t).toFixed(A)),k=V=>Math.min(r,Math.max(t,V));let z=e;switch(O.key){case"ArrowRight":case"ArrowUp":z=k(j(e+s));break;case"ArrowLeft":case"ArrowDown":z=k(j(e-s));break;case"Home":z=t;break;case"End":z=r;break;default:return}O.preventDefault(),z!==e&&c?.(z)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",u),...v,children:[i&&n.jsx(Ae.DialLabel,{...i,htmlFor:v.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:w,onPointerMove:R,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",d)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",f),style:{width:`${D}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":b,className:I.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",g),style:{left:`${D}%`},onKeyDown:_,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",p),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},ms=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(T.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),qr=h.createContext({dragDropManager:void 0});function De(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 xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},vr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function xs(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 bs(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(Ds(e))return"date";if(ys(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function ys(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ds(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ke(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bs(e)),t}function Zr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?De(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?De(1):"Expected the enhancer to be a function. Instead, received: '"+Ke(r)+"'");return r(Zr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?De(2):"Expected the root reducer to be a function. Instead, received: '"+Ke(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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 i}function f(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?De(4):"Expected the listener to be a function. Instead, received: '"+Ke(b)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?De(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 v=!0;return u(),l.push(b),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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.");v=!1,u();var D=l.indexOf(b);l.splice(D,1),o=null}}}function g(b){if(!xs(b))throw new Error(process.env.NODE_ENV==="production"?De(7):"Actions must be plain objects. Instead, the actual type was: '"+Ke(b)+"'. 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 b.type>"u")throw new Error(process.env.NODE_ENV==="production"?De(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"?De(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,b)}finally{c=!1}for(var v=o=l,y=0;y<v.length;y++){var D=v[y];D()}return b}function p(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?De(10):"Expected the nextReducer to be a function. Instead, received: '"+Ke(b));a=b,g({type:vr.REPLACE})}function m(){var b,v=f;return b={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(process.env.NODE_ENV==="production"?De(11):"Expected the observer to be an object. Instead, received: '"+Ke(D)+"'");function N(){D.next&&D.next(d())}N();var S=v(N);return{unsubscribe:S}}},b[xr]=function(){return this},b}return g({type:vr.INIT}),s={dispatch:g,subscribe:f,getState:d,replaceReducer:p},s[xr]=m,s}function q(e,t,...r){if(Cs()&&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 r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function Cs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ns(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Is(e,t){return e.filter(r=>r!==t)}function Yr(e){return typeof e=="object"}function Ss(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function js(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",yt="dnd-core/HOVER",Dt="dnd-core/DROP",Ct="dnd-core/END_DRAG";function yr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ts={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function ws(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(yr(i)),Es(r,l,c);const u=_s(r,l);if(u==null){e.dispatch(Ts);return}let d=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Os(o),d=o(u)}e.dispatch(yr(i,d));const g=c.getSource(u).beginDrag(l,u);if(g==null)return;As(g),c.pinSource(u);const p=c.getSourceType(u);return{type:vt,payload:{itemType:p,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function Es(e,t,r){q(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){q(r.getSource(s),"Expected sourceIds to be registered.")})}function Os(e){q(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function As(e){q(Yr(e),"Item must be an object.")}function _s(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function Rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ks(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Rs(e,a,r[a])})}return e}function Ps(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ls(s),Bs(s).forEach((o,l)=>{const c=Ms(o,l,a,s),u={type:Dt,payload:{dropResult:ks({},r,c)}};e.dispatch(u)})}}function Ls(e){q(e.isDragging(),"Cannot call drop while not dragging."),q(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Ms(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Fs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Fs(e){q(typeof e>"u"||Yr(e),"Drop result must either be an object or undefined.")}function Bs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function zs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();$s(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Ct}}}function $s(e){q(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Hs(e){return function(r,{clientOffset:s}={}){Vs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Us(a,o,l),Gs(a,i,o),Ks(a,i,o),{type:yt,payload:{targetIds:a,clientOffset:s||null}}}}function Vs(e){q(Array.isArray(e),"Expected targetIds to be an array.")}function Gs(e,t,r){q(t.isDragging(),"Cannot call hover while not dragging."),q(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];q(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);q(i,"Expected targetIds to be registered.")}}function Us(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ks(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ws(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function qs(e){return{beginDrag:ws(e),publishDragSource:Ws(e),hover:Hs(e),drop:Ps(e),endDrag:zs(e)}}class Zs{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=qs(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){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=r,t.subscribe(this.handleRefCountChange)}}function Ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Xr(Ys(t,s),r)}function Qs(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Xr(t,r)}const rt=[],nr=[];rt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function Js(e,t){return e===rt?!1:e===nr||typeof t>"u"?!0:js(t,e).length>0}class ea{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;q(typeof t=="function","listener must be a function."),q(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!Js(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){q(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return q(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(q(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(q(r,`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:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.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 Xs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Qs(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Qr=Dr.MutationObserver||Dr.WebKitMutationObserver;function Jr(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ta(e){let t=1;const r=new Qr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ra=typeof Qr=="function"?ta:Jr;class na{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let 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=ra(this.flush),this.requestErrorThrow=Jr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class sa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class aa{create(t){const r=this.freeTasks,s=r.length?r.pop():new sa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const en=new na,ia=new aa(en.registerPendingError);function oa(e){en.enqueueTask(ia.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",Nt="dnd-core/REMOVE_TARGET";function la(e){return{type:sr,payload:{sourceId:e}}}function ca(e){return{type:ar,payload:{targetId:e}}}function da(e){return{type:ir,payload:{sourceId:e}}}function ua(e){return{type:Nt,payload:{targetId:e}}}function fa(e){q(typeof e.canDrag=="function","Expected canDrag to be a function."),q(typeof e.beginDrag=="function","Expected beginDrag to be a function."),q(typeof e.endDrag=="function","Expected endDrag to be a function.")}function pa(e){q(typeof e.canDrop=="function","Expected canDrop to be a function."),q(typeof e.hover=="function","Expected hover to be a function."),q(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}q(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 Ce;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ce||(Ce={}));let ga=0;function ha(){return ga++}function ma(e){const t=ha().toString();switch(e){case Ce.SOURCE:return`S${t}`;case Ce.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class xa{addSource(t,r){Kt(t),fa(r);const s=this.addHandler(Ce.SOURCE,t,r);return this.store.dispatch(la(s)),s}addTarget(t,r){Kt(t,!0),pa(r);const s=this.addHandler(Ce.TARGET,t,r);return this.store.dispatch(ca(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return q(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return q(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ce.SOURCE}isTargetId(t){return Cr(t)===Ce.TARGET}removeSource(t){q(this.getSource(t),"Expected an existing source."),this.store.dispatch(da(t)),oa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){q(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ua(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);q(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){q(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=ma(t);return this.types.set(a,r),t===Ce.SOURCE?this.dragSources.set(a,s):t===Ce.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 ba=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function ya(e,t,r=ba){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Da(e=rt,t){switch(t.type){case yt:break;case sr:case ar:case Nt:case ir:return rt;case vt:case rr:case Ct:case Dt:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Ss(r,s);if(!(a.length>0||!ya(r,s)))return rt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ca(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ia(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case yt:return va(e.clientOffset,r.clientOffset)?e:Na({},e,{clientOffset:r.clientOffset});case Ct:case Dt:return Ir;default:return e}}function Sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Sa(e,a,r[a])})}return e}const ja={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(e=ja,t){const{payload:r}=t;switch(t.type){case vt:return We({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return We({},e,{isSourcePublic:!0});case yt:return We({},e,{targetIds:r.targetIds});case Nt:return e.targetIds.indexOf(r.targetId)===-1?e:We({},e,{targetIds:Is(e.targetIds,r.targetId)});case Dt:return We({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ct:return We({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function wa(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case Nt:return e-1;default:return e}}function Ea(e=0){return e+1}function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Oa(e,a,r[a])})}return e}function _a(e={},t){return{dirtyHandlerIds:Da(e.dirtyHandlerIds,{type:t.type,payload:Aa({},t.payload,{prevTargetIds:Ns(e,"dragOperation.targetIds",[])})}),dragOffset:Ia(e.dragOffset,t),refCount:wa(e.refCount,t),dragOperation:Ta(e.dragOperation,t),stateId:Ea(e.stateId)}}function Ra(e,t=void 0,r={},s=!1){const a=ka(s),i=new ea(a,new xa(a)),o=new Zs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function ka(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Zr(_a,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Pa(e,t){if(e==null)return{};var r=La(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function La(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ma=h.memo(function(t){var{children:r}=t,s=Pa(t,["children"]);const[a,i]=Fa(s);return h.useEffect(()=>{if(i){const o=tn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(qr.Provider,{value:a,children:r})});function Fa(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ba(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ba(e,t=tn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:Ra(e,t,r,s)}),a[pt]}function tn(){return typeof global<"u"?global:window}var Rt,jr;function za(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var $a=za();const Ha=x.getDefaultExportFromCjs($a),Ve=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Va(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Ha(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function Ga(e,t,r){const[s,a]=Va(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function rn(e,t,r){return Ga(t,e||(()=>({})),()=>r.reconnect())}function nn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ua(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Ka(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Wa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){q(!kt,"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 kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;q(!Pt,"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 Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}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 Lt=!1;class qa{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;q(!Lt,"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 Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!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 Za(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ya(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,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 i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const u=i[c];if(!l(u))return!1;const d=e[u],f=t[u];if(a=void 0,a===!1||a===void 0&&d!==f)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xa(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 Qa(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Xa(s),Ja(s,r?i=>e(i,r):e)}}function sn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Qa(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function Ja(e,t){const r=e.ref;return q(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ei{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,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(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=sn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,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 ti{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(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=sn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Xe(){const{dragDropManager:e}=h.useContext(qr);return q(e!=null,"Expected drag drop context"),e}function ri(e,t){const r=Xe(),s=h.useMemo(()=>new ei(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function ni(){const e=Xe();return h.useMemo(()=>new Wa(e),[e])}class si{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ai(e,t,r){const s=h.useMemo(()=>new si(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function ii(e){return h.useMemo(()=>{const t=e.type;return q(t!=null,"spec.type must be defined"),t},[e])}function oi(e,t,r){const s=Xe(),a=ai(e,t,r),i=ii(e);Ve(function(){if(i!=null){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function li(e,t){const r=nn(e,t);q(!r.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=ni(),a=ri(r.options,r.previewOptions);return oi(r,s,a),[rn(r.collect,s,a),Ua(a),Ka(a)]}function ci(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function di(e){const t=Xe(),r=h.useMemo(()=>new ti(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ui(){const e=Xe();return h.useMemo(()=>new qa(e),[e])}function fi(e){const{accept:t}=e;return h.useMemo(()=>(q(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class pi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function gi(e,t){const r=h.useMemo(()=>new pi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function hi(e,t,r){const s=Xe(),a=gi(e,t),i=fi(e);Ve(function(){const[l,c]=Za(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=nn(e,t),s=ui(),a=di(r.options);return hi(r,s,a),[rn(r.collect,s,a),ci(a)]}const wr="column",mi="flex items-center",xi="mr-3 cursor-move text-secondary",bi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:u},d,f]=li(()=>({type:wr,item:{id:e,originalIndex:c},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof a=="function"&&p.originalIndex>-1&&a(p.id,p.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:p=>{if(!(!p||p.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(p.id,m)}}}),[s,a,e]);return f(g(l)),d(o),n.jsxs("div",{ref:l,className:I.mergeClasses(mi,r),style:{opacity:u?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:xi,"aria-label":i,children:n.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},It=({iconClassName:e,label:t,...r})=>t?n.jsx(x.DialDangerButton,{...r,label:t,appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(M.DialDangerIconButton,{...r,appearance:T.ButtonAppearance.Ghost,icon:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-textarea dial-input px-3 py-2",u.invalid&&"dial-input-error",u.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(Ae.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(x.DialErrorText,{text:s}),!s&&n.jsx(x.DialCaptionText,{text:l})]})},yi="inline-flex items-center rounded bg-layer-3",Di="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",Ci="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ni="text-secondary hover:text-primary",Ii="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Si=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const u=c.findIndex(g=>g.value===t);let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=(u+1)%c.length;break;case"ArrowLeft":case"ArrowUp":d=(u-1+c.length)%c.length;break;case"Home":d=0;break;case"End":d=c.length-1;break;default:return}l.preventDefault();const f=c[d];f&&f.value!==t&&r(f.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(yi,a),children:e.map((l,c)=>{const u=l.value===t,d=c===0,f=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":u,tabIndex:u?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Di,!f&&"-mr-px",d&&"rounded-l",f&&"rounded-r",u?Ci:Ni,g&&Ii),children:[l.icon,l.label]},l.value)})})},Mt=8,ji=24,an=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:u=!1,readOnly:d=!1,containerClassName:f,tagClassName:g,onChange:p})=>{const m=h.useRef(null),b=h.useRef([]),v=h.useRef(null),[y,D]=h.useState(e),[N,S]=h.useState(""),[C,w]=h.useState(!1),[R,_]=h.useState(e.length),O=h.useCallback(B=>F=>{b.current[B]=F},[]),A=h.useCallback(()=>{if(!u)return;const B=m.current;if(!B)return;const F=B.offsetWidth;if(F===0)return;const G=v.current?.offsetWidth??0,te=F-(d?0:ji)-Mt;let re=0,W=0;for(let se=0;se<y.length;se++){const de=b.current[se];if(!de)continue;const ue=de.offsetWidth+Mt;if(re+ue>te)break;re+=ue,W++}if(W<y.length&&W>0)for(;re+G>te&&W>0;){W--;const se=b.current[W]?.offsetWidth??0;re-=se+Mt}_(W)},[u,d,y.length]),j=B=>{const F=B.trim().replace(/,$/,"");if(F&&!y.includes(F)){const G=[F,...y];D(G),p?.(G)}},k=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),j(N),S(""))},z=()=>{N.trim()&&(j(N),S(""))},V=B=>{const F=y.filter((G,Z)=>Z!==B);D(F),p?.(F)},ee=()=>o?n.jsx(x.DialErrorText,{text:o}):i?n.jsx(x.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(u)return;const B=new ResizeObserver(()=>{if(m.current){const F=m.current.scrollHeight>m.current.clientHeight+10;w(F)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[y,u]),h.useEffect(()=>{if(!u){_(y.length);return}_(y.length);const B=new ResizeObserver(()=>{A()}),F=m.current;return F&&B.observe(F),A(),()=>B.disconnect()},[u,A,y]),h.useEffect(()=>{D(e)},[JSON.stringify(e)]);const U=n.jsxs("div",{ref:m,className:ae("flex gap-2 items-center relative",u?"flex-nowrap overflow-hidden w-full min-w-0":ae("flex-wrap",C?"flex-col-reverse":"flex-row"),f),children:[(u?y.slice(0,R):y).map((B,F)=>n.jsx(He,{label:B,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>V(F):void 0},B+F)),u&&R<y.length&&n.jsx(T.DialTooltip,{tooltip:y.slice(R).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(He,{label:`+${y.length-R}`})}),!d&&n.jsx("input",{id:s,type:"text",value:N,onChange:B=>S(B.target.value),onKeyDown:k,onBlur:z,className:ae("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",u?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),u&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[y.map((B,F)=>n.jsx("div",{ref:O(F),className:"inline-flex shrink-0",children:n.jsx(He,{label:B,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>V(F):void 0})},`measure-${B}-${F}`)),n.jsx("div",{ref:v,className:"inline-flex shrink-0",children:n.jsx(He,{label:`+${y.length}`})})]})]});return d?U:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Ae.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ae("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:U}),ee()]})},on=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(an,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=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"})),ln=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:u,emptyValueText:d,placeholder:f,editable:g=!1,onValueChange:p,collapseTagOverflow:m=!1,iconBefore:b})=>{const v=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),D=v||y?s:f?void 0:d,N=r?void 0:o,S=h.useCallback(_=>{p?.(_.target.value)},[p]),C=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx("input",{type:"text",className:ae("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:f||d,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(x.DialErrorText,{text:c})]}),w=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx(T.DialTooltip,{tooltip:D==null?void 0:String(D),children:D||!f?n.jsx("span",{className:a,children:D}):n.jsx("span",{className:"text-secondary",children:f})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(x.DialErrorText,{text:c})]}),R=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx(on,{placeholder:f,selectedItems:D,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[v?R():g?C():w(),t&&Wn.createPortal(e,document.body)]})},Ti=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:u,onClose:d,header:f,portalId:g,onApply:p,onCancel:m,cancelButtonTitle:b="Cancel",applyButtonTitle:v="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:N,id:S,size:C=x.PopupSize.Md})=>{const[w,R]=h.useState(!1),_=h.useCallback(()=>{r||R(!0)},[r]),O=h.useCallback(()=>{R(!1),d?.()},[d]),A=h.useCallback(()=>{m?.(),O()},[m,O]),j=h.useCallback(()=>{p(),O()},[p,O]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Ae.DialLabel,{label:e,htmlFor:t}),n.jsx(ln,{disabled:r,open:w,selectedValue:i??a.find(k=>k.id===s)?.name,valueClassName:o,inputClassName:ae(l,"py-2","px-3"),emptyValueText:c,placeholder:u,onOpen:_,children:n.jsx(x.DialPopup,{open:w,onClose:A,header:f,portalId:g,size:C,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(x.DialNeutralButton,{label:b,onClick:A}),n.jsx(x.DialPrimaryButton,{label:v,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(x.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:D,onChange:N,elementId:S,orientation:x.RadioGroupOrientation.Column})})})})]})},wi="Create",Ei="Cancel",Oi="flex items-center justify-end gap-2 px-6 py-3",Ai=({header:e,open:t=!1,submitLabel:r=wi,cancelLabel:s=Ei,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:u,onCancel:d,children:f,dividers:g=!0,size:p=x.PopupSize.Md,footer:m})=>{const b=a?null:n.jsxs("div",{className:Oi,children:[n.jsx(x.DialNeutralButton,{label:s,onClick:()=>d?d():c?.()}),n.jsx(x.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>u()})]}),v=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(x.DialLoader,{size:50})}):f??null,[f,a]);return n.jsx(x.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??b,size:p,children:v()})},_i=/^0+\.(\d+)?$/,Ri=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>!d||d==="-"?d:String(d)?.match(_i)?String(d)?.replace(Ri,"0"):Number(d),c=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}x.handleKeyDown(d,"number",r,s)},u=d=>{const f=d.clipboardData.getData("text"),g=f.replace(/\D/g,"");if(g!==f&&(d.preventDefault(),g)){const p=d.currentTarget,m=p.selectionStart??0,b=p.selectionEnd??0,v=p.value.slice(0,m)+g+p.value.slice(b);t?.(l(v))}};return n.jsx(x.DialInput,{type:"number",min:r,max:s,onChange:d=>t?.(l(d)),onKeyDown:e?c:a,onPaste:e?u:i,...o})},ki=({onClick:e})=>n.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Pi=({onClick:e})=>n.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),cn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(x.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(ki,{onClick:()=>s(!1)}):n.jsx(Pi,{onClick:()=>s(!0)})})},dn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(He,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(M.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Li="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Mi="w-full rounded flex flex-col",nt="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",Fi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",Bi=352,zi=4,$i=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Hi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=M.useSubMenuFloating(zi,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ae(nt,u&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(M.DialIcon,{icon:e.icon}),n.jsx(M.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(M.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(d=>{const f=t.includes(d.value);return n.jsx("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":!!d.disabled,disabled:d.disabled,className:ae(nt,f&&Yt,d.disabled&&xt),onClick:()=>!d.disabled&&r(d.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d.icon&&n.jsx(M.DialIcon,{icon:d.icon}),n.jsx(M.DialEllipsisTooltip,{text:d.labelNode??d.label})]})},d.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:u="Select...",searchable:d=!1,searchSize:f=T.ElementSize.Standard,searchPlaceholder:g,selectAll:p=!1,invalid:m,selectAllLabel:b="Select all",emptyStateTitle:v="No options available",emptyStateDescription:y,emptyStateIcon:D,disabled:N=!1,className:S,listClassName:C,closable:w=!1,header:R,footer:_,onClose:O,onChange:A,inlineSearch:j=!1,dismissRef:k,onFooterClick:z,open:V,onOpenChange:ee,onInlineQueryChange:U,customMultiSelectTagsRenderer:B})=>{const F=h.useId(),[G,Z]=h.useState(!1),te=V!==void 0,re=te?!!V:G,W=h.useCallback(E=>{te||Z(E),ee?.(E)},[te,ee]),[se,de]=h.useState(j&&c||""),ue=h.useRef(null),ce=h.useCallback(E=>{E!==se&&(de(E||""),U?.(E||""))},[U,se]),pe=s!==void 0,[ge,fe]=h.useState(a),K=pe?s:ge,X=h.useMemo(()=>t?Array.isArray(K)?K:[]:typeof K=="string"?[K]:[],[K,t]),Ne=h.useMemo(()=>{const E=se.trim().toLowerCase();return E?e.filter(Q=>Q.label.toLowerCase().includes(E)):e},[e,se]);h.useEffect(()=>{!re&&!j&&ce("")},[j,re,ce]);const Me=h.useRef(c);h.useEffect(()=>{j&&c!==Me.current&&(re||(Me.current=c,ce(c||"")))},[c,j,re,ce]);const he=h.useCallback(E=>{pe||fe(E),A?.(E)},[pe,A]),Fe=h.useCallback(E=>{if(t){const Q=new Set(X);Q.has(E)?Q.delete(E):Q.add(E),he(Array.from(Q));return}if(he(E),j){const Q=e.find(xe=>xe.value===E)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===E);Q&&ce(Q.label)}W(!1)},[t,he,j,W,X,e,ce]),je=h.useCallback((E,Q)=>{if(E.stopPropagation(),!t){he("");return}const xe=X.filter(Et=>Et!==Q);he(xe)},[t,X,he]),ne=h.useMemo(()=>Ne.filter(E=>!E.disabled),[Ne]),_e=h.useMemo(()=>ne.filter(E=>X.includes(E.value)).length,[ne,X]),Ie=h.useCallback(E=>{j&&!t&&!E&&Fe(se),W(E)},[Fe,j,t,se,W]),{allSelectedInFiltered:Be,someSelectedInFiltered:tt}=h.useMemo(()=>{const E=ne.length>0&&_e===ne.length;return{allSelectedInFiltered:E,someSelectedInFiltered:_e>0&&!E}},[ne,_e]),ye=h.useCallback(()=>{if(!(!t||ne.length===0))if(Be){const E=new Set(ne.map(Q=>Q.value));he(X.filter(Q=>!E.has(Q)))}else{const E=new Set(X);ne.forEach(Q=>E.add(Q.value)),he(Array.from(E))}},[Be,t,ne,X,he]),ze=X.length>0;h.useEffect(()=>{re&&j&&!t&&!N&&requestAnimationFrame(()=>{const E=ue.current;if(!E)return;E.focus();const Q=E.value?.length??0;E.setSelectionRange?.(Q,Q)})},[re,j,t,N]);const Re=!t&&ze?X[0]:void 0,me=h.useMemo(()=>Re?e.find(E=>E.value===Re)??e.flatMap(E=>E.children??[]).find(E=>E.value===Re):void 0,[e,Re]),wt=h.useCallback(()=>t?ze?B?.(e,X,je)||n.jsx(dn,{options:e,selectedValues:X,handleRemoveTag:je}):n.jsx("span",{className:"text-secondary truncate",children:u}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(M.DialIcon,{icon:me.icon}),n.jsx(M.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:u}),[ze,t,c,l,s,u,me,e,X,je,B]);h.useImperativeHandle(k,()=>({dismiss:()=>{W(!1)}}));const Te=h.useCallback(()=>{ce(X.length===1?me?.label??se:"")},[se,X.length,ce,me?.label]),$e=h.useCallback(()=>{N||(W(!re),j&&!t&&(Te(),ue.current?.focus()))},[N,j,re,t,Te,W]);return n.jsx(M.DialDropdown,{open:re,onOpenChange:Ie,disabled:N,closable:w,onClose:O,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:Bi,listClassName:C,renderOverlay:()=>n.jsxs("div",{id:`list-${r||F}`,role:"listbox","aria-multiselectable":t||void 0,className:Mi,children:[R&&n.jsx(n.Fragment,{children:typeof R=="function"?R():R}),(d||w)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&n.jsx(x.DialSearch,{size:f,placeholder:g,onChange:ce,value:se,id:`search-${r||F}`,containerClassName:I.mergeClasses(x.SIZE_CONFIG[f].containerClassName,"w-full")}),w&&n.jsx(x.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:E=>{O?.(E),W(!1)}})]}),t&&p&&ne.length>0&&n.jsx("div",{className:ae(nt,"mt-2"),children:n.jsx(Gt,{id:`${r||F}-selectAll`,label:b,checked:Be,indeterminate:tt,onChange:ye,ariaLabel:b})}),n.jsx("div",{className:ae("overflow-y-auto max-h-[352px]",j&&Ne.length===0?"":"py-1"),children:Ne.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:D??n.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:v,description:y})}):Ne.map(E=>{const Q=X.includes(E.value);return t?n.jsxs("div",{role:"option","aria-selected":Q,"aria-disabled":!!E.disabled,className:ae(nt,Q&&Fi,E.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||F}-${E.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[E.icon&&n.jsx(M.DialIcon,{icon:E.icon}),n.jsx("span",{className:"truncate",children:E.labelNode??E.label})]}),checked:Q,disabled:E.disabled,onChange:()=>!E.disabled&&Fe(E.value),ariaLabel:E.label}),E.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:E.description})]},E.value):E.children?.length?n.jsx(Hi,{opt:E,selectedValues:X,onSelect:Fe},E.value):n.jsx("button",{role:"option",type:"button","aria-selected":Q,"aria-disabled":!!E.disabled,disabled:E.disabled,className:ae(nt,Q&&Yt,E.disabled&&xt),onClick:()=>!E.disabled&&Fe(E.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[E.icon&&n.jsx(M.DialIcon,{icon:E.icon}),n.jsx(M.DialEllipsisTooltip,{text:E.labelNode??E.label}),E.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:E.description})]})},E.value)})}),_&&n.jsx("div",{onClick:E=>{z?.(E),z&&W(!1)},children:typeof _=="function"?_():_})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":`list-${r||F}`,className:I.mergeClasses(Li,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:E=>{N||j&&!t&&(Te(),E.preventDefault())},onClick:()=>{$e()},onKeyDown:E=>{(E.key===" "||E.code==="Space")&&(E.preventDefault(),$e())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||F}`,type:"text",placeholder:g??u,value:se||"",onChange:E=>ce(E.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:E=>{Te(),E.stopPropagation()},onClick:E=>{E.stopPropagation()},onKeyDown:E=>{E.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:wt()}),!j&&n.jsx(M.DialIcon,{icon:$i,className:ae("text-primary",re&&"rotate-180")})]})})},Vi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:u,defaultEmptyText:d,...f})=>{const g=h.useCallback(()=>{if(!u||Array.isArray(u)&&u.length===0)return d??"None";if(Array.isArray(u))return n.jsx(dn,{options:f.options,selectedValues:u});{const p=f.options?.find(m=>m.value===u);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||u})}},[u,f.options,d]);return n.jsx(x.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:d,children:n.jsx(ke,{className:a,value:u,elementId:o,invalid:!!i,...f})})};function un(e){let t=null;return()=>(t==null&&(t=e()),t)}function Gi(e,t){return e.filter(r=>r!==t)}function Ui(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Ki{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ui(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Gi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const St="__NATIVE_FILE__",fn="__NATIVE_URL__",pn="__NATIVE_TEXT__",gn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:St,HTML:gn,TEXT:pn,URL:fn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[St]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[gn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[fn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
|
|
2
|
-
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[pn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Wi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Zi=un(()=>/firefox/i.test(navigator.userAgent)),hn=un(()=>!!window.safari);class Or{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,u=o.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const p=r[d];if(p<t)c=d+1;else if(p>t)u=d-1;else return s[d]}l=Math.max(0,u);const f=t-r[l],g=f*f;return s[l]+a[l]*f+i[l]*g+o[l]*f*g}constructor(t,r){const{length:s}=t,a=[];for(let p=0;p<s;p++)a.push(p);a.sort((p,m)=>t[p]<t[m]?-1:1);const i=[],o=[];let l,c;for(let p=0;p<s-1;p++)l=t[p+1]-t[p],c=r[p+1]-r[p],i.push(l),o.push(c/l);const u=[o[0]];for(let p=0;p<i.length-1;p++){const m=o[p],b=o[p+1];if(m*b<=0)u.push(0);else{l=i[p];const v=i[p+1],y=l+v;u.push(3*y/((y+v)/m+(y+l)/b))}}u.push(o[o.length-1]);const d=[],f=[];let g;for(let p=0;p<u.length-1;p++){g=o[p];const m=u[p],b=1/i[p],v=m+u[p+1]-g-g;d.push((g-m-v)*b),f.push(v*b*b)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=d,this.c3s=f}}const Yi=1;function mn(e){const t=e.nodeType===Yi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Xi(e){var t;return e.nodeName==="IMG"&&(Zi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Qi(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return hn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function Ji(e,t,r,s,a){const i=Xi(t),l=mn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:f,anchorY:g}=s,{dragPreviewWidth:p,dragPreviewHeight:m}=Qi(i,t,u,d),b=()=>{let w=new Or([0,.5,1],[c.y,c.y/d*m,c.y+m-d]).interpolate(g);return hn()&&i&&(w+=(window.devicePixelRatio-1)*m),w},v=()=>new Or([0,.5,1],[c.x,c.x/u*p,c.x+p-u]).interpolate(f),{offsetX:y,offsetY:D}=a,N=y===0||y,S=D===0||D;return{x:N?y:v(),y:S?D:b()}}class eo{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){to(e,a,r[a])})}return e}class ro{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ar({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ar({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Er).some(r=>Er[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=qi(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,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 i=this.sourceNodes.get(a);return i&&mn(i)||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:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),g=this.sourcePreviewNodes.get(d)||f;if(g){const{anchorX:p,anchorY:m,offsetX:b,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),N=Ji(f,g,o,{anchorX:p,anchorY:m},{offsetX:b,offsetY:v});l.setDragImage(g,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(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 i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).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 i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new eo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ki(this.isNodeInDocument)}}const no=function(t,r,s){return new ro(t,r,s)},so=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f})=>{const g=h.useRef(null),p=h.useRef(null),[m,b]=h.useState([]),[v,y]=h.useState(!1),[D,N]=h.useState(!1),S=h.useCallback(U=>{const B=U.target.files;if(B&&B.length>0){const F=Array.from(B),G=d?.(F),Z=f?.(F);G?y(!0):Z?N(!0):e(F)}},[d,f,e]),C=h.useCallback(U=>i&&U?.length>i,[i]),w=h.useMemo(()=>v||D||C(m),[v,D,C,m]),R=()=>{b([]),y(!1),N(!1)},_=h.useMemo(()=>v?n.jsx(x.DialErrorText,{text:l}):D?n.jsx(x.DialErrorText,{text:u}):C(m)?n.jsx(x.DialErrorText,{text:c}):null,[c,l,u,m,C,v,D]);h.useEffect(()=>{R()},[a]);const[{isOver:O,canDrop:A},j]=or(()=>({accept:[St],drop(U){const B=U.files,F=d?.(B)??!1,G=f?.(B)??!1,Z=C?.(B)??!1;if(y(F),N(G),F||G||Z){b(B);return}e(B),R()},collect:U=>({isOver:U.isOver(),canDrop:U.canDrop()})}),[e,d,f,C]),k=U=>{(U.key==="Enter"||U.key==="Space")&&(U.preventDefault(),p.current?.click())},z=U=>{U?.preventDefault();const B=Array.from(U.dataTransfer?.items??[]);y(!!d?.(B)),N(!!f?.(B)),b(B)},V=U=>{U.target===U.currentTarget&&R()},ee=ae("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!A&&!w&&"border-primary",A&&(O?"border-accent-primary":"border-hover"),w&&"border-error");return j(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ee,ref:g,onDragOver:z,onDragLeave:V,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(x.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,label:s,onClick:()=>p.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:p,hidden:!0,accept:a,onChange:S})]}),n.jsx(n.Fragment,{children:_})]})},ao=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(x.DialInput,{...r,iconBefore:a(),containerClassName:ae("h-[40px] p-0",s&&"h-[60px]"),className:ae("rounded-r-none border-r-0",s&&"text-error",t)})},io=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const u=h.useRef(null),[d,f]=h.useState(!1),[g,p]=h.useState(!1),[m,b]=h.useState(0),v=h.useCallback(()=>{f(!1),p(!1),b(0)},[]),y=h.useCallback(O=>!!(i&&t.length+O.length>i),[i,t.length]),D=d||g,[{isOver:N,canDrop:S},C]=or(()=>({accept:[St],drop(O){const A=O.files,j=[...t,...A],k=s?.(A)??!1,z=a?.(A)??!1,V=y?.(A)??!1;if(f(k),p(z),k||z||V){b(A.length);return}r(j),v()},collect:O=>({isOver:O.isOver(),canDrop:O.canDrop()})}),[t,r,s,a,y,v]),w=O=>{O.preventDefault();const A=Array.from(O.dataTransfer?.items??[]);f(!!s?.(A)),p(!1),b(A.length)},R=O=>{O.target===O.currentTarget&&v()};C(u);const _=y(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:u,onDragOver:w,onDragLeave:R,className:ae("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!D&&!_&&(S&&N?"border-accent-primary":"border-primary"),(D||_)&&"border-error"),children:e}),d&&n.jsx(x.DialErrorText,{text:o}),g&&n.jsx(x.DialErrorText,{text:l}),!d&&!g&&_&&n.jsx(x.DialErrorText,{text:c})]})},xn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g}=e,p=h.useCallback((v,y)=>{v.stopPropagation(),a(t?.filter(D=>D.name!==y)||[])},[a,t]),m=h.useCallback(v=>n.jsx(It,{"aria-label":l,onClick:y=>p(y,v)}),[l,p]),b=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((v,y)=>n.jsx(ao,{id:v.name,value:v.name,iconAfter:m(v.name),iconBefore:r||s?.(v.name),invalid:i?.(v),error:i?.(v)?o:""},v.name+y))}),[t,r,s,i,o,m]);return n.jsx(Ma,{backend:no,children:!t||t.length===0?n.jsx(so,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(io,{existingFiles:t,onDrop:a,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:b}),c?.(t)&&n.jsx(x.DialErrorText,{text:u})]})})},oo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,multiple:f=!0,acceptTypes:g,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:b,...v})=>{const y=h.useRef(null),D=()=>y.current?.click(),N=()=>{e([])},S=h.useCallback(_=>_?.some(O=>!(g==="/"||g?.toLowerCase()?.includes(O?.type?.toLowerCase()))),[g]),C=h.useCallback(_=>{if(!i)return!1;const O=i*(1024*1024);return _?.some(A=>{const j=A.size;return!!j&&j>O})},[i]),w=h.useCallback(_=>{if(!o||!f)return!1;const O=o*1024*1024;return _.reduce((j,k)=>j+k.size,0)>O},[o,f]),R=h.useCallback(_=>{const O=_.target.files;if(O&&O.length>0){const A=Array.from(O),j=S(A),k=C(A);!j&&!k&&e([...s||[],...A])}},[S,C,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(Ae.DialLabel,{label:`${t}: ${f?s?.length||0:""}`,htmlFor:r}),f&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(x.DialNeutralButton,{label:p,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(x.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:D}),b]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:f,ref:y,hidden:!0,accept:g,onChange:R}),n.jsx(xn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:f,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,getIsFileFormatError:S,getIsFileSizeError:C,getIsMultiFilesSizeError:w,...v})]})},lo=({icon:e,ariaLabel:t,size:r=T.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:u="bottom-start",matchReferenceWidth:d=!1,open:f,onOpenChange:g,defaultOpen:p=!1,...m})=>{const b=r===T.ElementSize.Small,[v,y]=h.useState(p),D=f??v,N=b?"w-8 px-0":"w-10 px-0",S={[T.ElementSize.Small]:"size-5",[T.ElementSize.Standard]:"size-6",[T.ElementSize.Large]:"size-7"},C=w=>{y(w),g?.(w)};return n.jsx(M.DialDropdown,{...m,disabled:s,placement:u,matchReferenceWidth:d,className:a,open:D,onOpenChange:C,defaultOpen:p,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.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",b?"h-8 px-2":"h-10 px-2",c?void 0:N,i),children:[n.jsx(M.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",S[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:"relative z-10 inline-grid size-5 shrink-0 place-items-center",children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(M.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",D&&"rotate-180")})]})]})})},co="application/octet-stream";function uo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const u=c.path||c.url||"",d=fo(c.nodeType),f=d===x.DialFileNodeType.FOLDER,g=$t(u,f);let p;return c.parentPath===null||c.parentPath===void 0?p=a:c.parentPath===""?p="":p=$t(c.parentPath,!0),{...c,originalPath:u,path:g,parentPath:p,nodeType:d}}),o=new Map;i.forEach(c=>{const u={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:po(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===x.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===x.DialFileNodeType.ITEM&&(u.extension=go(c.name),u.contentType=c.contentType||co,u.contentLength=c.contentLength||0),o.set(c.path,u)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const u=c.path.lastIndexOf(c.name||""),d=c.path.slice(0,u),f=o.get(d);f&&f.nodeType===x.DialFileNodeType.FOLDER?(f.items=f.items||[],f.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function fo(e){return e.toUpperCase()==="FOLDER"?x.DialFileNodeType.FOLDER:x.DialFileNodeType.ITEM}function po(e){if(!e)return;const t=e.toUpperCase();return Object.values(x.DialFileResourceType).find(s=>s.toUpperCase()===t)}function go(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ho(e,t="Prompts",r="prompts/public/",s="root"){const a=uo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:x.DialFileNodeType.FOLDER,folderId:s,items:a}]}const bn=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var qe=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(qe||{}),at=(e=>(e.Select="select",e.Radio="radio",e))(at||{}),jt=(e=>(e.Row="row",e.Column="column",e))(jt||{}),J=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(J||{});const mo={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"},vn=h.createContext(null);function Se(){const e=h.useContext(vn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function _r(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function Y(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const d of a)i=i?.[d];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?Y(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=_r(o,Y(l,t,r+1));s=_r(o,i)}return s}function yn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function Tt(e){return e==null||e===""}function Ue(e){return e.type===J.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Dn(e,t){return e.type===J.Null?"null":e.$ref?Y(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 Ee(e,t,r=0){if(r>15)return;const s=Y(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 i=Y({$ref:s.discriminator.mapping[a]},t);return{...Ee(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ue(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Ee(l,t,r+1);c!==void 0&&(a[o]=c,i=!0)}return i?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function we(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Y(t,r);if(o.anyOf){const u=o.anyOf.filter(d=>d.type!==J.Null);return e!=null&&u.length===1?we(e,u[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const u=o.discriminator.propertyName,d=e?.[u];if(d&&o.discriminator.mapping[d]){const f={$ref:o.discriminator.mapping[d]},g=Y(f,r);return we(e,g,r,s,a+1)}return i}if(o.type===J.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let u=0;u<e.length;u++){const d=we(e[u],o.items,r,`${s}[${u}]`,a+1);i.push(...d)}return i}if(!Ue(o))return i;const l=o.required??[],c=e;for(const u of l){const d=o.properties?.[u];if(d&&Y(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c?.[u];if(Tt(g)){const p=d?.title??bt(u);i.push({path:f,message:`${p} is required`})}}if(c&&o.properties)for(const[u,d]of Object.entries(o.properties)){if(Y(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c[u];if(g!=null){const p=we(g,d,r,f,a+1);i.push(...p)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const u=o.additionalProperties;for(const[d,f]of Object.entries(c)){const g=s?`${s}.${d}`:d,p=we(f,u,r,g,a+1);i.push(...p)}}return i}function lr(e,t,r){const s=Y(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ue(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!Y(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const u=o?.[c];return u!=null&&u!==""}).length}/${i} fields`}return""}function xo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===J.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Y(a,r).type===J.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Y(a,r).type===J.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Y(a,r);return i.type===J.Number||i.type===J.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Y(a,r).type===J.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(Ue(i)||i.oneOf)return a}return 0}return 0}function bo(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Cn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case J.String:return"";case J.Boolean:return!1;case J.Array:return[];case J.Integer:case J.Number:return;default:return{}}}const it=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[u,d]=h.useState(l),f=a===0,g="rounded border border-secondary",p=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",f?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",u?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",f?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:p,onClick:()=>d(b=>!b),role:"button","aria-expanded":u,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:u?n.jsx($.IconChevronDown,{size:16,stroke:2}):n.jsx($.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",f?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Ae.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(M.DialIcon,{icon:n.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(M.DialIcon,{icon:n.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(It,{size:T.ElementSize.Small,onClick:b=>{b.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),u&&n.jsx("div",{className:m,children:i})]})},Nn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:u=new Set,skipUntouched:d=!1}=Se(),f=Y(e,l),g=Ue(f),p=f.type===J.Array;if(g||p){const v=lr(t,f,l),y=we(t,f,l,s.join(".")),D=s.join("."),N=D+".",S=!d||u.has(D)||[...u].some(C=>C.startsWith(N));return n.jsx(it,{title:o??f.title??s[s.length-1]??"Section",description:f.description,level:a,summary:v,errorCount:S?y.length:0,defaultExpanded:c,children:n.jsx(Oe,{schema:f,value:t,onChange:r,path:s,level:a+1,required:i})})}const b=(!d||u.has(s.join(".")))&&i&&Tt(t)?`${o??"Field"} is required`:void 0;return n.jsx(x.DialFormItem,{label:o,required:i,description:f.description,error:b,children:n.jsx(Oe,{schema:f,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=Se(),l=Y(e,i),c=yn(Object.entries(l.properties??{}).filter(([,f])=>!Y(f,i).isHidden)),u=l.required??[],d=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([f,g])=>{const m=Y(g,i).title??g.title??bt(f),b=u.includes(f);return n.jsx(Nn,{schema:g,value:d[f],onChange:v=>r({...d,[f]:v}),path:[...s,f],level:a,required:b,label:m},f)})})},vo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=Se(),u=Array.isArray(t)?t:[],d=e.items,[f,g]=h.useState(void 0);if(!d)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const p=h.useMemo(()=>Y(d,i),[d,i]),m=h.useMemo(()=>p.discriminator,[p]),b=h.useMemo(()=>m?.propertyName,[m]),v=h.useMemo(()=>m?Object.keys(m.mapping).map(S=>({value:S,label:S})):[],[m]),y=()=>{const S=f??v[0]?.value;let C;if(m&&S){const w=Y({$ref:m.mapping[S]},i);C={...Ee(w,i)??{},[m.propertyName]:S}}else C=Ee(p,i)??Cn(p);r([...u,C])},D=S=>{r(u.filter((C,w)=>w!==S))},N=(S,C)=>{r(u.map((w,R)=>R===S?C:w))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),u.map((S,C)=>{const w=bo(S,b,C),R=lr(S,p,i),_=we(S,p,i,`${s.join(".")}[${C}]`);return n.jsx(it,{title:w,level:a,summary:R,errorCount:_.length,onRemove:l?void 0:()=>D(C),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Oe,{schema:d,value:S,onChange:O=>N(C,O),path:[...s,String(C)],level:a+1})},C)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:v,value:f??v[0]?.value,placeholder:o.selectTypeToAdd,onChange:S=>{const C=typeof S=="string"?S:S[0];g(C)}})}),n.jsx(x.DialGhostButton,{label:o.addItem,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})]})]})},yo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=Se(),c=h.useId(),u=e.discriminator;if(u){const v=u.propertyName,y=u.mapping,D=Object.keys(y).map(w=>({value:w,label:w})),N=typeof t=="object"&&t!==null?t[v]:void 0,S=N?Y({$ref:y[N]},i):void 0,C=w=>{const R=Y({$ref:y[w]},i),_=Ee(R,i)??{};r({..._,[v]:w})};if(e.discriminatorDisplay===at.Radio){const w=e.discriminatorOrientation===jt.Row,R=N?(()=>{const _=Y({$ref:y[N]},i),{[v]:O,...A}=_.properties??{};return{..._,properties:A}})():void 0;return w?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(y).map(_=>{const O=Y({$ref:y[_]},i);return n.jsx(M.DialRadioButton,{name:c,value:_,inputId:`${c}-${_}`,label:O.title??_,checked:N===_,disabled:l,onChange:()=>C(_)},_)})}),R&&n.jsx(gt,{schema:R,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(y).map(_=>{const O=Y({$ref:y[_]},i),A=N===_,{[v]:j,...k}=O.properties??{},z={...O,properties:k};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:_,inputId:`${c}-${_}`,label:O.title??_,checked:A,disabled:l,onChange:()=>C(_)}),A&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:z,value:t,onChange:r,path:s,level:a})})]},_)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:D,value:N,placeholder:o.selectTypePlaceholder,disabled:l,onChange:w=>{const R=typeof w=="string"?w:w[0];R&&C(R)}})}),S&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:S,value:t,onChange:r,path:s,level:a})})]})}const d=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let v=0;v<d.length;v++)if(Y(d[v],i).required?.every(D=>D in t))return v}return 0})(),p=v=>{const y=Y(d[v],i),D=Ee(y,i);r(D??null)},m=d[g];if(e.discriminatorDisplay===at.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:d.map((v,y)=>{const D=Y(v,i),N=Dn(v,i)??`Option ${y+1}`,S=g===y;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:String(y),inputId:`${c}-${y}`,label:N,checked:S,disabled:l,onChange:()=>p(y)}),S&&D&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Oe,{schema:D,value:t,onChange:r,path:s,level:a})})]},y)})});const b=d.map((v,y)=>{const D=Y(v,i);return{value:String(y),label:D.title??`Option ${y+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:b,value:String(g),disabled:l,onChange:v=>{const y=typeof v=="string"?v:v[0];p(Number(y))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Do=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=Se(),l=e.anyOf??[],c=l.map((m,b)=>({value:String(b),label:Dn(m,i)})),u=xo(t,l,i),d=l[u],g=Y(d,i).type===J.Null,p=m=>{const b=Y(l[m],i);if(b.type===J.Null){r(null);return}const v=Ee(b,i);if(v!==void 0){r(v);return}switch(b.type){case J.Array:r([]);break;case J.String:r("");break;case J.Boolean:r(!1);break;case J.Integer:case J.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:c,value:String(u),disabled:o,onChange:m=>{const b=typeof m=="string"?m:m[0];p(Number(b))}})}),!g&&d&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:d,value:t,onChange:r,path:s,level:a})})]})},In=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=Se(),u=e.const!==void 0,d=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===J.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(p=>{const m=c?.[p];return Array.isArray(m)?m.map(b=>{const v=String(b);return{value:v,label:v}}):[]});return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(u)return n.jsx(x.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(d&&e.enumDisplay===at.Radio){const g=e.enumOrientation===jt.Row;return n.jsx("div",{role:"radiogroup",className:g?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(p=>{const m=String(p);return n.jsx(M.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:b=>r(b)},m)})})}if(d){const g=e.enum.map(p=>({value:String(p),label:String(p)}));return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case J.Boolean:return n.jsx(Ae.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case J.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case J.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(cn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(x.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Sn=e=>!!(e.oneOf||e.anyOf||e.type===J.Array||Ue(e)),Co=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,onKeyChange:a,onValueChange:i,onRemove:o,keyInputPlaceholder:l,removeFieldAriaLabel:c,path:u,level:d,readonly:f=!1,inputClassName:g})=>{const{rootSchema:p,texts:m,defaultExpanded:b=!0,touchedPaths:v=new Set,markTouched:y=()=>{},skipUntouched:D=!1}=Se(),[N,S]=h.useState(t),C=Sn(s),w=[...u,e,"key"].join("."),_=(!D||v.has(w))&&t==="",O=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:C?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(x.DialInput,{value:N,disabled:f,invalid:_,onChange:z=>S(z??""),onBlur:()=>{y(w),N!==t&&a(N)},placeholder:l,containerClassName:g}),n.jsx(x.DialErrorText,{text:_?`${m.keyColumnHeader} is required`:void 0})]}),!C&&n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{schema:s,value:r,onChange:i})}),!f&&n.jsx(It,{size:T.ElementSize.Small,onClick:o,"aria-label":c,className:"shrink-0 p-1"})]});if(!C)return O;const A=[...u,t],j=lr(r,s,p),k=we(r,s,p,A.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[O,n.jsx(it,{title:t,level:d,summary:j,errorCount:k.length+(_?1:0),defaultExpanded:b,children:n.jsx(Oe,{schema:s,value:r,onChange:i,path:A,level:d+1})})]})},No=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c}=Se(),u=e.additionalProperties===!0||e.additionalProperties==null?{type:"string"}:typeof e.additionalProperties=="object"?Y(e.additionalProperties,i):{type:"string"},d=Sn(u),[f,g]=h.useState(()=>Object.entries(t??{}).map(([N,S])=>Rr(N,S))),p=N=>Object.fromEntries(N.filter(S=>S.key!=="").map(S=>[S.key,S.value])),m=(N,S)=>{const C=f.map((w,R)=>R===N?{...w,key:S}:w);g(C),r(p(C))},b=(N,S)=>{const C=f.map((w,R)=>R===N?{...w,value:S}:w);g(C),r(p(C))},v=()=>d?Ee(u,i)??Cn(u):"",y=()=>{g(N=>[...N,Rr("",v())])},D=N=>{const S=f.filter((C,w)=>w!==N);g(S),r(p(S))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[f.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),f.length>0&&!d&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:o.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:o.valueColumnHeader})]}),f.map((N,S)=>n.jsx(Co,{pairId:N.id,pairKey:N.key,pairValue:N.value,valueSchema:u,onKeyChange:C=>m(S,C),onValueChange:C=>b(S,C),onRemove:()=>D(S),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},N.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(x.DialGhostButton,{label:o.addField,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})})]})},jn=({value:e,onChange:t,theme:r=ot.EditorThemes.dark,height:s=240})=>{const{readonly:a}=Se(),[i,o]=h.useState(null),[l,c]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(d=>{o(()=>d.DialJsonEditor)})},[]);const u=d=>{const f=d??"";c(f);try{t(JSON.parse(f))}catch{}};return n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:l,currentTheme:r,onChange:u,options:{readOnly:a}})})},Oe=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:u=()=>{},touchedPaths:d=new Set,skipUntouched:f=!1,jsonEditorTheme:g}=Se(),p=Y(e,l),m=y=>{u(s.join(".")),r(y)},b=!f||d.has(s.join("."));let v;if(p.oneOf)v=n.jsx(yo,{schema:p,value:t,onChange:m,path:s,level:a});else if(p.anyOf&&p.type!==J.Object)v=n.jsx(Do,{schema:p,value:t,onChange:m,path:s,level:a});else if(Ue(p)){const y=p.additionalProperties!=null&&p.additionalProperties!==!1,D=!p.properties||Object.keys(p.properties).length===0;y&&D?v=n.jsx(No,{schema:p,value:t,onChange:m,path:s,level:a}):D&&p.additionalProperties!==!1?v=n.jsx(jn,{value:t,onChange:m,theme:g}):v=n.jsx(gt,{schema:p,value:t,onChange:m,path:s,level:a})}else if(p.type===J.Array)v=n.jsx(vo,{schema:p,value:t,onChange:m,path:s,level:a});else{const y=b&&i&&Tt(t),D=!o&&y?`${p.title??"Field"} is required`:void 0;v=n.jsxs(n.Fragment,{children:[n.jsx(In,{schema:p,value:t,onChange:m,invalid:y}),n.jsx(x.DialErrorText,{text:D})]})}return c?c(s,p,v):v},Io=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=qe.Sections,onChange:c,onPropertyChange:u,onDefaultValues:d,renderField:f,skipUntouched:g=!1,jsonEditorTheme:p,acceptableResourceTypes:m})=>{const b=h.useMemo(()=>({...mo,...r}),[r]),v=h.useMemo(()=>t||(Ee(e,e)??{}),[]),[y,D]=h.useState(v),[N,S]=h.useState(new Set),C=h.useCallback(j=>{S(k=>k.has(j)?k:new Set([...k,j]))},[]);h.useEffect(()=>{d?.(v)},[]);const w=(j,k)=>{const z={...y,[j]:k};D(z),c?.(z),u?.(j,k)},R=new Set(Object.keys(e.properties??{})),_=Object.keys(y).filter(j=>!R.has(j)),O=yn(Object.entries(e.properties??{}).filter(([,j])=>!Y(j,e).isHidden)),A=e.required??[];return n.jsx(vn.Provider,{value:{rootSchema:e,texts:b,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:p,acceptableResourceTypes:m,renderField:f,touchedPaths:N,markTouched:C,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[O.map(([j,k])=>{const z=Y(k,e),V=z.title??k.title??bt(j),ee=A.includes(j),U=y[j];if(l===qe.Flat)return n.jsx(Nn,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:0,required:ee,label:V},j);if(l===qe.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:V}),n.jsx(Oe,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:0,required:ee})]},j);const B=we(U,z,e,j),F=j+".",G=!g||N.has(j)||[...N].some(Z=>Z.startsWith(F));return n.jsx(it,{title:V,description:z.description,level:0,defaultExpanded:i,errorCount:G?ee&&Tt(U)?Math.max(B.length,1):B.length:0,children:n.jsx(Oe,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:1,required:ee})},j)}),_.map(j=>{const k=bt(j),z=n.jsx(jn,{value:y[j],onChange:V=>w(j,V),theme:p});return l===qe.Sections?n.jsx(it,{title:k,level:0,defaultExpanded:i,children:z},j):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:k}),z]},j)})]})})},So=e=>({info:n.jsx($.IconInfoCircleFilled,{size:e.size}),error:n.jsx($.IconAlertCircleFilled,{size:e.size}),warning:n.jsx($.IconAlertTriangleFilled,{size:e.size}),success:n.jsx($.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(x.Spinner,{size:e.size}),general:n.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),jo={[x.NotificationVariant.Info]:"bg-info text-info",[x.NotificationVariant.Success]:"bg-success text-success",[x.NotificationVariant.Warning]:"bg-warning text-warning",[x.NotificationVariant.Error]:"bg-error text-error",[x.NotificationVariant.Loading]:"bg-layer-raised text-info",[x.NotificationVariant.General]:"bg-layer-sunken text-primary"},To={[x.NotificationVariant.Info]:"status",[x.NotificationVariant.Success]:"status",[x.NotificationVariant.Warning]:"alert",[x.NotificationVariant.Error]:"alert",[x.NotificationVariant.Loading]:"status",[x.NotificationVariant.General]:"status"},wo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cr=({variant:e=x.NotificationVariant.Info,type:t=x.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:u,textClassName:d,...f})=>{const g=h.useMemo(()=>So({size:i,stroke:o})[e],[e,i,o]),p=d??(t===x.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:To[e],...f,className:I.mergeClasses(wo,jo[e],t===x.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===x.NotificationType.SectionMessage&&e===x.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(M.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",p),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),u,l&&n.jsx("div",{className:"relative size-[40px]",children:n.jsx(P.CloseButton,{className:"absolute top-[-2px] right-0 size-auto hover:bg-transparent ",ariaLabel:"Close notification",onClose:m=>c?.(m)})})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Eo=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,Oo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=Eo(a);if(!t.trim())return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:l})},Ao=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.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),children:t}),Qe=(e,t)=>({type:s,...a})=>n.jsx(cr,{...a,variant:e,type:s||t}),Je=(e,t)=>({variant:s,...a})=>n.jsx(cr,{...a,variant:s||t,type:e}),_o=Qe(x.NotificationVariant.Error,x.NotificationType.Toast),Ro=Qe(x.NotificationVariant.Info,x.NotificationType.Toast),ko=Qe(x.NotificationVariant.Success,x.NotificationType.Toast),Po=Qe(x.NotificationVariant.Warning,x.NotificationType.Toast),Lo=Qe(x.NotificationVariant.Loading,x.NotificationType.Toast),Mo=Qe(x.NotificationVariant.General,x.NotificationType.Toast),Fo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Error),Bo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Info),zo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Success),$o=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Warning),Ho=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Loading),Vo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Go="en-GB",Uo={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},Tn="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",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Ko="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Wo="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",qo="bg-control-accent text-control-permanent",Zo="text-accent dial-small-semi-text",Yo="text-control-disable-primary",On="text-secondary",Xo=n.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Qo=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Lr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Mr=(e,t,r)=>{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(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},Jo=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Fr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),el=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Br=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},tl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),rl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),sl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),zr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const u=M.useThemeScope(),[d,f]=h.useState(!1),{refs:g,floatingStyles:p,context:m}=le.useFloating({open:d,onOpenChange:S=>f(t?!1:S),placement:"bottom-start",whileElementsMounted:le.autoUpdate,middleware:[le.offset(8),le.flip({padding:8}),le.shift({padding:8})]}),b=le.useClick(m,{enabled:!t}),v=le.useDismiss(m),y=le.useRole(m,{role:"dialog"}),{getReferenceProps:D,getFloatingProps:N}=le.useInteractions([b,v,y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":d,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...D(),children:s}),d&&n.jsx(le.FloatingPortal,{children:n.jsx(le.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:p,"aria-label":c,className:I.mergeClasses(Ko,u,a),...N(),children:o(()=>f(!1))})})})]})},$r=({id:e,value:t,onChange:r,disabled:s,invalid:a,className:i,ariaLabel:o,placeholder:l="--:--",timezoneLabel:c})=>{const[u,d]=h.useState(t);h.useEffect(()=>{d(t)},[t]);const f=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":o,placeholder:l,disabled:s,value:u,onChange:g=>{const p=rl(g.target.value);d(p),tl(p)&&r(p)},className:I.mergeClasses(Tn,a&&En,s&&wn,i)});return c?n.jsxs("div",{className:"relative w-full",children:[f,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:c})]}):f},al=({mode:e=be.Date,value:t,onChange:r,labelProps:s,placeholder:a,disabled:i=!1,invalid:o=!1,id:l,className:c,minDate:u,maxDate:d,locale:f=Go,fieldClassName:g,showTimezone:p=!1})=>{const m=a??Uo[e],b=t instanceof Date?t:null,v=h.useId(),y=l??v,D=s?.id??`${y}-label`,N=!!s?.label,S=typeof s?.label=="string"?s.label:void 0,C=N?`${D} ${y}`:void 0,w=s?n.jsx(P.Label,{...s,id:D,htmlFor:y}):null,[R,_]=h.useState(()=>b??new Date),O=h.useMemo(()=>new Date,[]),A=h.useMemo(()=>p?bn({locale:f}):null,[p,f]),j=h.useMemo(()=>nl(f),[f]),k=h.useMemo(()=>sl(f),[f]),z=h.useMemo(()=>Qo(R.getFullYear(),R.getMonth()),[R]),V=F=>{_(G=>new Date(G.getFullYear(),G.getMonth()+F,1))},ee=(F,G)=>{if(Mr(F,u,d))return;const Z=e===be.DateTime&&b?Br(F,dt(b)):F;r?.(Z),e===be.Date&&G()},U=F=>{r?.(Br(b??new Date,F))},B=()=>b?e===be.DateTime?`${Fr(b,f)}, ${dt(b)}`:Fr(b,f):m;if(e===be.Time){const F=typeof t=="string"?t:b?dt(b):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx($r,{id:y,value:F,onChange:G=>r?.(G),disabled:i,invalid:o,placeholder:m,className:g,timezoneLabel:A})]})}if(e===be.Weekday){const F=typeof t=="string"?t:void 0,G=k.find(Z=>Z.value===F);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx(zr,{id:y,disabled:i,invalid:o,labelledBy:C,panelLabel:S??m,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??m}),n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:Z=>n.jsx("div",{role:"listbox","aria-label":S??m,className:"flex flex-col gap-0.5",children:k.map(te=>n.jsx("button",{type:"button",role:"option","aria-selected":te.value===F,className:I.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",te.value===F&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(te.value),Z()},children:te.label},te.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx(zr,{id:y,disabled:i,invalid:o,labelledBy:C,panelLabel:S??m,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!b&&"text-secondary"),children:B()}),Xo]}),panel:F=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(P.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:T.ElementSize.Small,onClick:()=>V(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Jo(R,f)}),n.jsx(P.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:T.ElementSize.Small,onClick:()=>V(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[j.map(G=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),z.map(G=>{const Z=G.getMonth()!==R.getMonth(),te=Lr(G,b),re=Lr(G,O),W=Mr(G,u,d);return n.jsx("button",{type:"button",disabled:W,"aria-label":el(G,f),"aria-pressed":te,"aria-current":re?"date":void 0,className:I.mergeClasses(Wo,Z&&Yo,re&&!te&&Zo,te&&qo,W&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>ee(G,F),children:G.getDate()},G.toISOString())})]}),e===be.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx($r,{ariaLabel:"Time",value:b?dt(b):"",onChange:U,className:"w-[120px] px-3 py-1.5"})]})]})})]})},il=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(M.DialIcon,{icon:n.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),o=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:i}:{}}));return n.jsx(x.DialBreadcrumb,{className:s,ariaLabel:a,separator:n.jsx(M.DialIcon,{icon:n.jsx($.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:o,labelClassName:I.mergeClasses(t,"text-secondary","!cursor-default")})},et=({label:e,variant:t,appearance:r=T.ButtonAppearance.Solid,size:s=T.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:u,href:d,target:f,rel:g,disabled:p,...m})=>{const b=I.mergeClasses("dial-kit-base-button",t&&P.getButtonClassNames(t,r),s===T.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===T.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===T.ElementSize.Small&&"dial-kit-base-button-small",r!==T.ButtonAppearance.Link&&(s===T.ElementSize.Small?"px-2":"px-4"),s!==T.ElementSize.Small&&r!==T.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),v=e?void 0:u?.tooltip,y=T.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],v),D=n.jsxs(n.Fragment,{children:[n.jsx(M.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(M.DialIcon,{icon:o})]}),N=m,S=d!==void 0?n.jsx("a",{...N,href:p?void 0:d,target:f,rel:g??(f==="_blank"?"noopener noreferrer":void 0),"aria-disabled":p||void 0,tabIndex:p?-1:N.tabIndex,onClick:p?void 0:N.onClick,className:b,"aria-label":y,children:D}):n.jsx("button",{...m,type:c,disabled:p,className:b,"aria-label":y,children:D});return u?n.jsx(P.Tooltip,{asChild:!0,...u,children:S}):S},dr=(e,t)=>({appearance:s,...a})=>n.jsx(et,{...a,variant:e,appearance:s||t}),ur=(e,t)=>({variant:s,...a})=>n.jsx(et,{...a,variant:s||t,appearance:e}),Rn=dr(T.ButtonVariant.Primary,T.ButtonAppearance.Solid),fr=dr(T.ButtonVariant.Neutral,T.ButtonAppearance.Solid),ol=dr(T.ButtonVariant.Danger,T.ButtonAppearance.Solid),ll=ur(T.ButtonAppearance.Link,T.ButtonVariant.Primary),cl=ur(T.ButtonAppearance.Ghost,T.ButtonVariant.Primary),dl=ur(T.ButtonAppearance.Outlined,T.ButtonVariant.Neutral),ul=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const i=I.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),o=n.jsx("button",{...a,type:s,className:i,"aria-label":T.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(T.DialTooltip,{...r,children:o}):o},fl=e=>n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),pl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>fl(a),[a]);return n.jsx("div",{children:n.jsx(P.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(et,{...s,iconAfter:o,variant:e||T.ButtonVariant.Primary,appearance:t||T.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},kn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===T.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.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",i,a.className),...a,children:[e,n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},gl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:u})=>{const[d,f]=h.useState(!1),[g,p]=h.useState(r??e[0]?.key),m=t!==void 0,b=m?t:g,v=h.useMemo(()=>{const D=e.find(N=>N.key===b);return D?.label?String(D.label):""},[e,b]),y=h.useCallback(({key:D})=>{const N=e.find(S=>S.key===D);N&&(m||p(D),s?.(N))},[e,m,s]);return n.jsx(P.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:f,onItemClick:y,children:n.jsx(kn,{label:v,size:a,isOpen:d,disabled:i,"aria-label":u})})},Pe=({text:e,className:t,variant:r=x.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===x.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Le=({...e})=>n.jsx(Pe,{...e,variant:x.CaptionType.Error}),hl="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",ml={[T.ElementSize.Small]:"size-[24px]",[T.ElementSize.Standard]:"size-[40px]",[T.ElementSize.Large]:"size-[48px]"},xl=({icon:e,onClick:t,disabled:r,size:s=T.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",ml[s]),children:n.jsx(P.IconButton,{className:I.mergeClasses(hl,s===T.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),bl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Pn=(e,t,r,s)=>{if((t==="number"||r!==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((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),u=parseFloat(c);if(!isNaN(u)){if(r!==void 0&&u<+r){e.preventDefault();return}if(s!==void 0&&u>+s){e.preventDefault();return}}}}},Ln={[T.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[T.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[T.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ge=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=T.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Ln[i].stackGap,a),children:[e&&n.jsx(P.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Le,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:u,inputRef:d,value:f,tooltipText:g,min:p,onChange:m,max:b,inputButtonProps:v,wrapperRef:y,size:D=T.ElementSize.Standard,...N})=>{const S=Ln[D],C=h.useRef(null),w=le.useMergeRefs([d,C]),R=u==="number"||p!==void 0||b!==void 0;h.useEffect(()=>{const j=C.current;if(!j||!R||t)return;const k=z=>{z.preventDefault()};return j.addEventListener("wheel",k,{passive:!1}),()=>{j.removeEventListener("wheel",k)}},[t,R,u]);const _=j=>{Pn(j,u,p,b)},O=j=>{const k=j.currentTarget.value;if(R&&k!==""){const z=parseFloat(k);if(isNaN(z)&&k!=="-"&&k!=="."||!isNaN(z)&&(p!==void 0&&z<+p||b!==void 0&&z>+b))return}m?.(k||void 0)},A=()=>n.jsxs("div",{ref:y,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",S.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&S.paddingStart,!v&&S.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:D,id:`${r}_textBefore`})}),n.jsx(M.DialIcon,{icon:o}),i,n.jsx("input",{ref:w,type:u,autoComplete:u==="password"?"new-password":"off",value:f??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:O,onKeyDown:_,min:p,disabled:t,max:b,...N}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",S.postfixText),children:[" ",a]}),n.jsx(M.DialIcon,{icon:l}),v&&n.jsx(xl,{size:D,...v,disabled:t})]});return t&&u!=="password"?n.jsx(P.Tooltip,{tooltip:g||f,children:A()}):A()};var Ye=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ye||{});const vl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",yl={[Ye.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ye.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Dl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Cl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ze=({label:e,icon:t,appearance:r=Ye.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:u,onRemove:d,onKeyDown:f,...g})=>{const p=r===Ye.Selectable,m=!!u&&!a,b=i&&!!d&&!a,v=p&&s,y=D=>{f?.(D),!(!m||D.defaultPrevented)&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),D.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":p&&m?s:void 0,onClick:a?void 0:u,onKeyDown:y,className:I.mergeClasses(vl,v?"dial-tiny-semi-text":"dial-tiny-text",yl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Dl,Cl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),b&&n.jsx(P.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:T.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:D=>{D.stopPropagation(),d?.(D)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(Ze,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),Nl=I.mergeClasses("w-full flex flex-col"),Il=P.overlayItemClassName,Sl="!max-w-[var(--reference-width)]",jl="max-h-[344px] overflow-y-auto",Tl=P.overlayGap,wl=P.overlaySubMenuClassName,El=n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ol="text-secondary transition-transform",Al=8,_l=n.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rl=n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl=n.jsx(P.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pl=({opt:e,selectedValues:t,mark:r=P.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:u,getFloatingProps:d}=M.useSubMenuFloating(Tl,"listbox",!!e.disabled),f=e.children?.some(p=>t.includes(p.value)),g=n.jsx(P.MenuItem,{ref:o.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!f,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:El,...u()});return n.jsxs(le.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(M.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:d,role:"listbox",surfaceClassName:wl,children:e.children.map(p=>{const m=n.jsx(P.MenuItem,{role:"option","aria-selected":t.includes(p.value),"aria-disabled":!!p.disabled,disabled:p.disabled,mark:r,selected:t.includes(p.value),ellipsisLabel:!0,icon:p.icon,label:p.labelNode??p.label,rightControl:p.rightControl,onClick:()=>!p.disabled&&s(p.value)});return n.jsx(h.Fragment,{children:p.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:p.interactiveTooltip.placement,content:p.interactiveTooltip.content,contentClassName:p.interactiveTooltip.contentClassName,children:m}):m},p.value)})})]})},Ll=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=T.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:u,error:d,caption:f,ariaLabel:g,searchable:p=!1,searchSize:m=T.ElementSize.Standard,searchPlaceholder:b,selectAll:v=!1,invalid:y,selectAllLabel:D="Select all",selectedOptionMark:N=P.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:C,emptyStateIcon:w,disabled:R=!1,className:_,fieldClassName:O,listClassName:A,closable:j=!1,header:k,footer:z,onClose:V,onChange:ee,dismissRef:U,onFooterClick:B,open:F,onOpenChange:G,onSearchQueryChange:Z,customMultiSelectTagsRenderer:te})=>{const re=h.useId(),W=r||re,se=`list-${W}`,de=i===T.ElementSize.Small,[ue,ce]=h.useState(!1),pe=F!==void 0,ge=pe?!!F:ue,fe=h.useCallback(L=>{pe||ce(L),G?.(L)},[pe,G]),[K,X]=h.useState(""),Ne=h.useCallback(L=>{L!==K&&(X(L||""),Z?.(L||""))},[Z,K]),Me=s!==void 0,[he,Fe]=h.useState(a),je=Me?s:he,ne=h.useMemo(()=>t?Array.isArray(je)?je:[]:typeof je=="string"?[je]:[],[je,t]),_e=h.useMemo(()=>{const L=K.trim().toLowerCase();return L?e.filter(oe=>oe.label.toLowerCase().includes(L)):e},[e,K]);h.useEffect(()=>{ge||Ne("")},[ge,Ne]);const Ie=h.useCallback(L=>{Me||Fe(L),ee?.(L)},[Me,ee]),Be=h.useCallback(L=>{if(t){const oe=new Set(ne);oe.has(L)?oe.delete(L):oe.add(L),Ie(Array.from(oe));return}Ie(L),fe(!1)},[t,Ie,fe,ne]),tt=h.useCallback((L,oe)=>{if(L.stopPropagation(),!t){Ie("");return}const lt=ne.filter(Kn=>Kn!==oe);Ie(lt)},[t,ne,Ie]),ye=h.useMemo(()=>_e.filter(L=>!L.disabled),[_e]),ze=h.useMemo(()=>ye.filter(L=>ne.includes(L.value)).length,[ye,ne]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=h.useMemo(()=>{const L=ye.length>0&&ze===ye.length;return{allSelectedInFiltered:L,someSelectedInFiltered:ze>0&&!L}},[ye,ze]),wt=h.useCallback(()=>{if(!(!t||ye.length===0))if(Re){const L=new Set(ye.map(oe=>oe.value));Ie(ne.filter(oe=>!L.has(oe)))}else{const L=new Set(ne);ye.forEach(oe=>L.add(oe.value)),Ie(Array.from(L))}},[Re,t,ye,ne,Ie]),Te=ne.length>0,$e=!t&&Te?ne[0]:void 0,E=h.useMemo(()=>$e?e.find(L=>L.value===$e)??e.flatMap(L=>L.children??[]).find(L=>L.value===$e):void 0,[e,$e]),Q=E?o?`${o} ${E.label}`:E.label:void 0,xe=h.useMemo(()=>t?Te?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:te?.(e,ne,tt)??n.jsx(Fn,{options:e,selectedValues:ne,handleRemoveTag:tt})}):null:!E||!E.labelNode&&!E.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(P.EllipsisTooltip,{text:E.labelNode??Q}),E.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:E.description})]}),[te,tt,Te,t,e,Q,ne,E]),Et=t||xe?"":Q||(l&&s?l:""),Hn=typeof u?.label=="string"?u.label:void 0,Vn=xe?[T.resolveAccessibleName(g,Hn),t?ne.map(L=>e.find(oe=>oe.value===L)?.label??L).join(", "):Q].filter(Boolean).join(", ")||void 0:T.resolveAccessibleName(g);h.useImperativeHandle(U,()=>({dismiss:()=>{fe(!1)}}));const Gn=h.useCallback(L=>{R||(L.key==="ArrowDown"||L.key==="ArrowUp")&&(L.preventDefault(),ge||fe(!0))},[R,ge,fe]),Un=()=>n.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:Nl,children:[k&&n.jsx(n.Fragment,{children:typeof k=="function"?k():k}),(p||j)&&(e.length>Al||!!K)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[p&&n.jsx(Ge,{id:`search-${W}`,size:m,placeholder:b,"aria-label":b||"Search options",onChange:L=>Ne(L),value:K,iconBefore:_l,containerClassName:"w-full"}),j&&n.jsx(P.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:T.ElementSize.Small,icon:Rl,onClick:L=>{V?.(L),fe(!1)}})]}),t&&v&&ye.length>0&&n.jsx("div",{className:I.mergeClasses(Il,"mt-2"),children:n.jsx(P.Checkbox,{id:`${W}-selectAll`,labelProps:{label:D},isSelected:Re,isIndeterminate:me,onChange:wt})}),n.jsx("div",{role:"none",className:jl,children:_e.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:w??kl,title:S,description:C})}):_e.map(L=>{const oe=ne.includes(L.value);if(L.children?.length)return n.jsx(Pl,{opt:L,selectedValues:ne,mark:t?P.MenuItemMark.Checkbox:N,onSelect:Be},L.value);const lt=t?n.jsx(P.MenuItem,{id:`${W}-${L.value}`,role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:P.MenuItemMark.Checkbox,selected:oe,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>Be(L.value)}):n.jsx(P.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:N,selected:oe,ellipsisLabel:!0,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>!L.disabled&&Be(L.value)});return n.jsx(h.Fragment,{children:L.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:L.interactiveTooltip.placement,content:L.interactiveTooltip.content,contentClassName:L.interactiveTooltip.contentClassName,children:lt}):lt},L.value)})}),z&&n.jsx("div",{onClick:L=>{B?.(L),B&&fe(!1)},children:typeof z=="function"?z():z})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",_),children:[u&&n.jsx(P.Label,{...u,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(P.Dropdown,{open:ge,onOpenChange:fe,disabled:R,closable:j,onClose:V,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Sl,A),className:"w-full",renderOverlay:Un,children:n.jsx(Ge,{id:W,size:i,disabled:R,invalid:y,value:Et,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:E?.icon,iconAfter:n.jsx($.IconChevronDown,{size:de?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Ol,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":se,"aria-autocomplete":"none","aria-label":Vn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!R&&"cursor-pointer",t&&Te&&["!h-auto flex-wrap py-1.5",de?"min-h-[24px]":"min-h-[40px]"],O),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:xe})}),n.jsx(Le,{text:d}),!d&&n.jsx(Pe,{text:f})]})]})};var Bn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Bn||{});const Hr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Ml=e=>typeof e=="boolean"?Hr[e?"both":"none"]:Hr[e],Fl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u.invalid&&"dial-kit-input-error",u.disabled&&"dial-kit-input-disable",Ml(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(P.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(Le,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},Bl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=T.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ge,{...a,size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},zl=/^0+\.(\d+)?$/,$l=/^0+/,Hl=[".","-","+","e","E"],Vr=e=>!e||e==="-"?e:String(e).match(zl)?String(e).replace($l,"0"):Number(e),Vl=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>{if(e&&Hl.includes(u.key)){u.preventDefault();return}Pn(u,"number",r,s),a?.(u)},c=u=>{if(e){const d=u.clipboardData.getData("text"),f=d.replace(/\D/g,"");if(f!==d&&(u.preventDefault(),f)){const g=u.currentTarget,p=g.selectionStart??0,m=g.selectionEnd??0,b=g.value.slice(0,p)+f+g.value.slice(m);t?.(Vr(b))}}i?.(u)};return n.jsx(Ge,{...o,type:"number",min:r,max:s,onChange:u=>t?.(Vr(u)),onKeyDown:l,onPaste:c})},Gl="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Ul="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Kl="flex flex-row items-center justify-between px-6 py-4",Wl="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",ql="border-b border-tertiary",Zl="flex flex-row items-center gap-2 px-6 py-4",Yl="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",Xl={[x.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[x.PopupSize.Md]:"max-w-full md:max-w-[800px]",[x.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},pr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:u,footer:d,footerClassName:f,onClose:g,onBack:p,backAriaLabel:m="Back",headerActions:b,headerDivider:v=!1,mainButtons:y,additionalButtons:D,additionalButtonsOnLeft:N=!1,footerDivider:S=!1,size:C=x.PopupSize.Md,hideClose:w=!1,closeAriaLabel:R="Close dialog",closeOnOutsideClick:_=!0,preventKeyboardOnOpen:O=!1})=>{const A=M.useThemeScope(),j=h.useRef(null),k=h.useId(),{refs:z,context:V}=le.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),ee=le.useRole(V,{role:"dialog"}),U=le.useDismiss(V,{outsidePress:_}),{getFloatingProps:B}=le.useInteractions([ee,U]);if(!e)return null;const F=typeof t=="string"?`popup-heading-${k}`:void 0,G=W=>W?typeof W=="string"?n.jsx("h2",{id:F,className:I.mergeClasses(Wl,o),children:n.jsx(P.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),Z=w?null:n.jsx(P.CloseButton,{ariaLabel:R,onClose:W=>g?.(W)}),te=(W,se=[])=>se.map(({variant:de=T.ButtonVariant.Neutral,...ue},ce)=>n.jsx(et,{variant:de,...ue},`${W}-${ce}`)),re=()=>{if(d!==void 0)return d;if(!y?.length&&!D?.length)return null;const W=te("additional",D);return n.jsxs("div",{className:I.mergeClasses(Zl,S&&Yl,f),children:[N&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!N&&W,te("main",y)]})]})};return n.jsx(le.FloatingPortal,{id:s,children:n.jsx(le.FloatingOverlay,{className:I.mergeClasses(Gl,A,i),children:n.jsx(le.FloatingFocusManager,{context:V,initialFocus:O?j:z.floating,children:n.jsxs("div",{ref:z.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":F,"aria-label":F?void 0:r,className:I.mergeClasses(Ul,Xl[C],a),children:[O&&n.jsx("div",{ref:j,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Kl,v&&ql,l),children:[p&&n.jsx(P.GhostIconButton,{"aria-label":m,size:T.ElementSize.Small,className:"mr-2",onClick:p,icon:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),G(t),b?n.jsxs("div",{className:Ht,children:[b,Z]}):Z]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:u}),re()]})})})})},Ql="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Jl="text-secondary dial-small-paragraph-text px-6 pb-4",ec="px-6 py-4 h-[120px]",tc="Cancel",rc="Ok",Vt={[x.ConfirmationPopupVariant.Info]:{confirm:{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Solid}},[x.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:T.ButtonVariant.Danger,appearance:T.ButtonAppearance.Solid}}},nc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=rc,cancelLabel:i=tc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:u,onClose:d,onConfirm:f,onCancel:g,children:p,variant:m=x.ConfirmationPopupVariant.Info,size:b=x.PopupSize.Sm,footer:v,hideClose:y,...D})=>{const N=o?null:n.jsxs("div",{className:Ql,children:[n.jsx(fr,{label:i,onClick:()=>g?g():d?.()}),n.jsx(et,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:u,label:a,disabled:l,onClick:f})]}),S=h.useCallback(()=>o?n.jsx("div",{className:ec,children:n.jsx(x.Spinner,{size:40})}):p??(t?n.jsx("div",{className:I.mergeClasses(Jl,r),children:t}):null),[p,t,o,r]);return n.jsx(pr,{...D,open:s,header:e,className:I.mergeClasses(Vt[m].container,c),onClose:()=>d?.(),footer:v??N,size:b,hideClose:y??(!o&&v===void 0),children:S()})},sc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:u,headerClassName:d,contentClassName:f})=>{const g=s!==void 0,[p,m]=h.useState(a),b=o?!0:g?s:p,v=h.useId(),y=`accordion-header-${v}`,D=`accordion-content-${v}`,N=()=>{if(i)return;const C=!b;g||m(C),c?.(C)},S=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",u),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",d),children:S}):n.jsx("button",{id:y,type:"button","aria-expanded":b,"aria-controls":b?D:void 0,"aria-label":T.resolveAccessibleName(l),disabled:i,onClick:N,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",d),children:S}),b&&n.jsx("div",{id:D,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",f),children:r})]})},ac=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),u=e??c,d=i?`${u}-caption`:void 0,f=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:I.mergeClasses("flex items-center gap-2",o),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:s,onChange:f,"aria-label":T.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":d,className:"peer sr-only"}),n.jsx("label",{htmlFor:u,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(P.Label,{size:T.ElementSize.Standard,...t,htmlFor:u,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:d,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},ic="flex flex-col gap-2",oc="flex",lc="mt-2 ml-[26px]",cc={[x.RadioGroupOrientation.Column]:"flex-col gap-y-3",[x.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},zn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=x.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:u,ariaLabel:d,className:f,optionsClassName:g,radioClassName:p,contentClassName:m})=>{const b=h.useId(),v=a??b,y=`${v}-label`,D=c?`${v}-error`:void 0,N=!c&&u?`${v}-caption`:void 0,S=T.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(ic,f),children:[o&&n.jsx(P.Label,{...o,id:y}),n.jsx("div",{role:"radiogroup","aria-labelledby":S?y:void 0,"aria-label":S?void 0:T.resolveAccessibleName(d),"aria-describedby":[D,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(oc,cc[i],g),children:e.map(C=>{const w=C.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(P.Radio,{id:`${v}-${C.value}`,name:s??v,value:C.value,labelProps:C.label==null?void 0:{label:C.label},"aria-label":C["aria-label"],caption:C.caption,isSelected:w,disabled:l||C.disabled,onChange:r,className:p}),w&&C.content?n.jsx("div",{className:I.mergeClasses(lc,m),children:C.content}):null]},C.value)})}),n.jsx(Le,{id:D,text:c}),!c&&n.jsx(Pe,{id:N,text:u})]})},dc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",uc="min-w-0 flex-1 truncate text-primary",fc="min-w-0 flex-1 truncate text-secondary",pc="shrink-0 text-secondary",gc="px-6 pb-4",hc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",mc="Cancel",xc="Apply",bc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:u,onCancel:d,onClose:f,isValid:g=!0,applyButtonLabel:p=xc,cancelButtonLabel:m=mc,size:b=x.PopupSize.Md,portalId:v,disabled:y,invalid:D,error:N,caption:S,ariaLabel:C,className:w,fieldClassName:R})=>{const _=h.useId(),O=i??_,A=`${O}-label`,j=`${O}-value`,k=N?`${O}-error`:void 0,z=!N&&S?`${O}-caption`:void 0,[V,ee]=h.useState(!1),U=c!==void 0,[B,F]=h.useState(t),G=U?c:B,Z=h.useCallback(()=>{y||(U||F(t),ee(!0))},[y,U,t]),te=h.useCallback(()=>{ee(!1),f?.()},[f]),re=h.useCallback(()=>{d?.(),te()},[d,te]),W=h.useCallback(()=>{a(G),te()},[a,G,te]),se=h.useCallback(K=>{U||F(K),u?.(K)},[U,u]),de=T.resolveAccessibleName(o?.label),ue=de?void 0:T.resolveAccessibleName(C),ce=de?A:ue&&`${O}-name`,pe=T.resolveAccessibleName(s),ge=e.find(K=>K.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",w),children:[o&&n.jsx(P.Label,{...o,id:A,htmlFor:O}),n.jsxs("div",{className:"flex flex-col gap-1",children:[ue&&n.jsx("span",{id:ce,className:"sr-only",children:ue}),n.jsxs("button",{type:"button",id:O,disabled:y,"aria-haspopup":"dialog","aria-expanded":V,"aria-labelledby":ce?`${ce} ${j}`:void 0,"aria-describedby":[k,z].filter(Boolean).join(" ")||void 0,onClick:Z,className:I.mergeClasses(dc,D&&"dial-kit-input-error",y&&"dial-kit-input-disable",R),children:[n.jsx("span",{id:j,className:fe==null?fc:uc,children:fe??l}),n.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:pc})]}),n.jsx(Le,{id:k,text:N}),!N&&n.jsx(Pe,{id:z,text:S})]}),n.jsx(pr,{open:V,header:s,ariaLabel:pe?void 0:de,portalId:v,size:b,onClose:re,footer:n.jsxs("div",{className:hc,children:[n.jsx(fr,{label:m,onClick:re}),n.jsx(Rn,{label:p,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:gc,children:n.jsx(zn,{id:`${O}-options`,items:e,value:G,onChange:se,orientation:x.RadioGroupOrientation.Column,ariaLabel:de??pe})})})]})},vc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=T.ElementSize.Small,className:l,...c})=>{const u=h.useCallback(f=>{a?.(f),s?.(!r)},[a,s,r]),d=n.jsx(P.IconButton,{...c,size:o,variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":T.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:u,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(P.Tooltip,{asChild:!0,...i,children:d}):d},yc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Dc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Cc="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",Nc="bg-layer-raised text-accent shadow-xs",Ic="bg-transparent text-secondary",Sc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",jc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Tc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",wc="cursor-not-allowed bg-transparent text-control-disable-primary",Ec=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(f=>f.value===t),u=c&&!c.disabled?c.value:e.find(f=>!f.disabled)?.value,d=h.useCallback(f=>{if(s||!yc.includes(f.key))return;const g=e.filter(y=>!y.disabled);if(g.length===0)return;const p=Math.max(g.findIndex(y=>y.value===t),0),m=g.length-1;let b=p;switch(f.key){case"ArrowRight":case"ArrowDown":b=p===m?0:p+1;break;case"ArrowLeft":case"ArrowUp":b=p===0?m:p-1;break;case"Home":b=0;break;case"End":b=m;break}f.preventDefault();const v=g[b];l.current[v.value]?.focus(),v.value!==t&&r(v.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:d,className:I.mergeClasses(Dc,a),children:e.map(f=>{const g=f.value===t,p=s||f.disabled;return n.jsxs("button",{ref:m=>{l.current[f.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":T.resolveAccessibleName(f["aria-label"],typeof f.label=="string"?f.label:void 0),tabIndex:f.value===u?0:-1,disabled:p,onClick:()=>r(f.value),className:I.mergeClasses(Cc,g?Nc:Ic,p?g?Tc:wc:g?Sc:jc,i),children:[f.icon,f.label]},f.value)})})},Oc=["ArrowRight","ArrowLeft","Home","End"],Ac=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(d=>d.id===t),c=l&&!l.disabled?l.id:e.find(d=>!d.disabled)?.id,u=h.useCallback(d=>{if(!Oc.includes(d.key)||e.length===0)return;const f=e.filter(v=>!v.disabled);if(f.length===0)return;const g=Math.max(f.findIndex(v=>v.id===t),0),p=f.length-1;let m=g;switch(d.key){case"ArrowRight":m=g===p?0:g+1;break;case"ArrowLeft":m=g===0?p:g-1;break;case"Home":m=0;break;case"End":m=p;break}d.preventDefault();const b=f[m];o.current[b.id]?.focus(),b.id!==t&&r(b.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:u,className:I.mergeClasses("flex justify-start gap-1",a),children:e.map(d=>{const f=t===d.id,g=!!d.disabled;return n.jsxs("button",{ref:p=>{o.current[d.id]=p},type:"button",role:"tab","aria-selected":f,disabled:g,tabIndex:d.id===c?0:-1,onClick:()=>r(d.id),className:I.mergeClasses("dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(f?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:d.label}),d.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(f?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:d.count})]},d.id)})})},Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},_c=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:u,id:d,ariaLabel:f,className:g})=>{const p=h.useId(),m=d??`file-dropzone-${p}`,b=c?`${m}-error`:void 0,[v,y]=h.useState(!1),D=h.useRef(0),N=h.useCallback(A=>{if(A.length===0)return;const j=o?A:A.slice(0,1),k=j.filter(V=>Qt(V,i)),z=j.filter(V=>!Qt(V,i));z.length>0&&a?.(z),k.length>0&&s(k)},[i,o,s,a]),S=h.useCallback(A=>{N(Array.from(A.target.files??[])),A.target.value=""},[N]),C=h.useCallback(()=>{D.current=0,y(!1)},[]),w=h.useCallback(A=>{l||(A.preventDefault(),D.current+=1,y(!0))},[l]),R=h.useCallback(A=>{l||(A.preventDefault(),A.dataTransfer.dropEffect="copy")},[l]),_=h.useCallback(()=>{l||(D.current-=1,D.current<=0&&C())},[l,C]),O=h.useCallback(A=>{A.preventDefault(),!l&&(C(),N(Array.from(A.dataTransfer?.files??[])))},[l,C,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(P.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:S,"aria-label":T.resolveAccessibleName(typeof t!="string"?f:void 0),"aria-describedby":b,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:w,onDragOver:R,onDragLeave:_,onDrop:O,className:I.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&&v&&"border-accent bg-control-accent-alpha",!l&&!v&&"border-secondary hover:border-accent",c&&!v&&"border-error hover:border-error",g),children:[u??n.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Le,{id:b,text:c})]})},Rc=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,i=0;for(const o of t){const l=o+s;if(a+l>e)break;a+=l,i++}if(i===t.length)return i;for(;i>0&&a+r>e;)i--,a-=t[i]+s;return i},kc=4,Pc=24,Gr=e=>parseFloat(e)||0,Lc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Mc=()=>{},Fc=({id:e,value:t,defaultValue:r,size:s=T.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:u=!1,readOnly:d=!1,collapseTagOverflow:f=!1,ariaLabel:g,tagListLabel:p="Tags",className:m,fieldClassName:b,tagClassName:v,onChange:y})=>{const D=h.useId(),N=e||D,S=s===T.ElementSize.Small,C=h.useRef(null),w=h.useRef([]),R=h.useRef(null),_=t!==void 0,[O,A]=h.useState(r??[]),j=_?t:O,k=j.length,[z,V]=h.useState(""),[ee,U]=h.useState(k),B=!d&&!u,F=h.useCallback(K=>{_||A(K),y?.(K)},[_,y]),G=h.useCallback(K=>X=>{w.current[K]=X},[]),Z=h.useCallback(()=>{const K=C.current;if(!K||K.clientWidth===0){U(j.length);return}const{paddingLeft:X,paddingRight:Ne}=getComputedStyle(K);U(Rc({availableWidth:K.clientWidth-Gr(X)-Gr(Ne)-(d?0:Pc),tagWidths:j.map((Me,he)=>w.current[he]?.offsetWidth??0),overflowChipWidth:R.current?.offsetWidth??0,gap:kc}))},[d,j]);h.useEffect(()=>{if(!f){U(k);return}const K=C.current;if(!K)return;const X=new ResizeObserver(()=>Z());return X.observe(K),Z(),()=>X.disconnect()},[f,Z,k]);const te=I.mergeClasses(f?"shrink-0":"min-w-0",v),re=K=>{const X=Lc(K.trim()).trim();!X||j.includes(X)||F([...j,X])},W=K=>{F(j.filter(X=>X!==K))},se=()=>{re(z),V("")},de=K=>{if(B){if(K.key==="Enter"||K.key===","){K.preventDefault(),se();return}K.key==="Backspace"&&!z&&k>0&&(K.preventDefault(),F(j.slice(0,-1)))}},ue=()=>{B&&z.trim()&&se()},ce=f?j.slice(0,ee):j,pe=f?j.slice(ee):[],ge=pe.join(", "),fe=k>0&&n.jsxs("span",{role:"list","aria-label":p,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",f?"flex-nowrap":"flex-wrap"),children:[ce.map(K=>n.jsx(Ze,{role:"listitem",label:K,className:te,disabled:u,closable:B,onRemove:B?()=>W(K):void 0},K)),pe.length>0&&n.jsx(Ze,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",v),disabled:u}),f&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[j.map((K,X)=>n.jsx("span",{ref:G(X),className:"inline-flex",children:n.jsx(Ze,{label:K,className:v,disabled:u,closable:B,onRemove:B?Mc:void 0})},K)),n.jsx("span",{ref:R,className:"inline-flex",children:n.jsx(Ze,{label:`+${k}`,className:v})})]})]});return n.jsx(Ge,{id:N,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:u,readOnly:d,value:z,placeholder:k>0?void 0:i,"aria-label":g,wrapperRef:C,onChange:K=>V(K??""),onKeyDown:de,onBlur:ue,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(k>0&&["!h-auto",S?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",f?"flex-nowrap overflow-hidden":"flex-wrap"],b),className:I.mergeClasses("w-auto flex-1",f?"min-w-[24px]":"min-w-[100px]",d&&"cursor-default"),children:fe})},Bc={[T.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[T.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[T.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},zc=({size:e=T.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...u})=>{const d=h.useRef(null),f=le.useMergeRefs([c,d]),g=!!i&&!a,p=h.useCallback(()=>{o?.(void 0),d.current?.focus()},[o]);return n.jsx(Ge,{...u,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:f,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l),iconBefore:n.jsx($.IconSearch,{size:Bc[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":s,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:p}):void 0})},$c=16,Hc=e=>(e.toString().split(".")[1]??"").length,Vc=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:u=!1,caption:d,error:f,onChange:g,containerClassName:p,trackClassName:m,fillClassName:b,className:v,...y})=>{const D=h.useId(),N=e??D,S=d&&!f?`${N}-caption`:void 0,C=f?`${N}-error`:void 0,w=s-r,R=w>0?Math.min(100,Math.max(0,(t-r)/w*100)):0,_=`calc(${R}% + ${(.5-R/100)*$c}px)`,O=c?c(t):t.toFixed(Hc(a)),A=h.useCallback(j=>{g?.(Number(j.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",p),children:[(o||u)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(P.Label,{...o,htmlFor:N}),u&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:O})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",i?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",i?"bg-control-disable-secondary":"bg-control-accent",b),style:{width:_}}),n.jsx("input",{...y,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:i,onChange:A,"aria-label":T.resolveAccessibleName(typeof o?.label!="string"?y["aria-label"]:void 0),"aria-valuetext":c?O:void 0,"aria-describedby":C??S,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",v)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Le,{id:C,text:f}),!f&&n.jsx(Pe,{id:S,text:d})]})]})},Gc=48,Uc=({children:e,title:t,width:r=280,collapsedWidth:s=Gc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:d="Expand sidebar",className:f,titleClassName:g,contentClassName:p,footerClassName:m})=>{const b=a!==void 0,[v,y]=h.useState(i),D=b?a:v,N=`collapsible-sidebar-content-${h.useId()}`,S=D?u:d,C=w=>{const R=!D;b||y(R),o?.(R,w)};return n.jsxs("aside",{"aria-label":c,style:{width:`${D?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",f),children:[n.jsx("div",{id:N,hidden:!D,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",p),children:e}),n.jsx("div",{hidden:D,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",D?"justify-end px-2":"justify-center",m),children:[D&&l,n.jsx(P.IconButton,{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,size:T.ElementSize.Standard,onClick:C,"aria-label":S,"aria-expanded":D,"aria-controls":N,tooltipProps:{tooltip:S},icon:D?n.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Kc=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:u})=>{const d=e===x.ResizableContainerSide.Left,f=d?$.IconChevronLeft:$.IconChevronRight,g=p=>{let m;switch(p.key){case"ArrowLeft":m=r+(d?i:-i);break;case"ArrowRight":m=r+(d?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}p.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:I.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:c??n.jsx(f,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",d?"right-full":"left-full")})})},Wc=16,$n=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=x.ResizableContainerSide.Right,keyboardStep:c=Wc,ariaLabel:u="Resize panel",className:d,resizeHandlerClassName:f,resizeHandler:g})=>{const[p,m]=h.useState(!1),[b,v]=h.useState(a??t),y=s!==void 0,D=y?s:b,N=h.useRef(null),S=h.useCallback(()=>{m(!0)},[]),C=h.useCallback(()=>{m(!1);const _=N.current?.resizable?.getBoundingClientRect(),O=_?Math.round(_.width):t;y||v(O),i?.(O)},[i,y,t]),w=h.useCallback(_=>{const O=Math.min(r,Math.max(t,_));O!==D&&(y||(v(O),N.current?.updateSize({width:O,height:"100%"})),o?.(O),i?.(O))},[r,t,D,y,o,i]),R=h.useMemo(()=>{const _=l===x.ResizableContainerSide.Left,O=n.jsx(Kc,{side:l,isResizing:p,width:D,minWidth:t,maxWidth:r,step:c,ariaLabel:u,onWidthChange:w,customHandler:g,handlerClassName:f});return{size:y?{width:D,height:"100%"}:void 0,defaultSize:y?void 0:{width:D,height:"100%"},minWidth:t,maxWidth:r,enable:{left:_,right:!_},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:_?O:void 0,right:_?void 0:O},onResizeStart:S,onResize:(A,j,k)=>{o?.(Math.round(k.offsetWidth))},onResizeStop:C}},[l,y,D,t,r,c,u,w,g,f,p,S,C,o]);return n.jsx(x.Resizable,{ref:N,...R,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",d),children:e})})},qc=({enabled:e=!0,children:t,...r})=>e?n.jsx($n,{...r,children:t}):t;exports.ConfirmationPopupVariant=x.ConfirmationPopupVariant;exports.DialBreadcrumb=x.DialBreadcrumb;exports.DialBreadcrumbItem=x.DialBreadcrumbItem;exports.DialButton=x.DialButton;exports.DialButtonDropdown=x.DialButtonDropdown;exports.DialCaptionText=x.DialCaptionText;exports.DialCollapsibleSidebar=x.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=x.DialConditionalResizableContainer;exports.DialConfirmationPopup=x.DialConfirmationPopup;exports.DialDangerButton=x.DialDangerButton;exports.DialDestinationFolderPopup=x.DialDestinationFolderPopup;exports.DialErrorText=x.DialErrorText;exports.DialFileIcon=x.DialFileIcon;exports.DialFileManager=x.DialFileManager;exports.DialFileManagerActions=x.DialFileManagerActions;exports.DialFileManagerTabs=x.DialFileManagerTabs;exports.DialFileName=x.DialFileName;exports.DialFileNodeType=x.DialFileNodeType;exports.DialFilePermission=x.DialFilePermission;exports.DialFileResourceType=x.DialFileResourceType;exports.DialFolderName=x.DialFolderName;exports.DialFoldersTree=x.DialFoldersTree;exports.DialFormItem=x.DialFormItem;exports.DialGhostButton=x.DialGhostButton;exports.DialInput=x.DialInput;exports.DialItemType=x.DialItemType;exports.DialLinkButton=x.DialLinkButton;exports.DialLoader=x.DialLoader;exports.DialNeutralButton=x.DialNeutralButton;exports.DialNotification=x.DialNotification;exports.DialPopup=x.DialPopup;exports.DialPrimaryButton=x.DialPrimaryButton;exports.DialRadioGroup=x.DialRadioGroup;exports.DialResizableContainer=x.DialResizableContainer;exports.DialSearch=x.DialSearch;exports.DialSharedEntityIndicator=x.DialSharedEntityIndicator;exports.DialTabs=x.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=x.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=x.FileManagerColumnKey;exports.FileManagerProvider=x.FileManagerProvider;exports.FlexibleActionsDirection=x.FlexibleActionsDirection;exports.FormItemOrientation=x.FormItemOrientation;exports.NAME_COLUMN=x.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=x.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=x.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=x.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=x.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=x.NotificationType;exports.NotificationVariant=x.NotificationVariant;exports.PopupSize=x.PopupSize;exports.RadioGroupOrientation=x.RadioGroupOrientation;exports.ResizableContainerSide=x.ResizableContainerSide;exports.SIZE_COLUMN=x.SIZE_COLUMN;exports.ScreenResolution=x.ScreenResolution;exports.Skeleton=x.Skeleton;exports.SkeletonAvatarShape=x.SkeletonAvatarShape;exports.SkeletonAvatarSize=x.SkeletonAvatarSize;exports.SkeletonVariant=x.SkeletonVariant;exports.Spinner=x.Spinner;exports.TabOrientation=x.TabOrientation;exports.TabView=x.TabView;exports.UPDATED_AT_COLUMN=x.UPDATED_AT_COLUMN;exports.editableContainerProps=x.editableContainerProps;exports.useDialFileManagerTabs=x.useDialFileManagerTabs;exports.useEditableItem=x.useEditableItem;exports.useFileManagerContext=x.useFileManagerContext;exports.DialLabel=Ae.DialLabel;exports.DialSwitch=Ae.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=M.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=M.DEFAULT_LOCALE;exports.DialCloseButton=M.DialCloseButton;exports.DialDangerIconButton=M.DialDangerIconButton;exports.DialDateCellRenderer=M.DialDateCellRenderer;exports.DialDropdown=M.DialDropdown;exports.DialEllipsisTooltip=M.DialEllipsisTooltip;exports.DialGhostIconButton=M.DialGhostIconButton;exports.DialGrid=M.DialGrid;exports.DialIcon=M.DialIcon;exports.DialNeutralIconButton=M.DialNeutralIconButton;exports.DialNoDataContent=M.DialNoDataContent;exports.DialPrimaryIconButton=M.DialPrimaryIconButton;exports.DialRadioButton=M.DialRadioButton;exports.DialSecondaryIconButton=M.DialSecondaryIconButton;exports.DialSuccessIconButton=M.DialSuccessIconButton;exports.DialTertiaryIconButton=M.DialTertiaryIconButton;exports.DropdownItemType=M.DropdownItemType;exports.DropdownTrigger=M.DropdownTrigger;exports.DropdownType=M.DropdownType;exports.GridSelectionMode=M.GridSelectionMode;exports.ThemeScope=M.ThemeScope;exports.baseColumnComparator=M.baseColumnComparator;exports.checkColDefsChanges=M.checkColDefsChanges;exports.convertGridDateToDate=M.convertToDate;exports.convertToDate=M.convertToDate;exports.useThemeScope=M.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=I.mergeClasses;exports.Checkbox=P.Checkbox;exports.CheckboxBox=P.CheckboxBox;exports.CloseButton=P.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=P.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=P.DEFAULT_LOCALE;exports.DangerIconButton=P.DangerIconButton;exports.DateCellRenderer=P.DateCellRenderer;exports.Dropdown=P.Dropdown;exports.EllipsisTooltip=P.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=P.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=P.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=P.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=P.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=P.GRID_THEME_PARAMS;exports.GhostIconButton=P.GhostIconButton;exports.Grid=P.Grid;exports.IconButton=P.IconButton;exports.InfoButton=P.InfoButton;exports.InteractiveTooltip=P.InteractiveTooltip;exports.Label=P.Label;exports.MenuItem=P.MenuItem;exports.MenuItemMark=P.MenuItemMark;exports.NeutralIconButton=P.NeutralIconButton;exports.NoDataContent=P.NoDataContent;exports.PrimaryIconButton=P.PrimaryIconButton;exports.Radio=P.Radio;exports.StaticIconButton=P.StaticIconButton;exports.Tooltip=P.Tooltip;exports.TooltipContainer=P.TooltipContainer;exports.TooltipContent=P.TooltipContent;exports.TooltipPlacement=P.TooltipPlacement;exports.TooltipTrigger=P.TooltipTrigger;exports.ButtonAppearance=T.ButtonAppearance;exports.ButtonVariant=T.ButtonVariant;exports.DialIconButton=T.DialIconButton;exports.DialTooltip=T.DialTooltip;exports.DialTooltipContainer=T.DialTooltipContainer;exports.DialTooltipContent=T.DialTooltipContent;exports.DialTooltipTrigger=T.DialTooltipTrigger;exports.ElementSize=T.ElementSize;exports.EditorThemes=ot.EditorThemes;exports.LazyDialJsonEditor=ot.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ot.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ot.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=sc;exports.AnalyticsCardVariant=st;exports.Button=et;exports.ButtonDropdown=pl;exports.Calendar=al;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Ao;exports.CollapsibleSidebar=Uc;exports.ConditionalResizableContainer=qc;exports.ConfirmationPopup=nc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=ol;exports.DialAccordion=Ur;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=Jn;exports.DialAnalyticsCard=Yn;exports.DialAnalyticsErrorTag=Jt;exports.DialAnalyticsHistogram=ss;exports.DialAutocompleteInputValue=on;exports.DialCheckbox=Gt;exports.DialDraggableItem=bi;exports.DialDropdownIcon=lo;exports.DialFormPopup=Ai;exports.DialInputPopup=ln;exports.DialLabelledText=ms;exports.DialLoadFileArea=xn;exports.DialLoadFileAreaField=oo;exports.DialNumberInput=Zt;exports.DialPagination=ds;exports.DialPasswordInput=cn;exports.DialRadioGroupPopupField=Ti;exports.DialRemoveButton=It;exports.DialSchemaRenderer=Io;exports.DialSegmentedControl=Si;exports.DialSelect=ke;exports.DialSelectField=Vi;exports.DialSlider=hs;exports.DialSteps=gs;exports.DialTag=He;exports.DialTagInput=an;exports.DialTextarea=vi;exports.ErrorMessageNotification=Fo;exports.ErrorText=Le;exports.ErrorToastNotification=_o;exports.FabButton=ul;exports.FileDropzone=_c;exports.FolderPath=il;exports.GeneralMessageNotification=Vo;exports.GeneralToastNotification=Mo;exports.GhostButton=cl;exports.Highlight=Oo;exports.InfoMessageNotification=Bo;exports.InfoToastNotification=Ro;exports.InlineSelect=gl;exports.InlineSelectTrigger=kn;exports.Input=Ge;exports.JsonSchemaType=J;exports.LinkButton=ll;exports.LoadingMessageNotification=Ho;exports.LoadingToastNotification=Lo;exports.MultiSelectTags=Fn;exports.NeutralButton=fr;exports.Notification=cr;exports.NumberInput=Vl;exports.OutlinedButton=dl;exports.PasswordInput=Bl;exports.Popup=pr;exports.PrimaryButton=Rn;exports.ProgressBar=as;exports.RadioGroup=zn;exports.RadioGroupPopupField=bc;exports.ResizableContainer=$n;exports.SchemaDisplayMode=at;exports.SchemaOrientation=jt;exports.SchemaRendererVariant=qe;exports.Search=zc;exports.SegmentedControl=Ec;exports.Select=Ll;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Vc;exports.StepStatus=ve;exports.SuccessMessageNotification=zo;exports.SuccessToastNotification=ko;exports.Switch=ac;exports.Tabs=Ac;exports.Tag=Ze;exports.TagAppearance=Ye;exports.TagInput=Fc;exports.Textarea=Fl;exports.TextareaResize=Bn;exports.ToggleIconButton=vc;exports.WarningMessageNotification=$o;exports.WarningToastNotification=Po;exports.getTimezoneLabel=bn;exports.matchesAccept=Qt;exports.wrapInRootFolder=ho;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./use-file-manager-tabs-DjdR_mYM.cjs"),Ae=require("./Switch-CUKClcEz.cjs"),n=require("react/jsx-runtime"),h=require("react"),$=require("@tabler/icons-react"),ae=require("classnames"),M=require("./DateCellRenderer-BVM-Q8yx.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),P=require("./DateCellRenderer-ssp7eaZY.cjs"),T=require("./IconButton-DWqoaBWf.cjs"),Wn=require("react-dom"),ot=require("./lazy-tfN4sKhq.cjs"),le=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function qn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=qn(h),He=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.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 n.jsxs("div",{className:l,onClick:i,children:[n.jsx(M.DialIcon,{icon:r}),n.jsx(M.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(b.DialButton,{className:"p-0",iconAfter:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(He,{label:e,className:I.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 Zn={[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}},Yn=({title:e,value:t,description:r,variant:s=st.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:d,compareValues:u})=>{const p=Zn[s],g=c!==void 0?c:(l??0)>=0,f=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",p.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:f})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-start"}):u?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:u[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:u[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:u[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:u[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!i&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},er=[{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"}],Xn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Qn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:d,inline:u,ariaLabel:p})=>{const g=e==null,f=!!(r||s||!g),m=Xn(g?0:e,t),v=Qn(m,o),x=i??(g?"—":e),y=p??(typeof a=="string"?a:void 0),D=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(b.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",u?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),S=f?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",u?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!D&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:v}})}):null,C=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return u?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:C}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[C,N]}),S]})},Ur=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:d,contentClassName:u})=>{const p=s!==void 0,[g,f]=h.useState(a),m=o?!0:p?s:g,v=h.useId(),x=()=>{if(i)return;const y=!m;p||f(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":v,disabled:i||o,onClick:x,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",d),children:[!o&&n.jsx(M.DialIcon,{className:ae("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:v,role:"region",className:I.mergeClasses("px-4 pb-4",u),children:r})]})},Jn=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:u,onBarClick:p,inline:g,barTitleClassName:f,barValueClassName:m,barClassName:v,barDescriptions:x,className:y})=>{const D=Object.entries(s),N=g?I.mergeClasses("text-secondary",f):f,S=i?"dial-tiny-text text-secondary":void 0,C=t?n.jsx(T.DialTooltip,{tooltip:t,children:e}):e,E=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],R="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",A="group flex flex-col gap-1.5",O=I.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return n.jsx(Ur,{title:C,description:r,defaultExpanded:c,nonCollapsible:d,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:u?n.jsx(b.DialLoader,{fullWidth:!1,className:"self-center"}):a?E.map(_=>{const j=_ in s?s[_]:null,k=_ in a?a[_]:null,G=typeof j=="number"&&typeof k=="number"?parseFloat((k-j).toFixed(3)):null,te=G!=null&&G!==0,U=te&&G>0,B=te?U?`+${G}`:String(G):null,z=x?.[_],q=n.jsx("span",{className:"dial-small-text text-secondary",children:_}),V=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[z?n.jsx(T.DialTooltip,{tooltip:z,children:q}):q,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:O,children:[n.jsx(ut,{title:i?.[0],value:j,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:_}),n.jsx(ut,{title:i?.[1],value:k,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:`${_} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(_,j),className:I.mergeClasses(A,R),children:V},_):n.jsx("div",{className:A,children:V},_)}):D.map(([_,j])=>{const k=n.jsx(ut,{title:_,value:j,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:v}),F=p?n.jsx("button",{type:"button",onClick:()=>p(_,j),className:R,children:k}):k,G=x?.[_];return G?n.jsx(T.DialTooltip,{tooltip:G,triggerClassName:"flex flex-col",children:F},_):n.jsx(h.Fragment,{children:F},_)})})})},es="#FF4E50",ts=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=ts(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:es,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:i(r[d]),isZeroBucket:!1}));return[o,...l]},Kr=e=>e<=0?2:e%2===0?e:e+1,rs=e=>{const t=Kr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,Wr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ns=(e,t)=>{const r=Wr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ns(a.from,a.to)})]}),ss=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const u=hr(t,r),p=l?hr(l,r):void 0,g=t.length,f=l?.length??0,m=Math.max(g,f),v=Kr(m),x=rs(m),y=C=>C.map(E=>({...E,ratio:v>0?E.count/v:0})),D=y(u),N=p?y(p):void 0,S=(C,E,R,A)=>{if(C.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})});const O=A?{backgroundImage:`repeating-linear-gradient(135deg, ${C.color} 0px, ${C.color} 1px, transparent 1px, transparent 4px)`,borderColor:C.color}:{backgroundColor:C.color};return n.jsx(T.DialTooltip,{placement:"bottom",tooltip:E,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${C.ratio*100}%`,...O},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(b.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:At},children:x.map((C,E)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${E/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:C},C))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((C,E)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${E/(x.length-1)*100}%`}},C)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?D.map((C,E)=>{const R=N[E],A=`${C.count} out of ${g} ${s}`,O=`${R.count} out of ${f} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(C,mr(c,C.count,g,s,C),A,!0),S(R,mr(d,R.count,f,s,R),O,!1)]},E)}):D.map((C,E)=>{const R=`${C.count} out of ${g} ${s}`;return C.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})},E):n.jsx(T.DialTooltip,{placement:"bottom",tooltip:R,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${C.ratio*100}%`,backgroundColor:C.color},children:a&&C.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})},E)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:D.map((C,E)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Wr(C.from,C.to)},E))})]})]})},as=({value:e,max:t=100,size:r=T.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const d=h.useId(),u=i??d,p=!!s?.label,g=p?s?.id??`${u}-label`:void 0,f=t>0?t:0,m=Number.isFinite(e)?e:0,v=Math.min(Math.max(m,0),f),x=f>0?v/f*100:0,y=n.jsx("div",{...c,id:u,role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":f,"aria-labelledby":g,"aria-label":T.resolveAccessibleName(l,p?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===T.ElementSize.Small?"h-1":"h-2",o),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(P.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},is=7,os=2,ls=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const cs=(e,t,r)=>e===t?"active":r<is||Math.abs(e-t)<=os?"adjacent":"far",ds=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=ls(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=cs(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const d=h.useCallback(f=>{o?.(f.target.checked,t)},[o,t]),u=ae("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||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=ae("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx($.IconMinus,{className:p,...H.BASE_ICON_PROPS}):r?n.jsx($.IconCheck,{className:p,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:u,htmlFor:t,"aria-description":c["aria-description"]||M.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(M.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ve=(e=>(e.VALID="valid",e.ERROR="error",e))(ve||{});const us=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"border-accent-secondary text-primary";case ve.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ve.VALID:return"border-primary text-primary";case ve.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},fs=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ps=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===ve.ERROR?n.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ve.VALID?n.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ae(a,us(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ae(i,fs(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},gs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===ve.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(ps,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,hs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:d,trackClassName:u,fillClassName:p,thumbClassName:g,labelsClassName:f,"aria-label":m,"aria-labelledby":v,...x})=>{const y=h.useRef(null),D=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),C=h.useCallback(O=>{const _=y.current;if(!_)return e;const j=_.getBoundingClientRect(),k=(O-j.left)/j.width,F=t+k*(r-t),G=_t(s),te=parseFloat((Math.round((F-t)/s)*s+t).toFixed(G));return Math.min(r,Math.max(t,te))},[t,r,s,e]),E=h.useCallback(O=>{a||(O.currentTarget.setPointerCapture(O.pointerId),c?.(C(O.clientX)))},[a,C,c]),R=h.useCallback(O=>{a||O.buttons===0||c?.(C(O.clientX))},[a,C,c]),A=h.useCallback(O=>{if(a)return;const _=_t(s),j=G=>parseFloat((Math.round((G-t)/s)*s+t).toFixed(_)),k=G=>Math.min(r,Math.max(t,G));let F=e;switch(O.key){case"ArrowRight":case"ArrowUp":F=k(j(e+s));break;case"ArrowLeft":case"ArrowDown":F=k(j(e-s));break;case"Home":F=t;break;case"End":F=r;break;default:return}O.preventDefault(),F!==e&&c?.(F)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[i&&n.jsx(Ae.DialLabel,{...i,htmlFor:x.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:E,onPointerMove:R,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",u)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${D}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":v,className:I.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",g),style:{left:`${D}%`},onKeyDown:A,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",f),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},ms=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(T.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),qr=h.createContext({dragDropManager:void 0});function De(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 xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},vr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function xs(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 bs(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(Ds(e))return"date";if(ys(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function ys(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ds(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ke(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bs(e)),t}function Zr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?De(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?De(1):"Expected the enhancer to be a function. Instead, received: '"+Ke(r)+"'");return r(Zr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?De(2):"Expected the root reducer to be a function. Instead, received: '"+Ke(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function d(){l===o&&(l=o.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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 i}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?De(4):"Expected the listener to be a function. Instead, received: '"+Ke(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?De(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(v),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?De(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 D=l.indexOf(v);l.splice(D,1),o=null}}}function g(v){if(!xs(v))throw new Error(process.env.NODE_ENV==="production"?De(7):"Actions must be plain objects. Instead, the actual type was: '"+Ke(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?De(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"?De(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,v)}finally{c=!1}for(var x=o=l,y=0;y<x.length;y++){var D=x[y];D()}return v}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?De(10):"Expected the nextReducer to be a function. Instead, received: '"+Ke(v));a=v,g({type:vr.REPLACE})}function m(){var v,x=p;return v={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(process.env.NODE_ENV==="production"?De(11):"Expected the observer to be an object. Instead, received: '"+Ke(D)+"'");function N(){D.next&&D.next(u())}N();var S=x(N);return{unsubscribe:S}}},v[xr]=function(){return this},v}return g({type:vr.INIT}),s={dispatch:g,subscribe:p,getState:u,replaceReducer:f},s[xr]=m,s}function Z(e,t,...r){if(Cs()&&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 r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function Cs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ns(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Is(e,t){return e.filter(r=>r!==t)}function Yr(e){return typeof e=="object"}function Ss(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function js(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",yt="dnd-core/HOVER",Dt="dnd-core/DROP",Ct="dnd-core/END_DRAG";function yr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ts={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function ws(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(yr(i)),Es(r,l,c);const d=_s(r,l);if(d==null){e.dispatch(Ts);return}let u=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Os(o),u=o(d)}e.dispatch(yr(i,u));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;As(g),c.pinSource(d);const f=c.getSourceType(d);return{type:vt,payload:{itemType:f,item:g,sourceId:d,clientOffset:i||null,sourceClientOffset:u||null,isSourcePublic:!!a}}}}function Es(e,t,r){Z(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){Z(r.getSource(s),"Expected sourceIds to be registered.")})}function Os(e){Z(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function As(e){Z(Yr(e),"Item must be an object.")}function _s(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function Rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ks(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Rs(e,a,r[a])})}return e}function Ps(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ls(s),Bs(s).forEach((o,l)=>{const c=Ms(o,l,a,s),d={type:Dt,payload:{dropResult:ks({},r,c)}};e.dispatch(d)})}}function Ls(e){Z(e.isDragging(),"Cannot call drop while not dragging."),Z(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Ms(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Fs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Fs(e){Z(typeof e>"u"||Yr(e),"Drop result must either be an object or undefined.")}function Bs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function zs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();$s(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Ct}}}function $s(e){Z(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Hs(e){return function(r,{clientOffset:s}={}){Vs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Us(a,o,l),Gs(a,i,o),Ks(a,i,o),{type:yt,payload:{targetIds:a,clientOffset:s||null}}}}function Vs(e){Z(Array.isArray(e),"Expected targetIds to be an array.")}function Gs(e,t,r){Z(t.isDragging(),"Cannot call hover while not dragging."),Z(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];Z(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);Z(i,"Expected targetIds to be registered.")}}function Us(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ks(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ws(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function qs(e){return{beginDrag:ws(e),publishDragSource:Ws(e),hover:Hs(e),drop:Ps(e),endDrag:zs(e)}}class Zs{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=qs(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){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=r,t.subscribe(this.handleRefCountChange)}}function Ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Xr(Ys(t,s),r)}function Qs(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Xr(t,r)}const rt=[],nr=[];rt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function Js(e,t){return e===rt?!1:e===nr||typeof t>"u"?!0:js(t,e).length>0}class ea{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;Z(typeof t=="function","listener must be a function."),Z(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!Js(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){Z(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Z(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Z(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Z(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.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 Xs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Qs(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Qr=Dr.MutationObserver||Dr.WebKitMutationObserver;function Jr(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ta(e){let t=1;const r=new Qr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ra=typeof Qr=="function"?ta:Jr;class na{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let 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=ra(this.flush),this.requestErrorThrow=Jr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class sa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class aa{create(t){const r=this.freeTasks,s=r.length?r.pop():new sa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const en=new na,ia=new aa(en.registerPendingError);function oa(e){en.enqueueTask(ia.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",Nt="dnd-core/REMOVE_TARGET";function la(e){return{type:sr,payload:{sourceId:e}}}function ca(e){return{type:ar,payload:{targetId:e}}}function da(e){return{type:ir,payload:{sourceId:e}}}function ua(e){return{type:Nt,payload:{targetId:e}}}function fa(e){Z(typeof e.canDrag=="function","Expected canDrag to be a function."),Z(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Z(typeof e.endDrag=="function","Expected endDrag to be a function.")}function pa(e){Z(typeof e.canDrop=="function","Expected canDrop to be a function."),Z(typeof e.hover=="function","Expected hover to be a function."),Z(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}Z(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ce;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ce||(Ce={}));let ga=0;function ha(){return ga++}function ma(e){const t=ha().toString();switch(e){case Ce.SOURCE:return`S${t}`;case Ce.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class xa{addSource(t,r){Kt(t),fa(r);const s=this.addHandler(Ce.SOURCE,t,r);return this.store.dispatch(la(s)),s}addTarget(t,r){Kt(t,!0),pa(r);const s=this.addHandler(Ce.TARGET,t,r);return this.store.dispatch(ca(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return Z(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Z(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Z(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ce.SOURCE}isTargetId(t){return Cr(t)===Ce.TARGET}removeSource(t){Z(this.getSource(t),"Expected an existing source."),this.store.dispatch(da(t)),oa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Z(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ua(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Z(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Z(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=ma(t);return this.types.set(a,r),t===Ce.SOURCE?this.dragSources.set(a,s):t===Ce.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 ba=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function ya(e,t,r=ba){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Da(e=rt,t){switch(t.type){case yt:break;case sr:case ar:case Nt:case ir:return rt;case vt:case rr:case Ct:case Dt:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Ss(r,s);if(!(a.length>0||!ya(r,s)))return rt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ca(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ia(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case yt:return va(e.clientOffset,r.clientOffset)?e:Na({},e,{clientOffset:r.clientOffset});case Ct:case Dt:return Ir;default:return e}}function Sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Sa(e,a,r[a])})}return e}const ja={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(e=ja,t){const{payload:r}=t;switch(t.type){case vt:return We({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return We({},e,{isSourcePublic:!0});case yt:return We({},e,{targetIds:r.targetIds});case Nt:return e.targetIds.indexOf(r.targetId)===-1?e:We({},e,{targetIds:Is(e.targetIds,r.targetId)});case Dt:return We({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ct:return We({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function wa(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case Nt:return e-1;default:return e}}function Ea(e=0){return e+1}function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Oa(e,a,r[a])})}return e}function _a(e={},t){return{dirtyHandlerIds:Da(e.dirtyHandlerIds,{type:t.type,payload:Aa({},t.payload,{prevTargetIds:Ns(e,"dragOperation.targetIds",[])})}),dragOffset:Ia(e.dragOffset,t),refCount:wa(e.refCount,t),dragOperation:Ta(e.dragOperation,t),stateId:Ea(e.stateId)}}function Ra(e,t=void 0,r={},s=!1){const a=ka(s),i=new ea(a,new xa(a)),o=new Zs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function ka(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Zr(_a,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Pa(e,t){if(e==null)return{};var r=La(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function La(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ma=h.memo(function(t){var{children:r}=t,s=Pa(t,["children"]);const[a,i]=Fa(s);return h.useEffect(()=>{if(i){const o=tn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(qr.Provider,{value:a,children:r})});function Fa(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ba(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ba(e,t=tn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:Ra(e,t,r,s)}),a[pt]}function tn(){return typeof global<"u"?global:window}var Rt,jr;function za(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var $a=za();const Ha=b.getDefaultExportFromCjs($a),Ve=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Va(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Ha(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function Ga(e,t,r){const[s,a]=Va(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function rn(e,t,r){return Ga(t,e||(()=>({})),()=>r.reconnect())}function nn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ua(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Ka(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Wa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Z(!kt,"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 kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;Z(!Pt,"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 Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}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 Lt=!1;class qa{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Z(!Lt,"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 Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!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 Za(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ya(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,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 i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const d=i[c];if(!l(d))return!1;const u=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&u!==p)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xa(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 Qa(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Xa(s),Ja(s,r?i=>e(i,r):e)}}function sn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Qa(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function Ja(e,t){const r=e.ref;return Z(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ei{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,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(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=sn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,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 ti{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(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=sn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Xe(){const{dragDropManager:e}=h.useContext(qr);return Z(e!=null,"Expected drag drop context"),e}function ri(e,t){const r=Xe(),s=h.useMemo(()=>new ei(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function ni(){const e=Xe();return h.useMemo(()=>new Wa(e),[e])}class si{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ai(e,t,r){const s=h.useMemo(()=>new si(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function ii(e){return h.useMemo(()=>{const t=e.type;return Z(t!=null,"spec.type must be defined"),t},[e])}function oi(e,t,r){const s=Xe(),a=ai(e,t,r),i=ii(e);Ve(function(){if(i!=null){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function li(e,t){const r=nn(e,t);Z(!r.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=ni(),a=ri(r.options,r.previewOptions);return oi(r,s,a),[rn(r.collect,s,a),Ua(a),Ka(a)]}function ci(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function di(e){const t=Xe(),r=h.useMemo(()=>new ti(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ui(){const e=Xe();return h.useMemo(()=>new qa(e),[e])}function fi(e){const{accept:t}=e;return h.useMemo(()=>(Z(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class pi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function gi(e,t){const r=h.useMemo(()=>new pi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function hi(e,t,r){const s=Xe(),a=gi(e,t),i=fi(e);Ve(function(){const[l,c]=Za(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=nn(e,t),s=ui(),a=di(r.options);return hi(r,s,a),[rn(r.collect,s,a),ci(a)]}const wr="column",mi="flex items-center",xi="mr-3 cursor-move text-secondary",bi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},u,p]=li(()=>({type:wr,item:{id:e,originalIndex:c},collect:f=>{const m=f.getItem();return{isDragging:f.isDragging()&&m?.id===e}},end:(f,m)=>{if(!f)return;!m.didDrop()&&typeof a=="function"&&f.originalIndex>-1&&a(f.id,f.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:f=>{if(!(!f||f.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(f.id,m)}}}),[s,a,e]);return p(g(l)),u(o),n.jsxs("div",{ref:l,className:I.mergeClasses(mi,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:xi,"aria-label":i,children:n.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},It=({iconClassName:e,label:t,...r})=>t?n.jsx(b.DialDangerButton,{...r,label:t,appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(M.DialDangerIconButton,{...r,appearance:T.ButtonAppearance.Ghost,icon:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const u=I.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(Ae.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:u,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(b.DialErrorText,{text:s}),!s&&n.jsx(b.DialCaptionText,{text:l})]})},yi="inline-flex items-center rounded bg-layer-3",Di="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",Ci="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ni="text-secondary hover:text-primary",Ii="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Si=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const d=c.findIndex(g=>g.value===t);let u=null;switch(l.key){case"ArrowRight":case"ArrowDown":u=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":u=(d-1+c.length)%c.length;break;case"Home":u=0;break;case"End":u=c.length-1;break;default:return}l.preventDefault();const p=c[u];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(yi,a),children:e.map((l,c)=>{const d=l.value===t,u=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Di,!p&&"-mr-px",u&&"rounded-l",p&&"rounded-r",d?Ci:Ni,g&&Ii),children:[l.icon,l.label]},l.value)})})},Mt=8,ji=24,an=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:u=!1,containerClassName:p,tagClassName:g,onChange:f})=>{const m=h.useRef(null),v=h.useRef([]),x=h.useRef(null),[y,D]=h.useState(e),[N,S]=h.useState(""),[C,E]=h.useState(!1),[R,A]=h.useState(e.length),O=h.useCallback(B=>z=>{v.current[B]=z},[]),_=h.useCallback(()=>{if(!d)return;const B=m.current;if(!B)return;const z=B.offsetWidth;if(z===0)return;const q=x.current?.offsetWidth??0,se=z-(u?0:ji)-Mt;let X=0,W=0;for(let re=0;re<y.length;re++){const de=v.current[re];if(!de)continue;const ue=de.offsetWidth+Mt;if(X+ue>se)break;X+=ue,W++}if(W<y.length&&W>0)for(;X+q>se&&W>0;){W--;const re=v.current[W]?.offsetWidth??0;X-=re+Mt}A(W)},[d,u,y.length]),j=B=>{const z=B.trim().replace(/,$/,"");if(z&&!y.includes(z)){const q=[z,...y];D(q),f?.(q)}},k=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),j(N),S(""))},F=()=>{N.trim()&&(j(N),S(""))},G=B=>{const z=y.filter((q,V)=>V!==B);D(z),f?.(z)},te=()=>o?n.jsx(b.DialErrorText,{text:o}):i?n.jsx(b.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(d)return;const B=new ResizeObserver(()=>{if(m.current){const z=m.current.scrollHeight>m.current.clientHeight+10;E(z)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[y,d]),h.useEffect(()=>{if(!d){A(y.length);return}A(y.length);const B=new ResizeObserver(()=>{_()}),z=m.current;return z&&B.observe(z),_(),()=>B.disconnect()},[d,_,y]),h.useEffect(()=>{D(e)},[JSON.stringify(e)]);const U=n.jsxs("div",{ref:m,className:ae("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ae("flex-wrap",C?"flex-col-reverse":"flex-row"),p),children:[(d?y.slice(0,R):y).map((B,z)=>n.jsx(He,{label:B,className:g,closable:!c&&!u,onRemove:!c&&!u?()=>G(z):void 0},B+z)),d&&R<y.length&&n.jsx(T.DialTooltip,{tooltip:y.slice(R).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(He,{label:`+${y.length-R}`})}),!u&&n.jsx("input",{id:s,type:"text",value:N,onChange:B=>S(B.target.value),onKeyDown:k,onBlur:F,className:ae("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&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[y.map((B,z)=>n.jsx("div",{ref:O(z),className:"inline-flex shrink-0",children:n.jsx(He,{label:B,className:g,closable:!c&&!u,onRemove:!c&&!u?()=>G(z):void 0})},`measure-${B}-${z}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(He,{label:`+${y.length}`})})]})]});return u?U:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Ae.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ae("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:U}),te()]})},on=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(an,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=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"})),ln=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:d,emptyValueText:u,placeholder:p,editable:g=!1,onValueChange:f,collapseTagOverflow:m=!1,iconBefore:v})=>{const x=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),D=x||y?s:p?void 0:u,N=r?void 0:o,S=h.useCallback(A=>{f?.(A.target.value)},[f]),C=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(M.DialIcon,{icon:v}),n.jsx("input",{type:"text",className:ae("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||u,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(b.DialErrorText,{text:c})]}),E=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(M.DialIcon,{icon:v}),n.jsx(T.DialTooltip,{tooltip:D==null?void 0:String(D),children:D||!p?n.jsx("span",{className:a,children:D}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(b.DialErrorText,{text:c})]}),R=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[v&&n.jsx(M.DialIcon,{icon:v}),n.jsx(on,{placeholder:p,selectedItems:D,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?R():g?C():E(),t&&Wn.createPortal(e,document.body)]})},Ti=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:d,onClose:u,header:p,portalId:g,onApply:f,onCancel:m,cancelButtonTitle:v="Cancel",applyButtonTitle:x="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:N,id:S,size:C=b.PopupSize.Md})=>{const[E,R]=h.useState(!1),A=h.useCallback(()=>{r||R(!0)},[r]),O=h.useCallback(()=>{R(!1),u?.()},[u]),_=h.useCallback(()=>{m?.(),O()},[m,O]),j=h.useCallback(()=>{f(),O()},[f,O]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Ae.DialLabel,{label:e,htmlFor:t}),n.jsx(ln,{disabled:r,open:E,selectedValue:i??a.find(k=>k.id===s)?.name,valueClassName:o,inputClassName:ae(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:A,children:n.jsx(b.DialPopup,{open:E,onClose:_,header:p,portalId:g,size:C,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(b.DialNeutralButton,{label:v,onClick:_}),n.jsx(b.DialPrimaryButton,{label:x,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(b.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:D,onChange:N,elementId:S,orientation:b.RadioGroupOrientation.Column})})})})]})},wi="Create",Ei="Cancel",Oi="flex items-center justify-end gap-2 px-6 py-3",Ai=({header:e,open:t=!1,submitLabel:r=wi,cancelLabel:s=Ei,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:d,onCancel:u,children:p,dividers:g=!0,size:f=b.PopupSize.Md,footer:m})=>{const v=a?null:n.jsxs("div",{className:Oi,children:[n.jsx(b.DialNeutralButton,{label:s,onClick:()=>u?u():c?.()}),n.jsx(b.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(b.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(b.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??v,size:f,children:x()})},_i=/^0+\.(\d+)?$/,Ri=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>!u||u==="-"?u:String(u)?.match(_i)?String(u)?.replace(Ri,"0"):Number(u),c=u=>{if([".","-","+","e","E"].includes(u.key)){u.preventDefault();return}b.handleKeyDown(u,"number",r,s)},d=u=>{const p=u.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(u.preventDefault(),g)){const f=u.currentTarget,m=f.selectionStart??0,v=f.selectionEnd??0,x=f.value.slice(0,m)+g+f.value.slice(v);t?.(l(x))}};return n.jsx(b.DialInput,{type:"number",min:r,max:s,onChange:u=>t?.(l(u)),onKeyDown:e?c:a,onPaste:e?d:i,...o})},ki=({onClick:e})=>n.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Pi=({onClick:e})=>n.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),cn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(b.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(ki,{onClick:()=>s(!1)}):n.jsx(Pi,{onClick:()=>s(!0)})})},dn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(He,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(M.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Li="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Mi="w-full rounded flex flex-col",nt="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",Fi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",Bi=352,zi=4,$i=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Hi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=M.useSubMenuFloating(zi,"listbox",!!e.disabled),d=e.children?.some(u=>t.includes(u.value));return n.jsxs(n.Fragment,{children:[n.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:ae(nt,d&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(M.DialIcon,{icon:e.icon}),n.jsx(M.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(M.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(u=>{const p=t.includes(u.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!u.disabled,disabled:u.disabled,className:ae(nt,p&&Yt,u.disabled&&xt),onClick:()=>!u.disabled&&r(u.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.icon&&n.jsx(M.DialIcon,{icon:u.icon}),n.jsx(M.DialEllipsisTooltip,{text:u.labelNode??u.label})]})},u.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:u=!1,searchSize:p=T.ElementSize.Standard,searchPlaceholder:g,selectAll:f=!1,invalid:m,selectAllLabel:v="Select all",emptyStateTitle:x="No options available",emptyStateDescription:y,emptyStateIcon:D,disabled:N=!1,className:S,listClassName:C,closable:E=!1,header:R,footer:A,onClose:O,onChange:_,inlineSearch:j=!1,dismissRef:k,onFooterClick:F,open:G,onOpenChange:te,onInlineQueryChange:U,customMultiSelectTagsRenderer:B})=>{const z=h.useId(),[q,V]=h.useState(!1),se=G!==void 0,X=se?!!G:q,W=h.useCallback(w=>{se||V(w),te?.(w)},[se,te]),[re,de]=h.useState(j&&c||""),ue=h.useRef(null),ce=h.useCallback(w=>{w!==re&&(de(w||""),U?.(w||""))},[U,re]),pe=s!==void 0,[ge,fe]=h.useState(a),K=pe?s:ge,Q=h.useMemo(()=>t?Array.isArray(K)?K:[]:typeof K=="string"?[K]:[],[K,t]),Ne=h.useMemo(()=>{const w=re.trim().toLowerCase();return w?e.filter(J=>J.label.toLowerCase().includes(w)):e},[e,re]);h.useEffect(()=>{!X&&!j&&ce("")},[j,X,ce]);const Me=h.useRef(c);h.useEffect(()=>{j&&c!==Me.current&&(X||(Me.current=c,ce(c||"")))},[c,j,X,ce]);const he=h.useCallback(w=>{pe||fe(w),_?.(w)},[pe,_]),Fe=h.useCallback(w=>{if(t){const J=new Set(Q);J.has(w)?J.delete(w):J.add(w),he(Array.from(J));return}if(he(w),j){const J=e.find(xe=>xe.value===w)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===w);J&&ce(J.label)}W(!1)},[t,he,j,W,Q,e,ce]),je=h.useCallback((w,J)=>{if(w.stopPropagation(),!t){he("");return}const xe=Q.filter(Et=>Et!==J);he(xe)},[t,Q,he]),ne=h.useMemo(()=>Ne.filter(w=>!w.disabled),[Ne]),_e=h.useMemo(()=>ne.filter(w=>Q.includes(w.value)).length,[ne,Q]),Ie=h.useCallback(w=>{j&&!t&&!w&&Fe(re),W(w)},[Fe,j,t,re,W]),{allSelectedInFiltered:Be,someSelectedInFiltered:tt}=h.useMemo(()=>{const w=ne.length>0&&_e===ne.length;return{allSelectedInFiltered:w,someSelectedInFiltered:_e>0&&!w}},[ne,_e]),ye=h.useCallback(()=>{if(!(!t||ne.length===0))if(Be){const w=new Set(ne.map(J=>J.value));he(Q.filter(J=>!w.has(J)))}else{const w=new Set(Q);ne.forEach(J=>w.add(J.value)),he(Array.from(w))}},[Be,t,ne,Q,he]),ze=Q.length>0;h.useEffect(()=>{X&&j&&!t&&!N&&requestAnimationFrame(()=>{const w=ue.current;if(!w)return;w.focus();const J=w.value?.length??0;w.setSelectionRange?.(J,J)})},[X,j,t,N]);const Re=!t&&ze?Q[0]:void 0,me=h.useMemo(()=>Re?e.find(w=>w.value===Re)??e.flatMap(w=>w.children??[]).find(w=>w.value===Re):void 0,[e,Re]),wt=h.useCallback(()=>t?ze?B?.(e,Q,je)||n.jsx(dn,{options:e,selectedValues:Q,handleRemoveTag:je}):n.jsx("span",{className:"text-secondary truncate",children:d}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(M.DialIcon,{icon:me.icon}),n.jsx(M.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ze,t,c,l,s,d,me,e,Q,je,B]);h.useImperativeHandle(k,()=>({dismiss:()=>{W(!1)}}));const Te=h.useCallback(()=>{ce(Q.length===1?me?.label??re:"")},[re,Q.length,ce,me?.label]),$e=h.useCallback(()=>{N||(W(!X),j&&!t&&(Te(),ue.current?.focus()))},[N,j,X,t,Te,W]);return n.jsx(M.DialDropdown,{open:X,onOpenChange:Ie,disabled:N,closable:E,onClose:O,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:u?null:Bi,listClassName:C,renderOverlay:()=>n.jsxs("div",{id:`list-${r||z}`,role:"listbox","aria-multiselectable":t||void 0,className:Mi,children:[R&&n.jsx(n.Fragment,{children:typeof R=="function"?R():R}),(u||E)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx(b.DialSearch,{size:p,placeholder:g,onChange:ce,value:re,id:`search-${r||z}`,containerClassName:I.mergeClasses(b.SIZE_CONFIG[p].containerClassName,"w-full")}),E&&n.jsx(b.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:w=>{O?.(w),W(!1)}})]}),t&&f&&ne.length>0&&n.jsx("div",{className:ae(nt,"mt-2"),children:n.jsx(Gt,{id:`${r||z}-selectAll`,label:v,checked:Be,indeterminate:tt,onChange:ye,ariaLabel:v})}),n.jsx("div",{className:ae("overflow-y-auto max-h-[352px]",j&&Ne.length===0?"":"py-1"),children:Ne.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:D??n.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:y})}):Ne.map(w=>{const J=Q.includes(w.value);return t?n.jsxs("div",{role:"option","aria-selected":J,"aria-disabled":!!w.disabled,className:ae(nt,J&&Fi,w.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||z}-${w.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[w.icon&&n.jsx(M.DialIcon,{icon:w.icon}),n.jsx("span",{className:"truncate",children:w.labelNode??w.label})]}),checked:J,disabled:w.disabled,onChange:()=>!w.disabled&&Fe(w.value),ariaLabel:w.label}),w.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:w.description})]},w.value):w.children?.length?n.jsx(Hi,{opt:w,selectedValues:Q,onSelect:Fe},w.value):n.jsx("button",{role:"option",type:"button","aria-selected":J,"aria-disabled":!!w.disabled,disabled:w.disabled,className:ae(nt,J&&Yt,w.disabled&&xt),onClick:()=>!w.disabled&&Fe(w.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w.icon&&n.jsx(M.DialIcon,{icon:w.icon}),n.jsx(M.DialEllipsisTooltip,{text:w.labelNode??w.label}),w.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:w.description})]})},w.value)})}),A&&n.jsx("div",{onClick:w=>{F?.(w),F&&W(!1)},children:typeof A=="function"?A():A})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":X,"aria-controls":`list-${r||z}`,className:I.mergeClasses(Li,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:w=>{N||j&&!t&&(Te(),w.preventDefault())},onClick:()=>{$e()},onKeyDown:w=>{(w.key===" "||w.code==="Space")&&(w.preventDefault(),$e())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||z}`,type:"text",placeholder:g??d,value:re||"",onChange:w=>ce(w.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:w=>{Te(),w.stopPropagation()},onClick:w=>{w.stopPropagation()},onKeyDown:w=>{w.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:wt()}),!j&&n.jsx(M.DialIcon,{icon:$i,className:ae("text-primary",X&&"rotate-180")})]})})},Vi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:d,defaultEmptyText:u,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return u??"None";if(Array.isArray(d))return n.jsx(dn,{options:p.options,selectedValues:d});{const f=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:f?.label||d})}},[d,p.options,u]);return n.jsx(b.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:u,children:n.jsx(ke,{className:a,value:d,elementId:o,invalid:!!i,...p})})};function un(e){let t=null;return()=>(t==null&&(t=e()),t)}function Gi(e,t){return e.filter(r=>r!==t)}function Ui(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Ki{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ui(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Gi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const St="__NATIVE_FILE__",fn="__NATIVE_URL__",pn="__NATIVE_TEXT__",gn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:St,HTML:gn,TEXT:pn,URL:fn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[St]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[gn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[fn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
|
|
2
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[pn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Wi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Zi=un(()=>/firefox/i.test(navigator.userAgent)),hn=un(()=>!!window.safari);class Or{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=o.length-1,u;for(;c<=d;){u=Math.floor(.5*(c+d));const f=r[u];if(f<t)c=u+1;else if(f>t)d=u-1;else return s[u]}l=Math.max(0,d);const p=t-r[l],g=p*p;return s[l]+a[l]*p+i[l]*g+o[l]*p*g}constructor(t,r){const{length:s}=t,a=[];for(let f=0;f<s;f++)a.push(f);a.sort((f,m)=>t[f]<t[m]?-1:1);const i=[],o=[];let l,c;for(let f=0;f<s-1;f++)l=t[f+1]-t[f],c=r[f+1]-r[f],i.push(l),o.push(c/l);const d=[o[0]];for(let f=0;f<i.length-1;f++){const m=o[f],v=o[f+1];if(m*v<=0)d.push(0);else{l=i[f];const x=i[f+1],y=l+x;d.push(3*y/((y+x)/m+(y+l)/v))}}d.push(o[o.length-1]);const u=[],p=[];let g;for(let f=0;f<d.length-1;f++){g=o[f];const m=d[f],v=1/i[f],x=m+d[f+1]-g-g;u.push((g-m-x)*v),p.push(x*v*v)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=u,this.c3s=p}}const Yi=1;function mn(e){const t=e.nodeType===Yi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Xi(e){var t;return e.nodeName==="IMG"&&(Zi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Qi(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return hn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function Ji(e,t,r,s,a){const i=Xi(t),l=mn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:u}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:f,dragPreviewHeight:m}=Qi(i,t,d,u),v=()=>{let E=new Or([0,.5,1],[c.y,c.y/u*m,c.y+m-u]).interpolate(g);return hn()&&i&&(E+=(window.devicePixelRatio-1)*m),E},x=()=>new Or([0,.5,1],[c.x,c.x/d*f,c.x+f-d]).interpolate(p),{offsetX:y,offsetY:D}=a,N=y===0||y,S=D===0||D;return{x:N?y:x(),y:S?D:v()}}class eo{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){to(e,a,r[a])})}return e}class ro{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ar({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ar({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Er).some(r=>Er[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=qi(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,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 i=this.sourceNodes.get(a);return i&&mn(i)||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:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const u=this.monitor.getSourceId(),p=this.sourceNodes.get(u),g=this.sourcePreviewNodes.get(u)||p;if(g){const{anchorX:f,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=Ji(p,g,o,{anchorX:f,anchorY:m},{offsetX:v,offsetY:x});l.setDragImage(g,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 i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).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 i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new eo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ki(this.isNodeInDocument)}}const no=function(t,r,s){return new ro(t,r,s)},so=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:u,getIsFileSizeError:p})=>{const g=h.useRef(null),f=h.useRef(null),[m,v]=h.useState([]),[x,y]=h.useState(!1),[D,N]=h.useState(!1),S=h.useCallback(U=>{const B=U.target.files;if(B&&B.length>0){const z=Array.from(B),q=u?.(z),V=p?.(z);q?y(!0):V?N(!0):e(z)}},[u,p,e]),C=h.useCallback(U=>i&&U?.length>i,[i]),E=h.useMemo(()=>x||D||C(m),[x,D,C,m]),R=()=>{v([]),y(!1),N(!1)},A=h.useMemo(()=>x?n.jsx(b.DialErrorText,{text:l}):D?n.jsx(b.DialErrorText,{text:d}):C(m)?n.jsx(b.DialErrorText,{text:c}):null,[c,l,d,m,C,x,D]);h.useEffect(()=>{R()},[a]);const[{isOver:O,canDrop:_},j]=or(()=>({accept:[St],drop(U){const B=U.files,z=u?.(B)??!1,q=p?.(B)??!1,V=C?.(B)??!1;if(y(z),N(q),z||q||V){v(B);return}e(B),R()},collect:U=>({isOver:U.isOver(),canDrop:U.canDrop()})}),[e,u,p,C]),k=U=>{(U.key==="Enter"||U.key==="Space")&&(U.preventDefault(),f.current?.click())},F=U=>{U?.preventDefault();const B=Array.from(U.dataTransfer?.items??[]);y(!!u?.(B)),N(!!p?.(B)),v(B)},G=U=>{U.target===U.currentTarget&&R()},te=ae("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!_&&!E&&"border-primary",_&&(O?"border-accent-primary":"border-hover"),E&&"border-error");return j(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:F,onDragLeave:G,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(b.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,label:s,onClick:()=>f.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:f,hidden:!0,accept:a,onChange:S})]}),n.jsx(n.Fragment,{children:A})]})},ao=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(b.DialInput,{...r,iconBefore:a(),containerClassName:ae("h-[40px] p-0",s&&"h-[60px]"),className:ae("rounded-r-none border-r-0",s&&"text-error",t)})},io=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[u,p]=h.useState(!1),[g,f]=h.useState(!1),[m,v]=h.useState(0),x=h.useCallback(()=>{p(!1),f(!1),v(0)},[]),y=h.useCallback(O=>!!(i&&t.length+O.length>i),[i,t.length]),D=u||g,[{isOver:N,canDrop:S},C]=or(()=>({accept:[St],drop(O){const _=O.files,j=[...t,..._],k=s?.(_)??!1,F=a?.(_)??!1,G=y?.(_)??!1;if(p(k),f(F),k||F||G){v(_.length);return}r(j),x()},collect:O=>({isOver:O.isOver(),canDrop:O.canDrop()})}),[t,r,s,a,y,x]),E=O=>{O.preventDefault();const _=Array.from(O.dataTransfer?.items??[]);p(!!s?.(_)),f(!1),v(_.length)},R=O=>{O.target===O.currentTarget&&x()};C(d);const A=y(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:E,onDragLeave:R,className:ae("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!D&&!A&&(S&&N?"border-accent-primary":"border-primary"),(D||A)&&"border-error"),children:e}),u&&n.jsx(b.DialErrorText,{text:o}),g&&n.jsx(b.DialErrorText,{text:l}),!u&&!g&&A&&n.jsx(b.DialErrorText,{text:c})]})},xn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:u,getIsFileSizeError:p,maxFilesCount:g}=e,f=h.useCallback((x,y)=>{x.stopPropagation(),a(t?.filter(D=>D.name!==y)||[])},[a,t]),m=h.useCallback(x=>n.jsx(It,{"aria-label":l,onClick:y=>f(y,x)}),[l,f]),v=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,y)=>n.jsx(ao,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:i?.(x),error:i?.(x)?o:""},x.name+y))}),[t,r,s,i,o,m]);return n.jsx(Ma,{backend:no,children:!t||t.length===0?n.jsx(so,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(io,{existingFiles:t,onDrop:a,getIsFileFormatError:u,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),c?.(t)&&n.jsx(b.DialErrorText,{text:d})]})})},oo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:u,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:f,addButtonLabel:m,additionalActionButtons:v,...x})=>{const y=h.useRef(null),D=()=>y.current?.click(),N=()=>{e([])},S=h.useCallback(A=>A?.some(O=>!(g==="/"||g?.toLowerCase()?.includes(O?.type?.toLowerCase()))),[g]),C=h.useCallback(A=>{if(!i)return!1;const O=i*(1024*1024);return A?.some(_=>{const j=_.size;return!!j&&j>O})},[i]),E=h.useCallback(A=>{if(!o||!p)return!1;const O=o*1024*1024;return A.reduce((j,k)=>j+k.size,0)>O},[o,p]),R=h.useCallback(A=>{const O=A.target.files;if(O&&O.length>0){const _=Array.from(O),j=S(_),k=C(_);!j&&!k&&e([...s||[],..._])}},[S,C,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(Ae.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:r}),p&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(b.DialNeutralButton,{label:f,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(b.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:D}),v]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:y,hidden:!0,accept:g,onChange:R}),n.jsx(xn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:u,getIsFileFormatError:S,getIsFileSizeError:C,getIsMultiFilesSizeError:E,...x})]})},lo=({icon:e,ariaLabel:t,size:r=T.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:u=!1,open:p,onOpenChange:g,defaultOpen:f=!1,...m})=>{const v=r===T.ElementSize.Small,[x,y]=h.useState(f),D=p??x,N=v?"w-8 px-0":"w-10 px-0",S={[T.ElementSize.Small]:"size-5",[T.ElementSize.Standard]:"size-6",[T.ElementSize.Large]:"size-7"},C=E=>{y(E),g?.(E)};return n.jsx(M.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:u,className:a,open:D,onOpenChange:C,defaultOpen:f,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.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",v?"h-8 px-2":"h-10 px-2",c?void 0:N,i),children:[n.jsx(M.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",S[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:"relative z-10 inline-grid size-5 shrink-0 place-items-center",children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(M.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",D&&"rotate-180")})]})]})})},co="application/octet-stream";function uo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",u=fo(c.nodeType),p=u===b.DialFileNodeType.FOLDER,g=$t(d,p);let f;return c.parentPath===null||c.parentPath===void 0?f=a:c.parentPath===""?f="":f=$t(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:f,nodeType:u}}),o=new Map;i.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:po(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===b.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===b.DialFileNodeType.ITEM&&(d.extension=go(c.name),d.contentType=c.contentType||co,d.contentLength=c.contentLength||0),o.set(c.path,d)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),u=c.path.slice(0,d),p=o.get(u);p&&p.nodeType===b.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function fo(e){return e.toUpperCase()==="FOLDER"?b.DialFileNodeType.FOLDER:b.DialFileNodeType.ITEM}function po(e){if(!e)return;const t=e.toUpperCase();return Object.values(b.DialFileResourceType).find(s=>s.toUpperCase()===t)}function go(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ho(e,t="Prompts",r="prompts/public/",s="root"){const a=uo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:b.DialFileNodeType.FOLDER,folderId:s,items:a}]}const bn=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var qe=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(qe||{}),at=(e=>(e.Select="select",e.Radio="radio",e))(at||{}),jt=(e=>(e.Row="row",e.Column="column",e))(jt||{}),ee=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(ee||{});const mo={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"},vn=h.createContext(null);function Se(){const e=h.useContext(vn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function _r(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function Y(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const u of a)i=i?.[u];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?Y(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=_r(o,Y(l,t,r+1));s=_r(o,i)}return s}function yn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function Tt(e){return e==null||e===""}function Ue(e){return e.type===ee.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Dn(e,t){return e.type===ee.Null?"null":e.$ref?Y(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 Ee(e,t,r=0){if(r>15)return;const s=Y(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 i=Y({$ref:s.discriminator.mapping[a]},t);return{...Ee(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ue(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Ee(l,t,r+1);c!==void 0&&(a[o]=c,i=!0)}return i?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function we(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Y(t,r);if(o.anyOf){const d=o.anyOf.filter(u=>u.type!==ee.Null);return e!=null&&d.length===1?we(e,d[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const d=o.discriminator.propertyName,u=e?.[d];if(u&&o.discriminator.mapping[u]){const p={$ref:o.discriminator.mapping[u]},g=Y(p,r);return we(e,g,r,s,a+1)}return i}if(o.type===ee.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let d=0;d<e.length;d++){const u=we(e[d],o.items,r,`${s}[${d}]`,a+1);i.push(...u)}return i}if(!Ue(o))return i;const l=o.required??[],c=e;for(const d of l){const u=o.properties?.[d];if(u&&Y(u,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if(Tt(g)){const f=u?.title??bt(d);i.push({path:p,message:`${f} is required`})}}if(c&&o.properties)for(const[d,u]of Object.entries(o.properties)){if(Y(u,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const f=we(g,u,r,p,a+1);i.push(...f)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const d=o.additionalProperties;for(const[u,p]of Object.entries(c)){const g=s?`${s}.${u}`:u,f=we(p,d,r,g,a+1);i.push(...f)}}return i}function lr(e,t,r){const s=Y(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ue(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!Y(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const d=o?.[c];return d!=null&&d!==""}).length}/${i} fields`}return""}function xo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===ee.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Y(a,r).type===ee.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Y(a,r).type===ee.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Y(a,r);return i.type===ee.Number||i.type===ee.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Y(a,r).type===ee.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(Ue(i)||i.oneOf)return a}return 0}return 0}function bo(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Cn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case ee.String:return"";case ee.Boolean:return!1;case ee.Array:return[];case ee.Integer:case ee.Number:return;default:return{}}}const it=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,u]=h.useState(l),p=a===0,g="rounded border border-secondary",f=I.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=I.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:f,onClick:()=>u(v=>!v),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx($.IconChevronDown,{size:16,stroke:2}):n.jsx($.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Ae.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(M.DialIcon,{icon:n.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(M.DialIcon,{icon:n.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(It,{size:T.ElementSize.Small,onClick:v=>{v.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:i})]})},Nn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:u=!1}=Se(),p=Y(e,l),g=Ue(p),f=p.type===ee.Array;if(g||f){const x=lr(t,p,l),y=we(t,p,l,s.join(".")),D=s.join("."),N=D+".",S=!u||d.has(D)||[...d].some(C=>C.startsWith(N));return n.jsx(it,{title:o??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:S?y.length:0,defaultExpanded:c,children:n.jsx(Oe,{schema:p,value:t,onChange:r,path:s,level:a+1,required:i})})}const v=(!u||d.has(s.join(".")))&&i&&Tt(t)?`${o??"Field"} is required`:void 0;return n.jsx(b.DialFormItem,{label:o,required:i,description:p.description,error:v,children:n.jsx(Oe,{schema:p,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=Se(),l=Y(e,i),c=yn(Object.entries(l.properties??{}).filter(([,p])=>!Y(p,i).isHidden)),d=l.required??[],u=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,g])=>{const m=Y(g,i).title??g.title??bt(p),v=d.includes(p);return n.jsx(Nn,{schema:g,value:u[p],onChange:x=>r({...u,[p]:x}),path:[...s,p],level:a,required:v,label:m},p)})})},vo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=Se(),d=Array.isArray(t)?t:[],u=e.items,[p,g]=h.useState(void 0);if(!u)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const f=h.useMemo(()=>Y(u,i),[u,i]),m=h.useMemo(()=>f.discriminator,[f]),v=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(S=>({value:S,label:S})):[],[m]),y=()=>{const S=p??x[0]?.value;let C;if(m&&S){const E=Y({$ref:m.mapping[S]},i);C={...Ee(E,i)??{},[m.propertyName]:S}}else C=Ee(f,i)??Cn(f);r([...d,C])},D=S=>{r(d.filter((C,E)=>E!==S))},N=(S,C)=>{r(d.map((E,R)=>R===S?C:E))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),d.map((S,C)=>{const E=bo(S,v,C),R=lr(S,f,i),A=we(S,f,i,`${s.join(".")}[${C}]`);return n.jsx(it,{title:E,level:a,summary:R,errorCount:A.length,onRemove:l?void 0:()=>D(C),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Oe,{schema:u,value:S,onChange:O=>N(C,O),path:[...s,String(C)],level:a+1})},C)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:x,value:p??x[0]?.value,placeholder:o.selectTypeToAdd,onChange:S=>{const C=typeof S=="string"?S:S[0];g(C)}})}),n.jsx(b.DialGhostButton,{label:o.addItem,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})]})]})},yo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=Se(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,y=d.mapping,D=Object.keys(y).map(E=>({value:E,label:E})),N=typeof t=="object"&&t!==null?t[x]:void 0,S=N?Y({$ref:y[N]},i):void 0,C=E=>{const R=Y({$ref:y[E]},i),A=Ee(R,i)??{};r({...A,[x]:E})};if(e.discriminatorDisplay===at.Radio){const E=e.discriminatorOrientation===jt.Row,R=N?(()=>{const A=Y({$ref:y[N]},i),{[x]:O,..._}=A.properties??{};return{...A,properties:_}})():void 0;return E?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(y).map(A=>{const O=Y({$ref:y[A]},i);return n.jsx(M.DialRadioButton,{name:c,value:A,inputId:`${c}-${A}`,label:O.title??A,checked:N===A,disabled:l,onChange:()=>C(A)},A)})}),R&&n.jsx(gt,{schema:R,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(y).map(A=>{const O=Y({$ref:y[A]},i),_=N===A,{[x]:j,...k}=O.properties??{},F={...O,properties:k};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:A,inputId:`${c}-${A}`,label:O.title??A,checked:_,disabled:l,onChange:()=>C(A)}),_&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:F,value:t,onChange:r,path:s,level:a})})]},A)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:D,value:N,placeholder:o.selectTypePlaceholder,disabled:l,onChange:E=>{const R=typeof E=="string"?E:E[0];R&&C(R)}})}),S&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:S,value:t,onChange:r,path:s,level:a})})]})}const u=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<u.length;x++)if(Y(u[x],i).required?.every(D=>D in t))return x}return 0})(),f=x=>{const y=Y(u[x],i),D=Ee(y,i);r(D??null)},m=u[g];if(e.discriminatorDisplay===at.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:u.map((x,y)=>{const D=Y(x,i),N=Dn(x,i)??`Option ${y+1}`,S=g===y;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:String(y),inputId:`${c}-${y}`,label:N,checked:S,disabled:l,onChange:()=>f(y)}),S&&D&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Oe,{schema:D,value:t,onChange:r,path:s,level:a})})]},y)})});const v=u.map((x,y)=>{const D=Y(x,i);return{value:String(y),label:D.title??`Option ${y+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:v,value:String(g),disabled:l,onChange:x=>{const y=typeof x=="string"?x:x[0];f(Number(y))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Do=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=Se(),l=e.anyOf??[],c=l.map((m,v)=>({value:String(v),label:Dn(m,i)})),d=xo(t,l,i),u=l[d],g=Y(u,i).type===ee.Null,f=m=>{const v=Y(l[m],i);if(v.type===ee.Null){r(null);return}const x=Ee(v,i);if(x!==void 0){r(x);return}switch(v.type){case ee.Array:r([]);break;case ee.String:r("");break;case ee.Boolean:r(!1);break;case ee.Integer:case ee.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:c,value:String(d),disabled:o,onChange:m=>{const v=typeof m=="string"?m:m[0];f(Number(v))}})}),!g&&u&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:u,value:t,onChange:r,path:s,level:a})})]})},In=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=Se(),d=e.const!==void 0,u=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===ee.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(f=>{const m=c?.[f];return Array.isArray(m)?m.map(v=>{const x=String(v);return{value:x,label:x}}):[]});return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(d)return n.jsx(b.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(u&&e.enumDisplay===at.Radio){const g=e.enumOrientation===jt.Row;return n.jsx("div",{role:"radiogroup",className:g?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(f=>{const m=String(f);return n.jsx(M.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:v=>r(v)},m)})})}if(u){const g=e.enum.map(f=>({value:String(f),label:String(f)}));return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:f=>r(typeof f=="string"?f:f[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case ee.Boolean:return n.jsx(Ae.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case ee.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case ee.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(cn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(b.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Sn=e=>!!(e.oneOf||e.anyOf||e.type===ee.Array||Ue(e)),Co=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,onKeyChange:a,onValueChange:i,onRemove:o,keyInputPlaceholder:l,removeFieldAriaLabel:c,path:d,level:u,readonly:p=!1,inputClassName:g})=>{const{rootSchema:f,texts:m,defaultExpanded:v=!0,touchedPaths:x=new Set,markTouched:y=()=>{},skipUntouched:D=!1}=Se(),[N,S]=h.useState(t),C=Sn(s),E=[...d,e,"key"].join("."),A=(!D||x.has(E))&&t==="",O=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:C?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(b.DialInput,{value:N,disabled:p,invalid:A,onChange:F=>S(F??""),onBlur:()=>{y(E),N!==t&&a(N)},placeholder:l,containerClassName:g}),n.jsx(b.DialErrorText,{text:A?`${m.keyColumnHeader} is required`:void 0})]}),!C&&n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{schema:s,value:r,onChange:i})}),!p&&n.jsx(It,{size:T.ElementSize.Small,onClick:o,"aria-label":c,className:"shrink-0 p-1"})]});if(!C)return O;const _=[...d,t],j=lr(r,s,f),k=we(r,s,f,_.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[O,n.jsx(it,{title:t,level:u,summary:j,errorCount:k.length+(A?1:0),defaultExpanded:v,children:n.jsx(Oe,{schema:s,value:r,onChange:i,path:_,level:u+1})})]})},No=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c}=Se(),d=e.additionalProperties===!0||e.additionalProperties==null?{type:"string"}:typeof e.additionalProperties=="object"?Y(e.additionalProperties,i):{type:"string"},u=Sn(d),[p,g]=h.useState(()=>Object.entries(t??{}).map(([N,S])=>Rr(N,S))),f=N=>Object.fromEntries(N.filter(S=>S.key!=="").map(S=>[S.key,S.value])),m=(N,S)=>{const C=p.map((E,R)=>R===N?{...E,key:S}:E);g(C),r(f(C))},v=(N,S)=>{const C=p.map((E,R)=>R===N?{...E,value:S}:E);g(C),r(f(C))},x=()=>u?Ee(d,i)??Cn(d):"",y=()=>{g(N=>[...N,Rr("",x())])},D=N=>{const S=p.filter((C,E)=>E!==N);g(S),r(f(S))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[p.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),p.length>0&&!u&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:o.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:o.valueColumnHeader})]}),p.map((N,S)=>n.jsx(Co,{pairId:N.id,pairKey:N.key,pairValue:N.value,valueSchema:d,onKeyChange:C=>m(S,C),onValueChange:C=>v(S,C),onRemove:()=>D(S),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},N.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(b.DialGhostButton,{label:o.addField,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})})]})},jn=({value:e,onChange:t,theme:r=ot.EditorThemes.dark,height:s=240})=>{const{readonly:a}=Se(),[i,o]=h.useState(null),[l,c]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(u=>{o(()=>u.DialJsonEditor)})},[]);const d=u=>{const p=u??"";c(p);try{t(JSON.parse(p))}catch{}};return n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:l,currentTheme:r,onChange:d,options:{readOnly:a}})})},Oe=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:u=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=Se(),f=Y(e,l),m=y=>{d(s.join(".")),r(y)},v=!p||u.has(s.join("."));let x;if(f.oneOf)x=n.jsx(yo,{schema:f,value:t,onChange:m,path:s,level:a});else if(f.anyOf&&f.type!==ee.Object)x=n.jsx(Do,{schema:f,value:t,onChange:m,path:s,level:a});else if(Ue(f)){const y=f.additionalProperties!=null&&f.additionalProperties!==!1,D=!f.properties||Object.keys(f.properties).length===0;y&&D?x=n.jsx(No,{schema:f,value:t,onChange:m,path:s,level:a}):D&&f.additionalProperties!==!1?x=n.jsx(jn,{value:t,onChange:m,theme:g}):x=n.jsx(gt,{schema:f,value:t,onChange:m,path:s,level:a})}else if(f.type===ee.Array)x=n.jsx(vo,{schema:f,value:t,onChange:m,path:s,level:a});else{const y=v&&i&&Tt(t),D=!o&&y?`${f.title??"Field"} is required`:void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(In,{schema:f,value:t,onChange:m,invalid:y}),n.jsx(b.DialErrorText,{text:D})]})}return c?c(s,f,x):x},Io=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=qe.Sections,onChange:c,onPropertyChange:d,onDefaultValues:u,renderField:p,skipUntouched:g=!1,jsonEditorTheme:f,acceptableResourceTypes:m})=>{const v=h.useMemo(()=>({...mo,...r}),[r]),x=h.useMemo(()=>t||(Ee(e,e)??{}),[]),[y,D]=h.useState(x),[N,S]=h.useState(new Set),C=h.useCallback(j=>{S(k=>k.has(j)?k:new Set([...k,j]))},[]);h.useEffect(()=>{u?.(x)},[]);const E=(j,k)=>{const F={...y,[j]:k};D(F),c?.(F),d?.(j,k)},R=new Set(Object.keys(e.properties??{})),A=Object.keys(y).filter(j=>!R.has(j)),O=yn(Object.entries(e.properties??{}).filter(([,j])=>!Y(j,e).isHidden)),_=e.required??[];return n.jsx(vn.Provider,{value:{rootSchema:e,texts:v,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:f,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:C,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[O.map(([j,k])=>{const F=Y(k,e),G=F.title??k.title??bt(j),te=_.includes(j),U=y[j];if(l===qe.Flat)return n.jsx(Nn,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:0,required:te,label:G},j);if(l===qe.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:G}),n.jsx(Oe,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:0,required:te})]},j);const B=we(U,F,e,j),z=j+".",q=!g||N.has(j)||[...N].some(V=>V.startsWith(z));return n.jsx(it,{title:G,description:F.description,level:0,defaultExpanded:i,errorCount:q?te&&Tt(U)?Math.max(B.length,1):B.length:0,children:n.jsx(Oe,{schema:k,value:U,onChange:V=>E(j,V),path:[j],level:1,required:te})},j)}),A.map(j=>{const k=bt(j),F=n.jsx(jn,{value:y[j],onChange:G=>E(j,G),theme:f});return l===qe.Sections?n.jsx(it,{title:k,level:0,defaultExpanded:i,children:F},j):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:k}),F]},j)})]})})},So=e=>({info:n.jsx($.IconInfoCircleFilled,{size:e.size}),error:n.jsx($.IconAlertCircleFilled,{size:e.size}),warning:n.jsx($.IconAlertTriangleFilled,{size:e.size}),success:n.jsx($.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(b.Spinner,{size:e.size}),general:n.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),jo={[b.NotificationVariant.Info]:"bg-info text-info",[b.NotificationVariant.Success]:"bg-success text-success",[b.NotificationVariant.Warning]:"bg-warning text-warning",[b.NotificationVariant.Error]:"bg-error text-error",[b.NotificationVariant.Loading]:"bg-layer-raised text-info",[b.NotificationVariant.General]:"bg-layer-sunken text-primary"},To={[b.NotificationVariant.Info]:"status",[b.NotificationVariant.Success]:"status",[b.NotificationVariant.Warning]:"alert",[b.NotificationVariant.Error]:"alert",[b.NotificationVariant.Loading]:"status",[b.NotificationVariant.General]:"status"},wo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cr=({variant:e=b.NotificationVariant.Info,type:t=b.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:d,textClassName:u,...p})=>{const g=h.useMemo(()=>So({size:i,stroke:o})[e],[e,i,o]),f=u??(t===b.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:To[e],...p,className:I.mergeClasses(wo,jo[e],t===b.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===b.NotificationType.SectionMessage&&e===b.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(M.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",f),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),d,l&&n.jsx(P.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:m=>c?.(m)})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Eo=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,Oo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=Eo(a);if(!t.trim())return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:l})},Ao=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.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),children:t}),Qe=(e,t)=>({type:s,...a})=>n.jsx(cr,{...a,variant:e,type:s||t}),Je=(e,t)=>({variant:s,...a})=>n.jsx(cr,{...a,variant:s||t,type:e}),_o=Qe(b.NotificationVariant.Error,b.NotificationType.Toast),Ro=Qe(b.NotificationVariant.Info,b.NotificationType.Toast),ko=Qe(b.NotificationVariant.Success,b.NotificationType.Toast),Po=Qe(b.NotificationVariant.Warning,b.NotificationType.Toast),Lo=Qe(b.NotificationVariant.Loading,b.NotificationType.Toast),Mo=Qe(b.NotificationVariant.General,b.NotificationType.Toast),Fo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Error),Bo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Info),zo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Success),$o=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Warning),Ho=Je(b.NotificationType.SectionMessage,b.NotificationVariant.Loading),Vo=Je(b.NotificationType.SectionMessage,b.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Go="en-GB",Uo={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},Tn="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",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Ko="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Wo="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",qo="bg-control-accent text-control-permanent",Zo="text-accent dial-small-semi-text",Yo="text-control-disable-primary",On="text-secondary",Xo=n.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Qo=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Lr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Mr=(e,t,r)=>{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(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},Jo=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Fr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),el=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Br=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},tl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),rl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),sl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),zr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const d=M.useThemeScope(),[u,p]=h.useState(!1),{refs:g,floatingStyles:f,context:m}=le.useFloating({open:u,onOpenChange:S=>p(t?!1:S),placement:"bottom-start",whileElementsMounted:le.autoUpdate,middleware:[le.offset(8),le.flip({padding:8}),le.shift({padding:8})]}),v=le.useClick(m,{enabled:!t}),x=le.useDismiss(m),y=le.useRole(m,{role:"dialog"}),{getReferenceProps:D,getFloatingProps:N}=le.useInteractions([v,x,y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":u,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...D(),children:s}),u&&n.jsx(le.FloatingPortal,{children:n.jsx(le.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:f,"aria-label":c,className:I.mergeClasses(Ko,d,a),...N(),children:o(()=>p(!1))})})})]})},$r=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:i,className:o,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[u,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:u,onChange:f=>{const m=rl(f.target.value);p(m),tl(m)&&r(m)},onBlur:s,className:I.mergeClasses(Tn,i&&En,a&&wn,o)});return d?n.jsxs("div",{className:"relative w-full",children:[g,n.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})]}):g},al=({mode:e=be.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:i,disabled:o=!1,invalid:l=!1,id:c,className:d,minDate:u,maxDate:p,locale:g=Go,fieldClassName:f,showTimezone:m=!1})=>{const v=i??Uo[e],x=t instanceof Date?t:null,y=h.useId(),D=c??y,N=a?.id??`${D}-label`,S=!!a?.label,C=typeof a?.label=="string"?a.label:void 0,E=S?`${N} ${D}`:void 0,R=a?n.jsx(P.Label,{...a,id:N,htmlFor:D}):null,[A,O]=h.useState(()=>x??new Date),_=h.useMemo(()=>new Date,[]),j=h.useMemo(()=>m?bn({locale:g}):null,[m,g]),k=h.useMemo(()=>nl(g),[g]),F=h.useMemo(()=>sl(g),[g]),G=h.useMemo(()=>Qo(A.getFullYear(),A.getMonth()),[A]),te=q=>{O(V=>new Date(V.getFullYear(),V.getMonth()+q,1))},U=(q,V)=>{if(Mr(q,u,p))return;const se=e===be.DateTime&&x?Br(q,dt(x)):q;r?.(se),e===be.Date&&V()},B=q=>{r?.(Br(x??new Date,q))},z=()=>x?e===be.DateTime?`${Fr(x,g)}, ${dt(x)}`:Fr(x,g):v;if(e===be.Time){const q=typeof t=="string"?t:x?dt(x):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d),children:[R,n.jsx($r,{id:D,value:q,onChange:V=>r?.(V),onBlur:s,disabled:o,invalid:l,placeholder:v,className:f,timezoneLabel:j})]})}if(e===be.Weekday){const q=typeof t=="string"?t:void 0,V=F.find(se=>se.value===q);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d),children:[R,n.jsx(zr,{id:D,disabled:o,invalid:l,labelledBy:E,panelLabel:C??v,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!V&&"text-secondary"),children:V?.label??v}),n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:se=>n.jsx("div",{role:"listbox","aria-label":C??v,className:"flex flex-col gap-0.5",children:F.map(X=>n.jsx("button",{type:"button",role:"option","aria-selected":X.value===q,className:I.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===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(X.value),se()},children:X.label},X.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",d),children:[R,n.jsx(zr,{id:D,disabled:o,invalid:l,labelledBy:E,panelLabel:C??v,fieldClassName:f,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!x&&"text-secondary"),children:z()}),Xo]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(P.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:T.ElementSize.Small,onClick:()=>te(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Jo(A,g)}),n.jsx(P.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:T.ElementSize.Small,onClick:()=>te(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[k.map(V=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:V},V)),G.map(V=>{const se=V.getMonth()!==A.getMonth(),X=Lr(V,x),W=Lr(V,_),re=Mr(V,u,p);return n.jsx("button",{type:"button",disabled:re,"aria-label":el(V,g),"aria-pressed":X,"aria-current":W?"date":void 0,className:I.mergeClasses(Wo,se&&Yo,W&&!X&&Zo,X&&qo,re&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>U(V,q),children:V.getDate()},V.toISOString())})]}),e===be.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx($r,{ariaLabel:"Time",value:x?dt(x):"",onChange:B,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},il=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(M.DialIcon,{icon:n.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),o=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:i}:{}}));return n.jsx(b.DialBreadcrumb,{className:s,ariaLabel:a,separator:n.jsx(M.DialIcon,{icon:n.jsx($.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:o,labelClassName:I.mergeClasses(t,"text-secondary","!cursor-default")})},et=({label:e,variant:t,appearance:r=T.ButtonAppearance.Solid,size:s=T.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:d,href:u,target:p,rel:g,disabled:f,...m})=>{const v=I.mergeClasses("dial-kit-base-button",t&&P.getButtonClassNames(t,r),s===T.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===T.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===T.ElementSize.Small&&"dial-kit-base-button-small",r!==T.ButtonAppearance.Link&&(s===T.ElementSize.Small?"px-2":"px-4"),s!==T.ElementSize.Small&&r!==T.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,y=T.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),D=n.jsxs(n.Fragment,{children:[n.jsx(M.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(M.DialIcon,{icon:o})]}),N=m,S=u!==void 0?n.jsx("a",{...N,href:f?void 0:u,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":f||void 0,tabIndex:f?-1:N.tabIndex,onClick:f?void 0:N.onClick,className:v,"aria-label":y,children:D}):n.jsx("button",{...m,type:c,disabled:f,className:v,"aria-label":y,children:D});return d?n.jsx(P.Tooltip,{asChild:!0,...d,children:S}):S},dr=(e,t)=>({appearance:s,...a})=>n.jsx(et,{...a,variant:e,appearance:s||t}),ur=(e,t)=>({variant:s,...a})=>n.jsx(et,{...a,variant:s||t,appearance:e}),Rn=dr(T.ButtonVariant.Primary,T.ButtonAppearance.Solid),fr=dr(T.ButtonVariant.Neutral,T.ButtonAppearance.Solid),ol=dr(T.ButtonVariant.Danger,T.ButtonAppearance.Solid),ll=ur(T.ButtonAppearance.Link,T.ButtonVariant.Primary),cl=ur(T.ButtonAppearance.Ghost,T.ButtonVariant.Primary),dl=ur(T.ButtonAppearance.Outlined,T.ButtonVariant.Neutral),ul=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const i=I.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),o=n.jsx("button",{...a,type:s,className:i,"aria-label":T.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(T.DialTooltip,{...r,children:o}):o},fl=e=>n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),pl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>fl(a),[a]);return n.jsx("div",{children:n.jsx(P.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(et,{...s,iconAfter:o,variant:e||T.ButtonVariant.Primary,appearance:t||T.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},kn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===T.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.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",i,a.className),...a,children:[e,n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},gl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:d})=>{const[u,p]=h.useState(!1),[g,f]=h.useState(r??e[0]?.key),m=t!==void 0,v=m?t:g,x=h.useMemo(()=>{const D=e.find(N=>N.key===v);return D?.label?String(D.label):""},[e,v]),y=h.useCallback(({key:D})=>{const N=e.find(S=>S.key===D);N&&(m||f(D),s?.(N))},[e,m,s]);return n.jsx(P.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:p,onItemClick:y,children:n.jsx(kn,{label:x,size:a,isOpen:u,disabled:i,"aria-label":d})})},Pe=({text:e,className:t,variant:r=b.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===b.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Le=({...e})=>n.jsx(Pe,{...e,variant:b.CaptionType.Error}),hl="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",ml={[T.ElementSize.Small]:"size-[24px]",[T.ElementSize.Standard]:"size-[40px]",[T.ElementSize.Large]:"size-[48px]"},xl=({icon:e,onClick:t,disabled:r,size:s=T.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",ml[s]),children:n.jsx(P.IconButton,{className:I.mergeClasses(hl,s===T.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),bl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Pn=(e,t,r,s)=>{if((t==="number"||r!==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((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),d=parseFloat(c);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},Ln={[T.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[T.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[T.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ge=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=T.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Ln[i].stackGap,a),children:[e&&n.jsx(P.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Le,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:d,inputRef:u,value:p,tooltipText:g,min:f,onChange:m,max:v,inputButtonProps:x,wrapperRef:y,size:D=T.ElementSize.Standard,...N})=>{const S=Ln[D],C=h.useRef(null),E=le.useMergeRefs([u,C]),R=d==="number"||f!==void 0||v!==void 0;h.useEffect(()=>{const j=C.current;if(!j||!R||t)return;const k=F=>{F.preventDefault()};return j.addEventListener("wheel",k,{passive:!1}),()=>{j.removeEventListener("wheel",k)}},[t,R,d]);const A=j=>{Pn(j,d,f,v)},O=j=>{const k=j.currentTarget.value;if(R&&k!==""){const F=parseFloat(k);if(isNaN(F)&&k!=="-"&&k!=="."||!isNaN(F)&&(f!==void 0&&F<+f||v!==void 0&&F>+v))return}m?.(k||void 0)},_=()=>n.jsxs("div",{ref:y,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",S.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&S.paddingStart,!x&&S.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:D,id:`${r}_textBefore`})}),n.jsx(M.DialIcon,{icon:o}),i,n.jsx("input",{ref:E,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:O,onKeyDown:A,min:f,disabled:t,max:v,...N}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",S.postfixText),children:[" ",a]}),n.jsx(M.DialIcon,{icon:l}),x&&n.jsx(xl,{size:D,...x,disabled:t})]});return t&&d!=="password"?n.jsx(P.Tooltip,{tooltip:g||p,children:_()}):_()};var Ye=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ye||{});const vl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",yl={[Ye.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ye.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Dl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Cl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ze=({label:e,icon:t,appearance:r=Ye.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:d,onRemove:u,onKeyDown:p,...g})=>{const f=r===Ye.Selectable,m=!!d&&!a,v=i&&!!u&&!a,x=f&&s,y=D=>{p?.(D),!(!m||D.defaultPrevented)&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),D.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":f&&m?s:void 0,onClick:a?void 0:d,onKeyDown:y,className:I.mergeClasses(vl,x?"dial-tiny-semi-text":"dial-tiny-text",yl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Dl,Cl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),v&&n.jsx(P.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:T.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:D=>{D.stopPropagation(),u?.(D)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(Ze,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),Nl=I.mergeClasses("w-full flex flex-col"),Il=P.overlayItemClassName,Sl="!max-w-[var(--reference-width)]",jl="max-h-[344px] overflow-y-auto",Tl=P.overlayGap,wl=P.overlaySubMenuClassName,El=n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ol="text-secondary transition-transform",Al=8,_l=n.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rl=n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl=n.jsx(P.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pl=({opt:e,selectedValues:t,mark:r=P.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:u}=M.useSubMenuFloating(Tl,"listbox",!!e.disabled),p=e.children?.some(f=>t.includes(f.value)),g=n.jsx(P.MenuItem,{ref:o.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:El,...d()});return n.jsxs(le.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(M.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:u,role:"listbox",surfaceClassName:wl,children:e.children.map(f=>{const m=n.jsx(P.MenuItem,{role:"option","aria-selected":t.includes(f.value),"aria-disabled":!!f.disabled,disabled:f.disabled,mark:r,selected:t.includes(f.value),ellipsisLabel:!0,icon:f.icon,label:f.labelNode??f.label,rightControl:f.rightControl,onClick:()=>!f.disabled&&s(f.value)});return n.jsx(h.Fragment,{children:f.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:m}):m},f.value)})})]})},Ll=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=T.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:u,caption:p,ariaLabel:g,searchable:f=!1,searchSize:m=T.ElementSize.Standard,searchPlaceholder:v,selectAll:x=!1,invalid:y,selectAllLabel:D="Select all",selectedOptionMark:N=P.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:C,emptyStateIcon:E,disabled:R=!1,className:A,fieldClassName:O,listClassName:_,closable:j=!1,header:k,footer:F,onClose:G,onChange:te,dismissRef:U,onFooterClick:B,open:z,onOpenChange:q,onSearchQueryChange:V,customMultiSelectTagsRenderer:se})=>{const X=h.useId(),W=r||X,re=`list-${W}`,de=i===T.ElementSize.Small,[ue,ce]=h.useState(!1),pe=z!==void 0,ge=pe?!!z:ue,fe=h.useCallback(L=>{pe||ce(L),q?.(L)},[pe,q]),[K,Q]=h.useState(""),Ne=h.useCallback(L=>{L!==K&&(Q(L||""),V?.(L||""))},[V,K]),Me=s!==void 0,[he,Fe]=h.useState(a),je=Me?s:he,ne=h.useMemo(()=>t?Array.isArray(je)?je:[]:typeof je=="string"?[je]:[],[je,t]),_e=h.useMemo(()=>{const L=K.trim().toLowerCase();return L?e.filter(oe=>oe.label.toLowerCase().includes(L)):e},[e,K]);h.useEffect(()=>{ge||Ne("")},[ge,Ne]);const Ie=h.useCallback(L=>{Me||Fe(L),te?.(L)},[Me,te]),Be=h.useCallback(L=>{if(t){const oe=new Set(ne);oe.has(L)?oe.delete(L):oe.add(L),Ie(Array.from(oe));return}Ie(L),fe(!1)},[t,Ie,fe,ne]),tt=h.useCallback((L,oe)=>{if(L.stopPropagation(),!t){Ie("");return}const lt=ne.filter(Kn=>Kn!==oe);Ie(lt)},[t,ne,Ie]),ye=h.useMemo(()=>_e.filter(L=>!L.disabled),[_e]),ze=h.useMemo(()=>ye.filter(L=>ne.includes(L.value)).length,[ye,ne]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=h.useMemo(()=>{const L=ye.length>0&&ze===ye.length;return{allSelectedInFiltered:L,someSelectedInFiltered:ze>0&&!L}},[ye,ze]),wt=h.useCallback(()=>{if(!(!t||ye.length===0))if(Re){const L=new Set(ye.map(oe=>oe.value));Ie(ne.filter(oe=>!L.has(oe)))}else{const L=new Set(ne);ye.forEach(oe=>L.add(oe.value)),Ie(Array.from(L))}},[Re,t,ye,ne,Ie]),Te=ne.length>0,$e=!t&&Te?ne[0]:void 0,w=h.useMemo(()=>$e?e.find(L=>L.value===$e)??e.flatMap(L=>L.children??[]).find(L=>L.value===$e):void 0,[e,$e]),J=w?o?`${o} ${w.label}`:w.label:void 0,xe=h.useMemo(()=>t?Te?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:se?.(e,ne,tt)??n.jsx(Fn,{options:e,selectedValues:ne,handleRemoveTag:tt})}):null:!w||!w.labelNode&&!w.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(P.EllipsisTooltip,{text:w.labelNode??J}),w.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:w.description})]}),[se,tt,Te,t,e,J,ne,w]),Et=t||xe?"":J||(l&&s?l:""),Hn=typeof d?.label=="string"?d.label:void 0,Vn=xe?[T.resolveAccessibleName(g,Hn),t?ne.map(L=>e.find(oe=>oe.value===L)?.label??L).join(", "):J].filter(Boolean).join(", ")||void 0:T.resolveAccessibleName(g);h.useImperativeHandle(U,()=>({dismiss:()=>{fe(!1)}}));const Gn=h.useCallback(L=>{R||(L.key==="ArrowDown"||L.key==="ArrowUp")&&(L.preventDefault(),ge||fe(!0))},[R,ge,fe]),Un=()=>n.jsxs("div",{id:re,role:"listbox","aria-multiselectable":t||void 0,className:Nl,children:[k&&n.jsx(n.Fragment,{children:typeof k=="function"?k():k}),(f||j)&&(e.length>Al||!!K)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(Ge,{id:`search-${W}`,size:m,placeholder:v,"aria-label":v||"Search options",onChange:L=>Ne(L),value:K,iconBefore:_l,containerClassName:"w-full"}),j&&n.jsx(P.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:T.ElementSize.Small,icon:Rl,onClick:L=>{G?.(L),fe(!1)}})]}),t&&x&&ye.length>0&&n.jsx("div",{className:I.mergeClasses(Il,"mt-2"),children:n.jsx(P.Checkbox,{id:`${W}-selectAll`,labelProps:{label:D},isSelected:Re,isIndeterminate:me,onChange:wt})}),n.jsx("div",{role:"none",className:jl,children:_e.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:E??kl,title:S,description:C})}):_e.map(L=>{const oe=ne.includes(L.value);if(L.children?.length)return n.jsx(Pl,{opt:L,selectedValues:ne,mark:t?P.MenuItemMark.Checkbox:N,onSelect:Be},L.value);const lt=t?n.jsx(P.MenuItem,{id:`${W}-${L.value}`,role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:P.MenuItemMark.Checkbox,selected:oe,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>Be(L.value)}):n.jsx(P.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:N,selected:oe,ellipsisLabel:!0,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>!L.disabled&&Be(L.value)});return n.jsx(h.Fragment,{children:L.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:L.interactiveTooltip.placement,content:L.interactiveTooltip.content,contentClassName:L.interactiveTooltip.contentClassName,children:lt}):lt},L.value)})}),F&&n.jsx("div",{onClick:L=>{B?.(L),B&&fe(!1)},children:typeof F=="function"?F():F})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",A),children:[d&&n.jsx(P.Label,{...d,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(P.Dropdown,{open:ge,onOpenChange:fe,disabled:R,closable:j,onClose:G,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Sl,_),className:"w-full",renderOverlay:Un,children:n.jsx(Ge,{id:W,size:i,disabled:R,invalid:y,value:Et,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:w?.icon,iconAfter:n.jsx($.IconChevronDown,{size:de?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Ol,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":re,"aria-autocomplete":"none","aria-label":Vn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!R&&"cursor-pointer",t&&Te&&["!h-auto flex-wrap py-1.5",de?"min-h-[24px]":"min-h-[40px]"],O),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:xe})}),n.jsx(Le,{text:u}),!u&&n.jsx(Pe,{text:p})]})]})};var Bn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Bn||{});const Hr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Ml=e=>typeof e=="boolean"?Hr[e?"both":"none"]:Hr[e],Fl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...d})=>{const u=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",Ml(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(P.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:u,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Le,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},Bl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=T.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ge,{...a,size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},zl=/^0+\.(\d+)?$/,$l=/^0+/,Hl=[".","-","+","e","E"],Vr=e=>!e||e==="-"?e:String(e).match(zl)?String(e).replace($l,"0"):Number(e),Vl=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>{if(e&&Hl.includes(d.key)){d.preventDefault();return}Pn(d,"number",r,s),a?.(d)},c=d=>{if(e){const u=d.clipboardData.getData("text"),p=u.replace(/\D/g,"");if(p!==u&&(d.preventDefault(),p)){const g=d.currentTarget,f=g.selectionStart??0,m=g.selectionEnd??0,v=g.value.slice(0,f)+p+g.value.slice(m);t?.(Vr(v))}}i?.(d)};return n.jsx(Ge,{...o,type:"number",min:r,max:s,onChange:d=>t?.(Vr(d)),onKeyDown:l,onPaste:c})},Gl="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Ul="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Kl="flex flex-row items-center justify-between px-6 py-4",Wl="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",ql="border-b border-tertiary",Zl="flex flex-row items-center gap-2 px-6 py-4",Yl="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",Xl={[b.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[b.PopupSize.Md]:"max-w-full md:max-w-[800px]",[b.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},pr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:d,footer:u,footerClassName:p,onClose:g,onBack:f,backAriaLabel:m="Back",headerActions:v,headerDivider:x=!1,mainButtons:y,additionalButtons:D,additionalButtonsOnLeft:N=!1,footerDivider:S=!1,size:C=b.PopupSize.Md,hideClose:E=!1,closeAriaLabel:R="Close dialog",closeOnOutsideClick:A=!0,preventKeyboardOnOpen:O=!1})=>{const _=M.useThemeScope(),j=h.useRef(null),k=h.useId(),{refs:F,context:G}=le.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),te=le.useRole(G,{role:"dialog"}),U=le.useDismiss(G,{outsidePress:A}),{getFloatingProps:B}=le.useInteractions([te,U]);if(!e)return null;const z=typeof t=="string"?`popup-heading-${k}`:void 0,q=W=>W?typeof W=="string"?n.jsx("h2",{id:z,className:I.mergeClasses(Wl,o),children:n.jsx(P.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),V=E?null:n.jsx(P.CloseButton,{ariaLabel:R,onClose:W=>g?.(W)}),se=(W,re=[])=>re.map(({variant:de=T.ButtonVariant.Neutral,...ue},ce)=>n.jsx(et,{variant:de,...ue},`${W}-${ce}`)),X=()=>{if(u!==void 0)return u;if(!y?.length&&!D?.length)return null;const W=se("additional",D);return n.jsxs("div",{className:I.mergeClasses(Zl,S&&Yl,p),children:[N&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!N&&W,se("main",y)]})]})};return n.jsx(le.FloatingPortal,{id:s,children:n.jsx(le.FloatingOverlay,{className:I.mergeClasses(Gl,_,i),children:n.jsx(le.FloatingFocusManager,{context:G,initialFocus:O?j:F.floating,children:n.jsxs("div",{ref:F.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-label":z?void 0:r,className:I.mergeClasses(Ul,Xl[C],a),children:[O&&n.jsx("div",{ref:j,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Kl,x&&ql,l),children:[f&&n.jsx(P.GhostIconButton,{"aria-label":m,size:T.ElementSize.Small,className:"mr-2",onClick:f,icon:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),v?n.jsxs("div",{className:Ht,children:[v,V]}):V]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:d}),X()]})})})})},Ql="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Jl="text-secondary dial-small-paragraph-text px-6 pb-4",ec="px-6 py-4 h-[120px]",tc="Cancel",rc="Ok",Vt={[b.ConfirmationPopupVariant.Info]:{confirm:{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Solid}},[b.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:T.ButtonVariant.Danger,appearance:T.ButtonAppearance.Solid}}},nc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=rc,cancelLabel:i=tc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:u,onConfirm:p,onCancel:g,children:f,variant:m=b.ConfirmationPopupVariant.Info,size:v=b.PopupSize.Sm,footer:x,hideClose:y,...D})=>{const N=o?null:n.jsxs("div",{className:Ql,children:[n.jsx(fr,{label:i,onClick:()=>g?g():u?.()}),n.jsx(et,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),S=h.useCallback(()=>o?n.jsx("div",{className:ec,children:n.jsx(b.Spinner,{size:40})}):f??(t?n.jsx("div",{className:I.mergeClasses(Jl,r),children:t}):null),[f,t,o,r]);return n.jsx(pr,{...D,open:s,header:e,className:I.mergeClasses(Vt[m].container,c),onClose:()=>u?.(),footer:x??N,size:v,hideClose:y??(!o&&x===void 0),children:S()})},sc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:d,headerClassName:u,contentClassName:p})=>{const g=s!==void 0,[f,m]=h.useState(a),v=o?!0:g?s:f,x=h.useId(),y=`accordion-header-${x}`,D=`accordion-content-${x}`,N=()=>{if(i)return;const C=!v;g||m(C),c?.(C)},S=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",v&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",d),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",u),children:S}):n.jsx("button",{id:y,type:"button","aria-expanded":v,"aria-controls":v?D:void 0,"aria-label":T.resolveAccessibleName(l),disabled:i,onClick:N,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",u),children:S}),v&&n.jsx("div",{id:D,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",p),children:r})]})},ac=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),d=e??c,u=i?`${d}-caption`:void 0,p=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:I.mergeClasses("flex items-center gap-2",o),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":T.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":u,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(P.Label,{size:T.ElementSize.Standard,...t,htmlFor:d,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:u,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},ic="flex flex-col gap-2",oc="flex",lc="mt-2 ml-[26px]",cc={[b.RadioGroupOrientation.Column]:"flex-col gap-y-3",[b.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},zn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=b.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:d,ariaLabel:u,className:p,optionsClassName:g,radioClassName:f,contentClassName:m})=>{const v=h.useId(),x=a??v,y=`${x}-label`,D=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,S=T.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(ic,p),children:[o&&n.jsx(P.Label,{...o,id:y}),n.jsx("div",{role:"radiogroup","aria-labelledby":S?y:void 0,"aria-label":S?void 0:T.resolveAccessibleName(u),"aria-describedby":[D,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(oc,cc[i],g),children:e.map(C=>{const E=C.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(P.Radio,{id:`${x}-${C.value}`,name:s??x,value:C.value,labelProps:C.label==null?void 0:{label:C.label},"aria-label":C["aria-label"],caption:C.caption,isSelected:E,disabled:l||C.disabled,onChange:r,className:f}),E&&C.content?n.jsx("div",{className:I.mergeClasses(lc,m),children:C.content}):null]},C.value)})}),n.jsx(Le,{id:D,text:c}),!c&&n.jsx(Pe,{id:N,text:d})]})},dc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",uc="min-w-0 flex-1 truncate text-primary",fc="min-w-0 flex-1 truncate text-secondary",pc="shrink-0 text-secondary",gc="px-6 pb-4",hc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",mc="Cancel",xc="Apply",bc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:u,onClose:p,isValid:g=!0,applyButtonLabel:f=xc,cancelButtonLabel:m=mc,size:v=b.PopupSize.Md,portalId:x,disabled:y,invalid:D,error:N,caption:S,ariaLabel:C,className:E,fieldClassName:R})=>{const A=h.useId(),O=i??A,_=`${O}-label`,j=`${O}-value`,k=N?`${O}-error`:void 0,F=!N&&S?`${O}-caption`:void 0,[G,te]=h.useState(!1),U=c!==void 0,[B,z]=h.useState(t),q=U?c:B,V=h.useCallback(()=>{y||(U||z(t),te(!0))},[y,U,t]),se=h.useCallback(()=>{te(!1),p?.()},[p]),X=h.useCallback(()=>{u?.(),se()},[u,se]),W=h.useCallback(()=>{a(q),se()},[a,q,se]),re=h.useCallback(K=>{U||z(K),d?.(K)},[U,d]),de=T.resolveAccessibleName(o?.label),ue=de?void 0:T.resolveAccessibleName(C),ce=de?_:ue&&`${O}-name`,pe=T.resolveAccessibleName(s),ge=e.find(K=>K.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",E),children:[o&&n.jsx(P.Label,{...o,id:_,htmlFor:O}),n.jsxs("div",{className:"flex flex-col gap-1",children:[ue&&n.jsx("span",{id:ce,className:"sr-only",children:ue}),n.jsxs("button",{type:"button",id:O,disabled:y,"aria-haspopup":"dialog","aria-expanded":G,"aria-labelledby":ce?`${ce} ${j}`:void 0,"aria-describedby":[k,F].filter(Boolean).join(" ")||void 0,onClick:V,className:I.mergeClasses(dc,D&&"dial-kit-input-error",y&&"dial-kit-input-disable",R),children:[n.jsx("span",{id:j,className:fe==null?fc:uc,children:fe??l}),n.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:pc})]}),n.jsx(Le,{id:k,text:N}),!N&&n.jsx(Pe,{id:F,text:S})]}),n.jsx(pr,{open:G,header:s,ariaLabel:pe?void 0:de,portalId:x,size:v,onClose:X,footer:n.jsxs("div",{className:hc,children:[n.jsx(fr,{label:m,onClick:X}),n.jsx(Rn,{label:f,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:gc,children:n.jsx(zn,{id:`${O}-options`,items:e,value:q,onChange:re,orientation:b.RadioGroupOrientation.Column,ariaLabel:de??pe})})})]})},vc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=T.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),u=n.jsx(P.IconButton,{...c,size:o,variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":T.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:d,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(P.Tooltip,{asChild:!0,...i,children:u}):u},yc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Dc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Cc="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",Nc="bg-layer-raised text-accent shadow-xs",Ic="bg-transparent text-secondary",Sc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",jc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Tc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",wc="cursor-not-allowed bg-transparent text-control-disable-primary",Ec=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,u=h.useCallback(p=>{if(s||!yc.includes(p.key))return;const g=e.filter(y=>!y.disabled);if(g.length===0)return;const f=Math.max(g.findIndex(y=>y.value===t),0),m=g.length-1;let v=f;switch(p.key){case"ArrowRight":case"ArrowDown":v=f===m?0:f+1;break;case"ArrowLeft":case"ArrowUp":v=f===0?m:f-1;break;case"Home":v=0;break;case"End":v=m;break}p.preventDefault();const x=g[v];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:u,className:I.mergeClasses(Dc,a),children:e.map(p=>{const g=p.value===t,f=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":T.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:f,onClick:()=>r(p.value),className:I.mergeClasses(Cc,g?Nc:Ic,f?g?Tc:wc:g?Sc:jc,i),children:[p.icon,p.label]},p.value)})})},Oc=["ArrowRight","ArrowLeft","Home","End"],Ac=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(u=>u.id===t),c=l&&!l.disabled?l.id:e.find(u=>!u.disabled)?.id,d=h.useCallback(u=>{if(!Oc.includes(u.key)||e.length===0)return;const p=e.filter(x=>!x.disabled);if(p.length===0)return;const g=Math.max(p.findIndex(x=>x.id===t),0),f=p.length-1;let m=g;switch(u.key){case"ArrowRight":m=g===f?0:g+1;break;case"ArrowLeft":m=g===0?f:g-1;break;case"Home":m=0;break;case"End":m=f;break}u.preventDefault();const v=p[m];o.current[v.id]?.focus(),v.id!==t&&r(v.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:d,className:I.mergeClasses("flex justify-start gap-1",a),children:e.map(u=>{const p=t===u.id,g=!!u.disabled;return n.jsxs("button",{ref:f=>{o.current[u.id]=f},type:"button",role:"tab","aria-selected":p,disabled:g,tabIndex:u.id===c?0:-1,onClick:()=>r(u.id),className:I.mergeClasses("dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(p?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:u.label}),u.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(p?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:u.count})]},u.id)})})},Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},_c=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:d,id:u,ariaLabel:p,className:g})=>{const f=h.useId(),m=u??`file-dropzone-${f}`,v=c?`${m}-error`:void 0,[x,y]=h.useState(!1),D=h.useRef(0),N=h.useCallback(_=>{if(_.length===0)return;const j=o?_:_.slice(0,1),k=j.filter(G=>Qt(G,i)),F=j.filter(G=>!Qt(G,i));F.length>0&&a?.(F),k.length>0&&s(k)},[i,o,s,a]),S=h.useCallback(_=>{N(Array.from(_.target.files??[])),_.target.value=""},[N]),C=h.useCallback(()=>{D.current=0,y(!1)},[]),E=h.useCallback(_=>{l||(_.preventDefault(),D.current+=1,y(!0))},[l]),R=h.useCallback(_=>{l||(_.preventDefault(),_.dataTransfer.dropEffect="copy")},[l]),A=h.useCallback(()=>{l||(D.current-=1,D.current<=0&&C())},[l,C]),O=h.useCallback(_=>{_.preventDefault(),!l&&(C(),N(Array.from(_.dataTransfer?.files??[])))},[l,C,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(P.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:S,"aria-label":T.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":v,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:E,onDragOver:R,onDragLeave:A,onDrop:O,className:I.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",g),children:[d??n.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Le,{id:v,text:c})]})},Rc=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,i=0;for(const o of t){const l=o+s;if(a+l>e)break;a+=l,i++}if(i===t.length)return i;for(;i>0&&a+r>e;)i--,a-=t[i]+s;return i},kc=4,Pc=24,Gr=e=>parseFloat(e)||0,Lc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Mc=()=>{},Fc=({id:e,value:t,defaultValue:r,size:s=T.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:d=!1,readOnly:u=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:f="Tags",className:m,fieldClassName:v,tagClassName:x,onChange:y})=>{const D=h.useId(),N=e||D,S=s===T.ElementSize.Small,C=h.useRef(null),E=h.useRef([]),R=h.useRef(null),A=t!==void 0,[O,_]=h.useState(r??[]),j=A?t:O,k=j.length,[F,G]=h.useState(""),[te,U]=h.useState(k),B=!u&&!d,z=h.useCallback(K=>{A||_(K),y?.(K)},[A,y]),q=h.useCallback(K=>Q=>{E.current[K]=Q},[]),V=h.useCallback(()=>{const K=C.current;if(!K||K.clientWidth===0){U(j.length);return}const{paddingLeft:Q,paddingRight:Ne}=getComputedStyle(K);U(Rc({availableWidth:K.clientWidth-Gr(Q)-Gr(Ne)-(u?0:Pc),tagWidths:j.map((Me,he)=>E.current[he]?.offsetWidth??0),overflowChipWidth:R.current?.offsetWidth??0,gap:kc}))},[u,j]);h.useEffect(()=>{if(!p){U(k);return}const K=C.current;if(!K)return;const Q=new ResizeObserver(()=>V());return Q.observe(K),V(),()=>Q.disconnect()},[p,V,k]);const se=I.mergeClasses(p?"shrink-0":"min-w-0",x),X=K=>{const Q=Lc(K.trim()).trim();!Q||j.includes(Q)||z([...j,Q])},W=K=>{z(j.filter(Q=>Q!==K))},re=()=>{X(F),G("")},de=K=>{if(B){if(K.key==="Enter"||K.key===","){K.preventDefault(),re();return}K.key==="Backspace"&&!F&&k>0&&(K.preventDefault(),z(j.slice(0,-1)))}},ue=()=>{B&&F.trim()&&re()},ce=p?j.slice(0,te):j,pe=p?j.slice(te):[],ge=pe.join(", "),fe=k>0&&n.jsxs("span",{role:"list","aria-label":f,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ce.map(K=>n.jsx(Ze,{role:"listitem",label:K,className:se,disabled:d,closable:B,onRemove:B?()=>W(K):void 0},K)),pe.length>0&&n.jsx(Ze,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",x),disabled:d}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[j.map((K,Q)=>n.jsx("span",{ref:q(Q),className:"inline-flex",children:n.jsx(Ze,{label:K,className:x,disabled:d,closable:B,onRemove:B?Mc:void 0})},K)),n.jsx("span",{ref:R,className:"inline-flex",children:n.jsx(Ze,{label:`+${k}`,className:x})})]})]});return n.jsx(Ge,{id:N,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:d,readOnly:u,value:F,placeholder:k>0?void 0:i,"aria-label":g,wrapperRef:C,onChange:K=>G(K??""),onKeyDown:de,onBlur:ue,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(k>0&&["!h-auto",S?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",p?"flex-nowrap overflow-hidden":"flex-wrap"],v),className:I.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",u&&"cursor-default"),children:fe})},Bc={[T.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[T.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[T.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},zc=({size:e=T.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...d})=>{const u=h.useRef(null),p=le.useMergeRefs([c,u]),g=!!i&&!a,f=h.useCallback(()=>{o?.(void 0),u.current?.focus()},[o]);return n.jsx(Ge,{...d,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:p,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l),iconBefore:n.jsx($.IconSearch,{size:Bc[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":s,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:f}):void 0})},$c=16,Hc=e=>(e.toString().split(".")[1]??"").length,Vc=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:d=!1,caption:u,error:p,onChange:g,containerClassName:f,trackClassName:m,fillClassName:v,className:x,...y})=>{const D=h.useId(),N=e??D,S=u&&!p?`${N}-caption`:void 0,C=p?`${N}-error`:void 0,E=s-r,R=E>0?Math.min(100,Math.max(0,(t-r)/E*100)):0,A=`calc(${R}% + ${(.5-R/100)*$c}px)`,O=c?c(t):t.toFixed(Hc(a)),_=h.useCallback(j=>{g?.(Number(j.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",f),children:[(o||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(P.Label,{...o,htmlFor:N}),d&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:O})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",i?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",i?"bg-control-disable-secondary":"bg-control-accent",v),style:{width:A}}),n.jsx("input",{...y,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:i,onChange:_,"aria-label":T.resolveAccessibleName(typeof o?.label!="string"?y["aria-label"]:void 0),"aria-valuetext":c?O:void 0,"aria-describedby":C??S,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",x)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Le,{id:C,text:p}),!p&&n.jsx(Pe,{id:S,text:u})]})]})},Gc=48,Uc=({children:e,title:t,width:r=280,collapsedWidth:s=Gc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:u="Expand sidebar",className:p,titleClassName:g,contentClassName:f,footerClassName:m})=>{const v=a!==void 0,[x,y]=h.useState(i),D=v?a:x,N=`collapsible-sidebar-content-${h.useId()}`,S=D?d:u,C=E=>{const R=!D;v||y(R),o?.(R,E)};return n.jsxs("aside",{"aria-label":c,style:{width:`${D?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",p),children:[n.jsx("div",{id:N,hidden:!D,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",f),children:e}),n.jsx("div",{hidden:D,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",D?"justify-end px-2":"justify-center",m),children:[D&&l,n.jsx(P.IconButton,{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,size:T.ElementSize.Standard,onClick:C,"aria-label":S,"aria-expanded":D,"aria-controls":N,tooltipProps:{tooltip:S},icon:D?n.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Kc=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const u=e===b.ResizableContainerSide.Left,p=u?$.IconChevronLeft:$.IconChevronRight,g=f=>{let m;switch(f.key){case"ArrowLeft":m=r+(u?i:-i);break;case"ArrowRight":m=r+(u?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}f.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:I.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??n.jsx(p,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",u?"right-full":"left-full")})})},Wc=16,$n=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=b.ResizableContainerSide.Right,keyboardStep:c=Wc,ariaLabel:d="Resize panel",className:u,resizeHandlerClassName:p,resizeHandler:g})=>{const[f,m]=h.useState(!1),[v,x]=h.useState(a??t),y=s!==void 0,D=y?s:v,N=h.useRef(null),S=h.useCallback(()=>{m(!0)},[]),C=h.useCallback(()=>{m(!1);const A=N.current?.resizable?.getBoundingClientRect(),O=A?Math.round(A.width):t;y||x(O),i?.(O)},[i,y,t]),E=h.useCallback(A=>{const O=Math.min(r,Math.max(t,A));O!==D&&(y||(x(O),N.current?.updateSize({width:O,height:"100%"})),o?.(O),i?.(O))},[r,t,D,y,o,i]),R=h.useMemo(()=>{const A=l===b.ResizableContainerSide.Left,O=n.jsx(Kc,{side:l,isResizing:f,width:D,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:E,customHandler:g,handlerClassName:p});return{size:y?{width:D,height:"100%"}:void 0,defaultSize:y?void 0:{width:D,height:"100%"},minWidth:t,maxWidth:r,enable:{left:A,right:!A},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:A?O:void 0,right:A?void 0:O},onResizeStart:S,onResize:(_,j,k)=>{o?.(Math.round(k.offsetWidth))},onResizeStop:C}},[l,y,D,t,r,c,d,E,g,p,f,S,C,o]);return n.jsx(b.Resizable,{ref:N,...R,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",u),children:e})})},qc=({enabled:e=!0,children:t,...r})=>e?n.jsx($n,{...r,children:t}):t;exports.ConfirmationPopupVariant=b.ConfirmationPopupVariant;exports.DialBreadcrumb=b.DialBreadcrumb;exports.DialBreadcrumbItem=b.DialBreadcrumbItem;exports.DialButton=b.DialButton;exports.DialButtonDropdown=b.DialButtonDropdown;exports.DialCaptionText=b.DialCaptionText;exports.DialCollapsibleSidebar=b.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=b.DialConditionalResizableContainer;exports.DialConfirmationPopup=b.DialConfirmationPopup;exports.DialDangerButton=b.DialDangerButton;exports.DialDestinationFolderPopup=b.DialDestinationFolderPopup;exports.DialErrorText=b.DialErrorText;exports.DialFileIcon=b.DialFileIcon;exports.DialFileManager=b.DialFileManager;exports.DialFileManagerActions=b.DialFileManagerActions;exports.DialFileManagerTabs=b.DialFileManagerTabs;exports.DialFileName=b.DialFileName;exports.DialFileNodeType=b.DialFileNodeType;exports.DialFilePermission=b.DialFilePermission;exports.DialFileResourceType=b.DialFileResourceType;exports.DialFolderName=b.DialFolderName;exports.DialFoldersTree=b.DialFoldersTree;exports.DialFormItem=b.DialFormItem;exports.DialGhostButton=b.DialGhostButton;exports.DialInput=b.DialInput;exports.DialItemType=b.DialItemType;exports.DialLinkButton=b.DialLinkButton;exports.DialLoader=b.DialLoader;exports.DialNeutralButton=b.DialNeutralButton;exports.DialNotification=b.DialNotification;exports.DialPopup=b.DialPopup;exports.DialPrimaryButton=b.DialPrimaryButton;exports.DialRadioGroup=b.DialRadioGroup;exports.DialResizableContainer=b.DialResizableContainer;exports.DialSearch=b.DialSearch;exports.DialSharedEntityIndicator=b.DialSharedEntityIndicator;exports.DialTabs=b.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=b.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=b.FileManagerColumnKey;exports.FileManagerProvider=b.FileManagerProvider;exports.FlexibleActionsDirection=b.FlexibleActionsDirection;exports.FormItemOrientation=b.FormItemOrientation;exports.NAME_COLUMN=b.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=b.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=b.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=b.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=b.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=b.NotificationType;exports.NotificationVariant=b.NotificationVariant;exports.PopupSize=b.PopupSize;exports.RadioGroupOrientation=b.RadioGroupOrientation;exports.ResizableContainerSide=b.ResizableContainerSide;exports.SIZE_COLUMN=b.SIZE_COLUMN;exports.ScreenResolution=b.ScreenResolution;exports.Skeleton=b.Skeleton;exports.SkeletonAvatarShape=b.SkeletonAvatarShape;exports.SkeletonAvatarSize=b.SkeletonAvatarSize;exports.SkeletonVariant=b.SkeletonVariant;exports.Spinner=b.Spinner;exports.TabOrientation=b.TabOrientation;exports.TabView=b.TabView;exports.UPDATED_AT_COLUMN=b.UPDATED_AT_COLUMN;exports.editableContainerProps=b.editableContainerProps;exports.useDialFileManagerTabs=b.useDialFileManagerTabs;exports.useEditableItem=b.useEditableItem;exports.useFileManagerContext=b.useFileManagerContext;exports.DialLabel=Ae.DialLabel;exports.DialSwitch=Ae.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=M.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=M.DEFAULT_LOCALE;exports.DialCloseButton=M.DialCloseButton;exports.DialDangerIconButton=M.DialDangerIconButton;exports.DialDateCellRenderer=M.DialDateCellRenderer;exports.DialDropdown=M.DialDropdown;exports.DialEllipsisTooltip=M.DialEllipsisTooltip;exports.DialGhostIconButton=M.DialGhostIconButton;exports.DialGrid=M.DialGrid;exports.DialIcon=M.DialIcon;exports.DialNeutralIconButton=M.DialNeutralIconButton;exports.DialNoDataContent=M.DialNoDataContent;exports.DialPrimaryIconButton=M.DialPrimaryIconButton;exports.DialRadioButton=M.DialRadioButton;exports.DialSecondaryIconButton=M.DialSecondaryIconButton;exports.DialSuccessIconButton=M.DialSuccessIconButton;exports.DialTertiaryIconButton=M.DialTertiaryIconButton;exports.DropdownItemType=M.DropdownItemType;exports.DropdownTrigger=M.DropdownTrigger;exports.DropdownType=M.DropdownType;exports.GridSelectionMode=M.GridSelectionMode;exports.ThemeScope=M.ThemeScope;exports.baseColumnComparator=M.baseColumnComparator;exports.checkColDefsChanges=M.checkColDefsChanges;exports.convertGridDateToDate=M.convertToDate;exports.convertToDate=M.convertToDate;exports.useThemeScope=M.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=I.mergeClasses;exports.Checkbox=P.Checkbox;exports.CheckboxBox=P.CheckboxBox;exports.CloseButton=P.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=P.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=P.DEFAULT_LOCALE;exports.DangerIconButton=P.DangerIconButton;exports.DateCellRenderer=P.DateCellRenderer;exports.Dropdown=P.Dropdown;exports.EllipsisTooltip=P.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=P.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=P.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=P.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=P.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=P.GRID_THEME_PARAMS;exports.GhostIconButton=P.GhostIconButton;exports.Grid=P.Grid;exports.IconButton=P.IconButton;exports.InfoButton=P.InfoButton;exports.InteractiveTooltip=P.InteractiveTooltip;exports.Label=P.Label;exports.MenuItem=P.MenuItem;exports.MenuItemMark=P.MenuItemMark;exports.NeutralIconButton=P.NeutralIconButton;exports.NoDataContent=P.NoDataContent;exports.PrimaryIconButton=P.PrimaryIconButton;exports.Radio=P.Radio;exports.StaticIconButton=P.StaticIconButton;exports.Tooltip=P.Tooltip;exports.TooltipContainer=P.TooltipContainer;exports.TooltipContent=P.TooltipContent;exports.TooltipPlacement=P.TooltipPlacement;exports.TooltipTrigger=P.TooltipTrigger;exports.ButtonAppearance=T.ButtonAppearance;exports.ButtonVariant=T.ButtonVariant;exports.DialIconButton=T.DialIconButton;exports.DialTooltip=T.DialTooltip;exports.DialTooltipContainer=T.DialTooltipContainer;exports.DialTooltipContent=T.DialTooltipContent;exports.DialTooltipTrigger=T.DialTooltipTrigger;exports.ElementSize=T.ElementSize;exports.EditorThemes=ot.EditorThemes;exports.LazyDialJsonEditor=ot.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ot.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ot.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=sc;exports.AnalyticsCardVariant=st;exports.Button=et;exports.ButtonDropdown=pl;exports.Calendar=al;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Ao;exports.CollapsibleSidebar=Uc;exports.ConditionalResizableContainer=qc;exports.ConfirmationPopup=nc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=ol;exports.DialAccordion=Ur;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=Jn;exports.DialAnalyticsCard=Yn;exports.DialAnalyticsErrorTag=Jt;exports.DialAnalyticsHistogram=ss;exports.DialAutocompleteInputValue=on;exports.DialCheckbox=Gt;exports.DialDraggableItem=bi;exports.DialDropdownIcon=lo;exports.DialFormPopup=Ai;exports.DialInputPopup=ln;exports.DialLabelledText=ms;exports.DialLoadFileArea=xn;exports.DialLoadFileAreaField=oo;exports.DialNumberInput=Zt;exports.DialPagination=ds;exports.DialPasswordInput=cn;exports.DialRadioGroupPopupField=Ti;exports.DialRemoveButton=It;exports.DialSchemaRenderer=Io;exports.DialSegmentedControl=Si;exports.DialSelect=ke;exports.DialSelectField=Vi;exports.DialSlider=hs;exports.DialSteps=gs;exports.DialTag=He;exports.DialTagInput=an;exports.DialTextarea=vi;exports.ErrorMessageNotification=Fo;exports.ErrorText=Le;exports.ErrorToastNotification=_o;exports.FabButton=ul;exports.FileDropzone=_c;exports.FolderPath=il;exports.GeneralMessageNotification=Vo;exports.GeneralToastNotification=Mo;exports.GhostButton=cl;exports.Highlight=Oo;exports.InfoMessageNotification=Bo;exports.InfoToastNotification=Ro;exports.InlineSelect=gl;exports.InlineSelectTrigger=kn;exports.Input=Ge;exports.JsonSchemaType=ee;exports.LinkButton=ll;exports.LoadingMessageNotification=Ho;exports.LoadingToastNotification=Lo;exports.MultiSelectTags=Fn;exports.NeutralButton=fr;exports.Notification=cr;exports.NumberInput=Vl;exports.OutlinedButton=dl;exports.PasswordInput=Bl;exports.Popup=pr;exports.PrimaryButton=Rn;exports.ProgressBar=as;exports.RadioGroup=zn;exports.RadioGroupPopupField=bc;exports.ResizableContainer=$n;exports.SchemaDisplayMode=at;exports.SchemaOrientation=jt;exports.SchemaRendererVariant=qe;exports.Search=zc;exports.SegmentedControl=Ec;exports.Select=Ll;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Vc;exports.StepStatus=ve;exports.SuccessMessageNotification=zo;exports.SuccessToastNotification=ko;exports.Switch=ac;exports.Tabs=Ac;exports.Tag=Ze;exports.TagAppearance=Ye;exports.TagInput=Fc;exports.Textarea=Fl;exports.TextareaResize=Bn;exports.ToggleIconButton=vc;exports.WarningMessageNotification=$o;exports.WarningToastNotification=Po;exports.getTimezoneLabel=bn;exports.matchesAccept=Qt;exports.wrapInRootFolder=ho;
|