@epam/ai-dial-ui-kit 0.3.0-rc.2 → 0.3.0-rc.20
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/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +4475 -1146
- package/dist/index.css +2 -2
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +41 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +13 -0
- package/dist/src/components/Breadcrumb/constants.d.ts +9 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +31 -0
- package/dist/src/components/EllipsisTooltip/constants.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +4 -1
- package/dist/src/components/InputField/InputField.d.ts +1 -1
- package/dist/src/components/InputPopup/InputPopup.d.ts +3 -3
- package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +69 -0
- package/dist/src/components/Select/Select.d.ts +59 -0
- package/dist/src/components/Select/constants.d.ts +8 -0
- package/dist/src/components/Tab/Tab.d.ts +35 -0
- package/dist/src/components/Tabs/Tabs.d.ts +40 -0
- package/dist/src/components/Tag/Tag.d.ts +6 -2
- package/dist/src/hooks/use-is-tablet-screen.d.ts +1 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/models/breadcrumb.d.ts +9 -0
- package/dist/src/models/field-control-props.d.ts +1 -0
- package/dist/src/models/select.d.ts +7 -0
- package/dist/src/models/tab.d.ts +4 -0
- package/dist/src/types/tab.d.ts +4 -0
- package/dist/src/utils/merge-classes.d.ts +3 -0
- package/dist/src/utils/mobile.d.ts +1 -0
- package/package.json +6 -3
- package/dist/src/components/RadioGroupModalField/RadioGroupModal.d.ts +0 -1
package/dist/dial-ui-kit.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("classnames"),w=require("@tabler/icons-react"),h=require("react"),m=require("@floating-ui/react"),we=require("react-dom");function Ne(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const F=Ne(h),H=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),_=({fieldTitle:e,htmlFor:t,optional:r,optionalText:n,cssClass:a})=>e?s.jsxs("label",{className:l("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:t,children:[s.jsx("span",{className:"min-h-4",children:e}),r&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null,S=({icon:e,className:t})=>e?s.jsx("span",{className:l("flex-shrink-0",t),children:e}):null;var E=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e.Danger="danger",e))(E||{});const ke={[E.Primary]:"dial-primary-button",[E.Secondary]:"dial-secondary-button",[E.Tertiary]:"dial-tertiary-button",[E.Danger]:"dial-danger-button"},V=({title:e,variant:t,cssClass:r,textCssClass:n,ref:a,onClick:o,disable:c,iconAfter:u,iconBefore:d,hideTitleOnMobile:i,ariaLabel:x})=>{const p=l("dial-small-semi",u?"mr-2":"",d?"ml-2":"",i?"hidden sm:inline":"inline",n),j=l(t&&ke[t],r,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:a,type:"button",className:j,onClick:g=>o?.(g),disabled:c,"aria-label":e||x,children:[s.jsx(S,{icon:d}),e&&s.jsx("span",{className:p,children:e}),s.jsx(S,{icon:u})]})};var M=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(M||{});const De={info:s.jsx(w.IconInfoCircle,{size:24,stroke:2}),error:s.jsx(w.IconAlertCircle,{size:24,stroke:2}),warning:s.jsx(w.IconAlertTriangle,{size:24,stroke:2}),success:s.jsx(w.IconCircleCheck,{size:24,stroke:2})},Ie={[M.Info]:"bg-info border-info text-info",[M.Success]:"bg-success border-success text-success",[M.Warning]:"bg-warning border-warning text-warning",[M.Error]:"bg-error border-error text-error"},Se="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Re=({variant:e=M.Info,message:t,cssClass:r,closable:n=!1,onClose:a})=>s.jsxs("div",{role:"alert",className:l(Se,Ie[e],r),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(S,{icon:De[e]}),s.jsx("div",{className:"text-primary",children:t})]}),n&&s.jsx(V,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:s.jsx(w.IconX,{size:16}),onClick:o=>a?.(o)})]}),Fe="flex items-center justify-center text-secondary",Ee="shrink-0 grow-0 basis-auto animate-spin-steps",Le=e=>F.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),F.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),re=({size:e=18,cssClass:t,iconClass:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status","aria-label":a,className:l({[Fe]:!0,"w-full h-full":n,[t||""]:!!t}),children:s.jsx(S,{icon:s.jsx(Le,{width:e,height:e,className:l(Ee,r),role:"img"})})}),Te=7,Pe=2,ne=h.createContext(null),ae=()=>{const e=h.useContext(ne);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ae=({initialOpen:e=!1,placement:t="bottom",isTriggerClickable:r=!1,open:n,onOpenChange:a}={})=>{const[o,c]=h.useState(e),u=h.useRef(null),d=n??o,i=a??c,x=m.useFloating({placement:t,open:d,onOpenChange:i,whileElementsMounted:m.autoUpdate,middleware:[m.offset(Te+Pe),m.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),m.shift({padding:5}),m.arrow({element:u})]}),p=m.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),j=m.useFocus(x.context,{enabled:n==null}),g=m.useDismiss(x.context),v=m.useRole(x.context,{role:"tooltip"}),C=m.useInteractions([p,j,g,v]);return h.useMemo(()=>({open:d,setOpen:i,arrowRef:u,...C,...x}),[d,i,C,x])},Me=({children:e,...t})=>{const r=Ae(t);return s.jsx(ne.Provider,{value:r,children:e})},Oe=h.forwardRef(function({style:t,...r},n){const a=ae(),o=m.useMergeRefs([a.refs.setFloating,n]);return a.open?s.jsx(m.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...a.floatingStyles,...t},...a.getFloatingProps(r),className:l("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(r).className),children:[r.children,s.jsx(m.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),Ve=h.forwardRef(function({children:t,asChild:r=!1,...n},a){const o=ae(),u=t&&typeof t=="object"&&"ref"in t&&t.ref!==void 0?t.ref:void 0,d=m.useMergeRefs([o.refs.setReference,a,u]);return r&&h.isValidElement(t)?h.cloneElement(t,o.getReferenceProps({ref:d,...n,...t.props})):s.jsx("span",{ref:d,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:t})}),P=({hideTooltip:e,tooltip:t,children:r,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(Me,{...o,children:[s.jsx(Ve,{className:l(n,"truncate"),children:r}),s.jsx(Oe,{className:l("text-primary",a,"max-w-[300px]",(e||!t)&&"hidden"),children:t})]}),W=18,z={size:W,stroke:2},Be=({label:e,id:t,checked:r,indeterminate:n,disabled:a,ariaLabel:o,onChange:c})=>{const u=h.useCallback(p=>{c?.(p.target.checked,t)},[c,t]),d=l("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${r||n?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":""),i=l("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":""),x=()=>n?s.jsx(w.IconMinus,{className:i,...z}):r?s.jsx(w.IconCheck,{className:i,...z}):null;return s.jsxs("label",{className:d,htmlFor:t,children:[x(),e&&s.jsx(P,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:s.jsx("p",{className:"text-primary w-full truncate",children:e})}),s.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":n?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible w-0 h-0"})]})};var I=(e=>(e.VALID="valid",e.ERROR="error",e))(I||{});const We=(e,t)=>{if(t===e.id)switch(e.status){case I.VALID:return"border-accent-secondary text-primary";case I.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case I.VALID:return"border-primary text-white";case I.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ze=(e,t)=>{if(t===e.id)switch(e.status){case I.VALID:return"bg-accent-secondary";case I.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case I.VALID:return"bg-accent-secondary";case I.ERROR:return"bg-red-400";default:return"bg-layer-4"}},He=({step:e,index:t,currentStep:r,onChangeStep:n})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",c=()=>r===e.id&&e.status===I.ERROR?s.jsx(w.IconExclamationCircle,{stroke:2,size:16}):r!==e.id&&e.status===I.VALID?s.jsx(w.IconCheck,{stroke:2,size:16}):t+1;return s.jsxs("button",{className:l(a,We(e,r)),onClick:()=>n(e.id),children:[s.jsx("span",{className:l(o,ze(e,r)),children:c()}),s.jsx("span",{children:e.name})]})},_e=({steps:e,currentStep:t,onChangeStep:r})=>{const n=a=>{const o=e.findIndex(u=>u.id===t),c=e.findIndex(u=>u.id===a);(a!==t&&e[o].status===I.VALID||c<o)&&r(a)};return s.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>s.jsx(He,{currentStep:t,onChangeStep:n,step:a,index:o},a.id))})},oe=({name:e,value:t,title:r,description:n,checked:a=!1,inputId:o,cssClass:c,labelCssClass:u,disabled:d,onChange:i,descriptionCssClass:x})=>{const p=`${o}-desc`,j=l("dial-small cursor-pointer",d?"text-secondary":"text-primary",u),g=l("cursor-pointer dial-input-radio",r&&"mr-2",c),v=l("flex flex-col",!!n&&"mb-2"),C=l("dial-tiny mt-2 ml-[26px] text-secondary",x),D=k=>{d||k.target.checked&&i?.(t)};return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"radio",id:o,name:e,value:t,checked:a,disabled:d,"aria-describedby":a&&n?p:void 0,className:g,onChange:D}),r?s.jsx("label",{className:j,htmlFor:o,children:r}):null]}),a&&n&&s.jsx("div",{id:p,className:C,children:n})]})};var Q=(e=>(e.Row="Row",e.Column="Column",e))(Q||{});const Ge="flex flex-col gap-2",$e="flex",qe="pb-1 mt-2",Ke={[Q.Column]:"flex-col gap-y-3",[Q.Row]:"flex-row gap-x-6"},Ue=({fieldTitle:e,radioCssClass:t,labelCssClass:r,disabled:n,elementId:a,radioButtons:o,activeRadioButton:c,orientation:u,onChange:d})=>s.jsxs("div",{className:Ge,children:[e&&s.jsx(_,{fieldTitle:e,htmlFor:a}),s.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":n||void 0,className:l($e,Ke[u]),children:o.map(i=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(oe,{name:a,value:i.id,inputId:i.id,disabled:n,cssClass:t,labelCssClass:r,title:i.name,checked:i.id===c,onChange:()=>d(i.id)}),i.id===c&&i.content?s.jsx("div",{className:qe,children:i.content}):null]},i.id))})]}),Xe=({icon:e,title:t,description:r})=>s.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[e||s.jsx(w.IconClipboardX,{width:60,height:60}),s.jsx("span",{className:"small mt-2 text-primary",children:t}),r&&s.jsx("span",{className:"mt-1 text-primary",children:r})]}),Ze=60,Qe=({containerCssClass:e,children:t,width:r,title:n,iconSize:a=W,titleCssClass:o,additionalButtons:c})=>{const[u,d]=h.useState(r),[i,x]=h.useState(!0),p=l(["transform rotate-180 [writing-mode:tb-rl]",i&&"hidden",o]),j=l(["flex flex-row gap-2 cursor-pointer text-secondary",i?"justify-end":"justify-center"]),g=()=>{d(i?Ze:r),x(!i)};return s.jsxs("div",{className:l(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",e]),style:{width:`${u}px`},children:[s.jsx("div",{className:l(["flex-1 min-h-0 overflow-auto",!i&&"hidden"]),children:t}),s.jsx("div",{className:p,children:n}),s.jsxs("div",{className:j,children:[i&&c,s.jsx(V,{cssClass:"hover:text-icon-accent-primary",onClick:g,iconBefore:i?s.jsx(w.IconChevronsLeft,{size:a,stroke:z.stroke}):s.jsx(w.IconChevronsRight,{size:a,stroke:z.stroke})})]})]})},Ye=({label:e,text:t,children:r,postfix:n})=>s.jsxs("div",{className:l("flex flex-col text-secondary",r?"":"max-w-[200px]"),children:[s.jsx("label",{className:"dial-tiny mb-2",children:e}),r||s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx(P,{triggerClassName:"text-primary",tooltip:t,children:t}),n||null]})]});var Y=(e=>(e.Default="default",e))(Y||{});const Je={[Y.Default]:"border-icon-secondary bg-layer-3"},le=({tag:e,cssClass:t,remove:r,variant:n=Y.Default})=>{const a=Je[n],o=l("flex items-center gap-1 tiny border rounded p-1 h-[22px] text-primary",t,a);return s.jsxs("div",{className:o,children:[s.jsx("span",{children:e}),r&&s.jsx(V,{iconAfter:s.jsx(w.IconX,{size:16}),onClick:r})]},e)},J=({ariaLabel:e,cssClass:t,size:r=24,onClose:n})=>s.jsx(V,{ariaLabel:e,cssClass:l("text-secondary hover:text-accent-primary",t),onClick:n,iconBefore:s.jsx(w.IconX,{size:r})}),ie=({value:e,textareaId:t,placeholder:r,cssClass:n="",disabled:a,invalid:o,readonly:c,onChange:u})=>s.jsx(P,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:t,placeholder:r,value:e||"",disabled:a,className:l("dial-textarea dial-input px-3 py-2",o?"dial-input-error":"",a&&"dial-input-disable",c&&"dial-input-readonly",n),onChange:d=>!c&&u?.(d.currentTarget.value)})}),es=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ss=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!es.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(r===void 0||r<0))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(r!==void 0||n!==void 0){const o=e.currentTarget.value,c=e.currentTarget.selectionStart||0,u=o.slice(0,c)+e.key+o.slice(c),d=parseFloat(u);if(!isNaN(d)){if(r!==void 0&&d<r){e.preventDefault();return}if(n!==void 0&&d>n){e.preventDefault();return}}}}},q=({iconBefore:e,iconAfter:t,hideBorder:r,value:n,elementId:a,placeholder:o="",cssClass:c="",containerCssClass:u,tooltipTriggerClassName:d,type:i="text",disabled:x,readonly:p,invalid:j,onChange:g,min:v,max:C,prefix:D,suffix:k,textBeforeInput:y,textAfterInput:b})=>{const N=T=>T.target.blur(),A=i==="number"||v!==void 0||C!==void 0,G=T=>{ss(T,i,v,C)},X=T=>{const R=T.currentTarget.value;if(A&&R!==""){const B=parseFloat(R);if(isNaN(B)&&R!=="-"&&R!=="."||!isNaN(B)&&(v!==void 0&&B<v||C!==void 0&&B>C))return}g?.(R)};return s.jsxs("div",{className:l("dial-input-field flex flex-row items-center justify-between py-2",r?"dial-input-no-border":"dial-input",j&&"dial-input-error",x&&"dial-input-disable",p&&"dial-input-readonly",!y&&"pl-3",!b&&"pr-3",u),children:[y&&s.jsx("div",{children:s.jsx(q,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:y,disabled:!0,elementId:y+"textBefore"})}),D&&s.jsxs("p",{className:"text-secondary dial-small",children:[" ",D]}),s.jsx(S,{icon:e}),s.jsx(P,{tooltip:n,triggerClassName:l(d,"flex-1"),children:s.jsx("input",{type:i,autoComplete:"off",id:a,placeholder:o,value:n??"",disabled:x,className:l("border-0 bg-transparent",c),onChange:T=>!p&&X?.(T),onKeyDown:G,onWheel:N,min:v,max:C})}),s.jsx(S,{icon:t}),k&&s.jsxs("p",{className:"text-secondary dial-small",children:[" ",k]}),b&&s.jsx("div",{children:s.jsx(q,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:b,disabled:!0,elementId:b+"textAfter"})})]})},ts=/^0+\.(\d+)?$/,rs=/^0+/,ce=({fieldTitle:e,errorText:t,optional:r,elementCssClass:n,elementContainerCssClass:a,elementId:o,containerCssClass:c,readonly:u,defaultEmptyText:d,min:i,max:x,...p})=>s.jsxs("div",{className:l("flex flex-col",c),children:[s.jsx(_,{fieldTitle:e,optional:r,htmlFor:o}),u?s.jsx("span",{children:p.value||(d??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(q,{elementId:o,cssClass:n,containerCssClass:a,invalid:t!=null,min:i,max:x,...p}),s.jsx(H,{errorText:t})]})]}),ns=({onChange:e,value:t,min:r,max:n,...a})=>{const o=c=>String(c)?.match(ts)?String(c)?.replace(rs,"0"):Number(c);return s.jsx(ce,{type:"number",onChange:c=>e?.(o(c)),value:t,min:r,max:n,...a})},as=({onChange:e,...t})=>s.jsx(ce,{type:"text",onChange:r=>e?.(r),...t}),os=({fieldTitle:e,optional:t,elementId:r,elementCssClass:n,errorText:a,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(_,{fieldTitle:e,optional:t,htmlFor:r}),s.jsx(ie,{textareaId:r,cssClass:n,...o}),s.jsx(H,{errorText:a})]}),ls=({title:e,switchId:t,isOn:r=!1,disabled:n,onChange:a})=>{const o=l("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",r?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?r?"bg-controls-disable":"bg-layer-4":r?"bg-accent-primary":"bg-layer-4"),c=h.useCallback(u=>{u.stopPropagation(),a?.(!r)},[a,r]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:c,id:t,disabled:n,className:"invisible w-0 h-0",checked:r}),s.jsx("label",{htmlFor:t,className:o,children:s.jsx("span",{className:l("size-3 rounded-full",n?r?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};var O=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(O||{});const is="z-[52] flex items-center justify-center bg-blackout md:p-4",cs="divide-tertiary divide-y",ds="flex flex-row justify-between py-4 px-6 items-center",us={[O.Sm]:"dial-sm-popup",[O.Md]:"dial-md-popup",[O.Lg]:"dial-lg-popup"},de=({open:e=!1,title:t,portalId:r,cssClass:n,overlayClass:a,headingClass:o,dividers:c=!0,children:u,footer:d,onClose:i,size:x=O.Md})=>{const{refs:p,context:j}=m.useFloating({open:e,onOpenChange:y=>{y||i?.(null)}}),g=m.useRole(j,{role:"dialog"}),v=m.useDismiss(j,{outsidePress:!0}),{getFloatingProps:C}=m.useInteractions([g,v]);if(!e)return null;const D=typeof t=="string"?"dial-popup-heading":void 0,k=y=>y?typeof y=="string"?s.jsx("h3",{id:D,className:l("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",o),children:s.jsx(P,{tooltip:y,children:y})}):y:s.jsx("span",{});return s.jsx(m.FloatingPortal,{id:r,children:s.jsx(m.FloatingOverlay,{className:l(is,a),children:s.jsx(m.FloatingFocusManager,{context:j,children:s.jsxs("div",{ref:p.setFloating,...C(),role:"dialog","aria-modal":"true","aria-labelledby":D,className:l("dial-popup",us[x],c&&cs,n),children:[s.jsxs("div",{className:ds,children:[k(t),s.jsx(J,{ariaLabel:"Close dialog",onClose:y=>i?.(y)})]}),s.jsx("div",{className:"flex-grow overflow-auto",children:u}),d]})})})})};var K=(e=>(e.Info="info",e.Danger="danger",e))(K||{});const xs="flex justify-end gap-2 px-6 py-4",ps="text-secondary dial-small-150 px-6 py-4",fs="Cancel",se={[K.Info]:{confirmVariant:E.Primary,cancelVariant:E.Secondary},[K.Danger]:{container:"border-t-4 border-error",confirmVariant:E.Danger,cancelVariant:E.Secondary}},ms=({title:e,description:t,descriptionCssClass:r,open:n=!1,confirmLabel:a,cancelLabel:o=fs,isLoading:c=!1,disableConfirmButton:u=!1,cssClass:d,confirmClassName:i,onClose:x,onConfirm:p,onCancel:j,children:g,dividers:v=!1,variant:C=K.Info,size:D=O.Sm})=>{const k=c?null:s.jsxs("div",{className:xs,children:[s.jsx(V,{variant:E.Secondary,title:o,onClick:()=>j?j():x?.()}),s.jsx(V,{variant:se[C].confirmVariant,cssClass:i,title:a,disable:u,onClick:()=>p()})]}),y=h.useCallback(()=>c?s.jsx("div",{className:"px-6 py-4 h-[120px]",children:s.jsx(re,{size:50})}):g??(t?s.jsx("div",{className:l(ps,r),children:t}):null),[g,t,c,r]);return s.jsx(de,{open:n,title:e,cssClass:l(se[C].container,d),dividers:v,onClose:()=>x?.(),footer:k,size:D,children:y()})},hs=({onClick:e})=>s.jsx(w.IconEyeOff,{...z,className:"text-primary",onClick:e}),gs=({onClick:e})=>s.jsx(w.IconEye,{...z,className:"text-primary",onClick:e}),ue=({...e})=>{const[t,r]=h.useState(!1),n=h.useCallback(a=>{r(a)},[]);return s.jsx(q,{type:t?"text":"password",...e,iconAfter:t?s.jsx(hs,{onClick:()=>n(!1)}):s.jsx(gs,{onClick:()=>n(!0)})})},js=({fieldTitle:e,optional:t,elementCssClass:r,elementId:n,errorText:a,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(_,{fieldTitle:e,optional:t,htmlFor:n}),s.jsx(ue,{cssClass:r,elementId:n,invalid:!!a,...o}),s.jsx(H,{errorText:a})]});var U=(e=>(e.Small="small",e.Base="base",e))(U||{});const bs={[U.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[U.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},Cs=({elementId:e,value:t,placeholder:r,disabled:n,readonly:a,invalid:o,cssClass:c,containerCssClass:u,onChange:d,size:i=U.Base})=>{const[x,p]=h.useState(t||"");h.useEffect(()=>{p(t||"")},[t]);const j=h.useCallback(C=>{p(C),d?.(C)},[d]),g=bs[i],v=h.useCallback(()=>{j("")},[j]);return s.jsxs("div",{className:l("dial-input flex flex-row items-center justify-between",o&&"dial-input-error",n&&"dial-input-disable",a&&"dial-input-readonly",g.containerClass,u),children:[s.jsx(S,{className:l(n?"text-secondary":"text-primary"),icon:s.jsx(w.IconSearch,{size:g.iconSize,stroke:g.iconStroke})}),s.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:r,value:x??"",disabled:n,readOnly:a,className:l("border-0 bg-transparent w-full",c,g.textClass),onChange:C=>!a&&j(C.currentTarget.value)}),x&&!a&&!n&&s.jsx(S,{className:"text-primary cursor-pointer",icon:s.jsx(w.IconX,{size:g.iconSize,stroke:g.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},ee=({selectedItems:e,listCssClass:t,listElementCssClass:r})=>!!e?.length&&s.jsx("ul",{className:l("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map(n=>s.jsx("li",{className:l(["tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",r]),children:s.jsx(P,{tooltip:n,children:s.jsx("button",{"aria-label":"autocomplete-action",type:"button",className:"truncate w-full",children:n})})},n))}),te=e=>F.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.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"})),ys=({children:e,open:t,readonly:r,selectedValue:n,valueCssClasses:a,inputCssClasses:o,onOpen:c,elementId:u,errorText:d,emptyValueText:i})=>{const x=Array.isArray(n)&&n.length>0,p=typeof n=="string"&&!!n.trim(),j=x||p?n:i,g=r?void 0:c,v=()=>s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"w-full",onClick:g,"aria-label":"open-popup",id:u,children:s.jsxs("div",{className:l("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",o,r&&"dial-input-disable",d&&"dial-input-error"),children:[s.jsx(P,{tooltip:String(j),children:s.jsx("span",{className:a,children:j})}),!r&&s.jsx("div",{className:"flex-shrink-0",children:s.jsx(S,{icon:s.jsx(te,{role:"img",width:W,height:W})})})]})}),d&&s.jsx(H,{errorText:d})]}),C=()=>s.jsx("div",{className:"w-full",onClick:g,children:s.jsxs("div",{className:l("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",r&&"dial-input-disable"),children:[s.jsx(ee,{selectedItems:j}),!r&&s.jsx("div",{className:"ml-1",children:s.jsx(S,{icon:s.jsx(te,{role:"img",width:W,height:W})})})]})});return s.jsxs(s.Fragment,{children:[x?C():v(),t&&we.createPortal(e,document.body)]})},vs=({placeholder:e="",selectedItems:t=[],updateSelected:r,listCssClass:n,listElementCssClass:a,containerCssClass:o,inputCssClass:c})=>{const[u,d]=h.useState(""),i=h.useCallback(p=>{p.key==="Enter"&&(r([...t,p.currentTarget.value]),d("")),(p.key==="Backspace"||p.key==="Delete")&&t.length&&!u&&r(t.slice(0,-1))},[t,r,u]),x=h.useCallback(p=>{d(p.target.value)},[d]);return s.jsxs("div",{className:l(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[s.jsx(ee,{selectedItems:t,listCssClass:n,listElementCssClass:a}),s.jsx("input",{type:"text",value:u,className:l(["border-0 bg-transparent p-0",c]),placeholder:t?.length?"":e,onKeyDown:i,onChange:x})]})},ws=({initialTags:e=[],fieldTitle:t,optional:r,elementId:n,placeholder:a,errorText:o,invalid:c,disabled:u,onChange:d})=>{const i=h.useRef(null),[x,p]=h.useState(e),[j,g]=h.useState(""),[v,C]=h.useState(!1),D=b=>{const N=b.trim().replace(/,$/,"");if(N&&!x.includes(N)){const A=[N,...x];p(A),d?.(A)}},k=b=>{(b.key===","||b.key==="Enter")&&(b.preventDefault(),D(j),g(""))},y=b=>{const N=x.filter((A,G)=>G!==b);p(N),d?.(N)};return h.useEffect(()=>{const b=new ResizeObserver(()=>{if(i.current){const N=i.current.scrollHeight>i.current.clientHeight+10;C(N)}});return i.current&&b.observe(i.current),()=>b.disconnect()},[x]),s.jsxs("div",{className:l("flex flex-col w-full"),children:[s.jsx(_,{fieldTitle:t,optional:r,htmlFor:n}),s.jsx("div",{className:l("dial-input min-h-[38px] p-[6px]",c&&"dial-input-error",u&&"dial-input-disable"),children:s.jsxs("div",{ref:i,className:l("flex flex-wrap gap-2 items-center",v?"flex-col-reverse":"flex-row"),children:[x.map((b,N)=>s.jsx(le,{tag:b,remove:u?void 0:()=>y(N)},b+N)),s.jsx("input",{type:"text",value:j,onChange:b=>g(b.target.value),onKeyDown:k,className:l("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:a,disabled:u})]})}),s.jsx(H,{errorText:o})]})};var xe=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(xe||{}),$=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))($||{}),pe=(e=>(e.Item="item",e.Divider="divider",e))(pe||{});const Ns=l("inline-flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),ks=l("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Ds=l("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Is="opacity-75 !cursor-not-allowed",Ss="text-error",Rs="my-1 border-t border-hover",Z=8,Fs=({children:e,menu:t,renderOverlay:r,trigger:n=[$.Click],placement:a,disabled:o=!1,open:c,defaultOpen:u=!1,onOpenChange:d,closable:i=!1,onClose:x,cssClass:p,listClassName:j,outsidePressIgnoreRef:g,outsideClosable:v=!0})=>{const[C,D]=h.useState(u),k=c!==void 0,y=k?!!c:C,b=h.useCallback(f=>{k||D(f),d?.(f)},[k,d]),N=h.useId(),A=f=>f?"clientWidth"in f?f.clientWidth:f.getBoundingClientRect?.()?.width??0:0,G=a===void 0,{refs:X,floatingStyles:T,context:R}=m.useFloating({placement:a,open:y,onOpenChange:b,whileElementsMounted:m.autoUpdate,middleware:[m.offset({mainAxis:Z,crossAxis:0}),G?m.autoPlacement({alignment:"start",crossAxis:!0,padding:Z}):m.flip({padding:Z}),m.shift({padding:Z}),m.size({apply({availableWidth:f,elements:L}){const ve=A(L.reference);L.floating.style.setProperty("--reference-width",`${ve}px`),L.floating.style.maxWidth=`${f}px`}})]}),B=m.useClick(R,{enabled:n.includes($.Click)&&!o}),fe=m.useHover(R,{enabled:n.includes($.Hover)&&!o,move:!1,restMs:40,delay:{open:80,close:80}}),me=m.useDismiss(R,{bubbles:!0,referencePress:!1,outsidePress:f=>{if(!v)return!1;const L=f.target;return!(g?.current&&L instanceof Node&&g.current.contains(L))}}),he=m.useRole(R,{role:"menu"}),{getReferenceProps:ge,getFloatingProps:je}=m.useInteractions([B,fe,me,he]),be=f=>{!n.includes($.ContextMenu)||o||(f.preventDefault(),b(!0))};h.useEffect(()=>{o&&y&&b(!1)},[o,y,b]);const Ce=f=>L=>{f.disabled||(f.onClick?.({key:f.key,domEvent:L}),t?.onClick?.({key:f.key,domEvent:L}),b(!1))},ye=r?r():t&&s.jsx("div",{role:"none",className:"py-1",children:t.items.map(f=>f.type===pe.Divider?s.jsx("div",{role:"separator",className:Rs},f.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!f.disabled,className:l(Ds,f.disabled&&Is,f.danger&&Ss),disabled:f.disabled,onClick:Ce(f),children:[f.icon&&s.jsx("span",{className:l(f.danger&&"text-error",f.disabled&&"text-secondary"),children:s.jsx(S,{icon:f.icon})}),s.jsx("span",{className:l("flex-1 truncate text-left",f.danger&&"text-error",f.disabled&&"text-secondary"),children:f.label})]},f.key))});return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:X.setReference,className:l(Ns,o&&"!cursor-not-allowed opacity-75",p),"aria-haspopup":"menu","aria-expanded":y,"aria-controls":N,onContextMenu:be,...ge(),children:e}),y&&s.jsx(m.FloatingPortal,{children:s.jsx(m.FloatingFocusManager,{context:R,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:N,ref:X.setFloating,style:T,className:l(ks,j),...je(),children:[i&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(J,{ariaLabel:"Close dropdown",onClose:f=>{x?.(f),b(!1)}})}),ye]})})})]})};exports.AlertVariant=M;exports.ButtonVariant=E;exports.ConfirmationPopupVariant=K;exports.DialAlert=Re;exports.DialAutocompleteInput=vs;exports.DialAutocompleteInputValue=ee;exports.DialButton=V;exports.DialCheckbox=Be;exports.DialCloseButton=J;exports.DialCollapsibleSidebar=Qe;exports.DialConfirmationPopup=ms;exports.DialDropdown=Fs;exports.DialErrorText=H;exports.DialFieldLabel=_;exports.DialIcon=S;exports.DialInput=q;exports.DialInputPopup=ys;exports.DialLabelledText=Ye;exports.DialLoader=re;exports.DialNoDataContent=Xe;exports.DialNumberInputField=ns;exports.DialPasswordInput=ue;exports.DialPasswordInputField=js;exports.DialPopup=de;exports.DialRadioButton=oe;exports.DialRadioGroup=Ue;exports.DialSearch=Cs;exports.DialSteps=_e;exports.DialSwitch=ls;exports.DialTag=le;exports.DialTagInput=ws;exports.DialTextAreaField=os;exports.DialTextInputField=as;exports.DialTextarea=ie;exports.DialTooltip=P;exports.DropdownType=xe;exports.PopupSize=O;exports.RadioGroupOrientation=Q;exports.SearchSize=U;exports.StepStatus=I;exports.TagVariant=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("classnames"),E=require("@tabler/icons-react"),f=require("react"),R=require("@floating-ui/react"),Tt=require("react-dom");function At(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const Y=At(f),ge=({errorText:e})=>e&&t.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),me=({fieldTitle:e,htmlFor:r,optional:s,optionalText:n,cssClass:o})=>e?t.jsxs("label",{className:m("dial-tiny text-secondary",o,!o?.includes("mb")&&"mb-2"),htmlFor:r,children:[t.jsx("span",{className:"min-h-4",children:e}),s&&t.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null,B=({icon:e,className:r})=>e?t.jsx("span",{className:m("flex-shrink-0",r),children:e}):null;var X=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e.Danger="danger",e))(X||{});const Pt={[X.Primary]:"dial-primary-button",[X.Secondary]:"dial-secondary-button",[X.Tertiary]:"dial-tertiary-button",[X.Danger]:"dial-danger-button"},ee=({title:e,variant:r,cssClass:s,textCssClass:n,ref:o,onClick:a,disable:l,iconAfter:c,iconBefore:i,hideTitleOnMobile:d,ariaLabel:u})=>{const g=m("dial-small-semi",c?"mr-2":"",i?"ml-2":"",d?"hidden sm:inline":"inline",n),w=m(r&&Pt[r],s,"focus-visible:outline outline-offset-0");return t.jsxs("button",{ref:o,type:"button",className:w,onClick:C=>a?.(C),disabled:l,"aria-label":e||u,children:[t.jsx(B,{icon:i}),e&&t.jsx("span",{className:g,children:e}),t.jsx(B,{icon:c})]})};var de=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(de||{});const Et={info:t.jsx(E.IconInfoCircle,{size:24,stroke:2}),error:t.jsx(E.IconAlertCircle,{size:24,stroke:2}),warning:t.jsx(E.IconAlertTriangle,{size:24,stroke:2}),success:t.jsx(E.IconCircleCheck,{size:24,stroke:2})},Lt={[de.Info]:"bg-info border-info text-info",[de.Success]:"bg-success border-success text-success",[de.Warning]:"bg-warning border-warning text-warning",[de.Error]:"bg-error border-error text-error"},Ft="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Ot=({variant:e=de.Info,message:r,cssClass:s,closable:n=!1,onClose:o})=>t.jsxs("div",{role:"alert",className:m(Ft,Lt[e],s),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(B,{icon:Et[e]}),t.jsx("div",{className:"text-primary",children:r})]}),n&&t.jsx(ee,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:t.jsx(E.IconX,{size:16}),onClick:a=>o?.(a)})]}),Vt="flex items-center justify-center text-secondary",Bt="shrink-0 grow-0 basis-auto animate-spin-steps",Gt=e=>Y.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Y.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Y.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),nt=({size:e=18,cssClass:r,iconClass:s,fullWidth:n=!0,ariaLabel:o="Loading"})=>t.jsx("div",{role:"status","aria-label":o,className:m({[Vt]:!0,"w-full h-full":n,[r||""]:!!r}),children:t.jsx(B,{icon:t.jsx(Gt,{width:e,height:e,className:m(Bt,s),role:"img"})})}),Wt=7,_t=2,ot=f.createContext(null),at=()=>{const e=f.useContext(ot);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},$t=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:s=!1,open:n,onOpenChange:o}={})=>{const[a,l]=f.useState(e),c=f.useRef(null),i=n??a,d=o??l,u=R.useFloating({placement:r,open:i,onOpenChange:d,whileElementsMounted:R.autoUpdate,middleware:[R.offset(Wt+_t),R.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),R.shift({padding:5}),R.arrow({element:c})]}),g=R.useHover(u.context,{move:!1,enabled:n==null,mouseOnly:s,delay:{open:500,close:0}}),w=R.useFocus(u.context,{enabled:n==null}),C=R.useDismiss(u.context),j=R.useRole(u.context,{role:"tooltip"}),y=R.useInteractions([g,w,C,j]);return f.useMemo(()=>({open:i,setOpen:d,arrowRef:c,...y,...u}),[i,d,y,u])},lt=({children:e,...r})=>{const s=$t(r);return t.jsx(ot.Provider,{value:s,children:e})},it=f.forwardRef(function({style:r,...s},n){const o=at(),a=R.useMergeRefs([o.refs.setFloating,n]);return o.open?t.jsx(R.FloatingPortal,{id:"tooltip-portal",children:t.jsxs("div",{ref:a,style:{...o.floatingStyles,...r},...o.getFloatingProps(s),className:m("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",o.getFloatingProps(s).className),children:[s.children,t.jsx(R.FloatingArrow,{ref:o.arrowRef,context:o.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),ct=f.forwardRef(function({children:r,asChild:s=!1,...n},o){const a=at(),c=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,i=R.useMergeRefs([a.refs.setReference,o,c]);return s&&f.isValidElement(r)?f.cloneElement(r,a.getReferenceProps({ref:i,...n,...r.props})):t.jsx("span",{ref:i,...a.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),le=({hideTooltip:e,tooltip:r,children:s,triggerClassName:n,contentClassName:o,...a})=>t.jsxs(lt,{...a,children:[t.jsx(ct,{className:m(n,"truncate"),children:s}),t.jsx(it,{className:m("text-primary",o,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),fe=18,ue={size:fe,stroke:2},Ve=({label:e,id:r,checked:s,indeterminate:n,disabled:o,ariaLabel:a,onChange:l,cssClass:c})=>{const i=f.useCallback(w=>{l?.(w.target.checked,r)},[l,r]),d=m("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${s||n?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,o?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",c),u=m("mr-2 border rounded",o?"bg-layer-4 border-icon-secondary":""),g=()=>n?t.jsx(E.IconMinus,{className:u,...ue}):s?t.jsx(E.IconCheck,{className:u,...ue}):null;return t.jsxs("label",{className:d,htmlFor:r,children:[g(),e&&(typeof e=="string"?t.jsx(le,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:t.jsx("span",{className:"text-primary w-full truncate",children:e})}):e),t.jsx("input",{type:"checkbox",role:"checkbox",name:r,onChange:i,id:r,checked:s,"aria-checked":n?"mixed":s,"aria-disabled":o||void 0,"aria-label":e?void 0:a,className:"invisible w-0 h-0"})]})};var K=(e=>(e.VALID="valid",e.ERROR="error",e))(K||{});const Ht=(e,r)=>{if(r===e.id)switch(e.status){case K.VALID:return"border-accent-secondary text-primary";case K.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case K.VALID:return"border-primary text-white";case K.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Ut=(e,r)=>{if(r===e.id)switch(e.status){case K.VALID:return"bg-accent-secondary";case K.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case K.VALID:return"bg-accent-secondary";case K.ERROR:return"bg-red-400";default:return"bg-layer-4"}},qt=({step:e,index:r,currentStep:s,onChangeStep:n})=>{const o="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",a="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",l=()=>s===e.id&&e.status===K.ERROR?t.jsx(E.IconExclamationCircle,{stroke:2,size:16}):s!==e.id&&e.status===K.VALID?t.jsx(E.IconCheck,{stroke:2,size:16}):r+1;return t.jsxs("button",{className:m(o,Ht(e,s)),onClick:()=>n(e.id),children:[t.jsx("span",{className:m(a,Ut(e,s)),children:l()}),t.jsx("span",{children:e.name})]})},Xt=({steps:e,currentStep:r,onChangeStep:s})=>{const n=o=>{const a=e.findIndex(c=>c.id===r),l=e.findIndex(c=>c.id===o);(o!==r&&e[a].status===K.VALID||l<a)&&s(o)};return t.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((o,a)=>t.jsx(qt,{currentStep:r,onChangeStep:n,step:o,index:a},o.id))})},dt=({name:e,value:r,title:s,description:n,checked:o=!1,inputId:a,cssClass:l,labelCssClass:c,disabled:i,onChange:d,descriptionCssClass:u})=>{const g=`${a}-desc`,w=m("dial-small cursor-pointer",i?"text-secondary":"text-primary",c),C=m("cursor-pointer dial-input-radio",s&&"mr-2",l),j=m("flex flex-col",!!n&&"mb-2"),y=m("dial-tiny mt-2 ml-[26px] text-secondary",u),k=M=>{i||M.target.checked&&d?.(r)};return t.jsxs("div",{className:j,children:[t.jsxs("div",{className:"flex flex-row items-center",children:[t.jsx("input",{type:"radio",id:a,name:e,value:r,checked:o,disabled:i,"aria-describedby":o&&n?g:void 0,className:C,onChange:k}),s?t.jsx("label",{className:w,htmlFor:a,children:s}):null]}),o&&n&&t.jsx("div",{id:g,className:y,children:n})]})};var Ce=(e=>(e.Row="Row",e.Column="Column",e))(Ce||{});const Kt="flex flex-col gap-2",Zt="flex",Qt="pb-1 mt-2",Jt={[Ce.Column]:"flex-col gap-y-3",[Ce.Row]:"flex-row gap-x-6"},ut=({fieldTitle:e,radioCssClass:r,labelCssClass:s,disabled:n,elementId:o,radioButtons:a,activeRadioButton:l,orientation:c,onChange:i})=>t.jsxs("div",{className:Kt,children:[e&&t.jsx(me,{fieldTitle:e,htmlFor:o}),t.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":n||void 0,className:m(Zt,Jt[c]),children:a.map(d=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx(dt,{name:o,value:d.id,inputId:d.id,disabled:n,cssClass:r,labelCssClass:s,title:d.name,checked:d.id===l,onChange:()=>i(d.id)}),d.id===l&&d.content?t.jsx("div",{className:Qt,children:d.content}):null]},d.id))})]}),mt=({icon:e,title:r,description:s})=>t.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[e||t.jsx(E.IconClipboardX,{width:60,height:60}),t.jsx("span",{className:"dial-small mt-2 text-primary",children:r}),s&&t.jsx("span",{className:"mt-1 text-primary",children:s})]}),Yt=60,er=({containerCssClass:e,children:r,width:s,title:n,iconSize:o=fe,titleCssClass:a,additionalButtons:l})=>{const[c,i]=f.useState(s),[d,u]=f.useState(!0),g=m(["transform rotate-180 [writing-mode:tb-rl]",d&&"hidden",a]),w=m(["flex flex-row gap-2 cursor-pointer text-secondary",d?"justify-end":"justify-center"]),C=()=>{i(d?Yt:s),u(!d)};return t.jsxs("div",{className:m(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",e]),style:{width:`${c}px`},children:[t.jsx("div",{className:m(["flex-1 min-h-0 overflow-auto",!d&&"hidden"]),children:r}),t.jsx("div",{className:g,children:n}),t.jsxs("div",{className:w,children:[d&&l,t.jsx(ee,{cssClass:"hover:text-icon-accent-primary",onClick:C,iconBefore:d?t.jsx(E.IconChevronsLeft,{size:o,stroke:ue.stroke}):t.jsx(E.IconChevronsRight,{size:o,stroke:ue.stroke})})]})]})},tr=({label:e,text:r,children:s,postfix:n})=>t.jsxs("div",{className:m("flex flex-col",s?"":"max-w-[200px]"),children:[t.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:e}),s||t.jsxs("div",{className:"flex flex-row items-center",children:[t.jsx(le,{triggerClassName:"text-primary",tooltip:r,children:r}),n||null]})]});var Ae=(e=>(e.Default="default",e))(Ae||{});const rr={[Ae.Default]:"border-icon-secondary bg-layer-3"},sr="text-primary",_e="-",nr=e=>{const r=ar(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const c=l.split(_e);return c[0]===""&&c.length!==1&&c.shift(),pt(c,r)||or(l)},getConflictingClassGroupIds:(l,c)=>{const i=s[l]||[];return c&&n[l]?[...i,...n[l]]:i}}},pt=(e,r)=>{if(e.length===0)return r.classGroupId;const s=e[0],n=r.nextPart.get(s),o=n?pt(e.slice(1),n):void 0;if(o)return o;if(r.validators.length===0)return;const a=e.join(_e);return r.validators.find(({validator:l})=>l(a))?.classGroupId},Ke=/^\[(.+)\]$/,or=e=>{if(Ke.test(e)){const r=Ke.exec(e)[1],s=r?.substring(0,r.indexOf(":"));if(s)return"arbitrary.."+s}},ar=e=>{const{theme:r,classGroups:s}=e,n={nextPart:new Map,validators:[]};for(const o in s)Be(s[o],n,o,r);return n},Be=(e,r,s,n)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?r:Ze(r,o);a.classGroupId=s;return}if(typeof o=="function"){if(lr(o)){Be(o(n),r,s,n);return}r.validators.push({validator:o,classGroupId:s});return}Object.entries(o).forEach(([a,l])=>{Be(l,Ze(r,a),s,n)})})},Ze=(e,r)=>{let s=e;return r.split(_e).forEach(n=>{s.nextPart.has(n)||s.nextPart.set(n,{nextPart:new Map,validators:[]}),s=s.nextPart.get(n)}),s},lr=e=>e.isThemeGetter,ir=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,s=new Map,n=new Map;const o=(a,l)=>{s.set(a,l),r++,r>e&&(r=0,n=s,s=new Map)};return{get(a){let l=s.get(a);if(l!==void 0)return l;if((l=n.get(a))!==void 0)return o(a,l),l},set(a,l){s.has(a)?s.set(a,l):o(a,l)}}},Ge="!",We=":",cr=We.length,dr=e=>{const{prefix:r,experimentalParseClassName:s}=e;let n=o=>{const a=[];let l=0,c=0,i=0,d;for(let j=0;j<o.length;j++){let y=o[j];if(l===0&&c===0){if(y===We){a.push(o.slice(i,j)),i=j+cr;continue}if(y==="/"){d=j;continue}}y==="["?l++:y==="]"?l--:y==="("?c++:y===")"&&c--}const u=a.length===0?o:o.substring(i),g=ur(u),w=g!==u,C=d&&d>i?d-i:void 0;return{modifiers:a,hasImportantModifier:w,baseClassName:g,maybePostfixModifierPosition:C}};if(r){const o=r+We,a=n;n=l=>l.startsWith(o)?a(l.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(s){const o=n;n=a=>s({className:a,parseClassName:o})}return n},ur=e=>e.endsWith(Ge)?e.substring(0,e.length-1):e.startsWith(Ge)?e.substring(1):e,mr=e=>{const r=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const o=[];let a=[];return n.forEach(l=>{l[0]==="["||r[l]?(o.push(...a.sort(),l),a=[]):a.push(l)}),o.push(...a.sort()),o}},pr=e=>({cache:ir(e.cacheSize),parseClassName:dr(e),sortModifiers:mr(e),...nr(e)}),fr=/\s+/,xr=(e,r)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=r,l=[],c=e.trim().split(fr);let i="";for(let d=c.length-1;d>=0;d-=1){const u=c[d],{isExternal:g,modifiers:w,hasImportantModifier:C,baseClassName:j,maybePostfixModifierPosition:y}=s(u);if(g){i=u+(i.length>0?" "+i:i);continue}let k=!!y,M=n(k?j.substring(0,y):j);if(!M){if(!k){i=u+(i.length>0?" "+i:i);continue}if(M=n(j),!M){i=u+(i.length>0?" "+i:i);continue}k=!1}const z=a(w).join(":"),D=C?z+Ge:z,I=D+M;if(l.includes(I))continue;l.push(I);const L=o(M,k);for(let _=0;_<L.length;++_){const $=L[_];l.push(D+$)}i=u+(i.length>0?" "+i:i)}return i};function hr(){let e=0,r,s,n="";for(;e<arguments.length;)(r=arguments[e++])&&(s=ft(r))&&(n&&(n+=" "),n+=s);return n}const ft=e=>{if(typeof e=="string")return e;let r,s="";for(let n=0;n<e.length;n++)e[n]&&(r=ft(e[n]))&&(s&&(s+=" "),s+=r);return s};function gr(e,...r){let s,n,o,a=l;function l(i){const d=r.reduce((u,g)=>g(u),e());return s=pr(d),n=s.cache.get,o=s.cache.set,a=c,c(i)}function c(i){const d=n(i);if(d)return d;const u=xr(i,s);return o(i,u),u}return function(){return a(hr.apply(null,arguments))}}const V=e=>{const r=s=>s[e]||[];return r.isThemeGetter=!0,r},xt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ht=/^\((?:(\w[\w-]*):)?(.+)\)$/i,br=/^\d+\/\d+$/,yr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pe=e=>br.test(e),S=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),Le=e=>e.endsWith("%")&&S(e.slice(0,-1)),re=e=>yr.test(e),jr=()=>!0,Nr=e=>wr.test(e)&&!vr.test(e),gt=()=>!1,Sr=e=>Cr.test(e),Dr=e=>kr.test(e),Ir=e=>!x(e)&&!h(e),Rr=e=>be(e,wt,gt),x=e=>xt.test(e),ce=e=>be(e,vt,Nr),Fe=e=>be(e,Pr,S),Qe=e=>be(e,bt,gt),zr=e=>be(e,yt,Dr),Re=e=>be(e,Ct,Sr),h=e=>ht.test(e),we=e=>ye(e,vt),Mr=e=>ye(e,Er),Je=e=>ye(e,bt),Tr=e=>ye(e,wt),Ar=e=>ye(e,yt),ze=e=>ye(e,Ct,!0),be=(e,r,s)=>{const n=xt.exec(e);return n?n[1]?r(n[1]):s(n[2]):!1},ye=(e,r,s=!1)=>{const n=ht.exec(e);return n?n[1]?r(n[1]):s:!1},bt=e=>e==="position"||e==="percentage",yt=e=>e==="image"||e==="url",wt=e=>e==="length"||e==="size"||e==="bg-size",vt=e=>e==="length",Pr=e=>e==="number",Er=e=>e==="family-name",Ct=e=>e==="shadow",Lr=()=>{const e=V("color"),r=V("font"),s=V("text"),n=V("font-weight"),o=V("tracking"),a=V("leading"),l=V("breakpoint"),c=V("container"),i=V("spacing"),d=V("radius"),u=V("shadow"),g=V("inset-shadow"),w=V("text-shadow"),C=V("drop-shadow"),j=V("blur"),y=V("perspective"),k=V("aspect"),M=V("ease"),z=V("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...I(),h,x],_=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[h,x,i],T=()=>[pe,"full","auto",...b()],O=()=>[oe,"none","subgrid",h,x],G=()=>["auto",{span:["full",oe,h,x]},oe,h,x],U=()=>[oe,"auto",h,x],ie=()=>["auto","min","max","fr",h,x],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...b()],Q=()=>[pe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],v=()=>[e,h,x],ne=()=>[...I(),Je,Qe,{position:[h,x]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",Tr,Rr,{size:[h,x]}],te=()=>[Le,we,ce],F=()=>["","none","full",d,h,x],p=()=>["",S,we,ce],P=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[S,Le,Je,Qe],Xe=()=>["","none",j,h,x],Se=()=>["none",S,h,x],De=()=>["none",S,h,x],Ee=()=>[S,h,x],Ie=()=>[pe,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[re],breakpoint:[re],color:[jr],container:[re],"drop-shadow":[re],ease:["in","out","in-out"],font:[Ir],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[re],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[re],shadow:[re],spacing:["px",S],text:[re],"text-shadow":[re],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pe,x,h,k]}],container:["container"],columns:[{columns:[S,x,h,c]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",h,x]}],basis:[{basis:[pe,"full","auto",c,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[S,pe,"auto","initial","none",x]}],grow:[{grow:["",S,h,x]}],shrink:[{shrink:["",S,h,x]}],order:[{order:[oe,"first","last","none",h,x]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",s,we,ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,h,Fe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Le,x]}],"font-family":[{font:[Mr,x,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,h,x]}],"line-clamp":[{"line-clamp":[S,"none",h,Fe]}],leading:[{leading:[a,...b()]}],"list-image":[{"list-image":["none",h,x]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:[S,"from-font","auto",h,ce]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[S,"auto",h,x]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,x]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,x]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,h,x],radial:["",h,x],conic:[oe,h,x]},Ar,zr]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:p()}],"border-w-x":[{"border-x":p()}],"border-w-y":[{"border-y":p()}],"border-w-s":[{"border-s":p()}],"border-w-e":[{"border-e":p()}],"border-w-t":[{"border-t":p()}],"border-w-r":[{"border-r":p()}],"border-w-b":[{"border-b":p()}],"border-w-l":[{"border-l":p()}],"divide-x":[{"divide-x":p()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":p()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...P(),"hidden","none"]}],"divide-style":[{divide:[...P(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...P(),"none","hidden"]}],"outline-offset":[{"outline-offset":[S,h,x]}],"outline-w":[{outline:["",S,we,ce]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",u,ze,Re]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",g,ze,Re]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:p()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[S,ce]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":p()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",w,ze,Re]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[S,h,x]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[S]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[h,x]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[S]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,x]}],filter:[{filter:["","none",h,x]}],blur:[{blur:Xe()}],brightness:[{brightness:[S,h,x]}],contrast:[{contrast:[S,h,x]}],"drop-shadow":[{"drop-shadow":["","none",C,ze,Re]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",S,h,x]}],"hue-rotate":[{"hue-rotate":[S,h,x]}],invert:[{invert:["",S,h,x]}],saturate:[{saturate:[S,h,x]}],sepia:[{sepia:["",S,h,x]}],"backdrop-filter":[{"backdrop-filter":["","none",h,x]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[S,h,x]}],"backdrop-contrast":[{"backdrop-contrast":[S,h,x]}],"backdrop-grayscale":[{"backdrop-grayscale":["",S,h,x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S,h,x]}],"backdrop-invert":[{"backdrop-invert":["",S,h,x]}],"backdrop-opacity":[{"backdrop-opacity":[S,h,x]}],"backdrop-saturate":[{"backdrop-saturate":[S,h,x]}],"backdrop-sepia":[{"backdrop-sepia":["",S,h,x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,x]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[S,"initial",h,x]}],ease:[{ease:["linear","initial",M,h,x]}],delay:[{delay:[S,h,x]}],animate:[{animate:["none",z,h,x]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,h,x]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[h,x,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,x]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,x]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[S,we,ce,Fe]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fr=gr(Lr);function se(...e){return Fr(m(e))}const he=({text:e,cssClass:r,contentClassName:s,hideTooltip:n,...o})=>{const a=f.useRef(null),[l,c]=f.useState(!1),[i,d]=f.useState(""),u=f.useRef(null),g=()=>{const y=a.current;if(!y)return;d(y.textContent??"");const k=y.clientWidth,M=y.scrollWidth,z=Math.ceil(y.getBoundingClientRect().width);c(M>k||M>z)},w=f.useCallback(()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(g)},[]);f.useEffect(()=>{w();const y=()=>w();window.addEventListener("resize",y);let k=null;return"ResizeObserver"in window&&a.current&&(k=new ResizeObserver(()=>w()),k.observe(a.current)),()=>{window.removeEventListener("resize",y),k&&k.disconnect(),u.current&&cancelAnimationFrame(u.current)}},[e,w]);const C=f.useMemo(()=>typeof e=="string"?e:i,[i,e]),j=f.useMemo(()=>n?"":l?C:"",[C,n,l]);return t.jsxs(lt,{...o,children:[t.jsx(ct,{asChild:!0,ref:a,onMouseEnter:w,onFocusCapture:w,children:t.jsx("span",{className:se("block truncate min-w-0 max-w-full",r),"aria-label":l?C:void 0,onMouseEnter:w,onFocus:w,children:e})}),t.jsx(it,{className:se(sr,s,!j&&"hidden"),children:j})]})},Pe=({tag:e,cssClass:r,remove:s,variant:n=Ae.Default,iconBefore:o,bordered:a=!0})=>{const l=rr[n],c=se("flex items-center gap-1 dial-tiny rounded p-1 h-[22px] text-primary",l,a?"border":"border-transparent",r);return t.jsxs("div",{className:c,children:[t.jsx(B,{icon:o}),t.jsx(he,{text:e}),s&&t.jsx(ee,{iconAfter:t.jsx(E.IconX,{size:16}),onClick:i=>s(i)})]},e)};var Te=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Te||{});const Ye=()=>typeof window<"u"&&window.innerWidth<1024,Or=()=>{const[e,r]=f.useState(Ye());return f.useEffect(()=>{const s=()=>r(Ye());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e};var kt=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(kt||{}),xe=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(xe||{}),jt=(e=>(e.Item="item",e.Divider="divider",e))(jt||{});const Vr=m("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Br=m("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Gr=m("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Wr="opacity-75 !cursor-not-allowed",_r="text-error",$r="my-1 border-t border-hover",ve=8,$e=({ariaLabel:e,cssClass:r,size:s=24,onClose:n})=>t.jsx(ee,{ariaLabel:e,cssClass:m("text-secondary hover:text-accent-primary",r),onClick:n,iconBefore:t.jsx(E.IconX,{size:s})}),He=({children:e,menu:r,renderOverlay:s,trigger:n=[xe.Click],placement:o,disabled:a=!1,open:l,defaultOpen:c=!1,onOpenChange:i,closable:d=!1,onClose:u,cssClass:g,listClassName:w,outsidePressIgnoreRef:C,outsideClosable:j=!0,allowedPlacements:y})=>{const[k,M]=f.useState(c),z=l!==void 0,D=z?!!l:k,I=f.useCallback(N=>{z||M(N),i?.(N)},[z,i]),L=f.useId(),_=N=>N?"clientWidth"in N?N.clientWidth:N.getBoundingClientRect?.()?.width??0:0,$=o===void 0,{refs:b,floatingStyles:T,context:O}=R.useFloating({placement:o,open:D,onOpenChange:I,whileElementsMounted:R.autoUpdate,middleware:[R.offset({mainAxis:ve,crossAxis:0}),$?R.autoPlacement({alignment:"start",crossAxis:!0,padding:ve,allowedPlacements:y}):R.flip({padding:ve}),R.shift({padding:ve}),R.size({padding:ve,apply({availableWidth:N,availableHeight:W,elements:te}){const F=te.floating,p=_(te.reference);F.style.setProperty("--reference-width",`${Math.round(p)}px`),F.style.setProperty("--fui-available-height",`${Math.floor(W)}px`),F.style.minWidth=`${Math.round(p)}px`,F.style.maxWidth=`${Math.floor(N)}px`,F.style.maxHeight=`${Math.floor(W)}px`}})]}),G=R.useClick(O,{enabled:n.includes(xe.Click)&&!a}),U=R.useHover(O,{enabled:n.includes(xe.Hover)&&!a,move:!1,restMs:40,delay:{open:80,close:80}}),ie=R.useDismiss(O,{bubbles:!0,referencePress:!1,outsidePress:N=>{if(!j)return!1;const W=N.target;return!(C?.current&&W instanceof Node&&C.current.contains(W))}}),q=R.useRole(O,{role:"menu"}),{getReferenceProps:Z,getFloatingProps:H}=R.useInteractions([G,U,ie,q]),Q=N=>{!n.includes(xe.ContextMenu)||a||(N.preventDefault(),I(!0))};f.useEffect(()=>{a&&D&&I(!1)},[a,D,I]);const v=N=>W=>{N.disabled||(N.onClick?.({key:N.key,domEvent:W}),r?.onClick?.({key:N.key,domEvent:W}),I(!1))},ne=s?s():r&&t.jsx("div",{role:"none",className:"py-1",children:r.items.map(N=>N.type===jt.Divider?t.jsx("div",{role:"separator",className:$r},N.key):t.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!N.disabled,className:m(Gr,N.disabled&&Wr,N.danger&&_r),disabled:N.disabled,onClick:v(N),children:[N.icon&&t.jsx("span",{className:m(N.danger&&"text-error",N.disabled&&"text-secondary"),children:t.jsx(B,{icon:N.icon})}),t.jsx("span",{className:m("flex-1 truncate text-left",N.danger&&"text-error",N.disabled&&"text-secondary"),children:N.label})]},N.key))});return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:b.setReference,className:m(Vr,a&&"!cursor-not-allowed opacity-75",g),"aria-haspopup":"menu","aria-expanded":D,"aria-controls":L,onContextMenu:Q,...Z(),children:e}),D&&t.jsx(R.FloatingPortal,{children:t.jsx(R.FloatingFocusManager,{context:O,modal:!1,initialFocus:-1,returnFocus:!0,children:t.jsxs("div",{id:L,ref:b.setFloating,style:T,className:m(Br,w),...H(),children:[d&&t.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:t.jsx($e,{ariaLabel:"Close dropdown",onClose:N=>{u?.(N),I(!1)}})}),ne]})})})]})},Me=({tab:e,active:r,disabled:s,invalid:n,cssClass:o,horizontal:a,onClick:l})=>{const i=se("rounded px-3 py-2 flex flex-row gap-2 h-[32px] cursor-pointer dial-small leading-4 hover:text-accent-primary",{"bg-layer-4":a,"bg-layer-1 text-secondary pointer-events-none":s,"bg-accent-primary-alpha text-primary":r&&!s,"text-primary":!r&&!s,"border-b-2 border-b-accent-primary":r&&a&&!s,"border-l-2 border-l-accent-primary":r&&!a&&!s},o);return t.jsxs("button",{role:"tab",className:i,onClick:()=>l(e.id),disabled:s,children:[t.jsx(he,{text:e.name,contentClassName:"max-w-[200px]",cssClass:"max-w-[200px]"}),n&&t.jsx("div",{className:"text-error",children:t.jsx(E.IconExclamationCircle,{...ue})})]})},Hr=({tabs:e,activeTab:r,onClick:s,jsonEditorEnabled:n,orientation:o=Te.Horizontal})=>{const[a,l]=f.useState(!1),c=Or(),i=o===Te.Horizontal,d=m("flex gap-3 flex-wrap",i?"flex-row":"flex-col",n?"hidden":""),u=m("h-11 flex items-center bg-layer-3",n?"hidden":""),[g,w]=f.useState(m(d,"hidden")),[C,j]=f.useState(m(u,"hidden"));f.useEffect(()=>{w(m(d,c||n?"hidden":"")),j(m(u,!c||n?"hidden":""))},[c,n,d,u]);const y=e.find(k=>k.id===r);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:g,children:e.map(k=>t.jsx(Me,{tab:k,active:r===k.id,onClick:s,horizontal:i},k.id))}),t.jsx("div",{className:C,children:t.jsx("div",{className:"h-full px-4",children:t.jsx(He,{trigger:[xe.Click],open:a,onOpenChange:l,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(k=>t.jsx(Me,{tab:k,active:k.id===r,onClick:M=>{s(M),l(!1)},cssClass:"w-full rounded-none h-11 items-center px-6"},k.id)),children:t.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[t.jsx(Me,{tab:y,active:!0,onClick:s,cssClass:"rounded-none bg-transparent border-l-0 border-b-[2px] border-accent-primary h-full items-center px-0"},r),t.jsx(B,{icon:t.jsx(E.IconChevronDown,{size:16}),className:m("text-primary",a&&"rotate-180")})]})})})})]})},Ur="w-full overflow-x-auto",qr="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",Xr="flex items-center gap-2 min-w-0 shrink-0 dial-small",et="inline-flex items-center gap-1 min-w-0 transition-colors",Kr="text-secondary hover:text-accent-primary",Zr="text-primary cursor-default",Qr="flex-none inline-flex items-center leading-none text-icon-secondary",Nt=t.jsx(E.IconChevronRight,{size:16,"aria-hidden":"true"}),St=({title:e,href:r,onClick:s,disabled:n,isLast:o,separator:a=Nt,cssClass:l,iconBefore:c,titleCssClass:i})=>{const d=se(Xr,l),u=!!r&&!o&&!n,g=typeof e=="string"?t.jsx(he,{text:e}):e;return t.jsxs("li",{className:d,children:[u?t.jsxs("a",{className:se(et,Kr,i),href:r,onClick:s,children:[c,g]}):t.jsxs("span",{className:se(et,Zr,n&&"pointer-events-none opacity-75",i),"aria-current":o?"page":void 0,"aria-disabled":n?"true":void 0,children:[c,g]}),!o&&t.jsx("span",{className:Qr,children:a})]})},Jr=({pathItems:e,separator:r=Nt,ariaLabel:s="Breadcrumb",cssClass:n,children:o,titleCssClass:a})=>{const l=e?.length?e.map((c,i)=>t.jsx(St,{...c,isLast:i===e.length-1,separator:r,titleCssClass:a},`item-${i}`)):f.Children.toArray(o).map((c,i,d)=>{if(!f.isValidElement(c))return c;const u=i===d.length-1;return f.cloneElement(c,{isLast:u,separator:r})});return t.jsx("nav",{"aria-label":s,className:se(Ur,n),children:t.jsx("ol",{className:qr,children:l})})},Dt=({value:e,textareaId:r,placeholder:s,cssClass:n="",disabled:o,invalid:a,readonly:l,onChange:c})=>t.jsx(le,{tooltip:e,triggerClassName:"flex",children:t.jsx("textarea",{id:r,placeholder:s,value:e||"",disabled:o,className:m("dial-textarea dial-input px-3 py-2",a?"dial-input-error":"",o&&"dial-input-disable",l&&"dial-input-readonly",n),onChange:i=>!l&&c?.(i.currentTarget.value)})}),Yr=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],es=(e,r,s,n)=>{if((r==="number"||s!==void 0||n!==void 0)&&!Yr.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(s===void 0||s<0))&&!(e.key==="."&&r==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||n!==void 0){const a=e.currentTarget.value,l=e.currentTarget.selectionStart||0,c=a.slice(0,l)+e.key+a.slice(l),i=parseFloat(c);if(!isNaN(i)){if(s!==void 0&&i<s){e.preventDefault();return}if(n!==void 0&&i>n){e.preventDefault();return}}}}},ke=({iconBefore:e,iconAfter:r,hideBorder:s,value:n,elementId:o,placeholder:a="",cssClass:l="",containerCssClass:c,tooltipTriggerClassName:i,type:d="text",disabled:u,readonly:g,invalid:w,onChange:C,min:j,max:y,prefix:k,suffix:M,textBeforeInput:z,textAfterInput:D,onBlur:I,defaultValue:L})=>{const _=O=>O.target.blur(),$=d==="number"||j!==void 0||y!==void 0,b=O=>{es(O,d,j,y)},T=O=>{const G=O.currentTarget.value;if($&&G!==""){const U=parseFloat(G);if(isNaN(U)&&G!=="-"&&G!=="."||!isNaN(U)&&(j!==void 0&&U<j||y!==void 0&&U>y))return}C?.(G)};return t.jsxs("div",{className:m("dial-input-field flex flex-row items-center justify-between py-2",s?"dial-input-no-border":"dial-input",w&&"dial-input-error",u&&"dial-input-disable",g&&"dial-input-readonly",!z&&"pl-3",!D&&"pr-3",c),children:[z&&t.jsx("div",{className:"mr-2",children:t.jsx(ke,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:z,disabled:!0,elementId:z+"textBefore"})}),k&&t.jsxs("p",{className:"text-secondary dial-small mr-2",children:[" ",k]}),t.jsx(B,{icon:e}),t.jsx(le,{tooltip:n,triggerClassName:m(i,"flex-1"),children:t.jsx("input",{type:d,autoComplete:"off",id:o,placeholder:a,value:L?void 0:n??"",disabled:u,className:m("border-0 bg-transparent w-full",l),onChange:O=>!g&&T?.(O),onKeyDown:b,onWheel:_,onBlur:I,min:j,max:y,defaultValue:L})}),t.jsx(B,{icon:r}),M&&t.jsxs("p",{className:"text-secondary dial-small ml-2",children:[" ",M]}),D&&t.jsx("div",{className:"ml-2",children:t.jsx(ke,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:D,disabled:!0,elementId:D+"textAfter"})})]})},ts=/^0+\.(\d+)?$/,rs=/^0+/,It=({fieldTitle:e,errorText:r,optional:s,elementCssClass:n,elementContainerCssClass:o,elementId:a,containerCssClass:l,readonly:c,defaultEmptyText:i,min:d,max:u,...g})=>t.jsxs("div",{className:m("flex flex-col",l),children:[t.jsx(me,{fieldTitle:e,optional:s,htmlFor:a}),c?t.jsx("span",{children:g.value||(i??"None")}):t.jsxs(t.Fragment,{children:[t.jsx(ke,{elementId:a,cssClass:n,containerCssClass:o,invalid:r!=null,min:d,max:u,...g}),t.jsx(ge,{errorText:r})]})]}),ss=({onChange:e,value:r,min:s,max:n,...o})=>{const a=l=>String(l)?.match(ts)?String(l)?.replace(rs,"0"):Number(l);return t.jsx(It,{type:"number",onChange:l=>e?.(a(l)),value:r,min:s,max:n,...o})},ns=({onChange:e,...r})=>t.jsx(It,{type:"text",onChange:s=>e?.(s),...r}),os=({fieldTitle:e,optional:r,elementId:s,elementCssClass:n,errorText:o,...a})=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx(me,{fieldTitle:e,optional:r,htmlFor:s}),t.jsx(Dt,{textareaId:s,cssClass:n,...a}),t.jsx(ge,{errorText:o})]}),as=({title:e,switchId:r,isOn:s=!1,disabled:n,onChange:o})=>{const a=m("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),l=f.useCallback(c=>{c.stopPropagation(),o?.(!s)},[o,s]);return t.jsxs("div",{className:"flex flex-row items-center",children:[t.jsx("input",{type:"checkbox",onChange:l,id:r,disabled:n,className:"invisible w-0 h-0",checked:s}),t.jsx("label",{htmlFor:r,className:a,children:t.jsx("span",{className:m("size-3 rounded-full",n?s?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&t.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};var ae=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(ae||{});const ls="z-[52] flex items-center justify-center bg-blackout md:p-4",is="divide-tertiary divide-y",cs="flex flex-row justify-between py-4 px-6 items-center",ds={[ae.Sm]:"dial-sm-popup",[ae.Md]:"dial-md-popup",[ae.Lg]:"dial-lg-popup"},Ue=({open:e=!1,title:r,portalId:s,cssClass:n,overlayClass:o,headingClass:a,dividers:l=!0,children:c,footer:i,onClose:d,size:u=ae.Md})=>{const{refs:g,context:w}=R.useFloating({open:e,onOpenChange:z=>{z||d?.(null)}}),C=R.useRole(w,{role:"dialog"}),j=R.useDismiss(w,{outsidePress:!0}),{getFloatingProps:y}=R.useInteractions([C,j]);if(!e)return null;const k=typeof r=="string"?"dial-popup-heading":void 0,M=z=>z?typeof z=="string"?t.jsx("h3",{id:k,className:m("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",a),children:t.jsx(le,{tooltip:z,children:z})}):z:t.jsx("span",{});return t.jsx(R.FloatingPortal,{id:s,children:t.jsx(R.FloatingOverlay,{className:m(ls,o),children:t.jsx(R.FloatingFocusManager,{context:w,children:t.jsxs("div",{ref:g.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":k,className:m("dial-popup",ds[u],l&&is,n),children:[t.jsxs("div",{className:cs,children:[M(r),t.jsx($e,{ariaLabel:"Close dialog",onClose:z=>d?.(z)})]}),t.jsx("div",{className:"flex-grow overflow-auto",children:c}),i]})})})})};var je=(e=>(e.Info="info",e.Danger="danger",e))(je||{});const us="flex justify-end gap-2 px-6 py-4",ms="text-secondary dial-small-150 px-6 py-4",ps="Cancel",tt={[je.Info]:{confirmVariant:X.Primary,cancelVariant:X.Secondary},[je.Danger]:{container:"dial-danger-popup",confirmVariant:X.Danger,cancelVariant:X.Secondary}},fs=({title:e,description:r,descriptionCssClass:s,open:n=!1,confirmLabel:o,cancelLabel:a=ps,isLoading:l=!1,disableConfirmButton:c=!1,cssClass:i,confirmClassName:d,onClose:u,onConfirm:g,onCancel:w,children:C,dividers:j=!1,variant:y=je.Info,size:k=ae.Sm})=>{const M=l?null:t.jsxs("div",{className:us,children:[t.jsx(ee,{variant:X.Secondary,title:a,onClick:()=>w?w():u?.()}),t.jsx(ee,{variant:tt[y].confirmVariant,cssClass:d,title:o,disable:c,onClick:()=>g()})]}),z=f.useCallback(()=>l?t.jsx("div",{className:"px-6 py-4 h-[120px]",children:t.jsx(nt,{size:50})}):C??(r?t.jsx("div",{className:m(ms,s),children:r}):null),[C,r,l,s]);return t.jsx(Ue,{open:n,title:e,cssClass:m(tt[y].container,i),dividers:j,onClose:()=>u?.(),footer:M,size:k,children:z()})},qe=({selectedItems:e,listCssClass:r,listElementCssClass:s})=>!!e?.length&&t.jsx("ul",{className:m("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",r),children:e?.map(n=>t.jsx("li",{children:t.jsx(le,{tooltip:n,children:t.jsx(Pe,{tag:n,cssClass:m([s])})})},n))}),rt=e=>Y.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Y.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"})),Rt=({children:e,open:r,disabled:s=!1,selectedValue:n,valueCssClasses:o,inputCssClasses:a,onOpen:l,elementId:c,errorText:i,emptyValueText:d})=>{const u=Array.isArray(n)&&n.length>0,g=typeof n=="string"&&!!n.trim(),w=u||g?n:d,C=s?void 0:l,j=()=>t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"w-full",onClick:C,"aria-label":"open-popup",id:c,children:t.jsxs("div",{className:m("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",a,s&&"dial-input-disable",i&&"dial-input-error"),children:[t.jsx(le,{tooltip:String(w),children:t.jsx("span",{className:o,children:w})}),!s&&t.jsx("div",{className:"flex-shrink-0",children:t.jsx(B,{icon:t.jsx(rt,{role:"img",width:fe,height:fe})})})]})}),i&&t.jsx(ge,{errorText:i})]}),y=()=>t.jsx("div",{className:"w-full",onClick:C,children:t.jsxs("div",{className:m("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",s&&"dial-input-disable"),children:[t.jsx(qe,{selectedItems:w}),!s&&t.jsx("div",{className:"ml-1",children:t.jsx(B,{icon:t.jsx(rt,{role:"img",width:fe,height:fe})})})]})});return t.jsxs(t.Fragment,{children:[u?y():j(),r&&Tt.createPortal(e,document.body)]})},xs=({fieldTitle:e,htmlFor:r,disabled:s,selectedValue:n,radioButtons:o,customInputValue:a,valueCssClasses:l,inputCssClasses:c,emptyValueText:i,onClose:d,title:u,portalId:g,onApply:w,cancelButtonTitle:C="Cancel",applyButtonTitle:j="Apply",isValid:y,selectedRadioValue:k,onChangeRadioField:M,id:z,size:D=ae.Md})=>{const[I,L]=f.useState(!1),_=f.useCallback(()=>{s||L(!0)},[s]),$=f.useCallback(()=>{L(!1),d?.()},[d]),b=f.useCallback(()=>{w(),$()},[w,$]);return t.jsxs("div",{className:"flex flex-col",children:[t.jsx(me,{fieldTitle:e,htmlFor:r}),t.jsx(Rt,{disabled:s,open:I,selectedValue:a??o.find(T=>T.id===n)?.name,valueCssClasses:l,inputCssClasses:m(c,"py-2","px-3"),emptyValueText:i,onOpen:_,children:t.jsx(Ue,{open:I,onClose:$,title:u,portalId:g,size:D,footer:t.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[t.jsx(ee,{variant:X.Secondary,title:C,onClick:$}),t.jsx(ee,{variant:X.Primary,title:j,onClick:b,disable:!y})]}),children:t.jsx("div",{className:"px-6 py-4",children:t.jsx(ut,{radioButtons:o,labelCssClass:"dial-small",activeRadioButton:k,onChange:M,elementId:z,orientation:Ce.Column})})})})]})},hs=({onClick:e})=>t.jsx(E.IconEyeOff,{...ue,className:"text-primary",onClick:e}),gs=({onClick:e})=>t.jsx(E.IconEye,{...ue,className:"text-primary",onClick:e}),zt=({...e})=>{const[r,s]=f.useState(!1),n=f.useCallback(o=>{s(o)},[]);return t.jsx(ke,{type:r?"text":"password",...e,iconAfter:r?t.jsx(hs,{onClick:()=>n(!1)}):t.jsx(gs,{onClick:()=>n(!0)})})},bs=({fieldTitle:e,optional:r,elementCssClass:s,elementId:n,errorText:o,...a})=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx(me,{fieldTitle:e,optional:r,htmlFor:n}),t.jsx(zt,{cssClass:s,elementId:n,invalid:!!o,...a}),t.jsx(ge,{errorText:o})]});var Ne=(e=>(e.Small="small",e.Base="base",e))(Ne||{});const ys={[Ne.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[Ne.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},Mt=({elementId:e,value:r,placeholder:s,disabled:n,readonly:o,invalid:a,cssClass:l,containerCssClass:c,onChange:i,size:d=Ne.Base})=>{const[u,g]=f.useState(r||"");f.useEffect(()=>{g(r||"")},[r]);const w=f.useCallback(y=>{g(y),i?.(y)},[i]),C=ys[d],j=f.useCallback(()=>{w("")},[w]);return t.jsxs("div",{className:m("dial-input flex flex-row items-center justify-between",a&&"dial-input-error",n&&"dial-input-disable",o&&"dial-input-readonly",C.containerClass,c),children:[t.jsx(B,{className:m(n?"text-secondary":"text-primary"),icon:t.jsx(E.IconSearch,{size:C.iconSize,stroke:C.iconStroke})}),t.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:s,value:u??"",disabled:n,readOnly:o,className:m("border-0 bg-transparent w-full",l,C.textClass),onChange:y=>!o&&w(y.currentTarget.value)}),u&&!o&&!n&&t.jsx(B,{className:"text-primary cursor-pointer",icon:t.jsx(E.IconX,{size:C.iconSize,stroke:C.iconStroke,onClick:j,"aria-label":"Clear search",role:"button"})})]})},ws=({placeholder:e="",selectedItems:r=[],updateSelected:s,listCssClass:n,listElementCssClass:o,containerCssClass:a,inputCssClass:l})=>{const[c,i]=f.useState(""),d=f.useCallback(g=>{g.key==="Enter"&&(s([...r,g.currentTarget.value]),i("")),(g.key==="Backspace"||g.key==="Delete")&&r.length&&!c&&s(r.slice(0,-1))},[r,s,c]),u=f.useCallback(g=>{i(g.target.value)},[i]);return t.jsxs("div",{className:m(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",a]),children:[t.jsx(qe,{selectedItems:r,listCssClass:n,listElementCssClass:o}),t.jsx("input",{type:"text",value:c,className:m(["border-0 bg-transparent p-0",l]),placeholder:r?.length?"":e,onKeyDown:d,onChange:u})]})},vs=({initialTags:e=[],fieldTitle:r,optional:s,elementId:n,placeholder:o,errorText:a,invalid:l,disabled:c,onChange:i})=>{const d=f.useRef(null),[u,g]=f.useState(e),[w,C]=f.useState(""),[j,y]=f.useState(!1),k=D=>{const I=D.trim().replace(/,$/,"");if(I&&!u.includes(I)){const L=[I,...u];g(L),i?.(L)}},M=D=>{(D.key===","||D.key==="Enter")&&(D.preventDefault(),k(w),C(""))},z=D=>{const I=u.filter((L,_)=>_!==D);g(I),i?.(I)};return f.useEffect(()=>{const D=new ResizeObserver(()=>{if(d.current){const I=d.current.scrollHeight>d.current.clientHeight+10;y(I)}});return d.current&&D.observe(d.current),()=>D.disconnect()},[u]),t.jsxs("div",{className:m("flex flex-col w-full"),children:[t.jsx(me,{fieldTitle:r,optional:s,htmlFor:n}),t.jsx("div",{className:m("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:t.jsxs("div",{ref:d,className:m("flex flex-wrap gap-2 items-center",j?"flex-col-reverse":"flex-row"),children:[u.map((D,I)=>t.jsx(Pe,{tag:D,remove:c?void 0:()=>z(I)},D+I)),t.jsx("input",{type:"text",value:w,onChange:D=>C(D.target.value),onKeyDown:M,className:m("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:o,disabled:c})]})}),t.jsx(ge,{errorText:a})]})},Cs="dial-input flex px-3 py-2 w-full items-center justify-between gap-2 h-auto",ks="w-full rounded",Oe="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",js="bg-accent-primary-alpha",Ns="bg-accent-primary-alpha border-l border-accent-primary border-1",st="opacity-75",Ss=t.jsx(E.IconChevronDown,{size:16}),Ds=({options:e,multiple:r=!1,value:s,defaultValue:n,placeholder:o="Select...",searchable:a=!1,selectAll:l=!1,selectAllLabel:c="Select all",emptyStateTitle:i="No options available",emptyStateDescription:d,emptyStateIcon:u,disabled:g=!1,cssClass:w,closable:C=!1,onClose:j,onChange:y})=>{const[k,M]=f.useState(!1),[z,D]=f.useState(""),I=f.useId(),L=s!==void 0,[_,$]=f.useState(n),b=L?s:_,T=f.useMemo(()=>r?Array.isArray(b)?b:[]:typeof b=="string"?[b]:[],[b,r]),O=f.useMemo(()=>{const p=z.trim().toLowerCase();return p?e.filter(P=>P.label.toLowerCase().includes(p)):e},[e,z]);f.useEffect(()=>{k||D("")},[k]);const G=f.useCallback(p=>{L||$(p),y?.(p)},[L,y]),U=p=>{if(r){const P=new Set(T);P.has(p)?P.delete(p):P.add(p),G(Array.from(P))}else G(p),M(!1)},ie=f.useCallback((p,P)=>{if(p.stopPropagation(),!r){G("");return}const J=T.filter(A=>A!==P);G(J)},[r,T,G]),q=f.useMemo(()=>O.filter(p=>!p.disabled),[O]),Z=f.useMemo(()=>q.filter(p=>T.includes(p.value)).length,[q,T]),H=q.length>0&&Z===q.length,Q=Z>0&&!H,v=()=>{if(!(!r||q.length===0))if(H){const p=new Set(q.map(J=>J.value)),P=T.filter(J=>!p.has(J));G(P)}else{const p=new Set(T);q.forEach(P=>p.add(P.value)),G(Array.from(p))}},ne=T.length>0,N=!r&&ne?T[0]:void 0,W=f.useMemo(()=>N?e.find(p=>p.value===N):void 0,[e,N]),te=f.useCallback(()=>!r||T.length===0?null:t.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:T.map(p=>{const P=e.find(A=>A.value===p)?.label??p,J=e.find(A=>A.value===p)?.icon;return t.jsx(Pe,{tag:P,remove:A=>ie(A,p),iconBefore:J?t.jsx(B,{icon:J}):null,cssClass:"max-w-full"},p)})}),[r,e,T,ie]),F=f.useCallback(()=>r?ne?te():t.jsx("span",{className:"text-secondary truncate",children:o}):W?t.jsxs(t.Fragment,{children:[W.icon&&t.jsx(B,{icon:W.icon}),t.jsx(he,{text:W.label})]}):t.jsx("span",{className:"text-secondary truncate",children:o}),[ne,r,o,te,W]);return t.jsx(He,{open:k,onOpenChange:M,disabled:g,closable:C,onClose:j,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>t.jsxs("div",{id:I,role:"listbox","aria-multiselectable":r||void 0,className:ks,children:[(a||C)&&t.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[a&&t.jsx(Mt,{onChange:D,value:z,elementId:`search-${I}`}),C&&t.jsx(ee,{ariaLabel:"Close select",cssClass:"shrink-0",iconBefore:t.jsx(E.IconX,{size:16}),onClick:p=>{j?.(p),M(!1)}})]}),r&&l&&q.length>0&&t.jsx("div",{className:m(Oe,"mt-2"),children:t.jsx(Ve,{id:`${I}-selectAll`,label:c,checked:H,indeterminate:Q,onChange:v,ariaLabel:c})}),t.jsx("div",{className:"overflow-y-auto py-1",children:O.length===0?t.jsx("div",{className:"px-2 py-3",children:t.jsx(mt,{icon:u??t.jsx(E.IconClipboardX,{size:24}),title:i,description:d})}):O.map(p=>{const P=T.includes(p.value);return r?t.jsx("div",{className:m(Oe,P&&js,p.disabled&&st,"w-full"),children:t.jsx(Ve,{id:`${I}-${p.value}`,label:t.jsxs("span",{className:"flex w-full flex-1 min-w-0 items-center gap-2 text-primary",children:[p.icon&&t.jsx(B,{icon:p.icon}),t.jsx("span",{className:"truncate",children:p.label})]}),checked:P,disabled:p.disabled,onChange:()=>!p.disabled&&U(p.value),ariaLabel:p.label})},p.value):t.jsx("button",{role:"option",type:"button","aria-selected":P,"aria-disabled":!!p.disabled,disabled:p.disabled,className:m(Oe,P&&Ns,p.disabled&&st),onClick:()=>!p.disabled&&U(p.value),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[p.icon&&t.jsx(B,{icon:p.icon}),t.jsx(he,{text:p.label})]})},p.value)})})]}),children:t.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":I,className:m(Cs,g&&"opacity-75 !cursor-not-allowed",w),onClick:()=>!g&&M(p=>!p),children:[t.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:F()}),t.jsx(B,{icon:Ss,className:m("text-primary",k&&"rotate-180")})]})})};exports.AlertVariant=de;exports.ButtonVariant=X;exports.ConfirmationPopupVariant=je;exports.DialAlert=Ot;exports.DialAutocompleteInput=ws;exports.DialAutocompleteInputValue=qe;exports.DialBreadcrumb=Jr;exports.DialBreadcrumbItem=St;exports.DialButton=ee;exports.DialCheckbox=Ve;exports.DialCloseButton=$e;exports.DialCollapsibleSidebar=er;exports.DialConfirmationPopup=fs;exports.DialDropdown=He;exports.DialEllipsisTooltip=he;exports.DialErrorText=ge;exports.DialFieldLabel=me;exports.DialIcon=B;exports.DialInput=ke;exports.DialInputPopup=Rt;exports.DialLabelledText=tr;exports.DialLoader=nt;exports.DialNoDataContent=mt;exports.DialNumberInputField=ss;exports.DialPasswordInput=zt;exports.DialPasswordInputField=bs;exports.DialPopup=Ue;exports.DialRadioButton=dt;exports.DialRadioGroup=ut;exports.DialRadioGroupPopupField=xs;exports.DialSearch=Mt;exports.DialSelect=Ds;exports.DialSteps=Xt;exports.DialSwitch=as;exports.DialTab=Me;exports.DialTabs=Hr;exports.DialTag=Pe;exports.DialTagInput=vs;exports.DialTextAreaField=os;exports.DialTextInputField=ns;exports.DialTextarea=Dt;exports.DialTooltip=le;exports.DropdownType=kt;exports.PopupSize=ae;exports.RadioGroupOrientation=Ce;exports.SearchSize=Ne;exports.StepStatus=K;exports.TabOrientation=Te;exports.TagVariant=Ae;exports.mergeClasses=se;
|