@npm-questionpro/wick-ui-lib 1.24.1 → 1.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,10 @@
1
- (function(T,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch"),require("@tiptap/react"),require("@tiptap/extension-list"),require("@tiptap/extension-subscript"),require("@tiptap/extension-superscript"),require("@tiptap/extension-table"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/starter-kit"),require("@tiptap/extension-image")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","react-dom","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch","@tiptap/react","@tiptap/extension-list","@tiptap/extension-subscript","@tiptap/extension-superscript","@tiptap/extension-table","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/starter-kit","@tiptap/extension-image"],a):(T=typeof globalThis<"u"?globalThis:T||self,a(T["wick-ui-lib"]={},T["react/jsx-runtime"],T.RadixUIAccordion,T.React,T.clsx,T.tailwindMerge,T.RadixUIAvatar,T.RadixUISlot,T.ClassVarianceAuthority,T.RadixUILabel,T.RadixUITooltip,T.dateFns,T.RadixUIPopover,T.ReactDayPicker,T.RadixUICheckbox,T.cmdk,T.ReactVirtuoso,T.RadixUIDropdownMenu,T.RadixUIDialog,T.RadixUIScrollArea,T.RadixUIRadioGroup,T.RadixUISeparator,T.ReactDOM,T.RadixUIToggleGroup,T.RadixUIToggle,T.RadixUITabs,T.TanstackReactTable,T.RadixUIToast,T.RadixUISwitch,T.TipTapReact,T.TipTapExtensionList,T.TipTapExtensionSubscript,T.TipTapExtensionSuperscript,T.TipTapExtensionTable,T.TipTapExtensionTextAlign,T.TipTapExtensionTextStyle,T.TipTapStarterKit,T.TipTapExtensionImage))})(this,(function(T,a,wt,p,wc,fc,pc,ft,Me,hc,dr,K,Bt,fa,mc,ye,gc,zt,pa,bc,yc,xc,vc,Nc,Sc,Cc,Be,Tc,Ec,we,ha,Ac,kc,Mc,Ic,pt,Dc,Pc){"use strict";var dy=Object.defineProperty;var wy=(T,a,wt)=>a in T?dy(T,a,{enumerable:!0,configurable:!0,writable:!0,value:wt}):T[a]=wt;var yn=(T,a,wt)=>wy(T,typeof a!="symbol"?a+"":a,wt);function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Je=pe(wt),v=pe(p),ht=pe(pc),ma=pe(hc),qt=pe(dr),$t=pe(Bt),wr=pe(mc),te=pe(zt),Q=pe(pa),Qe=pe(bc),Ht=pe(yc),ga=pe(xc),Fc=pe(vc),xn=pe(Nc),ba=pe(Sc),Re=pe(Cc),Se=pe(Tc),fr=pe(Ec),Vc=fc.extendTailwindMerge({prefix:"wu-"});function f(...e){return Vc(wc.clsx(e))}const pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function vn(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ut(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Lc=e=>e?/\S+@questionpro\.com/.test(e):!1,ya=Je.Root,hr=v.forwardRef(({className:e,...t},n)=>a.jsx(Je.Item,{ref:n,className:f("wu-border-b",e),...t}));hr.displayName="AccordionItem";const mr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Header,{className:"wu-flex",children:a.jsxs(Je.Trigger,{ref:r,className:f("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));mr.displayName=Je.Trigger.displayName;const gr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Content,{ref:r,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...n,children:a.jsx("div",{className:f("wu-pb-4 wu-pt-0",e),children:t})}));gr.displayName=Je.Content.displayName;const _c=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}},xa=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Root,{ref:n,className:f("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));xa.displayName=ht.Root.displayName;const va=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Image,{ref:n,className:f("wu-aspect-square wu-h-full wu-w-full",e),...t}));va.displayName=ht.Image.displayName;const Na=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Fallback,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Na.displayName=ht.Fallback.displayName;function br(e,t){p.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const yr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Sa=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=p.useState(!1),u=p.useRef(null),l=p.useRef(null);br([u,l],()=>i(!1));const c=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:yr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:f("wu-flex wu-relative",o&&yr.open),children:[a.jsx("button",{className:f("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:d=>{d.preventDefault(),c()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:f(yr.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:r})]})})})})},xr=Me.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded-sm","wu-whitespace-nowrap wu-leading-4 wu-text-sm wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px]","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),mt=v.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?ft.Slot:"button";return a.jsx(u,{className:f(xr({size:n,color:r,variant:t,className:e})),ref:i,...o})});mt.displayName="Button";const gt=p.forwardRef((e,t)=>Oc(e,t)),Oc=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=f("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},c=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:i,style:{fontSize:u},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:s==="spinner"?c:d})};gt.displayName="WuLoader";const ce=p.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:c="primary",selected:d,...w},h)=>{const m={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(mt,{...w,disabled:e,variant:n,size:r,className:f(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",d&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",l),color:c,style:{backgroundColor:t?m[c]:"",...w.style},ref:h,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(gt,{color:"#fff",size:"sm"}),!t&&i]})});ce.displayName="WuButton";const Wc=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(ce,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Bc=({user:e,dir:t})=>{const n=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:f("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:f(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},zc=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:f("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:f("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),qc=({user:e,dir:t})=>{var n,r,s,o,i,u,l,c,d;return a.jsxs("section",{className:f("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:f("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(u=e==null?void 0:e.license)==null?void 0:u.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(l=e==null?void 0:e.license)==null?void 0:l.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),a.jsx("p",{children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDate})]})]})]})]})},Ca=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Sa,{Trigger:a.jsxs(xa,{className:f("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[a.jsx(va,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(Na,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:f("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:n,children:[a.jsx(qc,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(zc,{settings:e.settings,dir:n}),a.jsx(Bc,{user:e,dir:n}),a.jsx(Wc,{onLogout:t,DataCenter:r})]})}):null},Ta=({menuList:e,dir:t})=>{const n=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return a.jsx(Sa,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>pr(r.link),onKeyDown:o=>{o.key==="Enter"&&pr(r.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
1
+ (function(T,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@tiptap/react"),require("@radix-ui/react-separator"),require("@radix-ui/react-dialog"),require("@tiptap/extension-list"),require("@tiptap/extension-subscript"),require("@tiptap/extension-superscript"),require("@tiptap/extension-table"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/starter-kit"),require("@tiptap/extension-image"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("react-dom"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@tiptap/react","@radix-ui/react-separator","@radix-ui/react-dialog","@tiptap/extension-list","@tiptap/extension-subscript","@tiptap/extension-superscript","@tiptap/extension-table","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/starter-kit","@tiptap/extension-image","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","react-dom","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],a):(T=typeof globalThis<"u"?globalThis:T||self,a(T["wick-ui-lib"]={},T["react/jsx-runtime"],T.RadixUIAccordion,T.React,T.clsx,T.tailwindMerge,T.RadixUIAvatar,T.RadixUISlot,T.ClassVarianceAuthority,T.RadixUILabel,T.RadixUITooltip,T.dateFns,T.RadixUIPopover,T.ReactDayPicker,T.RadixUICheckbox,T.cmdk,T.ReactVirtuoso,T.RadixUIDropdownMenu,T.TipTapReact,T.RadixUISeparator,T.RadixUIDialog,T.TipTapExtensionList,T.TipTapExtensionSubscript,T.TipTapExtensionSuperscript,T.TipTapExtensionTable,T.TipTapExtensionTextAlign,T.TipTapExtensionTextStyle,T.TipTapStarterKit,T.TipTapExtensionImage,T.RadixUIScrollArea,T.RadixUIRadioGroup,T.ReactDOM,T.RadixUIToggleGroup,T.RadixUIToggle,T.RadixUITabs,T.TanstackReactTable,T.RadixUIToast,T.RadixUISwitch))})(this,(function(T,a,wt,p,wc,fc,pc,ft,Me,hc,dr,K,Bt,fa,mc,ye,gc,zt,we,bc,pa,ha,yc,xc,vc,Nc,pt,Sc,Cc,Tc,Ec,Ac,kc,Mc,Ic,Be,Dc,Pc){"use strict";var dy=Object.defineProperty;var wy=(T,a,wt)=>a in T?dy(T,a,{enumerable:!0,configurable:!0,writable:!0,value:wt}):T[a]=wt;var yn=(T,a,wt)=>wy(T,typeof a!="symbol"?a+"":a,wt);function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Je=pe(wt),v=pe(p),ht=pe(pc),ma=pe(hc),qt=pe(dr),$t=pe(Bt),wr=pe(mc),te=pe(zt),ga=pe(bc),Q=pe(pa),Qe=pe(Tc),Ht=pe(Ec),Fc=pe(Ac),xn=pe(kc),ba=pe(Mc),Re=pe(Ic),Se=pe(Dc),fr=pe(Pc),Vc=fc.extendTailwindMerge({prefix:"wu-"});function f(...e){return Vc(wc.clsx(e))}const pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function vn(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ut(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Lc=e=>e?/\S+@questionpro\.com/.test(e):!1,ya=Je.Root,hr=v.forwardRef(({className:e,...t},n)=>a.jsx(Je.Item,{ref:n,className:f("wu-border-b",e),...t}));hr.displayName="AccordionItem";const mr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Header,{className:"wu-flex",children:a.jsxs(Je.Trigger,{ref:r,className:f("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));mr.displayName=Je.Trigger.displayName;const gr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Content,{ref:r,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...n,children:a.jsx("div",{className:f("wu-pb-4 wu-pt-0",e),children:t})}));gr.displayName=Je.Content.displayName;const _c=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}},xa=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Root,{ref:n,className:f("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));xa.displayName=ht.Root.displayName;const va=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Image,{ref:n,className:f("wu-aspect-square wu-h-full wu-w-full",e),...t}));va.displayName=ht.Image.displayName;const Na=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Fallback,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Na.displayName=ht.Fallback.displayName;function br(e,t){p.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const yr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Sa=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=p.useState(!1),u=p.useRef(null),l=p.useRef(null);br([u,l],()=>i(!1));const c=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:yr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:f("wu-flex wu-relative",o&&yr.open),children:[a.jsx("button",{className:f("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:d=>{d.preventDefault(),c()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:f(yr.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:r})]})})})})},xr=Me.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded-sm","wu-whitespace-nowrap wu-leading-4 wu-text-sm wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px]","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),mt=v.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?ft.Slot:"button";return a.jsx(u,{className:f(xr({size:n,color:r,variant:t,className:e})),ref:i,...o})});mt.displayName="Button";const gt=p.forwardRef((e,t)=>Oc(e,t)),Oc=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=f("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},c=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:i,style:{fontSize:u},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:s==="spinner"?c:d})};gt.displayName="WuLoader";const ce=p.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:c="primary",selected:d,...w},h)=>{const m={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(mt,{...w,disabled:e,variant:n,size:r,className:f(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",d&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",l),color:c,style:{backgroundColor:t?m[c]:"",...w.style},ref:h,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(gt,{color:"#fff",size:"sm"}),!t&&i]})});ce.displayName="WuButton";const Wc=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(ce,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Bc=({user:e,dir:t})=>{const n=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:f("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:f(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},zc=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:f("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:f("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),qc=({user:e,dir:t})=>{var n,r,s,o,i,u,l,c,d;return a.jsxs("section",{className:f("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:f("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(u=e==null?void 0:e.license)==null?void 0:u.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(l=e==null?void 0:e.license)==null?void 0:l.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),a.jsx("p",{children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDate})]})]})]})]})},Ca=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Sa,{Trigger:a.jsxs(xa,{className:f("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[a.jsx(va,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(Na,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:f("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:n,children:[a.jsx(qc,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(zc,{settings:e.settings,dir:n}),a.jsx(Bc,{user:e,dir:n}),a.jsx(Wc,{onLogout:t,DataCenter:r})]})}):null},Ta=({menuList:e,dir:t})=>{const n=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return a.jsx(Sa,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>pr(r.link),onKeyDown:o=>{o.key==="Enter"&&pr(r.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
2
2
  focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer`,children:a.jsx(Ea,{item:r,dir:t})}):a.jsx("a",{href:r.link,target:"_blank",className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[0.04] focus-visible:wu-border-none
3
3
  focus-visible:wu-bg-black
4
- focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:a.jsx(Ea,{item:r,dir:t})})},s))})})},Ea=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:f("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),$c=e=>{const[t,n]=p.useState(()=>window.innerWidth<=e);return p.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Hc({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const c=l[u];if(c){c.focus();const d=e[u]||null;n(d)}},s=(u,l,c,d)=>{u.preventDefault();const w=c==="down"?l+1:l-1;r(w,d)},o=(u,l,c,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(u.preventDefault(),r(l+1,c))},i=(u,l)=>{u.preventDefault();const c=e[l]===t?null:e[l];n(c)};return function(l,c,d){const w=document.querySelectorAll("[data-product-category]"),{key:h}=l;switch(h){case"ArrowDown":s(l,c,"down",w);break;case"ArrowUp":s(l,c,"up",w);break;case"Tab":o(l,c,w,d);break;case"Enter":case" ":i(l,c);break}}}const Uc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},jc=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:f(i[t],n),children:r})},Gc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},Kc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:f(o[t],n),children:r})},re=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:f(t,n),role:"presentation","aria-label":t})},Yc=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:f("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:u=>{r&&u.key==="ArrowDown"&&n(u,-1)},"aria-label":"product-switcher",children:[a.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(re,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),se={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},Xc=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=f("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=f("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:f("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[a.jsx("div",{className:se.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},Zc={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},Jc=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=p.useState(e.name===t),l=e.name===n,c=e.name===t,d=!e.active,w="#1b3380",h="#c5cce0",m="#ffcf70",b=f("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),g=f("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),x=i||s===e.name||l?w:h;return a.jsxs("li",{className:f(se.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&se.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&se.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":d,dir:r,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:d?m:x}}),a.jsxs("a",{className:f(se.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:f(g,Zc[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:f(b),children:e.name})]})]},e.name)},Qc=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,c=p.useMemo(()=>u.filter(b=>b.active).sort((b,g)=>(b.order||100)-(g.order||100)),[u]),d=p.useMemo(()=>u.filter(b=>!b.active),[u]),[w,h]=p.useState(i),m=b=>b.map((g,x)=>a.jsx(Jc,{product:g,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},x));return l?a.jsxs(a.Fragment,{children:[m(c),d.length>0&&a.jsxs("li",{className:f(se.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:f(se.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),m(d)]}):a.jsxs("li",{className:f(se.productListItem,se.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:se.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Aa=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:c,setFocusItem:d})=>{const w="#ffcf70",[h,m]=p.useState(window.innerWidth>768);return p.useEffect(()=>{const b=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),a.jsx("ul",{className:f(se.productDropdownMenu,n&&se.productDropdownMenuOpen,t==="rtl"&&se.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((b,g)=>a.jsxs("li",{className:f(se.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===b&&se.open,u&&se.open),onMouseEnter:()=>h&&o(b),onMouseLeave:()=>h&&o(null),"aria-label":b.name,dir:t,onKeyDown:x=>i(x,g),tabIndex:0,"data-product-category":!0,children:[a.jsx(Xc,{category:b,dir:t,openCategory:s}),a.jsx("ul",{className:f(se.productList,t==="rtl"&&se.rtlProductList),dir:t,children:a.jsx(Qc,{category:b,dir:t,activeProductName:l,currentProduct:b.name,focusItem:c,setFocusItem:d,borderColorLocked:w})})]},b.name))})},Rc=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:f("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:f("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:c=>{t&&c.key==="ArrowDown"&&l(c,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),ed=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:f("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"aria-label":"menu-toggle-btn",children:[a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},ka=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),c=p.useRef(null),[d,w]=p.useState(!1),[h,m]=p.useState(null),[b,g]=p.useState(n.base),[x,S]=p.useState(""),[y,N]=p.useState(!1),C=$c(768);br([u,i],()=>{w(!1),m(null)}),br([l,c,u],()=>{N(!1),w(!1),m(null)}),p.useEffect(()=>{const A=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[d]),p.useEffect(()=>g(n.base),[n.base]);const E=A=>{A.preventDefault(),A.stopPropagation(),w(k=>{const D=!k;return D||m(null),D})},M=(A,k)=>{Hc({productCategories:e,openCategory:h,setOpenCategory:m})(A,k,x)};return a.jsx("div",{className:f("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:C?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(ed,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:w,setIsProductButtonShow:N}),a.jsx(Rc,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:n,activeProductBgColor:b,activeProductName:t,handleDropdownToggle:E,smallScreenButtonRef:l,handleKeyDown:M,dir:r}),a.jsx("div",{className:f("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:d?n.hover:b},onMouseOver:()=>g(n.hover),onMouseOut:()=>g(n.base),children:[a.jsx(Yc,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:E,handleKeyDown:M,isDropdownOpen:d}),a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})]})})},Ma=({children:e,dir:t,className:n})=>a.jsx("section",{className:f("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",n),children:a.jsx("div",{className:"wu-grow",children:e})}),vr=v.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:f("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));vr.displayName="Input";const td=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:f("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},nd=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=p.useState(!1);return p.useEffect(()=>{var c;(((c=t==null?void 0:t.current)==null?void 0:c.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:f("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},rd=Me.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),Nn=v.forwardRef(({className:e,...t},n)=>a.jsx(ma.Root,{ref:n,className:f(rd(),e),...t}));Nn.displayName=ma.Root.displayName;const Ce=e=>a.jsx(Nn,{...e,className:f("wu-text-gray-lead wu-leading-6",e.className)}),sd=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const c=f("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),d=f("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:c,dir:o,...u,children:[e,a.jsxs("div",{className:d,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:h,children:t})]})]})},Te=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="top",Icon:s,iconPosition:o,type:i,value:u,variant:l="flat",readonly:c,id:d=vn(),...w}=e,h=Ut(r),m=s?o!=="right"?"wu-pl-8":"wu-pr-8":"",[b,g]=p.useState(!1),x=()=>{g(y=>!y)},S=y=>{w.onChange&&w.onChange(y)};return a.jsx(a.Fragment,{children:i==="submit"?a.jsx(ce,{type:"submit",className:w.className,id:d,children:n||"Submit"}):a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:w.dir,children:a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative",h,(r==="right"||r==="left")&&"wu-items-center","wu-input-wrapper"),children:[s&&o!=="right"&&a.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),a.jsx(vr,{...w,className:f("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",m,w.className),type:b?"text":i,ref:t,readOnly:c,onChange:w.onChange&&S,value:u,id:d}),s&&o==="right"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),i==="password"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:x,children:a.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:b?a.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):a.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),n&&a.jsx(Ce,{htmlFor:d,className:"wu-flex-none wu-w-fit wu-input-label",children:n})]})})})});Te.displayName="WuInput";const ad=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=p.useState(n);return p.useEffect(()=>{i(n)},[n]),a.jsx(Te,{...s,placeholder:t,onChange:u=>r(u.target.value),className:f("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:a.jsx(re,{"data-testid":"search-icon",icon:"wm-search",className:f("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)})})},Ia=qt.Provider,Da=qt.Root,Pa=qt.Trigger,Nr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(qt.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...n}));Nr.displayName=qt.Content.displayName;const Sn=p.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,...c},d)=>a.jsx(Ia,{delayDuration:r||200,children:a.jsxs(Da,{open:u,onOpenChange:l,children:[a.jsx(Pa,{asChild:!0,children:a.jsx("span",{ref:d,children:s})}),a.jsx(dr.Portal,{children:e&&a.jsxs(Nr,{...c,side:t||"top",sideOffset:n||0,className:f("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(dr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Sn.displayName="WuTooltip";const od=({label:e,className:t})=>{const n=p.useRef(null),[r,s]=p.useState(!1);return p.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,c=e.length*l;s(c>i||u>i)}},[e]),a.jsx("p",{ref:n,className:f("wu-w-full wu-truncate",t),children:r?a.jsx(Sn,{content:e,positionOffset:8,children:e}):e})},id=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:c,DataCenter:d}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:f("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Lc((w=r==null?void 0:r.profile)==null?void 0:w.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(ka,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:c})}),a.jsx(Ma,{dir:l,children:s}),a.jsxs("section",{className:f("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(Ta,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Ca,{user:r,onLogout:o,dir:l,DataCenter:d})]})]})})},ze=$t.Root,et=$t.Trigger,Ie=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx($t.Portal,{children:a.jsx($t.Content,{ref:s,align:t,sideOffset:n,className:f("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));Ie.displayName=$t.Content.displayName;function Fa({className:e,classNames:t,dir:n="ltr",...r}){const s=fa.getDefaultClassNames();return a.jsx(fa.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:f("wu-p-3",e),classNames:{root:f(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:f("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:f(s.month_caption,"wu-mb-5"),months:f(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:f(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:f(s.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:f(s.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:f(s.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:f(s.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:f(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:f("rm",s.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:f(s.range_end,"wu-rounded-none"),range_start:f(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:f(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:f(s.button_next,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:f(s.button_previous,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:f(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:f(s.chevron,"!wu-text-red-500"),outside:f(s.outside,"wu-invisible"),disabled:f(s.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...r})}Fa.displayName="Calendar";const Sr=e=>a.jsx(Fa,{...e}),Va=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[s&&a.jsx(ce,{variant:"secondary",onClick:r,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Cr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(Bt.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(ce,{...u,className:f("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),La=(e,t,n,r)=>{const s=K.startOfDay(e).getTime();return!!(t||n&&s<K.startOfDay(n).getTime()||r&&s>K.startOfDay(r).getTime())},Cn=e=>e?typeof e=="string"?new Date(e):e:new Date,Tr="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",ud=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ld=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:c,showResetButton:d=!1,placeholder:w="Select Date",CustomTrigger:h,...m})=>{const[b,g]=p.useState(),[x,S]=p.useState(""),y=p.useCallback(()=>{const C=Cn(b);S(K.format(C,e)),n&&n(b)},[b,e,n]),N=p.useCallback(()=>{c?c():(g(void 0),S(""),n&&n(void 0))},[n,c]);return p.useEffect(()=>{const C=Cn(t);g(C),S(K.format(C,e))},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(ze,{children:[a.jsx(Cr,{formattedString:x,dir:i,placeholder:w,CustomTrigger:h,...m}),a.jsx(Ie,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(Sr,{dir:i,mode:"single",captionLayout:"dropdown",selected:b,onSelect:g,disabled:C=>La(C,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:b,className:f("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(Va,{handleDateChange:y,disabled:r,onReset:N,showResetButton:d})})})]})]})},_a="yyyy-MM-dd",cd=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],dd=({current:e,onSelect:t,presetRanges:n=ud})=>{const[r,s]=p.useState(),[o,i]=p.useState(!1),[u,l]=p.useState(""),[c,d]=p.useState(""),[w,h]=p.useState(!1),m=p.useMemo(()=>n.map(y=>y.value),[n]),b=f("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),g=p.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const N=Number(y)-1;s(N),i(!1),t({from:K.sub(new Date,{days:N}),to:new Date})},[t]),x=p.useCallback((y,N)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Tr).test(y))return!1;const E=new Date(N==="start"?y:e.from),M=new Date(N==="end"?y:e.to);return K.isBefore(M,E)?(h(!0),!1):(h(!1),!(K.isSameDay(E,e.from)&&K.isSameDay(M,e.to)))},[e]),S=p.useCallback((y,N)=>{if((N==="start"?l:d)(y),x(y,N)){const E={from:e==null?void 0:e.from,to:e==null?void 0:e.to};N==="start"&&(E.from=new Date(y)),N==="end"&&(E.to=new Date(y)),t(E)}},[e,t,x]);return p.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&K.isValid(e.to)&&K.isValid(e.from)){l(K.format(e.from,_a)),d(K.format(e.to,_a));const y=K.differenceInCalendarDays(e.to,e.from);K.isToday(e.to)&&m.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,m]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:cd.map(({label:y,value:N})=>a.jsx(mt,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:N!==1,children:y},N))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:N})=>a.jsx("li",{children:a.jsx("button",{className:f(b,r===N-1&&"wu-bg-blue-p/10"),onClick:()=>g(N),children:y})},N)),a.jsx("li",{children:a.jsx("button",{className:f(b,o&&"wu-bg-blue-p/10"),onClick:()=>g(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Te,{placeholder:"Start Date",pattern:Tr,value:u,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Te,{placeholder:"End Date",pattern:Tr,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},wd=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:c,Label:d,labelPosition:w="top",onReset:h,showResetButton:m=!0,placeholder:b="Select Date Range",CustomTrigger:g,...x})=>{const[S,y]=p.useState(t),[N,C]=p.useState(t),[E,M]=p.useState(""),A=p.useCallback(()=>{if(N){const F=N.from,V=N.to;y({from:F,to:V}),M(`${K.format(F,e)} - ${K.format(V,e)}`),n&&n({from:F,to:V})}},[N,e,n]),k=p.useCallback(()=>{C(S)},[S]),D=p.useCallback(()=>{h?h():(y(void 0),C(void 0),M(""),n&&n(void 0))},[h,n]);return p.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const F=Cn(t.from),V=Cn(t.to);y(t),C(t),M(`${K.format(F,e)} - ${K.format(V,e)}`)}else y(void 0),C({to:new Date,from:new Date})},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[d,a.jsxs(ze,{onOpenChange:F=>!F&&k(),children:[a.jsx(Cr,{formattedString:E,dir:i,placeholder:b,CustomTrigger:g,...x}),a.jsxs(Ie,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:i,children:[a.jsx(dd,{current:N,onSelect:C,presetRanges:c}),a.jsx(Sr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:N,onSelect:C,disabled:F=>La(F,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:S==null?void 0:S.from,className:f("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(Va,{handleDateChange:A,disabled:r,onReset:D,showResetButton:m})})]})]})]})},Oa=p.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:f("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});Oa.displayName="WuCard";const Wa=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Wa.displayName="WuCardHeader";const Ba=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Ba.displayName="WuCardHeader";const za=v.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(wr.Root,{ref:r,className:f("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(wr.Indicator,{className:f("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));za.displayName=wr.Root.displayName;const Ae=p.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=vn(),partial:l,onChange:c,required:d,readonly:w,...h}=e;return p.useEffect(()=>{h.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,r]),a.jsxs("div",{className:fd({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[a.jsx(za,{id:u,...h,partial:l,checked:r,disabled:n||w,onCheckedChange:c,className:f("wu-peer wu-checkbox",i),required:d,ref:t}),s&&a.jsx(Ce,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),fd=Me.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});Ae.displayName="WuCheckbox";const pd=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:f("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},Er=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));Er.displayName=ye.Command.displayName;const qa=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(ye.Command.Input,{ref:n,className:f("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));qa.displayName=ye.Command.Input.displayName;const Ar=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.List,{ref:n,className:f("",e),...t}));Ar.displayName=ye.Command.List.displayName;const kr=v.forwardRef((e,t)=>a.jsx(ye.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));kr.displayName=ye.Command.Empty.displayName;const jt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Group,{ref:n,className:f("",e),...t}));jt.displayName=ye.Command.Group.displayName;const $a=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Separator,{ref:n,className:f("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));$a.displayName=ye.Command.Separator.displayName;const Gt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Item,{ref:n,className:f("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));Gt.displayName=ye.Command.Item.displayName;const bt=p.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(gc.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));bt.displayName="WuVirtualScroll";const hd=({tags:e,triggerRef:t})=>{const[n,r]=p.useState([]),[s,o]=p.useState([]),i=p.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,c)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},c))}),[s]),u=l=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=l,document.body.appendChild(c);const d=c.offsetWidth;return document.body.removeChild(c),d+8};return p.useEffect(()=>{const l=()=>{if(t.current){const h=t.current.offsetWidth-20-36;let m=0;const b=[],g=[];e.forEach(x=>{const S=u(x);m+S+8<h?(b.push(x),m+=S+8):g.push(x)}),r(b),o(g)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,c)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},c)),s.length>0&&a.jsx(Sn,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},md=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,className:w,...h})=>{const[m,b]=p.useState([]),g=p.useRef(null);p.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){b([]);return}if(i){const S=n;b(S==null?void 0:S.map(y=>y[o.label]));return}else b([n[o.label]])},[n]);const x=()=>{var S;return m.length?d&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=g.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):a.jsx(hd,{tags:m,triggerRef:g}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(et,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...h,ref:g,disabled:l,className:f("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[x(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Mr=te.Root,Ir=te.Trigger,Ha=te.Group,gd=te.Portal,bd=te.Sub,yd=te.RadioGroup,Ua=v.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(te.SubTrigger,{ref:o,className:f("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:f("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:f("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ua.displayName=te.SubTrigger.displayName;const ja=v.forwardRef(({className:e,...t},n)=>a.jsx(te.SubContent,{ref:n,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));ja.displayName=te.SubContent.displayName;const Tn=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(te.Portal,{children:a.jsx(te.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));Tn.displayName=te.Content.displayName;const Kt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Item,{ref:r,className:f("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Kt.displayName=te.Item.displayName;const Ga=v.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(te.CheckboxItem,{ref:o,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:f("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(te.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ga.displayName=te.CheckboxItem.displayName;const Ka=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(te.RadioItem,{ref:r,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(te.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ka.displayName=te.RadioItem.displayName;const Yt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Label,{ref:r,className:f("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));Yt.displayName=te.Label.displayName;const En=v.forwardRef(({className:e,...t},n)=>a.jsx(te.Separator,{ref:n,className:f("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));En.displayName=te.Separator.displayName;const Ya=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=()=>{e.disabled||r(e)};return a.jsxs(Gt,{onSelect:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(xd,{option:e,accessorKey:s})]})},xd=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Xa=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Gt,{onSelect:r,className:f("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(Ae,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(jt,{children:[a.jsx(Yt,{children:t.label}),t.options.map((l,c)=>p.createElement(Ya,{...i,option:l,key:c}))]});case"divider":return a.jsx($a,{className:"wu-mx-4"});default:return a.jsx(Ya,{...i,option:t})}},vd=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Nd=p.memo(Te),Sd=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:c,onSelect:d,Label:w,maxHeight:h=420,multiple:m=!1,hasGroup:b=!1,selectAll:g,id:x,disabled:S,labelPosition:y="top",className:N,onScroll:C,maxContentWidth:E,enableSearch:M=!0,noDataContent:A,...k})=>{const[D,F]=p.useState(""),[V,$]=p.useState(),[W,G]=p.useState(!1),[q,ue]=p.useState(!1),[I,_]=p.useState(!1),z=p.useRef(null),{allOptions:B,enabledOptions:ne}=p.useMemo(()=>b||g&&!g.includeDisabled?vd(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,b]),ae=p.useMemo(()=>{if(!D)return e;const O=D.toLowerCase();return B.filter(R=>R[t.label].toLowerCase().includes(O))},[D,B,e,t.label]),xe=p.useMemo(()=>m&&g!=null&&g.enable&&!D&&ae.length>0?[{type:"all"},...ae]:ae,[ae,D,m]),He=p.useCallback(O=>{const R=O[t.value];m?$(H=>{const be=H||[],Ne=be.some(me=>me[t.value]===R)?be.filter(me=>me[t.value]!==R):[...be,O];return d==null||d(Ne),Ne}):(G(!1),$(O),d==null||d(O))},[m,t.value,d]),j=p.useCallback(O=>F(O.target.value),[]),P=p.useCallback(()=>F(""),[]);p.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?$(n):r!==void 0&&$(r)},[n,r]),p.useEffect(()=>{if(!m)return;const O=g!=null&&g.includeDisabled?(V==null?void 0:V.length)===B.length:(V==null?void 0:V.length)===ne.length;ue(O);const R=(V==null?void 0:V.length)>0&&!O;_(R)},[V,g]);const U=p.useCallback(()=>{const O=q?[]:g!=null&&g.includeDisabled?B:ne;$(O),d==null||d(O)},[q,m,B,ne,d,g]),Z=Ut(y);return a.jsxs("div",{className:f(Z,"wu-flex wu-combobox-container"),ref:z,children:[a.jsxs(ze,{onOpenChange:O=>{O&&P(),G(O)},open:W,modal:!0,children:[a.jsx(md,{selectedOptions:V,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:c,multiple:m,disabled:S,selectAll:g,isCheckedAll:q,className:N,id:x,...k}),a.jsx(Ie,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:E},children:a.jsxs(Er,{id:x,children:[M&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Nd,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:j,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),s,a.jsxs(Ar,{children:[a.jsx(kr,{children:A||"No results found."}),xe.length>=o?a.jsx(bt,{className:"wu-combobox-list",containerHeight:h,list:xe,callback:(O,R)=>a.jsx(Xa,{option:R,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},O),dir:c}):a.jsx("div",{style:{height:"fit-content",maxHeight:h,overflow:"auto"},className:"wu-combobox-list",onScroll:C,children:xe.map((O,R)=>a.jsx(Xa,{option:O,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},R))})]})]})})]}),w&&a.jsx(Ce,{htmlFor:x,className:"wu-combobox-label",children:w})]})},Cd=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=p.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(ce,{...r,onClick:i,variant:"iconOnly",className:f("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:f("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(re,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Za=Q.Root,Td=Q.Trigger,Ed=Q.Close,Ad=Q.Portal,Ja=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));Ja.displayName=Q.Overlay.displayName;const kd=Me.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),Dr=v.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(Ad,{children:[a.jsx(Ja,{className:s}),a.jsxs(Q.Content,{ref:u,className:f(kd({side:e}),t),...i,children:[n,!r&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Dr.displayName=Q.Content.displayName;const Qa=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-semibold",e),...t}));Qa.displayName=Q.Title.displayName;const Md=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm",e),...t}));Md.displayName=Q.Description.displayName;const Id=e=>t=>{e&&t.preventDefault()},Dd=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:c,closeButtonClassName:d,...w}=e;return a.jsxs(Za,{open:i,onOpenChange:u,children:[a.jsx(Td,{asChild:!0,children:t}),a.jsxs(Dr,{onInteractOutside:Id(l),side:o,className:f("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:c,closeButtonClassName:d,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(Qa,{})}),n]})]})},Pd=({children:e,...t})=>a.jsx(Ed,{...t,children:e}),Ra=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(gt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});Ra.displayName="WuFooter";const eo=p.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>pr(u),children:a.jsx("span",{className:f("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});eo.displayName="WuHelpButton";const Ke=(e,t)=>`wu-listbox-${e}`;function Fd(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...c}=e,d=n.group&&Array.isArray(t[n.group]),w=({item:h,className:m})=>p.createElement(Gt,{...c,key:JSON.stringify(h),onSelect:()=>r==null?void 0:r(h),value:t[n.value],className:f("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(l!=null&&l(h))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,Ke("item")),disabled:h.disabled},s&&a.jsx(Ae,{checked:l==null?void 0:l(h)}),u?u({value:h,isSelected:l==null?void 0:l(h)}):a.jsx(a.Fragment,{children:h[n.label]}));if(d){const h=t[n.group],m=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(jt,{heading:m,children:h==null?void 0:h.map(b=>a.jsx(w,{item:b,className:"wu-pl-6"},JSON.stringify(b)))})}return a.jsx(w,{item:t})}const Vd=p.memo(Fd),Ld=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(re,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(qa,{...n,"aria-label":"Search",className:f("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",Ke("input"),t)})]})},_d=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=p.useState(!1),[u,l]=p.useState(!1);return p.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(Gt,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(Ae,{checked:o,partial:u}),t||"Select All"]})},Od=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:c,className:d,...w}=e,[h,m]=p.useState(),b=p.useRef(null);return p.useEffect(()=>{if(!r){m(null);return}m(Array.isArray(r)?i?r.map((x,S)=>i({value:x,unselect:u,key:S})):r.map(x=>x[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,m]),a.jsx(et,{asChild:!0,id:e.id,disabled:n,ref:b,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:f("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",d,Ke("trigger")),children:[a.jsx("div",{className:f("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||s}),a.jsx(re,{icon:"wm-arrow-drop-down",className:f("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",Ke("drop-icon"))})]})})},to=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Wd=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const c=l.filter(d=>to(d,s,n));c.length>0&&o.push({...i,[u]:c})}else to(i,s,n)&&o.push(i)}return o},Bd=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:c,Chip:d,onSelect:w,onScroll:h,disabled:m,multiple:b,searchable:g,selectAll:x,virtualizedThreshold:S=100,id:y,dir:N,className:C,listClass:E,placeholder:M="Select items...",variant:A,labelPosition:k="top",maxContentWidth:D,maxContentHeight:F,modal:V,...$}=e,[W,G]=p.useState(!1),[q,ue]=p.useState(""),[I,_]=p.useState(r),z=p.useMemo(()=>n,[n]),B=p.useMemo(()=>{if(!g||!q)return t;const j=q.toLowerCase().trim();return Wd(t,j,n)},[t,q,n.label,g]),ne=j=>{b?_(P=>{const U=j[n.value],Z=Array.isArray(P)?P:[],R=Z.some(H=>H[n.value]===U)?Z.filter(H=>H[n.value]!==U):[...Z,j];return w&&w(R),R}):(_(j),w&&w(j),G(!1))},ae=p.useCallback(j=>{const P=j?t:[];_(P),x!=null&&x.onSelectAll&&x.onSelectAll(j),w&&w(P)},[t,x,w]),xe=j=>Array.isArray(I)?I.some(P=>P[n.value]===j[n.value]):(I==null?void 0:I[n.value])===j[n.value];p.useEffect(()=>{_(r)},[r]);const He=j=>{const P=U=>a.jsx(Vd,{option:U,accessorKey:z,multiple:b,onSelect:Z=>ne(Z),dir:N,GroupLabel:i,Item:s,isSelected:Z=>xe(Z)},JSON.stringify(U));return j.length>S?a.jsx(bt,{list:j,callback:(U,Z)=>P(Z),dir:N}):j.map(P)};return a.jsxs("div",{className:f("wu-flex wu-text-sm wu-gap-2",k==="top"&&"wu-flex-col wu-gap-1",k==="left"&&"wu-flex-row",k==="right"&&"wu-flex-row-reverse",Ke("container")),dir:N,children:[o&&a.jsx(Ce,{htmlFor:y,className:Ke("label"),children:o}),a.jsxs(ze,{open:W,onOpenChange:j=>{G(j),j||setTimeout(()=>{ue("")},100)},modal:V,children:[a.jsx(Od,{CustomTrigger:l,disabled:m,value:I,accessorKey:n,placeholder:M,Chip:d,className:C,handleUnselect:ne,variant:A,id:y,dir:N,...$}),a.jsx(Ie,{className:f("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",Ke("content")),align:"start",sideOffset:-1,style:{maxWidth:D},children:a.jsxs(Er,{id:e.id,shouldFilter:!1,children:[g&&a.jsx(Ld,{value:q,onValueChange:ue}),u,a.jsxs(Ar,{className:f("wu-overflow-y-auto",Ke("list"),E),onScroll:h,style:{maxHeight:F||"420px"},children:[a.jsx(kr,{children:c||"No results found."}),a.jsx(jt,{children:b&&(x==null?void 0:x.enabled)&&!q&&a.jsx(_d,{data:t,value:I,onSelectAll:ae,label:x.label})}),a.jsx(jt,{children:He(B)})]})]})})]})]})},zd=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Ga,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},An=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=f("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),c=d=>{i&&i(d),u&&d.preventDefault()};return a.jsxs(Kt,{onSelect:c,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},qd=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Ha,{...r,children:[a.jsx(Yt,{children:n||e.label}),t]})},$d=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(yd,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ka,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Hd=e=>{const{className:t,...n}=e,r=f("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(En,{...n,className:r})},yt=v.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(Qe.Root,{ref:o,className:f("wu-relative wu-overflow-hidden",e),children:[a.jsx(Qe.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(Pr,{thumbColor:n,railColor:r}),a.jsx(Qe.Corner,{})]}));yt.displayName=Qe.Root.displayName;const Pr=v.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(Qe.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(Qe.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));Pr.displayName=Qe.ScrollAreaScrollbar.displayName;const Ud=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(bd,{...l,open:s,onOpenChange:o,children:[a.jsx(Ua,{dir:u,children:r||n}),a.jsx(gd,{children:a.jsx(ja,{onInteractOutside:c=>c.preventDefault(),children:a.jsx(yt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},jd="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",Fr=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:c,dir:d,Trigger:w,align:h="start",sideOffset:m=0,side:b="bottom",alignOffset:g,className:x,disabled:S,...y}=e;return a.jsxs(Mr,{...y,open:i,onOpenChange:u,dir:d,children:[a.jsx(Ir,{asChild:!0,dir:d,disabled:S,className:f("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Gd(s,o,S)}),a.jsx(Tn,{className:f("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",x,"wu-menu-content"),align:h,sideOffset:m,side:b,alignOffset:g,onInteractOutside:N=>c&&N.preventDefault(),children:a.jsxs(yt,{className:"h-fit",style:{height:l},dir:d,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(Yt,{dir:d,className:"wu-menu-title",children:r||n}),a.jsx(En,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Gd=(e,t,n)=>{const r=f(jd,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:f("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Vr=p.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=f("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:f("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});Vr.displayName="WuMenuIcon";const no={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},ro=Q.Root,so=Q.Trigger,Kd=Q.Portal,Yd=Q.Close,ao=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{ref:n,className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",no.overlay,e),...t}));ao.displayName=Q.Overlay.displayName;const Lr=p.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Kd,{children:[a.jsx(ao,{className:r?"wu-bg-transparent":""}),a.jsxs(Q.Content,{ref:o,className:f("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",no.content,e),...s,children:[t,!n&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wuexp:wu-top-3 wuexp:wu-right-4 wuexp:wu-p-1.5","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Lr.displayName=Q.Content.displayName;const _r=({className:e,...t})=>a.jsx("div",{className:f("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});_r.displayName="DialogHeader";const oo=({className:e,...t})=>a.jsx("div",{className:f("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});oo.displayName="DialogFooter";const xt=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));xt.displayName=Q.Title.displayName;const Xd=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm wu-text-muted-foreground",e),...t}));Xd.displayName=Q.Description.displayName;const Zd={gradientBackground:"_gradientBackground_1bbet_1"},io=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=p.useRef(null);return p.useEffect(()=>{const c=l.current;if(c){c.style.setProperty("--width",`${c.offsetWidth*n}px`),c.style.setProperty("--height",`${c.offsetHeight*n}px`),c.style.setProperty("--colors",t.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const h=m=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const b=c.getBoundingClientRect();let g=m.clientX-b.left,x=m.clientY-b.top;g=Math.max(0,Math.min(g+i.x,b.width)),x=Math.max(0,Math.min(x+i.y,b.height));const S=`radial-gradient(
4
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:a.jsx(Ea,{item:r,dir:t})})},s))})})},Ea=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:f("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),$c=e=>{const[t,n]=p.useState(()=>window.innerWidth<=e);return p.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Hc({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const c=l[u];if(c){c.focus();const d=e[u]||null;n(d)}},s=(u,l,c,d)=>{u.preventDefault();const w=c==="down"?l+1:l-1;r(w,d)},o=(u,l,c,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(u.preventDefault(),r(l+1,c))},i=(u,l)=>{u.preventDefault();const c=e[l]===t?null:e[l];n(c)};return function(l,c,d){const w=document.querySelectorAll("[data-product-category]"),{key:h}=l;switch(h){case"ArrowDown":s(l,c,"down",w);break;case"ArrowUp":s(l,c,"up",w);break;case"Tab":o(l,c,w,d);break;case"Enter":case" ":i(l,c);break}}}const Uc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},jc=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:f(i[t],n),children:r})},Gc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},Kc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:f(o[t],n),children:r})},re=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:f(t,n),role:"presentation","aria-label":t})},Yc=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:f("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:u=>{r&&u.key==="ArrowDown"&&n(u,-1)},"aria-label":"product-switcher",children:[a.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(re,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),se={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},Xc=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=f("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=f("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:f("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[a.jsx("div",{className:se.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},Zc={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},Jc=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=p.useState(e.name===t),l=e.name===n,c=e.name===t,d=!e.active,w="#1b3380",h="#c5cce0",m="#ffcf70",b=f("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),g=f("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),x=i||s===e.name||l?w:h;return a.jsxs("li",{className:f(se.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&se.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&se.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":d,dir:r,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:d?m:x}}),a.jsxs("a",{className:f(se.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:f(g,Zc[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:f(b),children:e.name})]})]},e.name)},Qc=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,c=p.useMemo(()=>u.filter(b=>b.active).sort((b,g)=>(b.order||100)-(g.order||100)),[u]),d=p.useMemo(()=>u.filter(b=>!b.active),[u]),[w,h]=p.useState(i),m=b=>b.map((g,x)=>a.jsx(Jc,{product:g,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},x));return l?a.jsxs(a.Fragment,{children:[m(c),d.length>0&&a.jsxs("li",{className:f(se.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:f(se.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),m(d)]}):a.jsxs("li",{className:f(se.productListItem,se.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:se.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Aa=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:c,setFocusItem:d})=>{const w="#ffcf70",[h,m]=p.useState(window.innerWidth>768);return p.useEffect(()=>{const b=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),a.jsx("ul",{className:f(se.productDropdownMenu,n&&se.productDropdownMenuOpen,t==="rtl"&&se.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((b,g)=>a.jsxs("li",{className:f(se.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===b&&se.open,u&&se.open),onMouseEnter:()=>h&&o(b),onMouseLeave:()=>h&&o(null),"aria-label":b.name,dir:t,onKeyDown:x=>i(x,g),tabIndex:0,"data-product-category":!0,children:[a.jsx(Xc,{category:b,dir:t,openCategory:s}),a.jsx("ul",{className:f(se.productList,t==="rtl"&&se.rtlProductList),dir:t,children:a.jsx(Qc,{category:b,dir:t,activeProductName:l,currentProduct:b.name,focusItem:c,setFocusItem:d,borderColorLocked:w})})]},b.name))})},Rc=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:f("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:f("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:c=>{t&&c.key==="ArrowDown"&&l(c,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),ed=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:f("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"aria-label":"menu-toggle-btn",children:[a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},ka=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),c=p.useRef(null),[d,w]=p.useState(!1),[h,m]=p.useState(null),[b,g]=p.useState(n.base),[x,S]=p.useState(""),[y,N]=p.useState(!1),C=$c(768);br([u,i],()=>{w(!1),m(null)}),br([l,c,u],()=>{N(!1),w(!1),m(null)}),p.useEffect(()=>{const A=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[d]),p.useEffect(()=>g(n.base),[n.base]);const E=A=>{A.preventDefault(),A.stopPropagation(),w(k=>{const D=!k;return D||m(null),D})},M=(A,k)=>{Hc({productCategories:e,openCategory:h,setOpenCategory:m})(A,k,x)};return a.jsx("div",{className:f("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:C?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(ed,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:w,setIsProductButtonShow:N}),a.jsx(Rc,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:n,activeProductBgColor:b,activeProductName:t,handleDropdownToggle:E,smallScreenButtonRef:l,handleKeyDown:M,dir:r}),a.jsx("div",{className:f("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:d?n.hover:b},onMouseOver:()=>g(n.hover),onMouseOut:()=>g(n.base),children:[a.jsx(Yc,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:E,handleKeyDown:M,isDropdownOpen:d}),a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})]})})},Ma=({children:e,dir:t,className:n})=>a.jsx("section",{className:f("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",n),children:a.jsx("div",{className:"wu-grow",children:e})}),vr=v.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:f("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));vr.displayName="Input";const td=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:f("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},nd=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=p.useState(!1);return p.useEffect(()=>{var c;(((c=t==null?void 0:t.current)==null?void 0:c.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:f("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},rd=Me.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),Nn=v.forwardRef(({className:e,...t},n)=>a.jsx(ma.Root,{ref:n,className:f(rd(),e),...t}));Nn.displayName=ma.Root.displayName;const Ce=e=>a.jsx(Nn,{...e,className:f("wu-text-gray-lead wu-leading-6",e.className)}),sd=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const c=f("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),d=f("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:c,dir:o,...u,children:[e,a.jsxs("div",{className:d,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:h,children:t})]})]})},Te=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="top",Icon:s,iconPosition:o,type:i,value:u,variant:l="flat",readonly:c,id:d=vn(),...w}=e,h=Ut(r),m=s?o!=="right"?"wu-pl-8":"wu-pr-8":"",[b,g]=p.useState(!1),x=()=>{g(y=>!y)},S=y=>{w.onChange&&w.onChange(y)};return a.jsx(a.Fragment,{children:i==="submit"?a.jsx(ce,{type:"submit",className:w.className,id:d,children:n||"Submit"}):a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:w.dir,children:a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative",h,(r==="right"||r==="left")&&"wu-items-center","wu-input-wrapper"),children:[s&&o!=="right"&&a.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),a.jsx(vr,{...w,className:f("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",m,w.className),type:b?"text":i,ref:t,readOnly:c,onChange:w.onChange&&S,value:u,id:d}),s&&o==="right"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),i==="password"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:x,children:a.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:b?a.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):a.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),n&&a.jsx(Ce,{htmlFor:d,className:"wu-flex-none wu-w-fit wu-input-label",children:n})]})})})});Te.displayName="WuInput";const ad=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=p.useState(n);return p.useEffect(()=>{i(n)},[n]),a.jsx(Te,{...s,placeholder:t,onChange:u=>r(u.target.value),className:f("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:a.jsx(re,{"data-testid":"search-icon",icon:"wm-search",className:f("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)})})},Ia=qt.Provider,Da=qt.Root,Pa=qt.Trigger,Nr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(qt.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...n}));Nr.displayName=qt.Content.displayName;const Sn=p.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,...c},d)=>a.jsx(Ia,{delayDuration:r||200,children:a.jsxs(Da,{open:u,onOpenChange:l,children:[a.jsx(Pa,{asChild:!0,children:a.jsx("span",{ref:d,children:s})}),a.jsx(dr.Portal,{children:e&&a.jsxs(Nr,{...c,side:t||"top",sideOffset:n||0,className:f("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(dr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Sn.displayName="WuTooltip";const od=({label:e,className:t})=>{const n=p.useRef(null),[r,s]=p.useState(!1);return p.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,c=e.length*l;s(c>i||u>i)}},[e]),a.jsx("p",{ref:n,className:f("wu-w-full wu-truncate",t),children:r?a.jsx(Sn,{content:e,positionOffset:8,children:e}):e})},id=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:c,DataCenter:d}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:f("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Lc((w=r==null?void 0:r.profile)==null?void 0:w.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(ka,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:c})}),a.jsx(Ma,{dir:l,children:s}),a.jsxs("section",{className:f("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(Ta,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Ca,{user:r,onLogout:o,dir:l,DataCenter:d})]})]})})},ze=$t.Root,et=$t.Trigger,Ie=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx($t.Portal,{children:a.jsx($t.Content,{ref:s,align:t,sideOffset:n,className:f("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));Ie.displayName=$t.Content.displayName;function Fa({className:e,classNames:t,dir:n="ltr",...r}){const s=fa.getDefaultClassNames();return a.jsx(fa.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:f("wu-p-3",e),classNames:{root:f(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:f("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:f(s.month_caption,"wu-mb-5"),months:f(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:f(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:f(s.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:f(s.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:f(s.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:f(s.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:f(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:f("rm",s.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:f(s.range_end,"wu-rounded-none"),range_start:f(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:f(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:f(s.button_next,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:f(s.button_previous,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:f(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:f(s.chevron,"!wu-text-red-500"),outside:f(s.outside,"wu-invisible"),disabled:f(s.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...r})}Fa.displayName="Calendar";const Sr=e=>a.jsx(Fa,{...e}),Va=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[s&&a.jsx(ce,{variant:"secondary",onClick:r,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Cr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(Bt.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(ce,{...u,className:f("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),La=(e,t,n,r)=>{const s=K.startOfDay(e).getTime();return!!(t||n&&s<K.startOfDay(n).getTime()||r&&s>K.startOfDay(r).getTime())},Cn=e=>e?typeof e=="string"?new Date(e):e:new Date,Tr="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",ud=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ld=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:c,showResetButton:d=!1,placeholder:w="Select Date",CustomTrigger:h,...m})=>{const[b,g]=p.useState(),[x,S]=p.useState(""),y=p.useCallback(()=>{const C=Cn(b);S(K.format(C,e)),n&&n(b)},[b,e,n]),N=p.useCallback(()=>{c?c():(g(void 0),S(""),n&&n(void 0))},[n,c]);return p.useEffect(()=>{const C=Cn(t);g(C),S(K.format(C,e))},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(ze,{children:[a.jsx(Cr,{formattedString:x,dir:i,placeholder:w,CustomTrigger:h,...m}),a.jsx(Ie,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(Sr,{dir:i,mode:"single",captionLayout:"dropdown",selected:b,onSelect:g,disabled:C=>La(C,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:b,className:f("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(Va,{handleDateChange:y,disabled:r,onReset:N,showResetButton:d})})})]})]})},_a="yyyy-MM-dd",cd=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],dd=({current:e,onSelect:t,presetRanges:n=ud})=>{const[r,s]=p.useState(),[o,i]=p.useState(!1),[u,l]=p.useState(""),[c,d]=p.useState(""),[w,h]=p.useState(!1),m=p.useMemo(()=>n.map(y=>y.value),[n]),b=f("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),g=p.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const N=Number(y)-1;s(N),i(!1),t({from:K.sub(new Date,{days:N}),to:new Date})},[t]),x=p.useCallback((y,N)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Tr).test(y))return!1;const E=new Date(N==="start"?y:e.from),M=new Date(N==="end"?y:e.to);return K.isBefore(M,E)?(h(!0),!1):(h(!1),!(K.isSameDay(E,e.from)&&K.isSameDay(M,e.to)))},[e]),S=p.useCallback((y,N)=>{if((N==="start"?l:d)(y),x(y,N)){const E={from:e==null?void 0:e.from,to:e==null?void 0:e.to};N==="start"&&(E.from=new Date(y)),N==="end"&&(E.to=new Date(y)),t(E)}},[e,t,x]);return p.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&K.isValid(e.to)&&K.isValid(e.from)){l(K.format(e.from,_a)),d(K.format(e.to,_a));const y=K.differenceInCalendarDays(e.to,e.from);K.isToday(e.to)&&m.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,m]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:cd.map(({label:y,value:N})=>a.jsx(mt,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:N!==1,children:y},N))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:N})=>a.jsx("li",{children:a.jsx("button",{className:f(b,r===N-1&&"wu-bg-blue-p/10"),onClick:()=>g(N),children:y})},N)),a.jsx("li",{children:a.jsx("button",{className:f(b,o&&"wu-bg-blue-p/10"),onClick:()=>g(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Te,{placeholder:"Start Date",pattern:Tr,value:u,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Te,{placeholder:"End Date",pattern:Tr,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},wd=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:c,Label:d,labelPosition:w="top",onReset:h,showResetButton:m=!0,placeholder:b="Select Date Range",CustomTrigger:g,...x})=>{const[S,y]=p.useState(t),[N,C]=p.useState(t),[E,M]=p.useState(""),A=p.useCallback(()=>{if(N){const F=N.from,V=N.to;y({from:F,to:V}),M(`${K.format(F,e)} - ${K.format(V,e)}`),n&&n({from:F,to:V})}},[N,e,n]),k=p.useCallback(()=>{C(S)},[S]),D=p.useCallback(()=>{h?h():(y(void 0),C(void 0),M(""),n&&n(void 0))},[h,n]);return p.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const F=Cn(t.from),V=Cn(t.to);y(t),C(t),M(`${K.format(F,e)} - ${K.format(V,e)}`)}else y(void 0),C({to:new Date,from:new Date})},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[d,a.jsxs(ze,{onOpenChange:F=>!F&&k(),children:[a.jsx(Cr,{formattedString:E,dir:i,placeholder:b,CustomTrigger:g,...x}),a.jsxs(Ie,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:i,children:[a.jsx(dd,{current:N,onSelect:C,presetRanges:c}),a.jsx(Sr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:N,onSelect:C,disabled:F=>La(F,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:S==null?void 0:S.from,className:f("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(Va,{handleDateChange:A,disabled:r,onReset:D,showResetButton:m})})]})]})]})},Oa=p.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:f("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});Oa.displayName="WuCard";const Wa=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Wa.displayName="WuCardHeader";const Ba=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Ba.displayName="WuCardHeader";const za=v.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(wr.Root,{ref:r,className:f("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(wr.Indicator,{className:f("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));za.displayName=wr.Root.displayName;const Ae=p.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=vn(),partial:l,onChange:c,required:d,readonly:w,...h}=e;return p.useEffect(()=>{h.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,r]),a.jsxs("div",{className:fd({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[a.jsx(za,{id:u,...h,partial:l,checked:r,disabled:n||w,onCheckedChange:c,className:f("wu-peer wu-checkbox",i),required:d,ref:t}),s&&a.jsx(Ce,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),fd=Me.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});Ae.displayName="WuCheckbox";const pd=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:f("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},Er=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));Er.displayName=ye.Command.displayName;const qa=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(ye.Command.Input,{ref:n,className:f("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));qa.displayName=ye.Command.Input.displayName;const Ar=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.List,{ref:n,className:f("",e),...t}));Ar.displayName=ye.Command.List.displayName;const kr=v.forwardRef((e,t)=>a.jsx(ye.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));kr.displayName=ye.Command.Empty.displayName;const jt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Group,{ref:n,className:f("",e),...t}));jt.displayName=ye.Command.Group.displayName;const $a=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Separator,{ref:n,className:f("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));$a.displayName=ye.Command.Separator.displayName;const Gt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Item,{ref:n,className:f("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));Gt.displayName=ye.Command.Item.displayName;const bt=p.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(gc.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));bt.displayName="WuVirtualScroll";const hd=({tags:e,triggerRef:t})=>{const[n,r]=p.useState([]),[s,o]=p.useState([]),i=p.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,c)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},c))}),[s]),u=l=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=l,document.body.appendChild(c);const d=c.offsetWidth;return document.body.removeChild(c),d+8};return p.useEffect(()=>{const l=()=>{if(t.current){const h=t.current.offsetWidth-20-36;let m=0;const b=[],g=[];e.forEach(x=>{const S=u(x);m+S+8<h?(b.push(x),m+=S+8):g.push(x)}),r(b),o(g)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,c)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},c)),s.length>0&&a.jsx(Sn,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},md=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,className:w,...h})=>{const[m,b]=p.useState([]),g=p.useRef(null);p.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){b([]);return}if(i){const S=n;b(S==null?void 0:S.map(y=>y[o.label]));return}else b([n[o.label]])},[n]);const x=()=>{var S;return m.length?d&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=g.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):a.jsx(hd,{tags:m,triggerRef:g}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(et,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...h,ref:g,disabled:l,className:f("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[x(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Mr=te.Root,Ir=te.Trigger,Ha=te.Group,gd=te.Portal,bd=te.Sub,yd=te.RadioGroup,Ua=v.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(te.SubTrigger,{ref:o,className:f("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:f("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:f("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ua.displayName=te.SubTrigger.displayName;const ja=v.forwardRef(({className:e,...t},n)=>a.jsx(te.SubContent,{ref:n,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));ja.displayName=te.SubContent.displayName;const Tn=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(te.Portal,{children:a.jsx(te.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));Tn.displayName=te.Content.displayName;const Kt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Item,{ref:r,className:f("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Kt.displayName=te.Item.displayName;const Ga=v.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(te.CheckboxItem,{ref:o,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:f("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(te.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ga.displayName=te.CheckboxItem.displayName;const Ka=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(te.RadioItem,{ref:r,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(te.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ka.displayName=te.RadioItem.displayName;const Yt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Label,{ref:r,className:f("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));Yt.displayName=te.Label.displayName;const En=v.forwardRef(({className:e,...t},n)=>a.jsx(te.Separator,{ref:n,className:f("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));En.displayName=te.Separator.displayName;const Ya=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=()=>{e.disabled||r(e)};return a.jsxs(Gt,{onSelect:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(xd,{option:e,accessorKey:s})]})},xd=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Xa=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Gt,{onSelect:r,className:f("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(Ae,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(jt,{children:[a.jsx(Yt,{children:t.label}),t.options.map((l,c)=>p.createElement(Ya,{...i,option:l,key:c}))]});case"divider":return a.jsx($a,{className:"wu-mx-4"});default:return a.jsx(Ya,{...i,option:t})}},vd=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Nd=p.memo(Te),Sd=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:c,onSelect:d,Label:w,maxHeight:h=420,multiple:m=!1,hasGroup:b=!1,selectAll:g,id:x,disabled:S,labelPosition:y="top",className:N,onScroll:C,maxContentWidth:E,enableSearch:M=!0,noDataContent:A,...k})=>{const[D,F]=p.useState(""),[V,$]=p.useState(),[W,G]=p.useState(!1),[q,ue]=p.useState(!1),[I,_]=p.useState(!1),z=p.useRef(null),{allOptions:B,enabledOptions:ne}=p.useMemo(()=>b||g&&!g.includeDisabled?vd(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,b]),ae=p.useMemo(()=>{if(!D)return e;const O=D.toLowerCase();return B.filter(R=>R[t.label].toLowerCase().includes(O))},[D,B,e,t.label]),xe=p.useMemo(()=>m&&g!=null&&g.enable&&!D&&ae.length>0?[{type:"all"},...ae]:ae,[ae,D,m]),He=p.useCallback(O=>{const R=O[t.value];m?$(H=>{const be=H||[],Ne=be.some(me=>me[t.value]===R)?be.filter(me=>me[t.value]!==R):[...be,O];return d==null||d(Ne),Ne}):(G(!1),$(O),d==null||d(O))},[m,t.value,d]),j=p.useCallback(O=>F(O.target.value),[]),P=p.useCallback(()=>F(""),[]);p.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?$(n):r!==void 0&&$(r)},[n,r]),p.useEffect(()=>{if(!m)return;const O=g!=null&&g.includeDisabled?(V==null?void 0:V.length)===B.length:(V==null?void 0:V.length)===ne.length;ue(O);const R=(V==null?void 0:V.length)>0&&!O;_(R)},[V,g]);const U=p.useCallback(()=>{const O=q?[]:g!=null&&g.includeDisabled?B:ne;$(O),d==null||d(O)},[q,m,B,ne,d,g]),Z=Ut(y);return a.jsxs("div",{className:f(Z,"wu-flex wu-combobox-container"),ref:z,children:[a.jsxs(ze,{onOpenChange:O=>{O&&P(),G(O)},open:W,modal:!0,children:[a.jsx(md,{selectedOptions:V,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:c,multiple:m,disabled:S,selectAll:g,isCheckedAll:q,className:N,id:x,...k}),a.jsx(Ie,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:E},children:a.jsxs(Er,{id:x,children:[M&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Nd,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:j,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),s,a.jsxs(Ar,{children:[a.jsx(kr,{children:A||"No results found."}),xe.length>=o?a.jsx(bt,{className:"wu-combobox-list",containerHeight:h,list:xe,callback:(O,R)=>a.jsx(Xa,{option:R,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},O),dir:c}):a.jsx("div",{style:{height:"fit-content",maxHeight:h,overflow:"auto"},className:"wu-combobox-list",onScroll:C,children:xe.map((O,R)=>a.jsx(Xa,{option:O,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},R))})]})]})})]}),w&&a.jsx(Ce,{htmlFor:x,className:"wu-combobox-label",children:w})]})},X={WuContentEditor:"_WuContentEditor_ylyja_8",EditorAction:"_EditorAction_ylyja_70",EditorActionActive:"_EditorActionActive_ylyja_73"},Za=p.createContext(null),Cd=({editor:e,children:t,customFonts:n})=>a.jsx(Za.Provider,{value:{editor:e,customFonts:n},children:t}),he=()=>{const e=p.useContext(Za);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},Dr=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(ga.Root,{ref:s,decorative:n,orientation:t,className:f("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Dr.displayName=ga.Root.displayName;const Pr=({action:e,defaultValue:t})=>{var s;const[n,r]=p.useState();return p.useEffect(()=>{r(t||e.items.find(o=>o.active)||e.items[0])},[e,t]),a.jsxs(zt.DropdownMenu,{children:[a.jsx(zt.DropdownMenuTrigger,{className:f(X.EditorAction,e.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:n==null?void 0:n.icon})}),a.jsx(zt.DropdownMenuContent,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px] wu-border wu-border-blue-p wu-rounded wu-bg-white",align:"start",children:(s=e.items)==null?void 0:s.map(o=>a.jsx(zt.DropdownMenuItem,{onClick:()=>{o.event(),r(o)},title:o.tooltip,children:a.jsx("button",{className:f(X.EditorAction,o.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:o.icon})})},o.id))})]})},Td=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isParagraph:(s=r.editor)==null?void 0:s.isActive("paragraph"),isH1:(o=r.editor)==null?void 0:o.isActive("heading",{level:1}),isH2:(i=r.editor)==null?void 0:i.isActive("heading",{level:2}),isH3:(u=r.editor)==null?void 0:u.isActive("heading",{level:3}),isH4:(l=r.editor)==null?void 0:l.isActive("heading",{level:4}),isStyle:(c=r.editor)==null?void 0:c.isActive("heading")}}}),n=[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run(),active:t.isParagraph},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run(),active:t.isH1},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run(),active:t.isH2},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run(),active:t.isH3},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run(),active:t.isH4}];return a.jsx(Pr,{action:{id:"style",active:t.isStyle,icon:"wm-format-paragraph",items:n},defaultValue:n.find(r=>r.active)})},Ed=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:({editor:n})=>({textColor:n.getAttributes("textStyle").color})});return a.jsxs("label",{className:X.EditorAction,htmlFor:"text-color",title:"Text Color",children:[a.jsx(re,{icon:"wm-format-color-text",className:"wu-cursor-pointer",style:{color:t.textColor}}),a.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"text-color",defaultValue:"#545E6B",onChange:n=>e.chain().focus().setColor(n.target.value).run()})]})},Ad=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isUl:(s=r.editor)==null?void 0:s.isActive("bulletList"),isOl:(o=r.editor)==null?void 0:o.isActive("orderedList"),isTodo:(i=r.editor)==null?void 0:i.isActive("taskList"),isList:((u=r.editor)==null?void 0:u.isActive("bulletList"))||((l=r.editor)==null?void 0:l.isActive("orderedList"))||((c=r.editor)==null?void 0:c.isActive("taskList"))}}}),n=[{id:"ul",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run(),active:t.isUl,tooltip:"Bulleted List"},{id:"ol",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run(),active:t.isOl,tooltip:"Numbered List"},{id:"todo",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run(),active:t.isTodo,tooltip:"To-Do List"}];return a.jsx(Pr,{action:{id:"style",active:t.isList,icon:"wm-format-paragraph",items:n}})},kd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c,d;return{isLeft:(s=r.editor)==null?void 0:s.isActive({textAlign:"left"}),isCenter:(o=r.editor)==null?void 0:o.isActive({textAlign:"center"}),isRight:(i=r.editor)==null?void 0:i.isActive({textAlign:"right"}),isJustify:(u=r.editor)==null?void 0:u.isActive({textAlign:"justify"}),isAligned:((l=r.editor)==null?void 0:l.isActive({textAlign:"center"}))||((c=r.editor)==null?void 0:c.isActive({textAlign:"right"}))||((d=r.editor)==null?void 0:d.isActive({textAlign:"justify"}))}}}),n=[{id:"left",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run(),tooltip:"Align Left",active:t.isLeft},{id:"center",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run(),tooltip:"Align Center",active:t.isCenter},{id:"right",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run(),tooltip:"Align Right",active:t.isRight},{id:"justify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",active:t.isJustify}];return a.jsx(Pr,{action:{id:"style",active:t.isAligned,icon:"wm-format-paragraph",items:n}})},Md=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>({code:n.editor.isActive("code")})});return a.jsx("button",{title:"Code line",className:f(X.EditorAction,(t==null?void 0:t.code)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleCode().run,children:a.jsx(re,{icon:"wm-code"})})},Id=()=>{const{editor:e}=he(),t=[{id:"clear",icon:"wm-format-clear",event:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),tooltip:"Clear Formatting"}];return a.jsx(a.Fragment,{children:t.map(n=>a.jsx("button",{title:n.tooltip,className:f(X.EditorAction),onClick:n.event,children:a.jsx(re,{icon:n.icon})},n.id))})},Dd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{blockquote:(r=n.editor)==null?void 0:r.isActive("blockquote")}}});return a.jsx("button",{title:"quote",className:f(X.EditorAction,(t==null?void 0:t.quote)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleBlockquote().run,children:a.jsx(re,{icon:"wm-format-quote"})})},Pd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{superscript:(r=n.editor)==null?void 0:r.isActive("superscript")}}});return a.jsx("button",{title:"Superscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSuperscript().run,children:a.jsx(re,{icon:"wm-superscript"})})},Fd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{subscript:(r=n.editor)==null?void 0:r.isActive("subscript")}}});return a.jsx("button",{title:"Subscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSubscript().run,children:a.jsx(re,{icon:"wm-subscript"})})},Vd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{bold:(r=n.editor)==null?void 0:r.isActive("bold")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleBold().run,children:a.jsx(re,{icon:"wm-format-bold"})})},Ld=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{italic:(r=n.editor)==null?void 0:r.isActive("italic")}}});return a.jsx("button",{title:"Italic",className:f(X.EditorAction,(t==null?void 0:t.italic)&&X.EditorActionActive),onClick:e.chain().focus().toggleItalic().run,children:a.jsx(re,{icon:"wm-format-italic"})})},_d=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{underline:(r=n.editor)==null?void 0:r.isActive("underline")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleUnderline().run,children:a.jsx(re,{icon:"wm-format-underlined"})})},Od=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{strikethrough:(r=n.editor)==null?void 0:r.isActive("strike")}}});return a.jsx("button",{title:"strikethrough",className:f(X.EditorAction,(t==null?void 0:t.strikethrough)&&X.EditorActionActive),onClick:e.chain().focus().toggleStrike().run,children:a.jsx(re,{icon:"wm-format-strikethrough"})})},Ja={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},Qa=Q.Root,Ra=Q.Trigger,Wd=Q.Portal,Bd=Q.Close,eo=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{ref:n,className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",Ja.overlay,e),...t}));eo.displayName=Q.Overlay.displayName;const Fr=p.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Wd,{children:[a.jsx(eo,{className:r?"wu-bg-transparent":""}),a.jsxs(Q.Content,{ref:o,className:f("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",Ja.content,e),...s,children:[t,!n&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wuexp:wu-top-3 wuexp:wu-right-4 wuexp:wu-p-1.5","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Fr.displayName=Q.Content.displayName;const Vr=({className:e,...t})=>a.jsx("div",{className:f("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Vr.displayName="DialogHeader";const to=({className:e,...t})=>a.jsx("div",{className:f("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});to.displayName="DialogFooter";const yt=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));yt.displayName=Q.Title.displayName;const zd=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm wu-text-muted-foreground",e),...t}));zd.displayName=Q.Description.displayName;const qd={gradientBackground:"_gradientBackground_1bbet_1"},no=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=p.useRef(null);return p.useEffect(()=>{const c=l.current;if(c){c.style.setProperty("--width",`${c.offsetWidth*n}px`),c.style.setProperty("--height",`${c.offsetHeight*n}px`),c.style.setProperty("--colors",t.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const h=m=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const b=c.getBoundingClientRect();let g=m.clientX-b.left,x=m.clientY-b.top;g=Math.max(0,Math.min(g+i.x,b.width)),x=Math.max(0,Math.min(x+i.y,b.height));const S=`radial-gradient(
5
5
  var(--width) var(--height) ellipse at ${g}px ${x}px,
6
6
  var(--colors)
7
- )`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:f(Zd.gradientBackground,"wu-transform-gpu",s),...u,children:r})},uo="calc(100vh - 64px)",Jd={sm:"400px",md:"600px",lg:"1200px"},kn=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:c,className:d,style:w,variant:h="action",...m})=>{const b={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(ro,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(so,{asChild:!0,children:e}),a.jsxs(Lr,{style:{width:"calc(100% - 64px)",maxWidth:l||Jd[n],maxHeight:c||uo,...w},hideCloseButton:r,onInteractOutside:g=>s&&g.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":h,className:f("wu-group wuexp:wu-rounded-[1.1rem]",d),...m,children:["data-theme"in m&&a.jsx(io,{colors:b[h],strokeWidth:4,className:f("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:c||uo},children:t}),!("data-theme"in m)&&t]})]})},Mn=({children:e,className:t,...n})=>a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...n,children:e}),Qd=({children:e,className:t,...n})=>a.jsx(_r,{...n,"data-variant":"action",className:f("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",t),children:a.jsx(xt,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Rd=({children:e,className:t,...n})=>a.jsx(oo,{...n,className:f("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",t),children:e}),Ye=({children:e,className:t,...n})=>{const r=p.useRef(null);return a.jsx(Yd,{asChild:!0,children:a.jsx(ce,{className:t,ref:r,...n,children:e})})},ew=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,width:w,...h})=>{const[m,b]=p.useState(""),[g,x]=p.useState(e);p.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){x(e),b("");return}const y=r.label;if(n&&Array.isArray(t)){const N=t.map(C=>C[y]).join(", ");b(N)}else!n&&!Array.isArray(t)&&b(t[y])},[t,r.label,n,e]);const S=()=>e&&!m?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:g}):a.jsx("span",{className:f("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:d?(c==null?void 0:c.triggerText)??m:m});return a.jsx(Ir,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...h,disabled:l,className:f("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",h.className),children:[i??S(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},lo=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=d=>{e.disabled||(r(e),n&&d.preventDefault())};return a.jsxs(Kt,{onClick:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(co,{option:e,accessorKey:s})]})},co=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},wo=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Kt,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Ae,{"data-partial":s,checked:r||s,partial:s}),a.jsx(co,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Ha,{dir:o.dir,children:[a.jsx(Yt,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>p.createElement(lo,{...o,option:u,key:l}))]});case"divider":return a.jsx(En,{className:"wu-mx-4"});default:return a.jsx(lo,{...o,option:t})}},tw=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},nw=100,rw=400,fo=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:c,virtualizedThreshold:d=nw,maxHeight:w=rw,hasGroup:h=!1,Header:m,CustomTrigger:b,selectAll:g,disabled:x,labelPosition:S="top",onScroll:y,maxContentWidth:N,...C})=>{const[E,M]=p.useState(),A=p.useRef(null),[k,D]=p.useState(!1),[F,V]=p.useState(!1),{cleanData:$,enabledOptions:W}=h||g!=null&&g.enable?tw(e):{cleanData:e,enabledOptions:[]},G=p.useMemo(()=>n&&g!=null&&g.enable&&e.length>0?[{type:"all",[o.label]:g.label||"Select All"},...e]:e,[e,g,n]),q=p.useCallback(z=>{const B=z[o.value];if(n)M((ne=[])=>{const ae=ne,He=ae.some(j=>j[o.value]===B)?ae.filter(j=>j[o.value]!==B):[...ae,z];return t==null||t(He),He});else{const ne=z;M(ne),t==null||t(ne)}},[n,o.value,t]);p.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&M(void 0),r!==void 0&&M(r),s!==void 0&&M(s)},[r,s]);const ue=G.length>d;p.useEffect(()=>{if(!n)return;const z=g!=null&&g.includeDisabled?(E==null?void 0:E.length)===e.length:(E==null?void 0:E.length)===W.length;D(z);const B=(E==null?void 0:E.length)>0&&!z;V(B)},[E,g]);const I=p.useCallback(()=>{const z=k?[]:g!=null&&g.includeDisabled?h?$:e:W;M(z),t==null||t(z)},[k,n,e,W,t,g]),_=Ut(S);return a.jsxs("div",{className:f(_,"wu-flex wu-select-container"),ref:A,dir:u,children:[a.jsxs(Mr,{children:[a.jsx(ew,{...C,value:E,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:b,id:C.id,disabled:x,selectAll:g,isCheckedAll:k}),a.jsxs(Tn,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:C.id,style:{maxWidth:N},children:[m,ue?a.jsx(bt,{list:G,containerHeight:w,callback:(z,B)=>a.jsx(wo,{option:B,accessorKey:o,multiple:n,onSelect:q,value:E,dir:u,handleSelectAll:I,isCheckedAll:k,isPartialSelected:F}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:G.map((z,B)=>a.jsx(wo,{option:z,accessorKey:o,multiple:n,onSelect:q,value:E,handleSelectAll:I,isCheckedAll:k,dir:u,isPartialSelected:F},`${B}`))})]})]}),c&&a.jsx(Ce,{htmlFor:C.id,className:"wu-select-label",children:c})]})},In=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sw=({value:e,onChange:t,min:n=K.sub(new Date,{years:5}),max:r=K.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:c,disabledMonths:d=[],...w})=>{const[h,m]=p.useState(null),[b,g]=p.useState(""),[x,S]=p.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=p.useMemo(()=>{const C=new Date(n).getFullYear(),E=new Date(r).getFullYear();return Array.from({length:E-C+1},(M,A)=>({value:E-A,label:E-A}))},[n,r]);p.useEffect(()=>{if(e){const C=new Date(e),E=C.getFullYear(),M=C.getMonth();m({year:E,month:M}),g(`${In[M]} ${E}`),S({value:E,label:E})}},[e]);const N=()=>{h&&t&&(t(new Date(h.year,h.month,15)),g(`${In[h.month]} ${h.year}`))};return a.jsxs("div",{className:f("wu-flex wu-flex-col wu-items-center",Ut(i),i==="top"&&"wu-items-start"),children:[a.jsxs(ze,{children:[a.jsx(Cr,{...w,disabled:u||c,id:l,dir:"ltr",placeholder:s,formattedString:b}),a.jsxs(Ie,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(fo,{data:y,accessorKey:{value:"value",label:"label"},value:x,onSelect:C=>S(C),multiple:!1,maxHeight:224})}),a.jsx(aw,{year:x==null?void 0:x.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(C,E)=>m({year:E,month:C}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:N,children:"Apply"})})})]})]}),o&&a.jsx(Ce,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},aw=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=p.useMemo(()=>{const c=new Set;return s.forEach(d=>{const w=typeof d=="string"?new Date(d):d;c.add(`${w.getFullYear()}-${w.getMonth()}`)}),c},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:In.map((c,d)=>{const w=e===i&&d===u,h=t===d&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${d}`),onClick:()=>r(d,e),className:f("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",h&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${In[d]} ${e}`,"data-month":d,"data-year":e,children:c},c)})})},po=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=p.useState([]),[u,l]=p.useState([]);return p.useEffect(()=>{const c=()=>{var b,g;const d=((b=t.current)==null?void 0:b.clientWidth)||0,w=((g=n.current)==null?void 0:g.clientWidth)||0,h=d-w,m=Math.floor(h/r);i(e.slice(0,m)),l(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,r]),[o,u]},ho={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},ow=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((d,w)=>p.cloneElement(d,{className:f(ho.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:w})),[t]),i=p.useRef(null),u=p.useRef(null),[l,c]=po(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),c.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(ho.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},Or={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},iw=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((w,h)=>p.cloneElement(w.link,{key:h,className:f(Or.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[p.cloneElement(w.imgOrIcon,{className:f("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),[c,d]=po(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:f(Or.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:c}),d.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(Or.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},mo=p.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,c]=p.useState(t),[d,w]=p.useState(n);p.useEffect(()=>{c(t),w(n)},[t,n]);const h=Math.ceil(e/d),m=l*d+1,b=Math.min((l+1)*d,e),g=Array.from({length:h},(y,N)=>N),x=p.useCallback(y=>{y>=0&&y<h&&(c(y),r==null||r(y))},[h,r]),S=224;return a.jsxs("div",{className:f("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(go,{label:"Previous page",onClick:()=>x(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Fr,{name:`${m} - ${b}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(yt,{style:{maxHeight:S+"px"},dir:i.dir,children:g.length>100?a.jsx(bt,{className:"wu-pagination-list",containerHeight:S,list:g,callback:(y,N)=>a.jsxs(An,{onSelect:()=>x(N),className:f("wu-py-2",N===l&&"wu-bg-gray-20","wu-pagination-item"),children:[N*d+1," -"," ",Math.min((N+1)*d,e)]},y)}):g.map(y=>a.jsxs(An,{onSelect:()=>x(y),className:f(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*d+1," -"," ",Math.min((y+1)*d,e)]},y))})}),a.jsx(go,{label:"Next page",onClick:()=>x(l+1),disabled:l===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});mo.displayName="WuPagination";const go=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(ce,{variant:"iconOnly",onClick:t,disabled:n,className:f("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:f("wu-text-sm",r)})}),uw=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(ze,{open:s,onOpenChange:o,modal:i,children:[a.jsx(et,{asChild:!0,dir:r,children:e}),a.jsx(Ie,{className:f("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),lw=e=>a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{...e})}),bo=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Root,{className:f("wu-grid wu-gap-2",e),...t,ref:n}));bo.displayName=Ht.Root.displayName;const yo=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Item,{ref:n,className:f("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(Ht.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));yo.displayName=Ht.Item.displayName;const xo=p.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(bo,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:f("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Nn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(yo,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Nn,{htmlFor:l.value,className:f(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});xo.displayName="WuRadioGroup";const cw=e=>{const{children:t,...n}=e;return a.jsxs(yt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Pr,{orientation:"horizontal"})]})},Wr=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(ga.Root,{ref:s,decorative:n,orientation:t,className:f("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Wr.displayName=ga.Root.displayName;function vo({className:e,...t}){return a.jsx("div",{className:f("animate-pulse rounded-md bg-muted",e),...t})}const Br=768;function No(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Br-1}px)`),r=()=>{t(window.innerWidth<Br)};return n.addEventListener("change",r),t(window.innerWidth<Br),()=>n.removeEventListener("change",r)},[]),!!e}const dw="sidebar_state",ww=3600*24*7,fw="256px",pw="256px",hw="3rem",mw="b",So=v.createContext(null);function tt(){const e=v.useContext(So);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Co=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=No(),[c,d]=v.useState(!1),[w,h]=v.useState(l?!0:e),m=t??w,b=v.useCallback(y=>{const N=typeof y=="function"?y(m):y;n?n(N):h(N),document.cookie=`${dw}=${N}; path=/; max-age=${ww}`},[n,m]),g=v.useCallback(()=>l?d(y=>!y):b(y=>!y),[l,b,d]);v.useEffect(()=>{const y=N=>{N.key===mw&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:m,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,b,l,c,d,g]);return a.jsx(So.Provider,{value:S,children:a.jsx(Ia,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":fw,"--sidebar-width-icon":hw,...s},className:f("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Co.displayName="SidebarProvider";const To=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:c,setOpenMobile:d}=tt();return n==="none"?a.jsx("div",{className:f("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(Za,{open:c,onOpenChange:d,...o,children:a.jsx(Dr,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":pw},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:f("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:f("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});To.displayName="Sidebar";const Eo=v.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=tt();return a.jsxs(mt,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:f("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Eo.displayName="SidebarTrigger";const gw=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=tt();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:f("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});gw.displayName="SidebarRail";const Ao=v.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:f("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));Ao.displayName="SidebarInset";const bw=v.forwardRef(({className:e,...t},n)=>a.jsx(vr,{ref:n,"data-sidebar":"input",className:f("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));bw.displayName="SidebarInput";const ko=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:f("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));ko.displayName="SidebarHeader";const Mo=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:f("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Mo.displayName="SidebarFooter";const yw=v.forwardRef(({className:e,...t},n)=>a.jsx(Wr,{ref:n,"data-sidebar":"separator",className:f("wu-mx-2 wu-w-auto",e),...t}));yw.displayName="SidebarSeparator";const Io=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:f("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Io.displayName="SidebarContent";const Do=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:f("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Do.displayName="SidebarGroup";const Po=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:f("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});Po.displayName="SidebarGroupLabel";const xw=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:f("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});xw.displayName="SidebarGroupAction";const Fo=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:f("wu-w-full wu-text-sm",e),...t}));Fo.displayName="SidebarGroupContent";const zr=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:f("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));zr.displayName="SidebarMenu";const Vo=v.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:f("wu-group/menu-item wu-relative",e),...t}));Vo.displayName="SidebarMenuItem";const vw=Me.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),Lo=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?ft.Slot:"button",{isMobile:c,state:d}=tt(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:f(vw({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Da,{children:[a.jsx(Pa,{asChild:!0,children:w}),a.jsx(Nr,{side:"right",align:"center",hidden:d!=="collapsed"||c,...s})]})):w});Lo.displayName="SidebarMenuButton";const Nw=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?ft.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:f("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});Nw.displayName="SidebarMenuAction";const Sw=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:f("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Sw.displayName="SidebarMenuBadge";const Cw=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:f("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(vo,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(vo,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});Cw.displayName="SidebarMenuSkeleton";const Tw=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:f("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Tw.displayName="SidebarMenuSub";const Ew=v.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));Ew.displayName="SidebarMenuSubItem";const Aw=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?ft.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:f("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Aw.displayName="SidebarMenuSubButton";const kw=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Co,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(To,{variant:"sidebar",collapsible:"icon",className:f("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(ko,{className:"wu-py-2",children:a.jsx(_o,{})}),t]}),a.jsx(Ao,{className:"wu-contain-inline-size",children:e})]}),_o=e=>{const{state:t,isMobile:n,openMobile:r}=tt();return a.jsx(Eo,{...e,children:a.jsx(Vr,{showMenu:n?r:t==="expanded"})})},Mw=({className:e,children:t,...n})=>{const r=p.useRef(null),s=p.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:c,scrollHeight:d}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+c!==d)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Io,{...n,className:f("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(yt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Iw=e=>a.jsx(Mo,{...e,children:e.children}),Dw=({label:e,children:t,...n})=>a.jsxs(Do,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Po,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Fo,{children:a.jsx(zr,{children:t})})]}),Pw=e=>a.jsx(zr,{...e}),Fw=({Icon:e,children:t,className:n,isActive:r,...s})=>{const{state:o}=tt(),[i,u]=p.useState(),l=No(),c=t&&p.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,a.jsx("span",{className:f("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t.props.children})]})}),d=p.useRef(null);return p.useEffect(()=>{var w;u(((w=d.current)==null?void 0:w.textContent)||"")},[]),a.jsx(Vo,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Lo,{className:f("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:!0,ref:d,children:c})})},Vw=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),qr=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},Lw=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Vw.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},Xt={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},_w=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,c={border:l?`4px solid ${qr(r,Xt.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:qr(r,s*Xt.LIGHTNESS_STEP),fontSize:l?Xt.FONT_SIZE_ACTIVE:Xt.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:qr(r,45+s*6),height:Xt.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:f("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:c,...i,children:[a.jsx("div",{style:d,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},Ow=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(ro,{open:o,onOpenChange:i,children:[a.jsx(so,{className:f("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(Lr,{className:f("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(xt,{}),a.jsx(pa.DialogClose,{className:f("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(re,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(_r,{className:f("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})};function Ww({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=v.useRef(e!==void 0),[o,i]=v.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){v.useEffect(()=>{s!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
8
- `))},[r,n,e]);const{current:c}=v.useRef(t);v.useEffect(()=>{!s&&JSON.stringify(c)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
9
- `))},[JSON.stringify(t)])}const l=v.useCallback(c=>{s||i(c)},[]);return[u,l]}const Oo={};function vt(e,t){const n=v.useRef(Oo);return n.current===Oo&&(n.current=e(t)),n}const $r=v[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Bw=$r&&$r!==v.useLayoutEffect?$r:e=>e();function De(e){const t=vt(zw).current;return t.next=e,Bw(t.effect),t.trampoline}function zw(){const e={next:void 0,callback:qw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function qw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const $w=[];function Wo(e){v.useEffect(e,$w)}const Zt=0;class Dn{constructor(){yn(this,"currentId",Zt);yn(this,"clear",()=>{this.currentId!==Zt&&(clearTimeout(this.currentId),this.currentId=Zt)});yn(this,"disposeEffect",()=>this.clear)}static create(){return new Dn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Zt,n()},t)}isStarted(){return this.currentId!==Zt}}function Bo(){const e=vt(Dn.create).current;return Wo(e.disposeEffect),e}const zo=0;class Hr extends Dn{constructor(){super(...arguments);yn(this,"clear",()=>{this.currentId!==zo&&(clearInterval(this.currentId),this.currentId=zo)})}static create(){return new Hr}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function Hw(){const e=vt(Hr.create).current;return Wo(e.disposeEffect),e}const Pe=typeof document<"u"?v.useLayoutEffect:()=>{};function qo(e){const t=vt(Uw,e).current;return t.next=e,Pe(t.effect),t}function Uw(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jw(){const[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}function Ur(e,t,n,r){const s=vt($o).current;return Kw(s,e,t,n,r)&&Ho(s,[e,t,n,r]),s.callback}function Gw(e){const t=vt($o).current;return Yw(t,e)&&Ho(t,e),t.callback}function $o(){return{callback:null,cleanup:null,refs:[]}}function Kw(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function Yw(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Ho(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Xw={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Uo(){return typeof window<"u"}function jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zw(e){return Uo()?e instanceof Element||e instanceof jr(e).Element:!1}function Jw(e){return Uo()?e instanceof HTMLElement||e instanceof jr(e).HTMLElement:!1}function Qw(e){return(e==null?void 0:e.ownerDocument)||document}const Pn=typeof navigator<"u",Gr=nf(),Rw=sf(),ef=rf();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const tf=Gr.platform==="MacIntel"&&Gr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Gr.platform);Pn&&Rw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,ef.includes("jsdom/");function nf(){if(!Pn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function rf(){if(!Pn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function sf(){if(!Pn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Fn(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const Kr=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kr.displayName="NumberFieldRootContext");function Vn(){const e=v.useContext(Kr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Fn(43));return e}function Fe(){}const qe=Object.freeze({});let jo=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const af={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},of={valid(e){return e===null?null:e?{[jo.valid]:""}:{[jo.invalid]:""}}},Go=v.createContext({invalid:void 0,name:void 0,validityData:{state:af,errors:[],error:"",value:"",initialValue:null},setValidityData:Fe,disabled:void 0,touched:!1,setTouched:Fe,dirty:!1,setDirty:Fe,filled:!1,setFilled:Fe,focused:!1,setFocused:Fe,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=qe)=>e,getInputValidationProps:(e=qe)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Go.displayName="FieldRootContext");function Yr(e=!0){const t=v.useContext(Go);if(t.setValidityData===Fe&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fn(28));return t}const uf={...v};let Ko=0;function lf(e,t="mui"){const[n,r]=v.useState(e),s=e||n;return v.useEffect(()=>{n==null&&(Ko+=1,r(`${t}-${Ko}`))},[n,t]),s}const Yo=uf.useId;function cf(e,t){if(Yo!==void 0){const n=Yo();return e??(t?`${t}-${n}`:n)}return lf(e,t)}function df(e){return cf(e,"base-ui")}const Xo=v.createContext({controlId:void 0,setControlId:Fe,labelId:void 0,setLabelId:Fe,messageIds:[],setMessageIds:Fe,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Xo.displayName="LabelableContext");function Zo(){return v.useContext(Xo)}function wf(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,setControlId:o}=Zo(),i=df(t);return Pe(()=>{if(!(!n&&!t||o===Fe)){if(n){const u=r==null?void 0:r.current;Zw(u)&&u.closest("label")!=null?o(t??null):o(s??i)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,r,s,o,n,i]),s??i}const Jt={inputValue:()=>null,value:()=>null},ff=parseInt(v.version,10);function pf(e){return ff>=e}function Jo(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(pf(19)?n==null?void 0:n.ref:t.ref)??null}function Xr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function hf(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function mf(e,t){return typeof e=="function"?e(t):e}function gf(e,t){return typeof e=="function"?e(t):e}const Qt={};function Qo(e,t,n,r,s){let o={...Zr(e,Qt)};return t&&(o=Ln(o,t)),n&&(o=Ln(o,n)),r&&(o=Ln(o,r)),o}function bf(e){if(e.length===0)return Qt;if(e.length===1)return Zr(e[0],Qt);let t={...Zr(e[0],Qt)};for(let n=1;n<e.length;n+=1)t=Ln(t,e[n]);return t}function Ln(e,t){return Ro(t)?t(e):yf(e,t)}function yf(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Xr(e.style,r);break}case"className":{e[n]=ei(e.className,r);break}default:xf(n,r)?e[n]=vf(e[n],r):e[n]=r}}return e}function xf(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Ro(e){return typeof e=="function"}function Zr(e,t){return Ro(e)?e(t):e??Qt}function vf(e,t){return t?e?n=>{if(Nf(n)){const s=n;Jr(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function Jr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ei(e,t){return t?e?t+" "+e:t:e}function Nf(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Rt(e,t,n={}){const r=t.render,s=Sf(t,n);if(n.enabled===!1)return null;const o=n.state??qe;return Cf(e,r,s,o)}function Sf(e,t={}){const{className:n,style:r,render:s}=e,{state:o=qe,ref:i,props:u,stateAttributesMapping:l,enabled:c=!0}=t,d=c?mf(n,o):void 0,w=c?gf(r,o):void 0,h=c?hf(o,l):qe,m=c?Xr(h,Array.isArray(u)?bf(u):u)??qe:qe;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=Gw([m.ref,Jo(s),...i]):m.ref=Ur(m.ref,Jo(s),i):Ur(null,null)),c?(d!==void 0&&(m.className=ei(m.className,d)),w!==void 0&&(m.style=Xr(m.style,w)),m):qe}function Cf(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Qo(n,t.props);return s.ref=n.ref,v.cloneElement(t,s)}if(e&&typeof e=="string")return Tf(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Fn(8))}function Tf(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}const ti=new Map;function en(e,t){const n=JSON.stringify({locale:e,options:t}),r=ti.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return ti.set(n,s),s}function Nt(e,t,n){return e==null?"":en(t,n).format(e)}function ni(e,t,n){return Nt(e,t,{...n,maximumFractionDigits:20})}const Ef=["零","〇","一","二","三","四","五","六","七","八","九"],Af={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},ri=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],si=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Qr=["0","1","2","3","4","5","6","7","8","9"],ai=["%","٪","%","﹪"],oi=["‰","؉"],ii=["−","-","‒","–","—","﹣"],ui=["+","﹢"],kf=".",Mf=",",If=new RegExp(`[${ri.join("")}]`,"g"),Df=new RegExp(`[${si.join("")}]`,"g"),Pf=new RegExp(`[${Qr.join("")}]`,"g"),Ff=new RegExp(`[${Ef.join("")}]`,"g"),Vf=new RegExp(`[${ai.join("")}]`),Lf=new RegExp(`[${oi.join("")}]`),Rr=/[٠١٢٣٤٥٦٧٨٩]/,li=/[۰۱۲۳۴۵۶۷۸۹]/,es=/[零〇一二三四五六七八九]/,ci=new RegExp(`[${Qr.join("")}]`),_f=[".",",",kf,Mf,"٫","٬"],di=new RegExp("\\p{Zs}","u"),Of=["+",...ui],Wf=["-",...ii],_n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Bf=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),wi=e=>`[${e.map(Bf).join("")}]`,fi=wi(["-"].concat(ii)),pi=wi(["+"].concat(ui)),hi=new RegExp(fi,"gu"),mi=new RegExp(pi,"gu"),tn=new RegExp(fi),On=new RegExp(pi);function ts(e,t){const n=en(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),en(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function St(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(hi,"-").replace(mi,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Rr.test(r)||li.test(r)?u="ar":es.test(r)&&(u="zh"));const{group:l,decimal:c,currency:d}=ts(u,n),w=en(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>_n(A.value)),h=w.length?new RegExp(w.join("|"),"g"):null;let m=null;l&&(new RegExp("\\p{Zs}","u").test(l)?m=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?m=/['’]/g:m=new RegExp(_n(l),"g"));let g=[{regex:l?m:null,replacement:""},{regex:c?new RegExp(_n(c),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(_n(d),"g"):null,replacement:""},{regex:h,replacement:""},{regex:If,replacement:A=>String(ri.indexOf(A))},{regex:Df,replacement:A=>String(si.indexOf(A))},{regex:Pf,replacement:A=>String(Qr.indexOf(A))},{regex:Ff,replacement:A=>Af[A]}].reduce((A,{regex:k,replacement:D})=>k?A.replace(k,D):A,r);const x=g.lastIndexOf(".");if(x!==-1&&(g=`${g.slice(0,x).replace(/\./g,"")}.${g.slice(x+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const S=(s?"-":"")+g;let y=parseFloat(S);const N=n==null?void 0:n.style,C=N==="unit"&&(n==null?void 0:n.unit)==="percent",E=Vf.test(e)||N==="percent";return Lf.test(e)?y/=1e3:!C&&E&&(y/=100),Number.isNaN(y)?null:y}const zf=60,qf=400,$f=50,Hf=3,Uf=8,Wn=1;function jf(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Gf=1e-10;function Kf(e){const t=en("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Yf(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function ns(e,t){const{maximumFractionDigits:n}=Kf(t);return Yf(e,n)}function Xf(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Gf*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let c;return r==="nearest"?c=Math.round(l):o>0?c=Math.floor(l):c=Math.ceil(l),t+c*(r==="nearest"?n:s)}function Zf(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u}){if(e===null)return e;const l=jf(e,n,r);if(t!=null&&i){if(t===0)return ns(l,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const d=Xf(l,c,t,u?"nearest":"directional");return ns(d,o)}return ns(l,o)}const Jf="none",gi="input-change",rs="input-clear",bi="input-blur",Qf="input-paste",nn="keyboard";function Ve(e,t,n,r){let s=!1,o=!1;const i=r??qe;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function rn(e,t,n){const r=qe;return{reason:e,event:t??new Event("base-ui"),...r}}const yi=v.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:c=!1,disabled:d=!1,readOnly:w=!1,name:h,defaultValue:m,value:b,onValueChange:g,onValueCommitted:x,allowWheelScrub:S=!1,snapOnStep:y=!1,format:N,locale:C,render:E,className:M,inputRef:A,...k}=t,{setDirty:D,validityData:F,disabled:V,setFilled:$,invalid:W,name:G,state:q,validation:ue,shouldValidateOnChange:I}=Yr(),_=V||d,z=G??h,[B,ne]=v.useState(!1),ae=s??Number.MIN_SAFE_INTEGER,xe=o??Number.MAX_SAFE_INTEGER,He=s??0,j=N==null?void 0:N.style,P=v.useRef(null),U=Ur(A,ue.inputRef),Z=wf({id:r}),[O,R]=Ww({controlled:b,default:m,name:"NumberField",state:"value"}),H=O??null,be=qo(H);Pe(()=>{$(H!==null)},[$,H]);const ve=jw(),Ne=qo(N),me=v.useRef(!1),Oe=De((J,Y)=>{me.current=!1,x==null||x(J,Y)}),Ge=Bo(),Vt=Hw(),Lt=Bo(),ir=v.useRef(!1),ur=v.useRef(0),ct=v.useRef(!0),_t=v.useRef(null),dt=v.useRef(()=>{}),[oe,Ue]=v.useState(()=>b!==void 0?xi(H,C,N):Nt(H,C,N)),[lr,uy]=v.useState("numeric"),cc=De(()=>{const{decimal:J,group:Y,currency:le,literal:fe}=ts(C,N),ee=new Set;_f.forEach(Ee=>ee.add(Ee)),J&&ee.add(J),Y&&(ee.add(Y),di.test(Y)&&ee.add(" "));const We=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="percent",bn=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="permille";return We&&ai.forEach(Ee=>ee.add(Ee)),bn&&oi.forEach(Ee=>ee.add(Ee)),j==="currency"&&le&&ee.add(le),fe&&(Array.from(fe).forEach(Ee=>ee.add(Ee)),di.test(fe)&&ee.add(" ")),Of.forEach(Ee=>ee.add(Ee)),ae<0&&Wf.forEach(Ee=>ee.add(Ee)),ee}),Ot=De(J=>J!=null&&J.altKey?i:J!=null&&J.shiftKey?l:u),cr=De((J,Y)=>{const le=Y.event,fe=Y.direction,ee=Zf(J,{step:fe?Ot(le)*fe:void 0,format:Ne.current,minWithDefault:ae,maxWithDefault:xe,minWithZeroDefault:He,snapOnStep:y,small:(le==null?void 0:le.altKey)??!1});if(ee!==H||J!==H||ct.current===!1){if(_t.current=ee,g==null||g(ee,Y),Y.isCanceled)return;R(ee),D(ee!==F.initialValue),me.current=!0}ct.current&&Ue(Nt(ee,C,N)),ve()}),gn=De((J,{direction:Y,currentValue:le,event:fe,reason:ee})=>{const We=le??be.current,bn=typeof We=="number"?We+J*Y:Math.max(0,s??0);cr(bn,Ve(ee,fe,void 0,{direction:Y}))}),Wt=De(()=>{Lt.clear(),Ge.clear(),Vt.clear(),dt.current(),ur.current=0}),dc=De((J,Y)=>{if(Wt(),!P.current)return;const le=jr(P.current);function fe(We){We.preventDefault()}le.addEventListener("contextmenu",fe),dt.current=()=>{le.removeEventListener("contextmenu",fe)},le.addEventListener("pointerup",We=>{ir.current=!1,Wt();const bn=_t.current??be.current;Oe(bn,rn(J?"increment":"decrement",We))},{once:!0});function ee(){const We=Ot(Y)??Wn;gn(We,{direction:J?1:-1,event:Y,reason:J?"increment-press":"decrement-press"})}ee(),Ge.start(qf,()=>{Vt.start(zf,ee)})});Pe(function(){if(!ct.current)return;const Y=b!==void 0?xi(H,C,N):Nt(H,C,N);Y!==oe&&Ue(Y)}),Pe(function(){if(!tf)return;let Y="text";ae>=0&&(Y="decimal"),uy(Y)},[ae,j]),v.useEffect(()=>()=>Wt(),[Wt]),v.useEffect(function(){const Y=P.current;if(_||w||!S||!Y)return;function le(fe){if(fe.ctrlKey||Qw(P.current).activeElement!==P.current)return;fe.preventDefault();const ee=Ot(fe)??Wn;gn(ee,{direction:fe.deltaY>0?-1:1,event:fe,reason:"wheel"})}return Y.addEventListener("wheel",le),()=>{Y.removeEventListener("wheel",le)}},[S,gn,_,w,l,u,Ot]);const wa=v.useMemo(()=>({...q,disabled:_,readOnly:w,required:c,value:H,inputValue:oe,scrubbing:B}),[q,_,w,c,H,oe,B]),ly=v.useMemo(()=>({inputRef:P,inputValue:oe,value:H,startAutoChange:dc,stopAutoChange:Wt,minWithDefault:ae,maxWithDefault:xe,disabled:_,readOnly:w,id:Z,setValue:cr,incrementValue:gn,getStepAmount:Ot,allowInputSyncRef:ct,formatOptionsRef:Ne,valueRef:be,lastChangedValueRef:_t,hasPendingCommitRef:me,isPressedRef:ir,intentionalTouchCheckTimeout:Lt,movesAfterTouchRef:ur,name:z,required:c,invalid:W,inputMode:lr,getAllowedNonNumericKeys:cc,min:s,max:o,setInputValue:Ue,locale:C,isScrubbing:B,setIsScrubbing:ne,state:wa,onValueCommitted:Oe}),[P,oe,H,dc,Wt,ae,xe,_,w,Z,cr,gn,Ot,Ne,be,Lt,z,c,W,lr,cc,s,o,Ue,C,B,wa,Oe]),cy=Rt("div",t,{ref:n,state:wa,props:k,stateAttributesMapping:Jt});return a.jsxs(Kr.Provider,{value:ly,children:[cy,a.jsx("input",{...ue.getInputValidationProps({onChange(J){if(J.nativeEvent.defaultPrevented)return;const Y=J.currentTarget.valueAsNumber,le=Number.isNaN(Y)?null:Y,fe=Ve(Jf,J.nativeEvent);D(le!==F.initialValue),cr(le,fe),I()&&ue.commit(le)}}),ref:U,type:"number",name:z,value:H??"",min:s,max:o,step:u,disabled:_,required:c,"aria-hidden":!0,tabIndex:-1,style:Xw})]})});process.env.NODE_ENV!=="production"&&(yi.displayName="NumberFieldRoot");function xi(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Nt(e,t,n):ni(e,t,n)}const vi=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=Vn();return Rt("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(vi.displayName="NumberFieldGroup");let ss;process.env.NODE_ENV!=="production"&&(ss=new Set);function Ni(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ss.has(t)||(ss.add(t),console.error(`Base UI: ${t}`))}}const Si=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(Si.displayName="CompositeRootContext");function Rf(e=!1){const t=v.useContext(Si);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Fn(16));return t}function ep(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:v.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||u)&&(c.disabled=n),c},[r,n,t,i,u,o,s])}}function Ci(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,o=v.useRef(null),i=Rf(!0)!==void 0,u=De(()=>{const h=o.current;return!!((h==null?void 0:h.tagName)==="A"&&(h!=null&&h.href))}),{props:l}=ep({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&v.useEffect(()=>{if(!o.current)return;const h=o.current.tagName==="BUTTON";s?h||Ni("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):h&&Ni("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[s]);const c=v.useCallback(()=>{const h=o.current;tp(h)&&i&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,i]);Pe(c,[c]);const d=v.useCallback((h={})=>{const{onClick:m,onMouseDown:b,onKeyUp:g,onKeyDown:x,onPointerDown:S,...y}=h;return Qo({type:s?"button":void 0,onClick(C){if(t){C.preventDefault();return}m==null||m(C)},onMouseDown(C){t||b==null||b(C)},onKeyDown(C){if(t||(Jr(C),x==null||x(C)),C.baseUIHandlerPrevented)return;const E=C.target===C.currentTarget&&!s&&!u()&&!t,M=C.key==="Enter",A=C.key===" ";E&&((A||M)&&C.preventDefault(),M&&(m==null||m(C)))},onKeyUp(C){t||(Jr(C),g==null||g(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!s&&!t&&C.key===" "&&(m==null||m(C))},onPointerDown(C){if(t){C.preventDefault();return}S==null||S(C)}},s?void 0:{role:"button"},l,y)},[t,l,s,u]),w=De(h=>{o.current=h,c()});return{getButtonProps:d,buttonRef:w}}function tp(e){return Jw(e)&&e.tagName==="BUTTON"}function Ti(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:c,isIncrement:d,isPressedRef:w,locale:h,maxWithDefault:m,minWithDefault:b,movesAfterTouchRef:g,readOnly:x,setValue:S,startAutoChange:y,stopAutoChange:N,value:C,valueRef:E,lastChangedValueRef:M,onValueCommitted:A}=e,k=v.useRef({x:0,y:0}),D=v.useRef(!1),F=v.useRef(!1),V=v.useRef(""),$=C!=null&&C<=b,W=C!=null&&C>=m,G=d?"increment-press":"decrement-press";function q(I){t.current=!0;const _=St(l,h,r.current);_!==null&&(E.current=_,S(_,Ve(G,I,void 0,{direction:d?1:-1})))}return{disabled:n||(d?W:$),"aria-readonly":x||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(I){const _=n||x||(d?W:$);if(I.defaultPrevented||_||(V.current==="touch"?F.current:I.detail!==0))return;q(I.nativeEvent);const z=s(I)??Wn,B=E.current;i(z,{direction:d?1:-1,event:I.nativeEvent,reason:G});const ne=M.current??E.current;ne!==B&&A(ne,rn(G,I.nativeEvent))},onPointerDown(I){var B;const _=!I.button||I.button===0,z=n||(d?W:$);I.defaultPrevented||x||!_||z||(V.current=I.pointerType,F.current=!1,w.current=!0,k.current={x:I.clientX,y:I.clientY},q(I.nativeEvent),I.pointerType!=="touch"?(I.preventDefault(),(B=u.current)==null||B.focus(),y(d,I)):c.start($f,()=>{const ne=g.current;g.current=0,w.current&&ne!=null&&ne<Hf?(y(d,I),F.current=!0):(F.current=!1,N())}))},onPointerUp(I){I.pointerType==="touch"&&(w.current=!1)},onPointerMove(I){if(n||x||(d?W:$)||I.pointerType!=="touch"||!w.current)return;g.current!=null&&(g.current+=1);const{x:z,y:B}=k.current,ne=z-I.clientX,ae=B-I.clientY;ne**2+ae**2>Uf**2&&N()},onMouseEnter(I){const _=n||x||(d?W:$);I.defaultPrevented||_||!w.current||D.current||V.current==="touch"||y(d,I)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Ei=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,locale:y,maxWithDefault:N,minWithDefault:C,movesAfterTouchRef:E,readOnly:M,setValue:A,startAutoChange:k,state:D,stopAutoChange:F,value:V,valueRef:$,lastChangedValueRef:W,onValueCommitted:G}=Vn(),q=o||c,ue=Ti({isIncrement:!0,inputRef:b,startAutoChange:k,stopAutoChange:F,minWithDefault:C,maxWithDefault:N,value:V,inputValue:g,disabled:q,readOnly:M,id:h,setValue:A,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:$,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:E,locale:y,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Ci({disabled:q,native:i}),z=v.useMemo(()=>({...D,disabled:q}),[D,q]);return Rt("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(Ei.displayName="NumberFieldIncrement");const Ai=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,maxWithDefault:y,minWithDefault:N,movesAfterTouchRef:C,readOnly:E,setValue:M,startAutoChange:A,state:k,stopAutoChange:D,value:F,valueRef:V,locale:$,lastChangedValueRef:W,onValueCommitted:G}=Vn(),q=o||c,ue=Ti({isIncrement:!1,inputRef:b,startAutoChange:A,stopAutoChange:D,minWithDefault:N,maxWithDefault:y,value:F,inputValue:g,disabled:q,readOnly:E,id:h,setValue:M,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:V,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:C,locale:$,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Ci({disabled:q,native:i}),z=v.useMemo(()=>({...k,disabled:q}),[k,q]);return Rt("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(Ai.displayName="NumberFieldDecrement");function np(e){e.preventDefault(),e.stopPropagation()}function rp(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const ki=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Fe,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(ki.displayName="FormContext");function Mi(){return v.useContext(ki)}function sp(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:o,commit:i}=e,{formRef:u}=Mi(),{invalid:l,markedDirtyRef:c,validityData:d,setValidityData:w}=Yr(),h=De(e.getValue);Pe(()=>{if(!t)return;let m=n;m===void 0&&(m=h()),d.initialValue===null&&m!==null&&w(b=>({...b,initialValue:m}))},[t,w,n,d.initialValue,h]),Pe(()=>{!t||!r||u.current.fields.set(r,{getValue:h,name:s,controlRef:o,validityData:rp(d,l),validate(){let m=n;m===void 0&&(m=h()),c.current=!0,Fc.flushSync(()=>i(m))}})},[i,o,t,u,h,r,l,c,s,d,n]),Pe(()=>{const m=u.current.fields;return()=>{r&&m.delete(r)}},[u,r])}function ap(e,t){const n=v.useRef(e),r=De(t);Pe(()=>{n.current!==e&&r(n.current)},[e,r]),Pe(()=>{n.current=e},[e])}const op={...of,...Jt},ip=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ii=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:c,getStepAmount:d,id:w,incrementValue:h,inputMode:m,inputValue:b,max:g,min:x,name:S,readOnly:y,required:N,setValue:C,state:E,setInputValue:M,locale:A,inputRef:k,value:D,onValueCommitted:F,lastChangedValueRef:V,hasPendingCommitRef:$,valueRef:W}=Vn(),{clearErrors:G}=Mi(),{validationMode:q,setTouched:ue,setFocused:I,invalid:_,shouldValidateOnChange:z,validation:B}=Yr(),{labelId:ne}=Zo(),ae=v.useRef(!1),xe=v.useRef(!1);return sp({id:w,commit:B.commit,value:D,controlRef:k,name:S,getValue:()=>D??null}),ap(D,P=>{const U=z();if(G(S),U&&B.commit(D),!(P===D||U)){if(xe.current){xe.current=!1;return}B.commit(D,!0)}}),Rt("input",t,{ref:[n,k],state:E,props:[{id:w,required:N,disabled:u,readOnly:y,inputMode:m,value:b,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":_||void 0,"aria-labelledby":ne,suppressHydrationWarning:!0,onFocus(P){if(P.defaultPrevented||y||u||ae.current)return;ae.current=!0,I(!0);const U=P.currentTarget,Z=U.value.length;U.setSelectionRange(Z,Z)},onBlur(P){if(P.defaultPrevented||y||u)return;ue(!0),I(!1);const U=!i.current,Z=$.current;if(i.current=!0,b.trim()===""){C(null,Ve(rs,P.nativeEvent)),q==="onBlur"&&B.commit(null),F(null,rn(rs,P.nativeEvent));return}const O=l.current,R=St(b,A,O);if(R===null)return;const H=(O==null?void 0:O.maximumFractionDigits)!=null||(O==null?void 0:O.minimumFractionDigits)!=null,be=O==null?void 0:O.maximumFractionDigits,ve=H&&typeof be=="number"?Number(R.toFixed(be)):R,Ne=rn(bi,P.nativeEvent),me=D!==ve,Oe=U||me||Z;q==="onBlur"&&B.commit(ve),me&&(xe.current=!0,C(ve,Ve(bi,P.nativeEvent))),Oe&&F(ve,Ne);const Ge=Nt(ve,A,O),Vt=ni(R,A,O);!(!H&&R===D&&b===Vt)&&b!==Ge&&M(Ge)},onChange(P){if(P.nativeEvent.defaultPrevented)return;i.current=!1;const U=P.target.value;if(U.trim()===""){M(U),C(null,Ve(rs,P.nativeEvent));return}const Z=c();if(!Array.from(U).every(H=>{const be=H>="0"&&H<="9",ve=Rr.test(H),Ne=es.test(H),me=li.test(H),Oe=ci.test(H),Ge=tn.test(H);return be||ve||Ne||me||Oe||Ge||Z.has(H)}))return;if(P.isTrusted){M(U);const H=St(U,A,l.current);H!==null&&C(H,Ve(gi,P.nativeEvent));return}const R=St(U,A,l.current);R!==null&&(M(U),C(R,Ve(gi,P.nativeEvent)))},onKeyDown(P){if(P.defaultPrevented||y||u)return;const U=P.nativeEvent;i.current=!0;const Z=c();let O=Z.has(P.key);const{decimal:R,currency:H,percentSign:be}=ts(A,l.current),ve=P.currentTarget.selectionStart,Ne=P.currentTarget.selectionEnd,me=ve===0&&Ne===b.length,Oe=oe=>ve!=null&&Ne!=null&&oe>=ve&&oe<Ne;if(tn.test(P.key)&&Array.from(Z).some(oe=>tn.test(oe||""))){const oe=b.search(hi),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(tn.test(b)||On.test(b))||me||Ue}if(On.test(P.key)&&Array.from(Z).some(oe=>On.test(oe||""))){const oe=b.search(mi),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(tn.test(b)||On.test(b))||me||Ue}[R,H,be].forEach(oe=>{if(P.key===oe){const Ue=b.indexOf(oe),lr=Oe(Ue);O=!b.includes(oe)||me||lr}});const Ge=P.key>="0"&&P.key<="9",Vt=Rr.test(P.key),Lt=es.test(P.key),ir=ci.test(P.key),ur=ip.has(P.key);if(P.which===229||P.altKey||P.ctrlKey||P.metaKey||O||Ge||Vt||ir||Lt||ur)return;const ct=St(b,A,l.current),_t=d(P)??Wn;np(P);const dt=rn(nn,U);P.key==="ArrowUp"?(h(_t,{direction:1,currentValue:ct,event:U,reason:nn}),F(V.current??W.current,dt)):P.key==="ArrowDown"?(h(_t,{direction:-1,currentValue:ct,event:U,reason:nn}),F(V.current??W.current,dt)):P.key==="Home"&&x!=null?(C(x,Ve(nn,U)),F(V.current??W.current,dt)):P.key==="End"&&g!=null&&(C(g,Ve(nn,U)),F(V.current??W.current,dt))},onPaste(P){if(P.defaultPrevented||y||u)return;P.preventDefault();const Z=(P.clipboardData||window.Clipboard).getData("text/plain"),O=St(Z,A,l.current);O!==null&&(i.current=!1,C(O,Ve(Qf,P.nativeEvent)),M(Z))}},B.getValidationProps(),o],stateAttributesMapping:op})});process.env.NODE_ENV!=="production"&&(Ii.displayName="NumberFieldInput");const up={wuStepper:"_wuStepper_apbnq_1"},lp=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:c,labelPosition:d="left",disabled:w,resetInvalidValueOnBlur:h=!0,...m})=>{const b=v.useId(),[g,x]=v.useState(l!==void 0?Number(l):n||0);v.useEffect(()=>{l!==void 0&&x(Number(l))},[l]);const S=A=>{x(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||x(k)},N=()=>{h&&(i!==void 0&&g<i?(x(i),e==null||e(i)):u!==void 0&&g>u&&(x(u),e==null||e(u)))};v.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const C={inc:r||u!==void 0&&g>=u||w,dec:r||i!==void 0&&g<=i||w},E=i!==void 0&&g<i||u!==void 0&&g>u,M=f("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(yi,{id:b,value:g,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&S(A),dir:s,className:f("wu-flex wu-stepper",s==="rtl"&&d!=="top"&&"wu-gap-2",up.wuStepper,cp({labelPosition:d}),c),children:[t&&a.jsx(Ce,{htmlFor:b,className:"wu-input-label",children:t}),a.jsxs(vi,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Ai,{"aria-label":"decrement",className:f(M,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:C.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ii,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":E||void 0,dir:s,className:f("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",E&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:N,disabled:w,min:i,max:u,step:o,value:g,...m}),a.jsx(Ei,{"aria-label":"increment",className:f(M,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:C.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},cp=Me.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}}),Di=Me.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),dp=v.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(ba.Root,{ref:s,className:f(Di({variant:t,size:n,className:e})),...r}));dp.displayName=ba.Root.displayName;const Pi=v.createContext({size:"default",variant:"default"}),Bn=v.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(xn.Root,{ref:o,className:f("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Pi.Provider,{value:{variant:t,size:n},children:r})}));Bn.displayName=xn.Root.displayName;const nt=v.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=v.useContext(Pi);return a.jsx(xn.Item,{ref:o,className:f(Di({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});nt.displayName=xn.Item.displayName;const Fi=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>f("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:f("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(nt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(nt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Fi.displayName="_IconTab";const Vi=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=c=>f("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",c===r&&"wu-text-white wu-font-medium",s&&r===c&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:f("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(nt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(nt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Vi.displayName="_Tab";const Li=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>f("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=f("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=f("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),d=f("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(nt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:c,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(nt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});Li.displayName="_Toggle";const _i=p.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:c=!0,...d}=e,[w,h]=p.useState(),m=b=>{let g=w;b!==""?g=b:c&&(g=w==="opt1"?"opt2":"opt1");const x=g==="opt1"?r[0].value:r[1].value;l&&l(x),h(g)};if(p.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");h(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Li,{...d,ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});case"iconTab":return a.jsx(Fi,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});default:return a.jsx(Vi,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i,size:u})}});_i.displayName="WuSwitcher";const Oi=Re.Root,as=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Re.List,{className:f("wu-relative wu-flex",e),...n,ref:r,children:t}));as.displayName=Re.List.displayName;const os=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Trigger,{ref:n,className:f("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));os.displayName=Re.Trigger.displayName;const Wi=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Content,{ref:n,className:e,...t}));Wi.displayName=Re.Content.displayName;const Bi=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:f("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx(Wi,{value:r.value,forceMount:t||void 0,className:f("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},wp=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return p.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:c,behavior:"smooth"})}}}},zi=(e,t)=>{const[n,r]=p.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return p.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const c={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(c)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},fp=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var N;const l=p.useRef(null),c=zi(l,"horizontal"),{showLeftArrow:d,showRightArrow:w,scrollByTab:h}=wp(l),[m,b]=p.useState(!1),g=()=>h("left"),x=()=>h("right"),S=C=>a.jsx("div",{"data-testid":`gradient-overlay-${C}`,className:f("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",C==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="left";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",M&&"wu-translate-x-0 wu-opacity-100",!M&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Oi,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:f("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("left"),y(g,"left",d&&m),a.jsxs(as,{ref:l,className:f("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(os,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&m&&S("right"),y(x,"right",w&&m)]}),a.jsx(Bi,{items:e,enableAnimation:s})]})},pp=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return p.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:c,behavior:"smooth"})}}}},hp=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var N;const l=p.useRef(null),c=zi(l,"vertical"),{showTopArrow:d,showBottomArrow:w,scrollByTab:h}=pp(l),[m,b]=p.useState(!1),g=()=>h("up"),x=()=>h("down"),S=C=>a.jsx("div",{className:f("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",C==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="up";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",M&&"wu-translate-y-0 wu-opacity-100",!M&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Oi,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:f("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("top"),y(g,"up",d&&m),a.jsxs(as,{ref:l,className:f("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(os,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:c.height,top:c.top}})]}),w&&m&&S("bottom"),y(x,"down",w&&m)]}),a.jsx(Bi,{items:e,enableAnimation:s})]})},mp=({...e})=>e.orientation==="vertical"?a.jsx(hp,{...e}):a.jsx(fp,{...e}),is=v.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:f("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));is.displayName="Table";const qi=v.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:f("[&_tr]:wu-border-b",e),...t}));qi.displayName="TableHeader";const $i=v.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:f("",e),...t}));$i.displayName="TableBody";const gp=v.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:f("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));gp.displayName="TableFooter";const sn=v.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:f("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));sn.displayName="TableRow";const us=v.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:f("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));us.displayName="TableHead";const zn=v.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:f("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));zn.displayName="TableCell";const ls=v.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:f("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));ls.displayName="TableCaption";const bp=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o}=t||{},i=p.useCallback(l=>c=>{s(()=>c?l:[])},[s]);return{finalColumns:p.useMemo(()=>n?[{id:"select",header:({table:l})=>{const c=l.getRowModel().rows.map(w=>w.original),d=i(c);return a.jsx(Ae,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:w=>{l.toggleAllRowsSelected(!!w),d(!!w)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ae,{checked:l.getIsSelected(),onChange:c=>{l.toggleSelected(!!c)},"aria-label":String(l.original[o])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,i])}};function Hi({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=bp({columns:t,rowSelection:n}),s=p.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const Ui=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s})=>{var u;const[o,i]=p.useState(null);return a.jsx($i,{children:r?a.jsx(sn,{children:a.jsx(zn,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s||a.jsx(gt,{className:"wu-w-full"})})}):(u=e.getRowModel().rows)!=null&&u.length?e.getRowModel().rows.map((l,c)=>a.jsx(sn,{"data-state":l.getIsSelected()&&"selected",onMouseOver:()=>i(l.id),onMouseOut:()=>i(null),className:f("wu-transition-colors wu-border-b wu-border-black/[12%]",l.getIsSelected()?o===l.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:l.getVisibleCells().map((d,w)=>a.jsx(zn,{className:f("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",d.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===l.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":"",d.column.columnDef.cellAlign==="right"&&"wu-text-right",d.column.columnDef.cellAlign==="center"&&"wu-text-center",d.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:Be.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${w}`))},`${l.id}-${c}`)):a.jsx(sn,{children:a.jsx(zn,{colSpan:e.getAllColumns().length,children:n})})})},ji=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u})=>{const l=s==="compact"?"wu-h-8":"wu-h-10",c=d=>{const{id:w,columnDef:h,getIsSorted:m,toggleSorting:b}=d,{header:g}=h;if(!t.includes(w))return g;const x=m(),S=x==="asc",y=x==="desc",N=()=>{n?(b(!y),r==null||r({id:w,desc:y})):b(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:N,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:f("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",S&&"wu-hidden",!x&&"-wu-top-[11px]")}),a.jsx("span",{className:f("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!x&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(qi,{className:f("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",l),children:[e.getHeaderGroups().map(d=>a.jsx(sn,{className:"wu-relative",children:d.headers.map(w=>w.column.id==="actions"?a.jsx(us,{colSpan:w.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${w.getSize()}px`}},w.id):a.jsx(us,{colSpan:w.colSpan,className:f("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",w.column.columnDef.headerAlign==="right"&&"wu-text-right",w.column.columnDef.headerAlign==="center"&&"wu-text-center",w.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${w.getSize()}px`},children:Be.flexRender(c(w.column),w.getContext())},w.id))},d.id)),o&&i&&a.jsxs("div",{className:f("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",l),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:a.jsx(Ae,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:d=>{e.toggleAllRowsSelected(!!d)},"aria-label":"Select all"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})]})},Gi=Me.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),yp=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:c=!1,CustomLoader:d,caption:w,...h})=>{var N;const{finalColumns:m,rowSelectionState:b}=Hi({data:e,columns:t,rowSelection:i}),g=p.useMemo(()=>m.filter(C=>C.enableSorting).map(C=>C.accessorKey),[m]),x=((N=i==null?void 0:i.selectedRows)==null?void 0:N.length)??0,S=C=>{if(typeof C=="function"){const E=C(b),M=Object.keys(E).filter(A=>E[Number(A)]).map(A=>e[Number(A)]);i==null||i.onRowSelect(M)}},y=Be.useReactTable({data:e,columns:m,getCoreRowModel:Be.getCoreRowModel(),getPaginationRowModel:Be.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i==null?void 0:i.isEnabled,state:{...i!=null&&i.isEnabled?{rowSelection:b}:{}},onRowSelectionChange:S});return a.jsxs("div",{className:f("wu-text-gray-lead wu-table-container wu-relative"),children:[w&&a.jsx(ls,{className:"wu-font-light",children:w}),a.jsxs(is,{...h,className:f(Gi({variant:r}),h.className),children:[a.jsx(ji,{table:y,sortableColumns:g,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:x>0,isStickyHeader:c}),!n&&a.jsx(Ui,{table:y,size:o,NoDataContent:l,CustomLoader:d})]}),n&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(gt,{})})]})},xp=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:c,NoDataContent:d,isLoading:w,caption:h,rowSelection:m,...b})=>{var $;const[g,x]=p.useState((s==null?void 0:s.initial)||[]),[S,y]=p.useState([]),[N,C]=p.useState((i==null?void 0:i.pageIndex)??0),{finalColumns:E,rowSelectionState:M}=Hi({data:e,columns:t,rowSelection:m}),A=p.useMemo(()=>E.filter(W=>W.enableSorting).map(W=>W.accessorKey),[E]),k=p.useMemo(()=>E.filter(W=>W.filterable).map(W=>W.accessorKey),[E]),D=(($=m==null?void 0:m.selectedRows)==null?void 0:$.length)??0,F=W=>{const G=typeof W=="function"?W(M):W,q=Object.keys(G).filter(ue=>G[Number(ue)]).map(ue=>e[Number(ue)]);m==null||m.onRowSelect(q)},V=Be.useReactTable({data:e,columns:E,getCoreRowModel:Be.getCoreRowModel(),getFilteredRowModel:Be.getFilteredRowModel(),getSortedRowModel:Be.getSortedRowModel(),getPaginationRowModel:i?Be.getPaginationRowModel():void 0,state:{sorting:g,columnFilters:S,...i?{pagination:i}:{},...m!=null&&m.isEnabled?{rowSelection:M}:{}},onSortingChange:x,onColumnFiltersChange:y,onRowSelectionChange:F});return p.useEffect(()=>{k.forEach(W=>{var G;(G=V.getColumn(W))==null||G.setFilterValue(o)})},[o,k,V]),p.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==N&&(m==null||m.onRowSelect(()=>[]),V.resetRowSelection(),C(i.pageIndex))},[i==null?void 0:i.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(is,{...b,className:f("wu-overflow-x-auto wu-w-full",Gi({variant:n}),"wu-table-fixed",b.className),children:[h&&a.jsx(ls,{children:h}),a.jsx(ji,{table:V,sortableColumns:A,size:r,HeaderAction:l,isRowSelected:D>0,isStickyHeader:u}),a.jsx(Ui,{table:V,size:r,NoDataContent:d,CustomLoader:c,isLoading:w})]})})},Ki=v.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:f("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));Ki.displayName="Textarea";const Yi=p.forwardRef((e,t)=>{const{Label:n,id:r=vn(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,c=w=>{l.onChange&&l.onChange(w)},d=Ut(u);return a.jsxs("div",{className:f(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(Ki,{...l,ref:t,id:r,className:f("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:c,readOnly:o,maxLength:i}),n&&a.jsx(Ce,{htmlFor:r,className:"wu-textarea-label",children:n})]})});Yi.displayName="WuTextarea";function vp(e){if(typeof e=="string"&&e.includes("T")){const t=K.parseISO(e);return K.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=K.parse(e,"HH:mm:ss",new Date);return K.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Xi=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Zi=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Ji=["am","pm"],qn=50;function Np(e){return Array(qn).fill(e).flat()}function cs(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function Sp(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function Qi(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const Cp=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:f("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),ds=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:f("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?Np(e):e).map((i,u)=>a.jsx(Cp,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function Tp(e,t,n,r){const s=p.useMemo(()=>e?cs(Xi,t.padStart(2,"0")):Xi,[e]),o=p.useMemo(()=>e?cs(Zi,n.padStart(2,"0")):Zi,[e]),i=p.useMemo(()=>e?cs(Ji,r):Ji,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function Ep(e,t,n){p.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/qn,l=Math.floor(qn/2);i.scrollTop=l*u;const c=()=>{const{scrollTop:d}=i,w=Math.round(d/u);(w<=1||w>=qn-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",c),()=>{i.removeEventListener("scroll",c)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const Ri=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=p.useState(!1),[l,c]=p.useState(""),d=p.useRef(null),w=p.useRef(null),h=p.useRef(null),m=p.useRef(null),[b,g]=p.useState("12"),[x,S]=p.useState("00"),[y,N]=p.useState("am");p.useEffect(()=>{if(!t){c(""),g("12"),S("00"),N("am"),d.current&&(d.current.value="");return}const k=vp(t);c(k);const[D,F]=k.split(":"),{hour:V,meridiem:$}=Qi(D);g(V),S(F),N($),d.current&&(d.current.value=k)},[t]),p.useEffect(()=>{const k=D=>{w.current&&!w.current.contains(D.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),Ep(i,h,m);const{rotatedHours:C,rotatedMinutes:E,rotatedMeridiem:M}=Tp(i,b,x,y),A=p.useCallback((k,D,F)=>{const V=k??b,$=D??x,W=F??y;g(V),S($),N(W);const G=`${Sp(V,W)}:${$}`;c(G)},[b,x,y]);return a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(Ce,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:f("relative inline-block"),ref:w,dir:s,children:[a.jsx(Te,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{c(k.target.value);const[D,F]=k.target.value.split(":"),{hour:V,meridiem:$}=Qi(D);g(V),S(F),N($)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(re,{icon:"wm-schedule",className:f("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
10
- input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
11
- `}),i&&a.jsxs("div",{className:f("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(ds,{values:C,selectedValue:b.padStart(2,"0"),scrollRef:h,onSelect:k=>A(k,x),className:"wu-time-hour-picker"}),a.jsx(ds,{values:E,selectedValue:x.padStart(2,"0"),scrollRef:m,onSelect:k=>A(b,k),className:"wu-time-minute-picker"}),a.jsx(ds,{values:M,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Ri.displayName="WuTimePicker";const Ap=1,kp=1e6;let ws=0;function Mp(){return ws=(ws+1)%Number.MAX_SAFE_INTEGER,ws.toString()}const fs=new Map,eu=e=>{if(fs.has(e))return;const t=setTimeout(()=>{fs.delete(e),an({type:"REMOVE_TOAST",toastId:e})},kp);fs.set(e,t)},Ip=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ap)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?eu(n):e.toasts.forEach(r=>{eu(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},$n=[];let Hn={toasts:[]};function an(e){Hn=Ip(Hn,e),$n.forEach(t=>{t(Hn)})}function tu({...e}){const t=Mp(),n=s=>an({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>an({type:"DISMISS_TOAST",toastId:t});return an({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Dp(){const[e,t]=p.useState(Hn);return p.useEffect(()=>($n.push(t),()=>{const n=$n.indexOf(t);n>-1&&$n.splice(n,1)}),[e]),{...e,toast:tu,dismiss:n=>an({type:"DISMISS_TOAST",toastId:n})}}const Pp=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>tu({description:t,variant:n,duration:r,position:s})}),Fp=Se.Provider,Vp=Me.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),nu=v.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Se.Viewport,{ref:r,className:f(Vp({position:t}),e),...n}));nu.displayName=Se.Viewport.displayName;const Lp=Me.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),ru=v.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Se.Root,{ref:s,className:f(Lp({variant:t,position:n}),e),...r}));ru.displayName=Se.Root.displayName;const _p=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Action,{ref:n,className:f("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));_p.displayName=Se.Action.displayName;const su=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Close,{ref:n,className:f("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));su.displayName=Se.Close.displayName;const au=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Title,{ref:n,className:f("wu-text-sm wu-font-semibold",e),...t}));au.displayName=Se.Title.displayName;const ou=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Description,{ref:n,className:f("wu-text-sm wu-opacity-90",e),...t}));ou.displayName=Se.Description.displayName;function Op(){const{toasts:e}=Dp(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(Fp,{children:Object.entries(t).map(([n,r])=>a.jsx(nu,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:c,...d}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(ru,{variant:l||"success",position:c,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(au,{children:o}),i&&a.jsxs(ou,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(re,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(su,{})]},s)})},n))})}const Wp=()=>a.jsx(Op,{}),iu=v.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(fr.Root,{className:f("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(fr.Thumb,{className:f("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));iu.displayName=fr.Root.displayName;const uu=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=vn(),...c}=e;return p.useEffect(()=>{const{checked:d,defaultChecked:w}=c;d!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),a.jsxs("div",{className:f(Bp({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(iu,{...c,id:l,disabled:u,ref:t,onCheckedChange:s,className:f("wu-peer",o),dir:i}),a.jsx(Ce,{htmlFor:l,className:"wu-toggle-label",children:n})]})});uu.displayName="WuToggle";const Bp=Me.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),Un=p.createContext(null),zp=()=>{const e=p.useContext(Un);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},qp=()=>{const e=p.useContext(Un);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},$p=({children:e})=>{const[t,n]=p.useState({}),[r,s]=p.useState({}),o=p.useCallback(async(c,d)=>{try{const h=await(await fetch(c)).json();n(h)}catch(w){console.error("Failed to load translations:",w),d&&n(d)}d&&s(d)},[]),i=p.useCallback(c=>{s(c)},[]),u=p.useCallback(()=>({t:(d,w)=>t[d]?t[d]:r[d]?r[d]:w||d}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Un.Provider,{value:l,children:e})},Hp={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},lu=p.createContext({});function ps(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const hs=typeof window<"u",cu=hs?p.useLayoutEffect:p.useEffect,jn=p.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const rt=(e,t,n)=>n>t?t:n<e?e:n;function ms(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let on=()=>{},st=()=>{};process.env.NODE_ENV!=="production"&&(on=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ms(t,n))},st=(e,t,n)=>{if(!e)throw new Error(ms(t,n))});const je={},du=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Gp(e){return typeof e=="object"&&e!==null}const wu=e=>/^0[^.\s]+$/u.test(e);function gs(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ct=e=>e,Kp=(e,t)=>n=>t(e(n)),Gn=(...e)=>e.reduce(Kp),fu=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class pu{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>jp(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $e=e=>e*1e3,Le=e=>e/1e3;function hu(e,t){return t?e*(1e3/t):0}const mu=new Set;function gu(e,t,n){e||mu.has(t)||(console.warn(ms(t,n)),mu.add(t))}const bu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Yp=1e-7,Xp=12;function Zp(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=bu(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Yp&&++u<Xp);return i}function un(e,t,n,r){if(e===t&&n===r)return Ct;const s=o=>Zp(o,0,1,e,n);return o=>o===0||o===1?o:bu(s(o),t,r)}const yu=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xu=e=>t=>1-e(1-t),vu=un(.33,1.53,.69,.99),bs=xu(vu),Nu=yu(bs),Su=e=>(e*=2)<1?.5*bs(e):.5*(2-Math.pow(2,-10*(e-1))),ys=e=>1-Math.sin(Math.acos(e)),Jp=xu(ys),Cu=yu(ys),Qp=un(.42,0,1,1),Rp=un(0,0,.58,1),Tu=un(.42,0,.58,1),eh=e=>Array.isArray(e)&&typeof e[0]!="number",Eu=e=>Array.isArray(e)&&typeof e[0]=="number",Au={linear:Ct,easeIn:Qp,easeInOut:Tu,easeOut:Rp,circIn:ys,circInOut:Cu,circOut:Jp,backIn:bs,backInOut:Nu,backOut:vu,anticipate:Su},th=e=>typeof e=="string",ku=e=>{if(Eu(e)){st(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return un(t,n,r,s)}else if(th(e))return st(Au[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Au[e];return e},Kn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nh(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),e()),d(u)}const c={schedule:(d,w=!1,h=!1)=>{const b=h&&s?n:r;return w&&i.add(d),b.has(d)||b.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(u=d,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(l),n.clear(),s=!1,o&&(o=!1,c.process(d))}};return c}const rh=40;function Mu(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Kn.reduce((N,C)=>(N[C]=nh(o),N),{}),{setup:u,read:l,resolveKeyframes:c,preUpdate:d,update:w,preRender:h,render:m,postRender:b}=i,g=()=>{const N=je.useManualTiming?s.timestamp:performance.now();n=!1,je.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(N-s.timestamp,rh),1)),s.timestamp=N,s.isProcessing=!0,u.process(s),l.process(s),c.process(s),d.process(s),w.process(s),h.process(s),m.process(s),b.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Kn.reduce((N,C)=>{const E=i[C];return N[C]=(M,A=!1,k=!1)=>(n||x(),E.schedule(M,A,k)),N},{}),cancel:N=>{for(let C=0;C<Kn.length;C++)i[Kn[C]].cancel(N)},state:s,steps:i}}const{schedule:_e,cancel:xs,state:Yn}=Mu(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ct,!0);let Xn;function sh(){Xn=void 0}const ke={now:()=>(Xn===void 0&&ke.set(Yn.isProcessing||je.useManualTiming?Yn.timestamp:performance.now()),Xn),set:e=>{Xn=e,queueMicrotask(sh)}},Iu=e=>t=>typeof t=="string"&&t.startsWith(e),Du=Iu("--"),ah=Iu("var(--"),vs=e=>ah(e)?oh.test(e.split("/*")[0].trim()):!1,oh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Tt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...Tt,transform:e=>rt(0,1,e)},Zn={...Tt,default:1},cn=e=>Math.round(e*1e5)/1e5,Ns=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ih(e){return e==null}const uh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ss=(e,t)=>n=>!!(typeof n=="string"&&uh.test(n)&&n.startsWith(e)||t&&!ih(n)&&Object.prototype.hasOwnProperty.call(n,t)),Pu=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(Ns);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},lh=e=>rt(0,255,e),Cs={...Tt,transform:e=>Math.round(lh(e))},at={test:Ss("rgb","red"),parse:Pu("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Cs.transform(e)+", "+Cs.transform(t)+", "+Cs.transform(n)+", "+cn(ln.transform(r))+")"};function ch(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Ts={test:Ss("#"),parse:ch,transform:at.transform},dn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xe=dn("deg"),Et=dn("%"),L=dn("px"),dh=dn("vh"),wh=dn("vw"),Fu={...Et,parse:e=>Et.parse(e)/100,transform:e=>Et.transform(e*100)},At={test:Ss("hsl","hue"),parse:Pu("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Et.transform(cn(t))+", "+Et.transform(cn(n))+", "+cn(ln.transform(r))+")"},de={test:e=>at.test(e)||Ts.test(e)||At.test(e),parse:e=>at.test(e)?at.parse(e):At.test(e)?At.parse(e):Ts.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?at.transform(e):At.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},fh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ph(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ns))==null?void 0:t.length)||0)+(((n=e.match(fh))==null?void 0:n.length)||0)>0}const Vu="number",Lu="color",hh="var",mh="var(",_u="${}",gh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(gh,l=>(de.test(l)?(r.color.push(o),s.push(Lu),n.push(de.parse(l))):l.startsWith(mh)?(r.var.push(o),s.push(hh),n.push(l)):(r.number.push(o),s.push(Vu),n.push(parseFloat(l))),++o,_u)).split(_u);return{values:n,split:u,indexes:r,types:s}}function Ou(e){return wn(e).values}function Wu(e){const{split:t,types:n}=wn(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const u=n[i];u===Vu?o+=cn(s[i]):u===Lu?o+=de.transform(s[i]):o+=s[i]}return o}}const bh=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e;function yh(e){const t=Ou(e);return Wu(e)(t.map(bh))}const Ze={test:ph,parse:Ou,createTransformer:Wu,getAnimatableNone:yh};function Es(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function xh({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Es(l,u,e+1/3),o=Es(l,u,e),i=Es(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Jn(e,t){return n=>n>0?t:e}const fn=(e,t,n)=>e+(t-e)*n,As=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},vh=[Ts,at,At],Nh=e=>vh.find(t=>t.test(e));function Bu(e){const t=Nh(e);if(on(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===At&&(n=xh(n)),n}const zu=(e,t)=>{const n=Bu(e),r=Bu(t);if(!n||!r)return Jn(e,t);const s={...n};return o=>(s.red=As(n.red,r.red,o),s.green=As(n.green,r.green,o),s.blue=As(n.blue,r.blue,o),s.alpha=fn(n.alpha,r.alpha,o),at.transform(s))},ks=new Set(["none","hidden"]);function Sh(e,t){return ks.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ch(e,t){return n=>fn(e,t,n)}function Ms(e){return typeof e=="number"?Ch:typeof e=="string"?vs(e)?Jn:de.test(e)?zu:Ah:Array.isArray(e)?qu:typeof e=="object"?de.test(e)?zu:Th:Jn}function qu(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Ms(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Th(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ms(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Eh(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Ah=(e,t)=>{const n=Ze.createTransformer(t),r=wn(e),s=wn(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ks.has(e)&&!s.values.length||ks.has(t)&&!r.values.length?Sh(e,t):Gn(qu(Eh(r,s),s.values),n):(on(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Jn(e,t))};function $u(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?fn(e,t,n):Ms(e)(e,t)}const kh=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_e.update(t,n),stop:()=>xs(t),now:()=>Yn.isProcessing?Yn.timestamp:ke.now()}},Hu=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Qn=2e4;function Is(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Qn;)t+=n,r=e.next(t);return t>=Qn?1/0:t}function Mh(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Is(r),Qn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Le(s)}}const Ih=5;function Uu(e,t,n){const r=Math.max(t-Ih,0);return hu(n-e(r),t-r)}const ie={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ds=.001;function Dh({duration:e=ie.duration,bounce:t=ie.bounce,velocity:n=ie.velocity,mass:r=ie.mass}){let s,o;on(e<=$e(ie.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=rt(ie.minDamping,ie.maxDamping,i),e=rt(ie.minDuration,ie.maxDuration,Le(e)),i<1?(s=c=>{const d=c*i,w=d*e,h=d-n,m=Ps(c,i),b=Math.exp(-w);return Ds-h/m*b},o=c=>{const w=c*i*e,h=w*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,b=Math.exp(-w),g=Ps(Math.pow(c,2),i);return(-s(c)+Ds>0?-1:1)*((h-m)*b)/g}):(s=c=>{const d=Math.exp(-c*e),w=(c-n)*e+1;return-Ds+d*w},o=c=>{const d=Math.exp(-c*e),w=(n-c)*(e*e);return d*w});const u=5/e,l=Fh(s,o,u);if(e=$e(e),isNaN(l))return{stiffness:ie.stiffness,damping:ie.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const Ph=12;function Fh(e,t,n){let r=n;for(let s=1;s<Ph;s++)r=r-e(r)/t(r);return r}function Ps(e,t){return e*Math.sqrt(1-t*t)}const Vh=["duration","bounce"],Lh=["stiffness","damping","mass"];function ju(e,t){return t.some(n=>e[n]!==void 0)}function _h(e){let t={velocity:ie.velocity,stiffness:ie.stiffness,damping:ie.damping,mass:ie.mass,isResolvedFromDuration:!1,...e};if(!ju(e,Lh)&&ju(e,Vh))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*rt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ie.mass,stiffness:s,damping:o}}else{const n=Dh(e);t={...t,...n,mass:ie.mass},t.isResolvedFromDuration=!0}return t}function Rn(e=ie.visualDuration,t=ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:c,mass:d,duration:w,velocity:h,isResolvedFromDuration:m}=_h({...n,velocity:-Le(n.velocity||0)}),b=h||0,g=c/(2*Math.sqrt(l*d)),x=i-o,S=Le(Math.sqrt(l/d)),y=Math.abs(x)<5;r||(r=y?ie.restSpeed.granular:ie.restSpeed.default),s||(s=y?ie.restDelta.granular:ie.restDelta.default);let N;if(g<1){const E=Ps(S,g);N=M=>{const A=Math.exp(-g*S*M);return i-A*((b+g*S*x)/E*Math.sin(E*M)+x*Math.cos(E*M))}}else if(g===1)N=E=>i-Math.exp(-S*E)*(x+(b+S*x)*E);else{const E=S*Math.sqrt(g*g-1);N=M=>{const A=Math.exp(-g*S*M),k=Math.min(E*M,300);return i-A*((b+g*S*x)*Math.sinh(k)+E*x*Math.cosh(k))/E}}const C={calculatedDuration:m&&w||null,next:E=>{const M=N(E);if(m)u.done=E>=w;else{let A=E===0?b:0;g<1&&(A=E===0?$e(b):Uu(N,E,M));const k=Math.abs(A)<=r,D=Math.abs(i-M)<=s;u.done=k&&D}return u.value=u.done?i:M,u},toString:()=>{const E=Math.min(Is(C),Qn),M=Hu(A=>C.next(E*A).value,E,30);return E+"ms "+M},toTransition:()=>{}};return C}Rn.applyToOptions=e=>{const t=Mh(e,100,Rn);return e.ease=t.ease,e.duration=$e(t.duration),e.type="keyframes",e};function Fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:c=.5,restSpeed:d}){const w=e[0],h={done:!1,value:w},m=k=>u!==void 0&&k<u||l!==void 0&&k>l,b=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let g=n*t;const x=w+g,S=i===void 0?x:i(x);S!==x&&(g=S-w);const y=k=>-g*Math.exp(-k/r),N=k=>S+y(k),C=k=>{const D=y(k),F=N(k);h.done=Math.abs(D)<=c,h.value=h.done?S:F};let E,M;const A=k=>{m(h.value)&&(E=k,M=Rn({keyframes:[h.value,b(h.value)],velocity:Uu(N,k,h.value),damping:s,stiffness:o,restDelta:c,restSpeed:d}))};return A(0),{calculatedDuration:null,next:k=>{let D=!1;return!M&&E===void 0&&(D=!0,C(k),A(k)),E!==void 0&&k>=E?M.next(k-E):(!D&&C(k),h)}}}function Oh(e,t,n){const r=[],s=n||je.mix||$u,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Ct:t;u=Gn(l,u)}r.push(u)}return r}function Wh(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(st(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Oh(t,r,s),l=u.length,c=d=>{if(i&&d<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(d<e[w+1]);w++);const h=fu(e[w],e[w+1],d);return u[w](h)};return n?d=>c(rt(e[0],e[o-1],d)):c}function Bh(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fu(0,t,r);e.push(fn(n,1,s))}}function zh(e){const t=[0];return Bh(t,e.length-1),t}function qh(e,t){return e.map(n=>n*t)}function $h(e,t){return e.map(()=>t||Tu).splice(0,e.length-1)}function kt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=eh(r)?r.map(ku):ku(r),o={done:!1,value:t[0]},i=qh(n&&n.length===t.length?n:zh(t),e),u=Wh(i,t,{ease:Array.isArray(s)?s:$h(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const Hh=e=>e!==null;function Vs(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(Hh),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const Uh={decay:Fs,inertia:Fs,tween:kt,keyframes:kt,spring:Rn};function Gu(e){typeof e.type=="string"&&(e.type=Uh[e.type])}class Ls{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const jh=e=>e/100;class _s extends Ls{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ke.now()&&this.tick(ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Gu(t);const{type:n=kt,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||kt;process.env.NODE_ENV!=="production"&&l!==kt&&st(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==kt&&typeof u[0]!="number"&&(this.mixKeyframes=Gn(jh,$u(u[0],u[1])),u=[0,100]);const c=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=Is(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:w,repeatType:h,repeatDelay:m,type:b,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,C=r;if(w){const k=Math.min(this.currentTime,s)/u;let D=Math.floor(k),F=k%1;!F&&k>=1&&(F=1),F===1&&D--,D=Math.min(D,w+1),!!(D%2)&&(h==="reverse"?(F=1-F,m&&(F-=m/u)):h==="mirror"&&(C=i)),N=rt(0,1,F)*u}const E=y?{done:!1,value:d[0]}:C.next(N);o&&(E.value=o(E.value));let{done:M}=E;!y&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return A&&b!==Fs&&(E.value=Vs(d,this.options,x,this.speed)),g&&g(E.value),A&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return Le(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Le(t)}get time(){return Le(this.currentTime)}set time(t){var n;t=$e(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ke.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Le(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=kh,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Gh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ot=e=>e*180/Math.PI,Os=e=>{const t=ot(Math.atan2(e[1],e[0]));return Ws(t)},Kh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Os,rotateZ:Os,skewX:e=>ot(Math.atan(e[1])),skewY:e=>ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ws=e=>(e=e%360,e<0&&(e+=360),e),Ku=Os,Yu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Yh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yu,scaleY:Xu,scale:e=>(Yu(e)+Xu(e))/2,rotateX:e=>Ws(ot(Math.atan2(e[6],e[5]))),rotateY:e=>Ws(ot(Math.atan2(-e[2],e[0]))),rotateZ:Ku,rotate:Ku,skewX:e=>ot(Math.atan(e[4])),skewY:e=>ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bs(e){return e.includes("scale")?1:0}function zs(e,t){if(!e||e==="none")return Bs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Yh,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Kh,s=u}if(!s)return Bs(t);const o=r[t],i=s[1].split(",").map(Zh);return typeof o=="function"?o(i):i[o]}const Xh=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return zs(n,t)};function Zh(e){return parseFloat(e.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set(Mt),Zu=e=>e===Tt||e===L,Jh=new Set(["x","y","z"]),Qh=Mt.filter(e=>!Jh.has(e));function Rh(e){const t=[];return Qh.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const it={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>zs(t,"x"),y:(e,{transform:t})=>zs(t,"y")};it.translateX=it.x,it.translateY=it.y;const ut=new Set;let qs=!1,$s=!1,Hs=!1;function Ju(){if($s){const e=Array.from(ut).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Rh(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$s=!1,qs=!1,ut.forEach(e=>e.complete(Hs)),ut.clear()}function Qu(){ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($s=!0)})}function em(){Hs=!0,Qu(),Ju(),Hs=!1}class Us{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),qs||(qs=!0,_e.read(Qu),_e.resolveKeyframes(Ju))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Gh(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const tm=e=>e.startsWith("--");function nm(e,t,n){tm(t)?e.style.setProperty(t,n):e.style[t]=n}const rm=gs(()=>window.ScrollTimeline!==void 0),sm={};function am(e,t){const n=gs(e);return()=>sm[t]??n()}const Ru=am(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,el={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function tl(e,t){if(e)return typeof e=="function"?Ru()?Hu(e,t):"ease-out":Eu(e)?pn(e):Array.isArray(e)?e.map(n=>tl(n,t)||el.easeOut):el[e]}function om(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const w=tl(u,s);Array.isArray(w)&&(d.easing=w);const h={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function nl(e){return typeof e=="function"&&"applyToOptions"in e}function im({type:e,...t}){return nl(e)&&Ru()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class um extends Ls{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,st(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=im(t);this.animation=om(n,r,s,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Vs(s,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):nm(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Le(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Le(t)}get time(){return Le(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=$e(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&rm()?(this.animation.timeline=t,Ct):n(this)}}const rl={anticipate:Su,backInOut:Nu,circInOut:Cu};function lm(e){return e in rl}function cm(e){typeof e.ease=="string"&&lm(e.ease)&&(e.ease=rl[e.ease])}const sl=10;class dm extends um{constructor(t){cm(t),Gu(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new _s({...i,autoplay:!1}),l=$e(this.finishedTime??this.time);n.setWithVelocity(u.sample(l-sl).value,u.sample(l).value,sl),u.stop()}}const al=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ze.test(e)||e==="0")&&!e.startsWith("url("));function wm(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fm(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=al(s,t),u=al(o,t);return on(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:wm(e)||(n==="spring"||nl(n))&&r}function js(e){e.duration=0,e.type="keyframes"}const pm=new Set(["opacity","clipPath","filter","transform"]),hm=gs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mm(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return hm()&&n&&pm.has(n)&&(n!=="transform"||!c)&&!l&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const gm=40;class bm extends Ls{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:c,element:d,...w}){var b;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=ke.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:c,element:d,...w},m=(d==null?void 0:d.KeyframeResolver)||Us;this.keyframeResolver=new m(u,(g,x,S)=>this.onKeyframesResolved(g,x,h,!S),l,c,d),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=ke.now(),fm(t,o,i,u)||((je.instantAnimations||!l)&&(d==null||d(Vs(t,r,n))),t[0]=t[t.length-1],js(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>gm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!c&&mm(h)?new dm({...h,element:h.motionValue.owner.current}):new _s(h);m.finished.then(()=>this.notifyFinished()).catch(Ct),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),em()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const ym=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xm(e){const t=ym.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const vm=4;function ol(e,t,n=1){st(n<=vm,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=xm(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return du(i)?parseFloat(i):i}return vs(s)?ol(s,t,n+1):s}function il(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const ul=new Set(["width","height","top","left","right","bottom",...Mt]),Nm={test:e=>e==="auto",parse:e=>e},ll=e=>t=>t.test(e),cl=[Tt,L,Et,Xe,wh,dh,Nm],dl=e=>cl.find(ll(e));function Sm(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wu(e):!0}const Cm=new Set(["brightness","contrast","saturate","opacity"]);function Tm(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ns)||[];if(!r)return e;const s=n.replace(r,"");let o=Cm.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Em=/\b([a-z-]*)\(.*?\)/gu,Gs={...Ze,getAnimatableNone:e=>{const t=e.match(Em);return t?t.map(Tm).join(" "):e}},wl={...Tt,transform:Math.round},Ks={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,backgroundPositionX:L,backgroundPositionY:L,...{rotate:Xe,rotateX:Xe,rotateY:Xe,rotateZ:Xe,scale:Zn,scaleX:Zn,scaleY:Zn,scaleZ:Zn,skew:Xe,skewX:Xe,skewY:Xe,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:ln,originX:Fu,originY:Fu,originZ:L},zIndex:wl,fillOpacity:ln,strokeOpacity:ln,numOctaves:wl},Am={...Ks,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Gs,WebkitFilter:Gs},fl=e=>Am[e];function pl(e,t){let n=fl(e);return n!==Gs&&(n=Ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const km=new Set(["auto","none","0"]);function Mm(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!km.has(o)&&wn(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=pl(n,s)}class Im extends Us{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),vs(c))){const d=ol(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ul.has(r)||t.length!==2)return;const[s,o]=t,i=dl(s),u=dl(o);if(i!==u)if(Zu(i)&&Zu(u))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else it[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Sm(t[s]))&&r.push(s);r.length&&Mm(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=it[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Dm(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const hl=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ml(e){return Gp(e)&&"offsetHeight"in e}const gl=30,Pm=e=>!isNaN(parseFloat(e));class Fm{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=ke.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Pm(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&gu(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new pu);const r=this.events[t].add(n);return t==="change"?()=>{r(),_e.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gl);return hu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function er(e,t){return new Fm(e,t)}const{schedule:Vm}=Mu(queueMicrotask,!1),Lm={y:!1};function _m(){return Lm.y}function bl(e,t){const n=Dm(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function yl(e){return!(e.pointerType==="touch"||_m())}function Om(e,t,n={}){const[r,s,o]=bl(e,n),i=u=>{if(!yl(u))return;const{target:l}=u,c=t(l,u);if(typeof c!="function"||!l)return;const d=w=>{yl(w)&&(c(w),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,s)};return r.forEach(u=>{u.addEventListener("pointerenter",i,s)}),o}const xl=(e,t)=>t?e===t?!0:xl(e,t.parentElement):!1,Wm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Bm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zm(e){return Bm.has(e.tagName)||e.tabIndex!==-1}const tr=new WeakSet;function vl(e){return t=>{t.key==="Enter"&&e(t)}}function Ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qm=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=vl(()=>{if(tr.has(n))return;Ys(n,"down");const s=vl(()=>{Ys(n,"up")}),o=()=>Ys(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Nl(e){return Wm(e)&&!0}function $m(e,t,n={}){const[r,s,o]=bl(e,n),i=u=>{const l=u.currentTarget;if(!Nl(u))return;tr.add(l);const c=t(l,u),d=(m,b)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",h),tr.has(l)&&tr.delete(l),Nl(m)&&typeof c=="function"&&c(m,{success:b})},w=m=>{d(m,l===window||l===document||n.useGlobalTarget||xl(l,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",h,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),ml(u)&&(u.addEventListener("focus",c=>qm(c,s)),!zm(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const ge=e=>!!(e&&e.getVelocity),Hm=[...cl,de,Ze],Um=e=>Hm.find(ll(e)),Xs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Sl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jm(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Sl(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Sl(e[s],null)}}}}function Gm(...e){return v.useCallback(jm(...e),e)}class Km extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=ml(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Ym({children:e,isPresent:t,anchorX:n,root:r}){const s=p.useId(),o=p.useRef(null),i=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:u}=p.useContext(Xs),l=Gm(o,e==null?void 0:e.ref);return p.useInsertionEffect(()=>{const{width:c,height:d,top:w,left:h,right:m}=i.current;if(t||!o.current||!c||!d)return;const b=n==="left"?`left: ${h}`:`right: ${m}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");u&&(g.nonce=u);const x=r??document.head;return x.appendChild(g),g.sheet&&g.sheet.insertRule(`
7
+ )`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:f(qd.gradientBackground,"wu-transform-gpu",s),...u,children:r})},ro="calc(100vh - 64px)",$d={sm:"400px",md:"600px",lg:"1200px"},An=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:c,className:d,style:w,variant:h="action",...m})=>{const b={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(Qa,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(Ra,{asChild:!0,children:e}),a.jsxs(Fr,{style:{width:"calc(100% - 64px)",maxWidth:l||$d[n],maxHeight:c||ro,...w},hideCloseButton:r,onInteractOutside:g=>s&&g.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":h,className:f("wu-group wuexp:wu-rounded-[1.1rem]",d),...m,children:["data-theme"in m&&a.jsx(no,{colors:b[h],strokeWidth:4,className:f("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:c||ro},children:t}),!("data-theme"in m)&&t]})]})},kn=({children:e,className:t,...n})=>a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...n,children:e}),Hd=({children:e,className:t,...n})=>a.jsx(Vr,{...n,"data-variant":"action",className:f("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",t),children:a.jsx(yt,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Ud=({children:e,className:t,...n})=>a.jsx(to,{...n,className:f("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",t),children:e}),Ke=({children:e,className:t,...n})=>{const r=p.useRef(null);return a.jsx(Bd,{asChild:!0,children:a.jsx(ce,{className:t,ref:r,...n,children:e})})},jd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:w=>({isTable:w.editor.isActive("table"),tableAttrs:w.editor.getAttributes("table")})}),[n,r]=p.useState(t.tableAttrs.rows||2),[s,o]=p.useState(t.tableAttrs.cols||2),[i,u]=p.useState(!1),l=p.useRef(null),c=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().insertTable({rows:n,cols:s,withHeaderRow:i}).run()},100)},[e,n,s,i]),d=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().deleteTable().run()},100)},[e]);return a.jsx(An,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isTable&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-table"})}),hideCloseButton:!0,maxWidth:"360px",children:a.jsxs(kn,{children:[a.jsx(yt,{className:"wu-hidden"}),t.isTable?a.jsxs("div",{className:"wu-space-y-4 wu-mt-2",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-4",children:[a.jsx(ce,{onClick:()=>e.chain().focus().addColumnBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Left"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Top"}),a.jsx(ce,{onClick:()=>e.chain().focus().addColumnAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Right"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Bottom"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteColumn().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Column"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteRow().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Row"})]}),a.jsx(ce,{onClick:()=>e.chain().focus().toggleHeaderRow().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Toggle Header Row"})]}):a.jsxs("div",{className:"wu-space-y-3",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-3",children:[a.jsx(Te,{Label:"Rows",type:"number",min:1,value:n,onChange:w=>r(Number(w.target.value))}),a.jsx(Te,{Label:"Columns",type:"number",min:1,value:s,onChange:w=>o(Number(w.target.value))})]}),a.jsx(Ae,{Label:"Add header row",checked:i,onChange:u})]}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2 wu-mt-4",children:[a.jsx(Ke,{variant:"secondary",children:"Cancel"}),!t.isTable&&a.jsx(Ke,{onClick:c,children:"Insert"}),t.isTable&&a.jsx(Ke,{color:"error",onClick:d,children:"Delete Table"})]})]})})},Gd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:u=>{var l,c;return{isImage:(l=u.editor)==null?void 0:l.isActive("image"),imageAttrs:(c=u.editor)==null?void 0:c.getAttributes("image")}}}),[n,r]=p.useState(t.imageAttrs.src||""),[s,o]=p.useState(t.imageAttrs.alt||""),i=()=>{e.chain().focus().setImage({src:n,alt:s}).run()};return a.jsx(An,{hideCloseButton:!0,Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isImage&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-image"})}),maxWidth:"400px",children:a.jsxs(kn,{children:[a.jsx(yt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Image URL",type:"url",value:n,onChange:u=>r(u.target.value),required:!0}),a.jsx(Te,{Label:"Alt Text",type:"text",value:s,onChange:u=>o(u.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[a.jsx(Ke,{variant:"secondary",children:"Cancel"}),a.jsx(Ke,{onClick:i,disabled:!n,children:"Save"})]})]})})},Kd=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:l=>{var c,d;return{isLink:(c=l.editor)==null?void 0:c.isActive("link"),linkAttrs:(d=l.editor)==null?void 0:d.getAttributes("link")}}}),[n,r]=p.useState(t.linkAttrs.href||""),[s,o]=p.useState(t.linkAttrs.alt||""),i=()=>{e.chain().focus().insertContent({type:"text",text:s||n,marks:[{type:"link",attrs:{href:n}}]}).run()},u=()=>{const{$from:l}=e.state.selection,c=l.parent.textContent,d=l.parentOffset;let w=d,h=d;for(;w>0&&!/\s/.test(c[w-1]);)w--;for(;h<c.length&&!/\s/.test(c[h]);)h++;const m=l.start(),b=m+w,g=m+h,x=c.slice(w,h);e.commands.setTextSelection({from:b,to:g}),r(t.linkAttrs.href||""),o(x||t.linkAttrs.alt||"")};return a.jsx(An,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isLink&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-link"})}),maxWidth:"400px",onOpenChange:l=>l&&u(),children:a.jsxs(kn,{children:[a.jsx(yt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Link",type:"url",value:n,onChange:l=>r(l.target.value),required:!0}),a.jsx(Te,{Label:"Text to display",type:"text",value:s,onChange:l=>o(l.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[t.isLink&&a.jsx(Ke,{color:"error",onClick:()=>e.chain().focus().unsetLink().run(),variant:"secondary",children:"Remove"}),a.jsx(Ke,{onClick:i,disabled:!n,children:"Save"})]})]})})},Yd=["e","E","+","-"],Xd="wu-border wu-rounded wu-w-10 wu-h-6 wu-text-center [appearance:textfield] [&::-webkit-outer-spin-button]:wu-appearance-none [&::-webkit-inner-spin-button]:wu-appearance-none focus:wu-border-blue-p",so=1,Zd=()=>{const{editor:e}=he(),[t,n]=p.useState(16),r=we.useEditorState({editor:e,selector:u=>({fontSize:u.editor.getAttributes("textStyle").fontSize})}),s=u=>{e.chain().focus().setFontSize(u+"px").run()},o=u=>{const l=Math.max(so,u);n(l),s(l)},i=u=>{Yd.includes(u.key)?u.preventDefault():u.key==="Enter"&&s(t)};return p.useEffect(()=>{var u;n(Number((u=r.fontSize)==null?void 0:u.replace("px",""))||16)},[r.fontSize]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-1",children:[a.jsx("button",{className:X.EditorAction,onClick:()=>o(t-1),disabled:t<=so,children:"−"}),a.jsx("input",{type:"number",inputMode:"numeric",pattern:"[0-9]*",className:Xd,value:t,onKeyDown:i,onChange:u=>n(u.target.valueAsNumber),onBlur:()=>s(t)}),a.jsx("button",{className:X.EditorAction,onClick:()=>o(t+1),disabled:t>=128,children:"+"})]})},Jd=()=>{const{editor:e,customFonts:t}=he(),n=we.useEditorState({editor:e,selector:i=>({currentFontFamily:i.editor.getAttributes("textStyle").fontFamily||""})}),r=["Fira Sans","Inter","Poppins","JetBrains Mono","Montserrat",...t||[]],[s,o]=p.useState(n.currentFontFamily||r[0]);return p.useEffect(()=>{var i;o(((i=n.currentFontFamily)==null?void 0:i.replace(/"/g,""))||r[0])},[n.currentFontFamily]),a.jsxs(Mr,{children:[a.jsx(Ir,{className:X.EditorAction+" wu-transition-colors "+(s!=="Fira Sans"&&X.EditorActionActive),style:{fontFamily:s},title:s||"Font Family",children:s==null?void 0:s[0]}),a.jsx(Tn,{align:"start",className:"wu-border-blue-p wu-rounded",children:r.map(i=>a.jsx(Kt,{title:i,onSelect:()=>{e.chain().focus().setFontFamily(i).run(),o(i)},className:s===i?X.EditorActionActive:"",children:i},i))})]})},Qd={block:a.jsx(Td,{}),fontFamily:a.jsx(Jd,{}),fontSize:a.jsx(Zd,{}),bold:a.jsx(Vd,{}),italic:a.jsx(Ld,{}),underline:a.jsx(_d,{}),strike:a.jsx(Od,{}),color:a.jsx(Ed,{}),list:a.jsx(Ad,{}),alignment:a.jsx(kd,{}),image:a.jsx(Gd,{}),link:a.jsx(Kd,{}),table:a.jsx(jd,{}),blockquote:a.jsx(Dd,{}),superscript:a.jsx(Pd,{}),subscript:a.jsx(Fd,{}),codeline:a.jsx(Md,{}),clear:a.jsx(Id,{}),"|":a.jsx(Dr,{orientation:"vertical",className:"wu-h-5"})},Rd=["block","fontFamily","|","fontSize","|","bold","italic","underline","strike","|","color","|","list","alignment","|","image","link","table","|","blockquote","superscript","subscript","codeline","|","clear"],ew=e=>{const{editor:t,customFonts:n,children:r,items:s=Rd,...o}=e;return a.jsx("div",{...o,children:a.jsx(Cd,{editor:t,customFonts:n,children:a.jsxs("div",{className:"wu-flex wu-gap-1 wu-p-2 wu-items-center wu-justify-start wu-border-gray-40",children:[s.map((i,u)=>a.jsx(a.Fragment,{children:Qd[i]},i+u)),r]})})})},tw=[Sc.configure({link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const n=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(n.href))return!1;const r=["ftp","file","mailto"],s=n.protocol.replace(":","");if(r.includes(s)||!t.protocols.map(l=>typeof l=="string"?l:l.scheme).includes(s))return!1;const i=["example-phishing.com","malicious-site.net"],u=n.hostname;return!i.includes(u)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),n=["example-no-autolink.com","another-no-autolink.com"],r=t.hostname;return!n.includes(r)}catch{return!1}}}}),Nc.configure({types:["heading","paragraph"]}),xc,yc,pt.TextStyle,pt.Color,pt.BackgroundColor,ha.TaskList,ha.TaskItem,pt.LineHeight,pt.FontSize,pt.FontFamily,Cc.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),vc.TableKit.configure({table:{resizable:!0}})],nw=e=>{const{defaultValue:t,onUpdate:n,className:r,readonly:s,toolbarPosition:o="top",classNames:i={},customToolbarChildren:u,toolbarItems:l,...c}=e,d=we.useEditor({editable:!s,extensions:tw,content:t,onUpdate:({editor:w})=>{n&&n(w.getHTML())}});return a.jsxs("div",{className:f(X.WuContentEditor,r,o==="top"?"wu-flex-col":"wu-flex-col-reverse"),...c,children:[a.jsx(ew,{editor:d,customFonts:e.customFonts,className:f("wu-sticky wu-z-10 wu-bg-white",i.toolbar,o==="top"?"wu-top-0 wu-border-b":"wu-bottom-0 wu-border-t"),items:l,children:u}),a.jsx(we.EditorContent,{editor:d,className:f("wu-p-4 wu-flex-grow",i.editor)})]})},rw=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=p.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(ce,{...r,onClick:i,variant:"iconOnly",className:f("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:f("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(re,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ao=Q.Root,sw=Q.Trigger,aw=Q.Close,ow=Q.Portal,oo=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));oo.displayName=Q.Overlay.displayName;const iw=Me.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),Lr=v.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(ow,{children:[a.jsx(oo,{className:s}),a.jsxs(Q.Content,{ref:u,className:f(iw({side:e}),t),...i,children:[n,!r&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Lr.displayName=Q.Content.displayName;const io=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-semibold",e),...t}));io.displayName=Q.Title.displayName;const uw=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm",e),...t}));uw.displayName=Q.Description.displayName;const lw=e=>t=>{e&&t.preventDefault()},cw=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:c,closeButtonClassName:d,...w}=e;return a.jsxs(ao,{open:i,onOpenChange:u,children:[a.jsx(sw,{asChild:!0,children:t}),a.jsxs(Lr,{onInteractOutside:lw(l),side:o,className:f("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:c,closeButtonClassName:d,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(io,{})}),n]})]})},dw=({children:e,...t})=>a.jsx(aw,{...t,children:e}),uo=p.createContext({});function _r(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Or=typeof window<"u",lo=Or?p.useLayoutEffect:p.useEffect,Mn=p.createContext(null);function ww(e,t){e.indexOf(t)===-1&&e.push(t)}function fw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const tt=(e,t,n)=>n>t?t:n<e?e:n;function Wr(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Xt=()=>{},nt=()=>{};process.env.NODE_ENV!=="production"&&(Xt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Wr(t,n))},nt=(e,t,n)=>{if(!e)throw new Error(Wr(t,n))});const je={},co=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function pw(e){return typeof e=="object"&&e!==null}const wo=e=>/^0[^.\s]+$/u.test(e);function Br(e){let t;return()=>(t===void 0&&(t=e()),t)}const xt=e=>e,hw=(e,t)=>n=>t(e(n)),In=(...e)=>e.reduce(hw),fo=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class po{constructor(){this.subscriptions=[]}add(t){return ww(this.subscriptions,t),()=>fw(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qe=e=>e*1e3,De=e=>e/1e3;function ho(e,t){return t?e*(1e3/t):0}const mo=new Set;function go(e,t,n){e||mo.has(t)||(console.warn(Wr(t,n)),mo.add(t))}const bo=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mw=1e-7,gw=12;function bw(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=bo(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>mw&&++u<gw);return i}function Zt(e,t,n,r){if(e===t&&n===r)return xt;const s=o=>bw(o,0,1,e,n);return o=>o===0||o===1?o:bo(s(o),t,r)}const yo=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xo=e=>t=>1-e(1-t),vo=Zt(.33,1.53,.69,.99),zr=xo(vo),No=yo(zr),So=e=>(e*=2)<1?.5*zr(e):.5*(2-Math.pow(2,-10*(e-1))),qr=e=>1-Math.sin(Math.acos(e)),yw=xo(qr),Co=yo(qr),xw=Zt(.42,0,1,1),vw=Zt(0,0,.58,1),To=Zt(.42,0,.58,1),Nw=e=>Array.isArray(e)&&typeof e[0]!="number",Eo=e=>Array.isArray(e)&&typeof e[0]=="number",Ao={linear:xt,easeIn:xw,easeInOut:To,easeOut:vw,circIn:qr,circInOut:Co,circOut:yw,backIn:zr,backInOut:No,backOut:vo,anticipate:So},Sw=e=>typeof e=="string",ko=e=>{if(Eo(e)){nt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return Zt(t,n,r,s)}else if(Sw(e))return nt(Ao[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ao[e];return e},Dn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Cw(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),e()),d(u)}const c={schedule:(d,w=!1,h=!1)=>{const b=h&&s?n:r;return w&&i.add(d),b.has(d)||b.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(u=d,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(l),n.clear(),s=!1,o&&(o=!1,c.process(d))}};return c}const Tw=40;function Mo(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Dn.reduce((N,C)=>(N[C]=Cw(o),N),{}),{setup:u,read:l,resolveKeyframes:c,preUpdate:d,update:w,preRender:h,render:m,postRender:b}=i,g=()=>{const N=je.useManualTiming?s.timestamp:performance.now();n=!1,je.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(N-s.timestamp,Tw),1)),s.timestamp=N,s.isProcessing=!0,u.process(s),l.process(s),c.process(s),d.process(s),w.process(s),h.process(s),m.process(s),b.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Dn.reduce((N,C)=>{const E=i[C];return N[C]=(M,A=!1,k=!1)=>(n||x(),E.schedule(M,A,k)),N},{}),cancel:N=>{for(let C=0;C<Dn.length;C++)i[Dn[C]].cancel(N)},state:s,steps:i}}const{schedule:Pe,cancel:$r,state:Pn}=Mo(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0);let Fn;function Ew(){Fn=void 0}const ke={now:()=>(Fn===void 0&&ke.set(Pn.isProcessing||je.useManualTiming?Pn.timestamp:performance.now()),Fn),set:e=>{Fn=e,queueMicrotask(Ew)}},Io=e=>t=>typeof t=="string"&&t.startsWith(e),Do=Io("--"),Aw=Io("var(--"),Hr=e=>Aw(e)?kw.test(e.split("/*")[0].trim()):!1,kw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Jt={...vt,transform:e=>tt(0,1,e)},Vn={...vt,default:1},Qt=e=>Math.round(e*1e5)/1e5,Ur=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Mw(e){return e==null}const Iw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jr=(e,t)=>n=>!!(typeof n=="string"&&Iw.test(n)&&n.startsWith(e)||t&&!Mw(n)&&Object.prototype.hasOwnProperty.call(n,t)),Po=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(Ur);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},Dw=e=>tt(0,255,e),Gr={...vt,transform:e=>Math.round(Dw(e))},rt={test:jr("rgb","red"),parse:Po("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Gr.transform(e)+", "+Gr.transform(t)+", "+Gr.transform(n)+", "+Qt(Jt.transform(r))+")"};function Pw(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Kr={test:jr("#"),parse:Pw,transform:rt.transform},Rt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ye=Rt("deg"),Nt=Rt("%"),L=Rt("px"),Fw=Rt("vh"),Vw=Rt("vw"),Fo={...Nt,parse:e=>Nt.parse(e)/100,transform:e=>Nt.transform(e*100)},St={test:jr("hsl","hue"),parse:Po("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Nt.transform(Qt(t))+", "+Nt.transform(Qt(n))+", "+Qt(Jt.transform(r))+")"},de={test:e=>rt.test(e)||Kr.test(e)||St.test(e),parse:e=>rt.test(e)?rt.parse(e):St.test(e)?St.parse(e):Kr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?rt.transform(e):St.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},Lw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _w(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ur))==null?void 0:t.length)||0)+(((n=e.match(Lw))==null?void 0:n.length)||0)>0}const Vo="number",Lo="color",Ow="var",Ww="var(",_o="${}",Bw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function en(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(Bw,l=>(de.test(l)?(r.color.push(o),s.push(Lo),n.push(de.parse(l))):l.startsWith(Ww)?(r.var.push(o),s.push(Ow),n.push(l)):(r.number.push(o),s.push(Vo),n.push(parseFloat(l))),++o,_o)).split(_o);return{values:n,split:u,indexes:r,types:s}}function Oo(e){return en(e).values}function Wo(e){const{split:t,types:n}=en(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const u=n[i];u===Vo?o+=Qt(s[i]):u===Lo?o+=de.transform(s[i]):o+=s[i]}return o}}const zw=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e;function qw(e){const t=Oo(e);return Wo(e)(t.map(zw))}const Xe={test:_w,parse:Oo,createTransformer:Wo,getAnimatableNone:qw};function Yr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $w({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Yr(l,u,e+1/3),o=Yr(l,u,e),i=Yr(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Ln(e,t){return n=>n>0?t:e}const tn=(e,t,n)=>e+(t-e)*n,Xr=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Hw=[Kr,rt,St],Uw=e=>Hw.find(t=>t.test(e));function Bo(e){const t=Uw(e);if(Xt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===St&&(n=$w(n)),n}const zo=(e,t)=>{const n=Bo(e),r=Bo(t);if(!n||!r)return Ln(e,t);const s={...n};return o=>(s.red=Xr(n.red,r.red,o),s.green=Xr(n.green,r.green,o),s.blue=Xr(n.blue,r.blue,o),s.alpha=tn(n.alpha,r.alpha,o),rt.transform(s))},Zr=new Set(["none","hidden"]);function jw(e,t){return Zr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Gw(e,t){return n=>tn(e,t,n)}function Jr(e){return typeof e=="number"?Gw:typeof e=="string"?Hr(e)?Ln:de.test(e)?zo:Xw:Array.isArray(e)?qo:typeof e=="object"?de.test(e)?zo:Kw:Ln}function qo(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Jr(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Kw(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Jr(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Yw(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Xw=(e,t)=>{const n=Xe.createTransformer(t),r=en(e),s=en(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Zr.has(e)&&!s.values.length||Zr.has(t)&&!r.values.length?jw(e,t):In(qo(Yw(r,s),s.values),n):(Xt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ln(e,t))};function $o(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?tn(e,t,n):Jr(e)(e,t)}const Zw=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Pe.update(t,n),stop:()=>$r(t),now:()=>Pn.isProcessing?Pn.timestamp:ke.now()}},Ho=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},_n=2e4;function Qr(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<_n;)t+=n,r=e.next(t);return t>=_n?1/0:t}function Jw(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Qr(r),_n);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:De(s)}}const Qw=5;function Uo(e,t,n){const r=Math.max(t-Qw,0);return ho(n-e(r),t-r)}const ie={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Rr=.001;function Rw({duration:e=ie.duration,bounce:t=ie.bounce,velocity:n=ie.velocity,mass:r=ie.mass}){let s,o;Xt(e<=qe(ie.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=tt(ie.minDamping,ie.maxDamping,i),e=tt(ie.minDuration,ie.maxDuration,De(e)),i<1?(s=c=>{const d=c*i,w=d*e,h=d-n,m=es(c,i),b=Math.exp(-w);return Rr-h/m*b},o=c=>{const w=c*i*e,h=w*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,b=Math.exp(-w),g=es(Math.pow(c,2),i);return(-s(c)+Rr>0?-1:1)*((h-m)*b)/g}):(s=c=>{const d=Math.exp(-c*e),w=(c-n)*e+1;return-Rr+d*w},o=c=>{const d=Math.exp(-c*e),w=(n-c)*(e*e);return d*w});const u=5/e,l=tf(s,o,u);if(e=qe(e),isNaN(l))return{stiffness:ie.stiffness,damping:ie.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const ef=12;function tf(e,t,n){let r=n;for(let s=1;s<ef;s++)r=r-e(r)/t(r);return r}function es(e,t){return e*Math.sqrt(1-t*t)}const nf=["duration","bounce"],rf=["stiffness","damping","mass"];function jo(e,t){return t.some(n=>e[n]!==void 0)}function sf(e){let t={velocity:ie.velocity,stiffness:ie.stiffness,damping:ie.damping,mass:ie.mass,isResolvedFromDuration:!1,...e};if(!jo(e,rf)&&jo(e,nf))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*tt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ie.mass,stiffness:s,damping:o}}else{const n=Rw(e);t={...t,...n,mass:ie.mass},t.isResolvedFromDuration=!0}return t}function On(e=ie.visualDuration,t=ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:c,mass:d,duration:w,velocity:h,isResolvedFromDuration:m}=sf({...n,velocity:-De(n.velocity||0)}),b=h||0,g=c/(2*Math.sqrt(l*d)),x=i-o,S=De(Math.sqrt(l/d)),y=Math.abs(x)<5;r||(r=y?ie.restSpeed.granular:ie.restSpeed.default),s||(s=y?ie.restDelta.granular:ie.restDelta.default);let N;if(g<1){const E=es(S,g);N=M=>{const A=Math.exp(-g*S*M);return i-A*((b+g*S*x)/E*Math.sin(E*M)+x*Math.cos(E*M))}}else if(g===1)N=E=>i-Math.exp(-S*E)*(x+(b+S*x)*E);else{const E=S*Math.sqrt(g*g-1);N=M=>{const A=Math.exp(-g*S*M),k=Math.min(E*M,300);return i-A*((b+g*S*x)*Math.sinh(k)+E*x*Math.cosh(k))/E}}const C={calculatedDuration:m&&w||null,next:E=>{const M=N(E);if(m)u.done=E>=w;else{let A=E===0?b:0;g<1&&(A=E===0?qe(b):Uo(N,E,M));const k=Math.abs(A)<=r,D=Math.abs(i-M)<=s;u.done=k&&D}return u.value=u.done?i:M,u},toString:()=>{const E=Math.min(Qr(C),_n),M=Ho(A=>C.next(E*A).value,E,30);return E+"ms "+M},toTransition:()=>{}};return C}On.applyToOptions=e=>{const t=Jw(e,100,On);return e.ease=t.ease,e.duration=qe(t.duration),e.type="keyframes",e};function ts({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:c=.5,restSpeed:d}){const w=e[0],h={done:!1,value:w},m=k=>u!==void 0&&k<u||l!==void 0&&k>l,b=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let g=n*t;const x=w+g,S=i===void 0?x:i(x);S!==x&&(g=S-w);const y=k=>-g*Math.exp(-k/r),N=k=>S+y(k),C=k=>{const D=y(k),F=N(k);h.done=Math.abs(D)<=c,h.value=h.done?S:F};let E,M;const A=k=>{m(h.value)&&(E=k,M=On({keyframes:[h.value,b(h.value)],velocity:Uo(N,k,h.value),damping:s,stiffness:o,restDelta:c,restSpeed:d}))};return A(0),{calculatedDuration:null,next:k=>{let D=!1;return!M&&E===void 0&&(D=!0,C(k),A(k)),E!==void 0&&k>=E?M.next(k-E):(!D&&C(k),h)}}}function af(e,t,n){const r=[],s=n||je.mix||$o,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||xt:t;u=In(l,u)}r.push(u)}return r}function of(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(nt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=af(t,r,s),l=u.length,c=d=>{if(i&&d<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(d<e[w+1]);w++);const h=fo(e[w],e[w+1],d);return u[w](h)};return n?d=>c(tt(e[0],e[o-1],d)):c}function uf(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fo(0,t,r);e.push(tn(n,1,s))}}function lf(e){const t=[0];return uf(t,e.length-1),t}function cf(e,t){return e.map(n=>n*t)}function df(e,t){return e.map(()=>t||To).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Nw(r)?r.map(ko):ko(r),o={done:!1,value:t[0]},i=cf(n&&n.length===t.length?n:lf(t),e),u=of(i,t,{ease:Array.isArray(s)?s:df(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const wf=e=>e!==null;function ns(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(wf),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const ff={decay:ts,inertia:ts,tween:Ct,keyframes:Ct,spring:On};function Go(e){typeof e.type=="string"&&(e.type=ff[e.type])}class rs{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const pf=e=>e/100;class ss extends rs{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ke.now()&&this.tick(ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Go(t);const{type:n=Ct,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||Ct;process.env.NODE_ENV!=="production"&&l!==Ct&&nt(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==Ct&&typeof u[0]!="number"&&(this.mixKeyframes=In(pf,$o(u[0],u[1])),u=[0,100]);const c=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=Qr(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:w,repeatType:h,repeatDelay:m,type:b,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,C=r;if(w){const k=Math.min(this.currentTime,s)/u;let D=Math.floor(k),F=k%1;!F&&k>=1&&(F=1),F===1&&D--,D=Math.min(D,w+1),!!(D%2)&&(h==="reverse"?(F=1-F,m&&(F-=m/u)):h==="mirror"&&(C=i)),N=tt(0,1,F)*u}const E=y?{done:!1,value:d[0]}:C.next(N);o&&(E.value=o(E.value));let{done:M}=E;!y&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return A&&b!==ts&&(E.value=ns(d,this.options,x,this.speed)),g&&g(E.value),A&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return De(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+De(t)}get time(){return De(this.currentTime)}set time(t){var n;t=qe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ke.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=De(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Zw,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function hf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const st=e=>e*180/Math.PI,as=e=>{const t=st(Math.atan2(e[1],e[0]));return os(t)},mf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:as,rotateZ:as,skewX:e=>st(Math.atan(e[1])),skewY:e=>st(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},os=e=>(e=e%360,e<0&&(e+=360),e),Ko=as,Yo=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xo=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yo,scaleY:Xo,scale:e=>(Yo(e)+Xo(e))/2,rotateX:e=>os(st(Math.atan2(e[6],e[5]))),rotateY:e=>os(st(Math.atan2(-e[2],e[0]))),rotateZ:Ko,rotate:Ko,skewX:e=>st(Math.atan(e[4])),skewY:e=>st(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function is(e){return e.includes("scale")?1:0}function us(e,t){if(!e||e==="none")return is(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=gf,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=mf,s=u}if(!s)return is(t);const o=r[t],i=s[1].split(",").map(yf);return typeof o=="function"?o(i):i[o]}const bf=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return us(n,t)};function yf(e){return parseFloat(e.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Et=new Set(Tt),Zo=e=>e===vt||e===L,xf=new Set(["x","y","z"]),vf=Tt.filter(e=>!xf.has(e));function Nf(e){const t=[];return vf.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const at={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>us(t,"x"),y:(e,{transform:t})=>us(t,"y")};at.translateX=at.x,at.translateY=at.y;const ot=new Set;let ls=!1,cs=!1,ds=!1;function Jo(){if(cs){const e=Array.from(ot).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Nf(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cs=!1,ls=!1,ot.forEach(e=>e.complete(ds)),ot.clear()}function Qo(){ot.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cs=!0)})}function Sf(){ds=!0,Qo(),Jo(),ds=!1}class ws{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(ot.add(this),ls||(ls=!0,Pe.read(Qo),Pe.resolveKeyframes(Jo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}hf(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ot.delete(this)}cancel(){this.state==="scheduled"&&(ot.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Cf=e=>e.startsWith("--");function Tf(e,t,n){Cf(t)?e.style.setProperty(t,n):e.style[t]=n}const Ef=Br(()=>window.ScrollTimeline!==void 0),Af={};function kf(e,t){const n=Br(e);return()=>Af[t]??n()}const Ro=kf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),nn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ei={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:nn([0,.65,.55,1]),circOut:nn([.55,0,1,.45]),backIn:nn([.31,.01,.66,-.59]),backOut:nn([.33,1.53,.69,.99])};function ti(e,t){if(e)return typeof e=="function"?Ro()?Ho(e,t):"ease-out":Eo(e)?nn(e):Array.isArray(e)?e.map(n=>ti(n,t)||ei.easeOut):ei[e]}function Mf(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const w=ti(u,s);Array.isArray(w)&&(d.easing=w);const h={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function ni(e){return typeof e=="function"&&"applyToOptions"in e}function If({type:e,...t}){return ni(e)&&Ro()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Df extends rs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,nt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=If(t);this.animation=Mf(n,r,s,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=ns(s,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):Tf(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return De(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+De(t)}get time(){return De(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=qe(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ef()?(this.animation.timeline=t,xt):n(this)}}const ri={anticipate:So,backInOut:No,circInOut:Co};function Pf(e){return e in ri}function Ff(e){typeof e.ease=="string"&&Pf(e.ease)&&(e.ease=ri[e.ease])}const si=10;class Vf extends Df{constructor(t){Ff(t),Go(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new ss({...i,autoplay:!1}),l=qe(this.finishedTime??this.time);n.setWithVelocity(u.sample(l-si).value,u.sample(l).value,si),u.stop()}}const ai=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xe.test(e)||e==="0")&&!e.startsWith("url("));function Lf(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function _f(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=ai(s,t),u=ai(o,t);return Xt(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:Lf(e)||(n==="spring"||ni(n))&&r}function fs(e){e.duration=0,e.type="keyframes"}const Of=new Set(["opacity","clipPath","filter","transform"]),Wf=Br(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Bf(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return Wf()&&n&&Of.has(n)&&(n!=="transform"||!c)&&!l&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const zf=40;class qf extends rs{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:c,element:d,...w}){var b;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=ke.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:c,element:d,...w},m=(d==null?void 0:d.KeyframeResolver)||ws;this.keyframeResolver=new m(u,(g,x,S)=>this.onKeyframesResolved(g,x,h,!S),l,c,d),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=ke.now(),_f(t,o,i,u)||((je.instantAnimations||!l)&&(d==null||d(ns(t,r,n))),t[0]=t[t.length-1],fs(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>zf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!c&&Bf(h)?new Vf({...h,element:h.motionValue.owner.current}):new ss(h);m.finished.then(()=>this.notifyFinished()).catch(xt),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Sf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const $f=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hf(e){const t=$f.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Uf=4;function oi(e,t,n=1){nt(n<=Uf,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=Hf(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return co(i)?parseFloat(i):i}return Hr(s)?oi(s,t,n+1):s}function ii(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const ui=new Set(["width","height","top","left","right","bottom",...Tt]),jf={test:e=>e==="auto",parse:e=>e},li=e=>t=>t.test(e),ci=[vt,L,Nt,Ye,Vw,Fw,jf],di=e=>ci.find(li(e));function Gf(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wo(e):!0}const Kf=new Set(["brightness","contrast","saturate","opacity"]);function Yf(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ur)||[];if(!r)return e;const s=n.replace(r,"");let o=Kf.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Xf=/\b([a-z-]*)\(.*?\)/gu,ps={...Xe,getAnimatableNone:e=>{const t=e.match(Xf);return t?t.map(Yf).join(" "):e}},wi={...vt,transform:Math.round},hs={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,backgroundPositionX:L,backgroundPositionY:L,...{rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:Vn,scaleX:Vn,scaleY:Vn,scaleZ:Vn,skew:Ye,skewX:Ye,skewY:Ye,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:Jt,originX:Fo,originY:Fo,originZ:L},zIndex:wi,fillOpacity:Jt,strokeOpacity:Jt,numOctaves:wi},Zf={...hs,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:ps,WebkitFilter:ps},fi=e=>Zf[e];function pi(e,t){let n=fi(e);return n!==ps&&(n=Xe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Jf=new Set(["auto","none","0"]);function Qf(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!Jf.has(o)&&en(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=pi(n,s)}class Rf extends ws{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Hr(c))){const d=oi(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ui.has(r)||t.length!==2)return;const[s,o]=t,i=di(s),u=di(o);if(i!==u)if(Zo(i)&&Zo(u))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else at[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Gf(t[s]))&&r.push(s);r.length&&Qf(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=at[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function ep(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const hi=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function mi(e){return pw(e)&&"offsetHeight"in e}const gi=30,tp=e=>!isNaN(parseFloat(e));class np{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=ke.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=tp(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&go(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new po);const r=this.events[t].add(n);return t==="change"?()=>{r(),Pe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gi)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gi);return ho(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wn(e,t){return new np(e,t)}const{schedule:rp}=Mo(queueMicrotask,!1),sp={y:!1};function ap(){return sp.y}function bi(e,t){const n=ep(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function yi(e){return!(e.pointerType==="touch"||ap())}function op(e,t,n={}){const[r,s,o]=bi(e,n),i=u=>{if(!yi(u))return;const{target:l}=u,c=t(l,u);if(typeof c!="function"||!l)return;const d=w=>{yi(w)&&(c(w),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,s)};return r.forEach(u=>{u.addEventListener("pointerenter",i,s)}),o}const xi=(e,t)=>t?e===t?!0:xi(e,t.parentElement):!1,ip=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,up=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lp(e){return up.has(e.tagName)||e.tabIndex!==-1}const Bn=new WeakSet;function vi(e){return t=>{t.key==="Enter"&&e(t)}}function ms(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cp=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=vi(()=>{if(Bn.has(n))return;ms(n,"down");const s=vi(()=>{ms(n,"up")}),o=()=>ms(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ni(e){return ip(e)&&!0}function dp(e,t,n={}){const[r,s,o]=bi(e,n),i=u=>{const l=u.currentTarget;if(!Ni(u))return;Bn.add(l);const c=t(l,u),d=(m,b)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",h),Bn.has(l)&&Bn.delete(l),Ni(m)&&typeof c=="function"&&c(m,{success:b})},w=m=>{d(m,l===window||l===document||n.useGlobalTarget||xi(l,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",h,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),mi(u)&&(u.addEventListener("focus",c=>cp(c,s)),!lp(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const ge=e=>!!(e&&e.getVelocity),wp=[...ci,de,Xe],fp=e=>wp.find(li(e)),gs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Si(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pp(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Si(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Si(e[s],null)}}}}function hp(...e){return v.useCallback(pp(...e),e)}class mp extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=mi(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function gp({children:e,isPresent:t,anchorX:n,root:r}){const s=p.useId(),o=p.useRef(null),i=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:u}=p.useContext(gs),l=hp(o,e==null?void 0:e.ref);return p.useInsertionEffect(()=>{const{width:c,height:d,top:w,left:h,right:m}=i.current;if(t||!o.current||!c||!d)return;const b=n==="left"?`left: ${h}`:`right: ${m}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");u&&(g.nonce=u);const x=r??document.head;return x.appendChild(g),g.sheet&&g.sheet.insertRule(`
12
8
  [data-motion-pop-id="${s}"] {
13
9
  position: absolute !important;
14
10
  width: ${c}px !important;
@@ -16,5 +12,9 @@
16
12
  ${b}px !important;
17
13
  top: ${w}px !important;
18
14
  }
19
- `),()=>{x.contains(g)&&x.removeChild(g)}},[t]),a.jsx(Km,{isPresent:t,childRef:o,sizeRef:i,children:v.cloneElement(e,{ref:l})})}const Xm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,root:l})=>{const c=ps(Zm),d=p.useId();let w=!0,h=p.useMemo(()=>(w=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{c.set(m,!0);for(const b of c.values())if(!b)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return o&&w&&(h={...h}),p.useMemo(()=>{c.forEach((m,b)=>c.set(b,!1))},[n]),v.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),i==="popLayout"&&(e=a.jsx(Ym,{isPresent:n,anchorX:u,root:l,children:e})),a.jsx(jn.Provider,{value:h,children:e})};function Zm(){return new Map}function Jm(e=!0){const t=p.useContext(jn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=p.useId();p.useEffect(()=>{if(e)return s(o)},[e]);const i=p.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const nr=e=>e.key||"";function Cl(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const Tl=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",root:l})=>{const[c,d]=Jm(i),w=p.useMemo(()=>Cl(e),[e]),h=i&&!c?[]:w.map(nr),m=p.useRef(!0),b=p.useRef(w),g=ps(()=>new Map),[x,S]=p.useState(w),[y,N]=p.useState(w);cu(()=>{m.current=!1,b.current=w;for(let M=0;M<y.length;M++){const A=nr(y[M]);h.includes(A)?g.delete(A):g.get(A)!==!0&&g.set(A,!1)}},[y,h.length,h.join("-")]);const C=[];if(w!==x){let M=[...w];for(let A=0;A<y.length;A++){const k=y[A],D=nr(k);h.includes(D)||(M.splice(A,0,k),C.push(k))}return o==="wait"&&C.length&&(M=C),N(Cl(M)),S(w),null}process.env.NODE_ENV!=="production"&&o==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:E}=p.useContext(lu);return a.jsx(a.Fragment,{children:y.map(M=>{const A=nr(M),k=i&&!c?!1:w===y||h.includes(A),D=()=>{if(g.has(A))g.set(A,!0);else return;let F=!0;g.forEach(V=>{V||(F=!1)}),F&&(E==null||E(),N(b.current),i&&(d==null||d()),r&&r())};return a.jsx(Xm,{isPresent:k,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:k?void 0:D,anchorX:u,children:M},A)})})},Zs=p.createContext({strict:!1}),El={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Dt={};for(const e in El)Dt[e]={isEnabled:t=>El[e].some(n=>!!t[n])};function Al(e){for(const t in e)Dt[t]={...Dt[t],...e[t]}}function kl({children:e,features:t,strict:n=!1}){const[,r]=p.useState(!Js(t)),s=p.useRef(void 0);if(!Js(t)){const{renderer:o,...i}=t;s.current=o,Al(i)}return p.useEffect(()=>{Js(t)&&t().then(({renderer:o,...i})=>{Al(i),s.current=o,r(!0)})},[]),a.jsx(Zs.Provider,{value:{renderer:s.current,strict:n},children:e})}function Js(e){return typeof e=="function"}const Qm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function rr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Qm.has(e)}let Ml=e=>!rr(e);function Rm(e){typeof e=="function"&&(Ml=t=>t.startsWith("on")?!rr(t):e(t))}try{Rm(require("@emotion/is-prop-valid").default)}catch{}function eg(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Ml(s)||n===!0&&rr(s)||!t&&!rr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const sr=p.createContext({});function ar(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function hn(e){return typeof e=="string"||Array.isArray(e)}const Qs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rs=["initial",...Qs];function or(e){return ar(e.animate)||Rs.some(t=>hn(e[t]))}function Il(e){return!!(or(e)||e.variants)}function tg(e,t){if(or(e)){const{initial:n,animate:r}=e;return{initial:n===!1||hn(n)?n:void 0,animate:hn(r)?r:void 0}}return e.inherit!==!1?t:{}}function ng(e){const{initial:t,animate:n}=tg(e,p.useContext(sr));return p.useMemo(()=>({initial:t,animate:n}),[Dl(t),Dl(n)])}function Dl(e){return Array.isArray(e)?e.join(" "):e}function Pl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Pl(e,t.target.x),r=Pl(e,t.target.y);return`${n}% ${r}%`}},rg={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ze.parse(e);if(s.length>5)return r;const o=Ze.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const c=fn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=c),typeof s[3+i]=="number"&&(s[3+i]/=c),o(s)}},sg={borderRadius:{...mn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mn,borderTopRightRadius:mn,borderBottomLeftRadius:mn,borderBottomRightRadius:mn,boxShadow:rg};function Fl(e,{layout:t,layoutId:n}){return It.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!sg[e]||e==="opacity")}const ag={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},og=Mt.length;function ig(e,t,n){let r="",s=!0;for(let o=0;o<og;o++){const i=Mt[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number"?l=u===(i.startsWith("scale")?1:0):l=parseFloat(u)===0,!l||n){const c=hl(u,Ks[i]);if(!l){s=!1;const d=ag[i]||i;r+=`${d}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ea(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const c=t[l];if(It.has(l)){i=!0;continue}else if(Du(l)){s[l]=c;continue}else{const d=hl(c,Ks[l]);l.startsWith("origin")?(u=!0,o[l]=d):r[l]=d}}if(t.transform||(i||n?r.transform=ig(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;r.transformOrigin=`${l} ${c} ${d}`}}const ta=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vl(e,t,n){for(const r in t)!ge(t[r])&&!Fl(r,n)&&(e[r]=t[r])}function ug({transformTemplate:e},t){return p.useMemo(()=>{const n=ta();return ea(n,t,e),Object.assign({},n.vars,n.style)},[t])}function lg(e,t){const n=e.style||{},r={};return Vl(r,n,e),Object.assign(r,ug(e,t)),r}function cg(e,t){const n={},r=lg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const dg={offset:"stroke-dashoffset",array:"stroke-dasharray"},wg={offset:"strokeDashoffset",array:"strokeDasharray"};function fg(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?dg:wg;e[o.offset]=L.transform(-r);const i=L.transform(t),u=L.transform(n);e[o.array]=`${i} ${u}`}function Ll(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,c,d){if(ea(e,u,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:h}=e;w.transform&&(h.transform=w.transform,delete w.transform),(h.transform||w.transformOrigin)&&(h.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete w.transformBox),t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&fg(w,s,o,i,!1)}const _l=()=>({...ta(),attrs:{}}),Ol=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pg(e,t,n,r){const s=p.useMemo(()=>{const o=_l();return Ll(o,t,Ol(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Vl(o,e.style,e),s.style={...o,...s.style}}return s}const hg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function na(e){return typeof e!="string"||e.includes("-")?!1:!!(hg.indexOf(e)>-1||/[A-Z]/u.test(e))}function mg(e,t,n,{latestValues:r},s,o=!1){const u=(na(e)?pg:cg)(t,r,s,e),l=eg(t,typeof e=="string",o),c=e!==p.Fragment?{...l,...u,ref:n}:{},{children:d}=t,w=p.useMemo(()=>ge(d)?d.get():d,[d]);return p.createElement(e,{...c,children:w})}function Wl(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ra(e,t,n,r){if(typeof t=="function"){const[s,o]=Wl(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=Wl(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function gg(e){return ge(e)?e.get():e}function bg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:yg(n,r,s,e),renderState:t()}}function yg(e,t,n,r){const s={},o=r(e,{});for(const h in o)s[h]=gg(o[h]);let{initial:i,animate:u}=e;const l=or(e),c=Il(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const w=d?u:i;if(w&&typeof w!="boolean"&&!ar(w)){const h=Array.isArray(w)?w:[w];for(let m=0;m<h.length;m++){const b=ra(e,h[m]);if(b){const{transitionEnd:g,transition:x,...S}=b;for(const y in S){let N=S[y];if(Array.isArray(N)){const C=d?N.length-1:0;N=N[C]}N!==null&&(s[y]=N)}for(const y in g)s[y]=g[y]}}}return s}const Bl=e=>(t,n)=>{const r=p.useContext(sr),s=p.useContext(jn),o=()=>bg(e,t,r,s);return n?o():ps(o)};function sa(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(ge(r[i])||t.style&&ge(t.style[i])||Fl(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const xg=Bl({scrapeMotionValuesFromProps:sa,createRenderState:ta});function zl(e,t,n){const r=sa(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const o=Mt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const vg=Bl({scrapeMotionValuesFromProps:zl,createRenderState:_l}),Ng=Symbol.for("motionComponentSymbol");function ql(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sg(e,t,n){return p.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ql(n)&&(n.current=r))},[t])}const aa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$l="data-"+aa("framerAppearId"),Cg=p.createContext({});function Tg(e,t,n,r,s){var g,x;const{visualElement:o}=p.useContext(sr),i=p.useContext(Zs),u=p.useContext(jn),l=p.useContext(Xs).reducedMotion,c=p.useRef(null);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,w=p.useContext(Cg);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Eg(c.current,n,s,w);const h=p.useRef(!1);p.useInsertionEffect(()=>{d&&h.current&&d.update(n,u)});const m=n[$l],b=p.useRef(!!m&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,m))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,m)));return cu(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),b.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!b.current&&d.animationState&&d.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,m)}),b.current=!1),d.enteringChildren=void 0)}),d}function Eg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Hl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ql(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Hl(e){if(e)return e.options.allowProjection!==!1?e.projection:Hl(e.parent)}function Ag(e,{forwardMotionProps:t=!1}={},n,r){const s=na(e)?vg:xg;function o(u,l){let c;const d={...p.useContext(Xs),...u,layoutId:kg(u)},{isStatic:w}=d,h=ng(u),m=s(u,w);if(!w&&hs){Mg(d,n);const b=Ig(d);c=b.MeasureLayout,h.visualElement=Tg(e,m,d,r,b.ProjectionNode)}return a.jsxs(sr.Provider,{value:h,children:[c&&h.visualElement?a.jsx(c,{visualElement:h.visualElement,...d}):null,mg(e,u,Sg(m,h.visualElement,l),m,w,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=p.forwardRef(o);return i[Ng]=e,i}function kg({layoutId:e}){const t=p.useContext(lu).id;return t&&e!==void 0?t+"-"+e:e}function Mg(e,t){p.useContext(Zs).strict,process.env.NODE_ENV}function Ig(e){const{drag:t,layout:n}=Dt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Dg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Pg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fg(e,t){return Dg(Pg(e.getBoundingClientRect(),t))}const Ul=()=>({min:0,max:0}),jl=()=>({x:Ul(),y:Ul()}),oa={current:null},Gl={current:!1};function Vg(){if(Gl.current=!0,!!hs)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>oa.current=e.matches;e.addEventListener("change",t),t()}else oa.current=!1}const Lg=new WeakMap;function _g(e,t,n){for(const r in t){const s=t[r],o=n[r];if(ge(s))e.addValue(r,s);else if(ge(o))e.addValue(r,er(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,er(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Kl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Og{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Us,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ke.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,_e.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=or(n),this.isVariantNode=Il(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...w}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in w){const m=w[h];l[h]!==void 0&&ge(m)&&m.set(l[h])}}mount(t){var n;this.current=t,Lg.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),Gl.current||Vg(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:oa.current,process.env.NODE_ENV!=="production"&&gu(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),xs(this.notifyUpdate),xs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=It.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&_e.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Dt){const n=Dt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Kl.length;r++){const s=Kl[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=_g(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=er(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(du(r)||wu(r))?r=parseFloat(r):!Um(r)&&Ze.test(n)&&(r=pl(t,n)),this.setBaseTarget(t,ge(r)?r.get():r)),ge(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ra(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ge(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new pu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Vm.render(this.render)}}class Yl extends Og{constructor(){super(...arguments),this.KeyframeResolver=Im}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Xl(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Wg(e){return window.getComputedStyle(e)}class Bg extends Yl{constructor(){super(...arguments),this.type="html",this.renderInstance=Xl}readValueFromInstance(t,n){var r;if(It.has(n))return(r=this.projection)!=null&&r.isProjecting?Bs(n):Xh(t,n);{const s=Wg(t),o=(Du(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fg(t,n)}build(t,n,r){ea(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sa(t,n,r)}}const Zl=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function zg(e,t,n,r){Xl(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Zl.has(s)?s:aa(s),t.attrs[s])}class qg extends Yl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=jl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(It.has(n)){const r=fl(n);return r&&r.default||0}return n=Zl.has(n)?n:aa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zl(t,n,r)}build(t,n,r){Ll(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){zg(t,n,r,s)}mount(t){this.isSVGTag=Ol(t.tagName),super.mount(t)}}const $g=(e,t)=>na(e)?new qg(t):new Bg(t,{allowProjection:e!==p.Fragment});function Pt(e,t,n){const r=e.getProps();return ra(r,t,n!==void 0?n:r.custom,e)}const ia=e=>Array.isArray(e);function Hg(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,er(n))}function Ug(e){return ia(e)?e[e.length-1]||0:e}function jg(e,t){const n=Pt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Ug(o[i]);Hg(e,i,u)}}function Gg(e){return!!(ge(e)&&e.add)}function Kg(e,t){const n=e.getValue("willChange");if(Gg(n))return n.add(t);if(!n&&je.WillChange){const r=new je.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Yg(e){return e.props[$l]}const Xg=e=>e!==null;function Zg(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Xg),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const Jg={type:"spring",stiffness:500,damping:25,restSpeed:10},Qg=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rg={type:"keyframes",duration:.8},eb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tb=(e,{keyframes:t})=>t.length>2?Rg:It.has(e)?e.startsWith("scale")?Qg(t[1]):Jg:eb;function nb({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:u,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const rb=(e,t,n,r={},s,o)=>i=>{const u=il(r,e)||{},l=u.delay||r.delay||0;let{elapsed:c=0}=r;c=c-$e(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-c,onUpdate:h=>{t.set(h),u.onUpdate&&u.onUpdate(h)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};nb(u)||Object.assign(d,tb(e,d)),d.duration&&(d.duration=$e(d.duration)),d.repeatDelay&&(d.repeatDelay=$e(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let w=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(js(d),d.delay===0&&(w=!0)),(je.instantAnimations||je.skipAnimations)&&(w=!0,js(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const h=Zg(d.keyframes,u);if(h!==void 0){_e.update(()=>{d.onUpdate(h),d.onComplete()});return}}return u.isSync?new _s(d):new bm(d)};function sb({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Jl(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...u}=t;r&&(o=r);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const d in u){const w=e.getValue(d,e.latestValues[d]??null),h=u[d];if(h===void 0||c&&sb(c,d))continue;const m={delay:n,...il(o||{},d)},b=w.get();if(b!==void 0&&!w.isAnimating&&!Array.isArray(h)&&h===b&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const S=Yg(e);if(S){const y=window.MotionHandoffAnimation(S,d,_e);y!==null&&(m.startTime=y,g=!0)}}Kg(e,d),w.start(rb(d,w,h,e.shouldReduceMotion&&ul.has(d)?{type:!1}:m,e,g));const x=w.animation;x&&l.push(x)}return i&&Promise.all(l).then(()=>{_e.update(()=>{i&&jg(e,i)})}),l}function Ql(e,t,n,r=0,s=1){const o=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}function ua(e,t,n={}){var l;const r=Pt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(Jl(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:w,staggerDirection:h}=s;return ab(e,t,c,d,w,h,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[c,d]=u==="beforeChildren"?[o,i]:[i,o];return c().then(()=>d())}else return Promise.all([o(),i(n.delay)])}function ab(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(ua(l,t,{...i,delay:n+(typeof r=="function"?0:r)+Ql(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function ob(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>ua(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=ua(e,t,n);else{const s=typeof t=="function"?Pt(e,t,n.custom):t;r=Promise.all(Jl(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Rl(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ib=Rs.length;function ec(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ec(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ib;n++){const r=Rs[n],s=e.props[r];(hn(s)||s===!1)&&(t[r]=s)}return t}const ub=[...Qs].reverse(),lb=Qs.length;function cb(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ob(e,n,r)))}function db(e){let t=cb(e),n=tc(),r=!0;const s=l=>(c,d)=>{var h;const w=Pt(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(w){const{transition:m,transitionEnd:b,...g}=w;c={...c,...g,...b}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,d=ec(e.parent)||{},w=[],h=new Set;let m={},b=1/0;for(let x=0;x<lb;x++){const S=ub[x],y=n[S],N=c[S]!==void 0?c[S]:d[S],C=hn(N),E=S===l?y.isActive:null;E===!1&&(b=x);let M=N===d[S]&&N!==c[S]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),y.protectedKeys={...m},!y.isActive&&E===null||!N&&!y.prevProp||ar(N)||typeof N=="boolean")continue;const A=wb(y.prevProp,N);let k=A||S===l&&y.isActive&&!M&&C||x>b&&C,D=!1;const F=Array.isArray(N)?N:[N];let V=F.reduce(s(S),{});E===!1&&(V={});const{prevResolvedValues:$={}}=y,W={...$,...V},G=I=>{k=!0,h.has(I)&&(D=!0,h.delete(I)),y.needsAnimating[I]=!0;const _=e.getValue(I);_&&(_.liveStyle=!1)};for(const I in W){const _=V[I],z=$[I];if(m.hasOwnProperty(I))continue;let B=!1;ia(_)&&ia(z)?B=!Rl(_,z):B=_!==z,B?_!=null?G(I):h.add(I):_!==void 0&&h.has(I)?G(I):y.protectedKeys[I]=!0}y.prevProp=N,y.prevResolvedValues=V,y.isActive&&(m={...m,...V}),r&&e.blockInitialAnimation&&(k=!1);const q=M&&A;k&&(!q||D)&&w.push(...F.map(I=>{const _={type:S};if(typeof I=="string"&&r&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,B=Pt(z,I);if(z.enteringChildren&&B){const{delayChildren:ne}=B.transition||{};_.delay=Ql(z.enteringChildren,e,ne)}}return{animation:I,options:_}}))}if(h.size){const x={};if(typeof c.initial!="boolean"){const S=Pt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);S&&S.transition&&(x.transition=S.transition)}h.forEach(S=>{const y=e.getBaseTarget(S),N=e.getValue(S);N&&(N.liveStyle=!0),x[S]=y??null}),w.push({animation:x})}let g=!!w.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(w):Promise.resolve()}function u(l,c){var w;if(n[l].isActive===c)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:i,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tc()}}}function wb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Rl(t,e):!1}function lt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tc(){return{animate:lt(!0),whileInView:lt(),whileHover:lt(),whileTap:lt(),whileDrag:lt(),whileFocus:lt(),exit:lt()}}class Ft{constructor(t){this.isMounted=!1,this.node=t}update(){}}class fb extends Ft{constructor(t){super(t),t.animationState||(t.animationState=db(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ar(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let pb=0;class hb extends Ft{constructor(){super(...arguments),this.id=pb++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const mb={animation:{Feature:fb},exit:{Feature:hb}};function nc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rc(e){return{point:{x:e.pageX,y:e.pageY}}}function sc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&_e.postRender(()=>o(t,rc(t)))}class gb extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=Om(t,(n,r)=>(sc(this.node,r,"Start"),s=>sc(this.node,s,"End"))))}unmount(){}}class bb extends Ft{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gn(nc(this.node.current,"focus",()=>this.onFocus()),nc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ac(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&_e.postRender(()=>o(t,rc(t)))}class yb extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=$m(t,(n,r)=>(ac(this.node,r,"Start"),(s,{success:o})=>ac(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const la=new WeakMap,ca=new WeakMap,xb=e=>{const t=la.get(e.target);t&&t(e)},vb=e=>{e.forEach(xb)};function Nb({root:e,...t}){const n=e||document;ca.has(n)||ca.set(n,{});const r=ca.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(vb,{root:e,...t})),r[s]}function Sb(e,t,n){const r=Nb(t);return la.set(e,n),r.observe(e),()=>{la.delete(e),r.unobserve(e)}}const Cb={some:0,all:1};class Tb extends Ft{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Cb[s]},u=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:w}=this.node.getProps(),h=c?d:w;h&&h(l)};return Sb(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Eb(t,n))&&this.startObserver()}unmount(){}}function Eb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oc={renderer:$g,...mb,...{inView:{Feature:Tb},tap:{Feature:yb},focus:{Feature:bb},hover:{Feature:gb}}};function Ab(e,t){return Ag(e,t)}const ic=Ab("div"),kb=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o})=>a.jsxs("div",{className:f("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-transform wu-items-center wu-origin-left wu-w-full wu-transition-[height_opacity] wu-duration-300",t!==n?"wu-opacity-100 wu-delay-200 wu-z-50 ":"wu-opacity-0 wu-delay-0 -wu-z-10",s),style:{height:t!==n?`${o}px`:"0px"},children:[a.jsx(Fr,{Trigger:a.jsx(ce,{variant:"iconOnly",className:"wu-w-6 wu-h-6 wu-shrink-0 wu-p-0",Icon:a.jsx("span",{className:"wm-arrow-drop-down wu-w-5 wu-h-5"})}),children:e.map(i=>a.jsx(An,{onSelect:u=>r(u,i.id),children:i.title},i.id))}),a.jsx("div",{className:"wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-1 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(kl,{features:oc,children:a.jsxs(Tl,{initial:!1,mode:"popLayout",children:[Mb(e).map((i,u)=>a.jsx(ic,{initial:{y:8,opacity:0,zIndex:0},animate:{y:0,opacity:1,zIndex:50},exit:{y:-8,opacity:0,zIndex:0},transition:{duration:.3},children:a.jsxs("h6",{"data-id":i.id,onClick:r,className:f("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-1",u===2||u===1||i.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70",i.id==="LEVEL_DOTS"&&"wu-text-[#1B87E6]"),children:[u!==0&&a.jsx("span",{className:"wm-chevron-right wu-text-lg"}),i.title]})},i.id)),"``"]})})})]}),Mb=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},Ib=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default"})=>{const[u,l]=p.useState(n?[n]:[]),[[c,d],w]=p.useState([t,1]),h=(x,S)=>{S&&l([...u,S]),w([x,1])},m=x=>{const S=u.findIndex(y=>y.id===x);if(S!==-1){const y=u.slice(0,S+1);l(y)}w([x,-1])},b=(x,S)=>{const y=S||x.currentTarget.getAttribute("data-id")||"";if(y&&y!==c){const N=u.findIndex(C=>C.id===y);N!==-1&&(l(u.slice(0,N+1)),m(y))}},g=()=>{const x=e[c]?e[c]:null;if(!x)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const S=typeof x.component=="function"?x.component({goNext:h,goBack:m}):x.component;return a.jsx(ic,{custom:d,variants:Db(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:S},c)};return a.jsxs("div",{className:"wu-h-full wu-relative wu-overflow-hidden wu-w-full wu-flex wu-flex-col",children:[a.jsx(kb,{titles:u,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o}),a.jsx(kl,{features:oc,children:a.jsx(Tl,{initial:!1,custom:d,mode:r,children:g()})})]})},Db=e=>{switch(e){case"slideRight":return Fb;case"slideLeft":return Vb;case"fadeZoom":return Lb;case"default":default:return Pb}},Pb={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},Fb={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Vb={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},Lb={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},X={WuContentEditor:"_WuContentEditor_ylyja_8",EditorAction:"_EditorAction_ylyja_70",EditorActionActive:"_EditorActionActive_ylyja_73"},uc=p.createContext(null),_b=({editor:e,children:t,customFonts:n})=>a.jsx(uc.Provider,{value:{editor:e,customFonts:n},children:t}),he=()=>{const e=p.useContext(uc);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},da=({action:e,defaultValue:t})=>{var s;const[n,r]=p.useState();return p.useEffect(()=>{r(t||e.items.find(o=>o.active)||e.items[0])},[e,t]),a.jsxs(zt.DropdownMenu,{children:[a.jsx(zt.DropdownMenuTrigger,{className:f(X.EditorAction,e.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:n==null?void 0:n.icon})}),a.jsx(zt.DropdownMenuContent,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px] wu-border wu-border-blue-p wu-rounded wu-bg-white",align:"start",children:(s=e.items)==null?void 0:s.map(o=>a.jsx(zt.DropdownMenuItem,{onClick:()=>{o.event(),r(o)},title:o.tooltip,children:a.jsx("button",{className:f(X.EditorAction,o.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:o.icon})})},o.id))})]})},Ob=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isParagraph:(s=r.editor)==null?void 0:s.isActive("paragraph"),isH1:(o=r.editor)==null?void 0:o.isActive("heading",{level:1}),isH2:(i=r.editor)==null?void 0:i.isActive("heading",{level:2}),isH3:(u=r.editor)==null?void 0:u.isActive("heading",{level:3}),isH4:(l=r.editor)==null?void 0:l.isActive("heading",{level:4}),isStyle:(c=r.editor)==null?void 0:c.isActive("heading")}}}),n=[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run(),active:t.isParagraph},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run(),active:t.isH1},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run(),active:t.isH2},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run(),active:t.isH3},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run(),active:t.isH4}];return a.jsx(da,{action:{id:"style",active:t.isStyle,icon:"wm-format-paragraph",items:n},defaultValue:n.find(r=>r.active)})},Wb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:({editor:n})=>({textColor:n.getAttributes("textStyle").color})});return a.jsxs("label",{className:X.EditorAction,htmlFor:"text-color",title:"Text Color",children:[a.jsx(re,{icon:"wm-format-color-text",className:"wu-cursor-pointer",style:{color:t.textColor}}),a.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"text-color",defaultValue:"#545E6B",onChange:n=>e.chain().focus().setColor(n.target.value).run()})]})},Bb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isUl:(s=r.editor)==null?void 0:s.isActive("bulletList"),isOl:(o=r.editor)==null?void 0:o.isActive("orderedList"),isTodo:(i=r.editor)==null?void 0:i.isActive("taskList"),isList:((u=r.editor)==null?void 0:u.isActive("bulletList"))||((l=r.editor)==null?void 0:l.isActive("orderedList"))||((c=r.editor)==null?void 0:c.isActive("taskList"))}}}),n=[{id:"ul",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run(),active:t.isUl,tooltip:"Bulleted List"},{id:"ol",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run(),active:t.isOl,tooltip:"Numbered List"},{id:"todo",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run(),active:t.isTodo,tooltip:"To-Do List"}];return a.jsx(da,{action:{id:"style",active:t.isList,icon:"wm-format-paragraph",items:n}})},zb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c,d;return{isLeft:(s=r.editor)==null?void 0:s.isActive({textAlign:"left"}),isCenter:(o=r.editor)==null?void 0:o.isActive({textAlign:"center"}),isRight:(i=r.editor)==null?void 0:i.isActive({textAlign:"right"}),isJustify:(u=r.editor)==null?void 0:u.isActive({textAlign:"justify"}),isAligned:((l=r.editor)==null?void 0:l.isActive({textAlign:"center"}))||((c=r.editor)==null?void 0:c.isActive({textAlign:"right"}))||((d=r.editor)==null?void 0:d.isActive({textAlign:"justify"}))}}}),n=[{id:"left",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run(),tooltip:"Align Left",active:t.isLeft},{id:"center",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run(),tooltip:"Align Center",active:t.isCenter},{id:"right",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run(),tooltip:"Align Right",active:t.isRight},{id:"justify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",active:t.isJustify}];return a.jsx(da,{action:{id:"style",active:t.isAligned,icon:"wm-format-paragraph",items:n}})},qb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>({code:n.editor.isActive("code")})});return a.jsx("button",{title:"Code line",className:f(X.EditorAction,(t==null?void 0:t.code)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleCode().run,children:a.jsx(re,{icon:"wm-code"})})},$b=()=>{const{editor:e}=he(),t=[{id:"clear",icon:"wm-format-clear",event:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),tooltip:"Clear Formatting"}];return a.jsx(a.Fragment,{children:t.map(n=>a.jsx("button",{title:n.tooltip,className:f(X.EditorAction),onClick:n.event,children:a.jsx(re,{icon:n.icon})},n.id))})},Hb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{blockquote:(r=n.editor)==null?void 0:r.isActive("blockquote")}}});return a.jsx("button",{title:"quote",className:f(X.EditorAction,(t==null?void 0:t.quote)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleBlockquote().run,children:a.jsx(re,{icon:"wm-format-quote"})})},Ub=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{superscript:(r=n.editor)==null?void 0:r.isActive("superscript")}}});return a.jsx("button",{title:"Superscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSuperscript().run,children:a.jsx(re,{icon:"wm-superscript"})})},jb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{subscript:(r=n.editor)==null?void 0:r.isActive("subscript")}}});return a.jsx("button",{title:"Subscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSubscript().run,children:a.jsx(re,{icon:"wm-subscript"})})},Gb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{bold:(r=n.editor)==null?void 0:r.isActive("bold")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleBold().run,children:a.jsx(re,{icon:"wm-format-bold"})})},Kb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{italic:(r=n.editor)==null?void 0:r.isActive("italic")}}});return a.jsx("button",{title:"Italic",className:f(X.EditorAction,(t==null?void 0:t.italic)&&X.EditorActionActive),onClick:e.chain().focus().toggleItalic().run,children:a.jsx(re,{icon:"wm-format-italic"})})},Yb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{underline:(r=n.editor)==null?void 0:r.isActive("underline")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleUnderline().run,children:a.jsx(re,{icon:"wm-format-underlined"})})},Xb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{strikethrough:(r=n.editor)==null?void 0:r.isActive("strike")}}});return a.jsx("button",{title:"strikethrough",className:f(X.EditorAction,(t==null?void 0:t.strikethrough)&&X.EditorActionActive),onClick:e.chain().focus().toggleStrike().run,children:a.jsx(re,{icon:"wm-format-strikethrough"})})},Zb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:w=>({isTable:w.editor.isActive("table"),tableAttrs:w.editor.getAttributes("table")})}),[n,r]=p.useState(t.tableAttrs.rows||2),[s,o]=p.useState(t.tableAttrs.cols||2),[i,u]=p.useState(!1),l=p.useRef(null),c=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().insertTable({rows:n,cols:s,withHeaderRow:i}).run()},100)},[e,n,s,i]),d=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().deleteTable().run()},100)},[e]);return a.jsx(kn,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isTable&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-table"})}),hideCloseButton:!0,maxWidth:"360px",children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),t.isTable?a.jsxs("div",{className:"wu-space-y-4 wu-mt-2",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-4",children:[a.jsx(ce,{onClick:()=>e.chain().focus().addColumnBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Left"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Top"}),a.jsx(ce,{onClick:()=>e.chain().focus().addColumnAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Right"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Bottom"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteColumn().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Column"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteRow().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Row"})]}),a.jsx(ce,{onClick:()=>e.chain().focus().toggleHeaderRow().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Toggle Header Row"})]}):a.jsxs("div",{className:"wu-space-y-3",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-3",children:[a.jsx(Te,{Label:"Rows",type:"number",min:1,value:n,onChange:w=>r(Number(w.target.value))}),a.jsx(Te,{Label:"Columns",type:"number",min:1,value:s,onChange:w=>o(Number(w.target.value))})]}),a.jsx(Ae,{Label:"Add header row",checked:i,onChange:u})]}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2 wu-mt-4",children:[a.jsx(Ye,{variant:"secondary",children:"Cancel"}),!t.isTable&&a.jsx(Ye,{onClick:c,children:"Insert"}),t.isTable&&a.jsx(Ye,{color:"error",onClick:d,children:"Delete Table"})]})]})})},Jb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:u=>{var l,c;return{isImage:(l=u.editor)==null?void 0:l.isActive("image"),imageAttrs:(c=u.editor)==null?void 0:c.getAttributes("image")}}}),[n,r]=p.useState(t.imageAttrs.src||""),[s,o]=p.useState(t.imageAttrs.alt||""),i=()=>{e.chain().focus().setImage({src:n,alt:s}).run()};return a.jsx(kn,{hideCloseButton:!0,Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isImage&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-image"})}),maxWidth:"400px",children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Image URL",type:"url",value:n,onChange:u=>r(u.target.value),required:!0}),a.jsx(Te,{Label:"Alt Text",type:"text",value:s,onChange:u=>o(u.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[a.jsx(Ye,{variant:"secondary",children:"Cancel"}),a.jsx(Ye,{onClick:i,disabled:!n,children:"Save"})]})]})})},Qb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:l=>{var c,d;return{isLink:(c=l.editor)==null?void 0:c.isActive("link"),linkAttrs:(d=l.editor)==null?void 0:d.getAttributes("link")}}}),[n,r]=p.useState(t.linkAttrs.href||""),[s,o]=p.useState(t.linkAttrs.alt||""),i=()=>{e.chain().focus().insertContent({type:"text",text:s||n,marks:[{type:"link",attrs:{href:n}}]}).run()},u=()=>{const{$from:l}=e.state.selection,c=l.parent.textContent,d=l.parentOffset;let w=d,h=d;for(;w>0&&!/\s/.test(c[w-1]);)w--;for(;h<c.length&&!/\s/.test(c[h]);)h++;const m=l.start(),b=m+w,g=m+h,x=c.slice(w,h);e.commands.setTextSelection({from:b,to:g}),r(t.linkAttrs.href||""),o(x||t.linkAttrs.alt||"")};return a.jsx(kn,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isLink&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-link"})}),maxWidth:"400px",onOpenChange:l=>l&&u(),children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Link",type:"url",value:n,onChange:l=>r(l.target.value),required:!0}),a.jsx(Te,{Label:"Text to display",type:"text",value:s,onChange:l=>o(l.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[t.isLink&&a.jsx(Ye,{color:"error",onClick:()=>e.chain().focus().unsetLink().run(),variant:"secondary",children:"Remove"}),a.jsx(Ye,{onClick:i,disabled:!n,children:"Save"})]})]})})},Rb=["e","E","+","-"],ey="wu-border wu-rounded wu-w-10 wu-h-6 wu-text-center [appearance:textfield] [&::-webkit-outer-spin-button]:wu-appearance-none [&::-webkit-inner-spin-button]:wu-appearance-none focus:wu-border-blue-p",lc=1,ty=()=>{const{editor:e}=he(),[t,n]=p.useState(16),r=we.useEditorState({editor:e,selector:u=>({fontSize:u.editor.getAttributes("textStyle").fontSize})}),s=u=>{e.chain().focus().setFontSize(u+"px").run()},o=u=>{const l=Math.max(lc,u);n(l),s(l)},i=u=>{Rb.includes(u.key)?u.preventDefault():u.key==="Enter"&&s(t)};return p.useEffect(()=>{var u;n(Number((u=r.fontSize)==null?void 0:u.replace("px",""))||16)},[r.fontSize]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-1",children:[a.jsx("button",{className:X.EditorAction,onClick:()=>o(t-1),disabled:t<=lc,children:"−"}),a.jsx("input",{type:"number",inputMode:"numeric",pattern:"[0-9]*",className:ey,value:t,onKeyDown:i,onChange:u=>n(u.target.valueAsNumber),onBlur:()=>s(t)}),a.jsx("button",{className:X.EditorAction,onClick:()=>o(t+1),disabled:t>=128,children:"+"})]})},ny=()=>{const{editor:e,customFonts:t}=he(),n=we.useEditorState({editor:e,selector:i=>({currentFontFamily:i.editor.getAttributes("textStyle").fontFamily||""})}),r=["Fira Sans","Inter","Poppins","JetBrains Mono","Montserrat",...t||[]],[s,o]=p.useState(n.currentFontFamily||r[0]);return p.useEffect(()=>{var i;o(((i=n.currentFontFamily)==null?void 0:i.replace(/"/g,""))||r[0])},[n.currentFontFamily]),a.jsxs(Mr,{children:[a.jsx(Ir,{className:X.EditorAction+" wu-transition-colors "+(s!=="Fira Sans"&&X.EditorActionActive),style:{fontFamily:s},title:s||"Font Family",children:s==null?void 0:s[0]}),a.jsx(Tn,{align:"start",className:"wu-border-blue-p wu-rounded",children:r.map(i=>a.jsx(Kt,{title:i,onSelect:()=>{e.chain().focus().setFontFamily(i).run(),o(i)},className:s===i?X.EditorActionActive:"",children:i},i))})]})},ry={block:a.jsx(Ob,{}),fontFamily:a.jsx(ny,{}),fontSize:a.jsx(ty,{}),bold:a.jsx(Gb,{}),italic:a.jsx(Kb,{}),underline:a.jsx(Yb,{}),strike:a.jsx(Xb,{}),color:a.jsx(Wb,{}),list:a.jsx(Bb,{}),alignment:a.jsx(zb,{}),image:a.jsx(Jb,{}),link:a.jsx(Qb,{}),table:a.jsx(Zb,{}),blockquote:a.jsx(Hb,{}),superscript:a.jsx(Ub,{}),subscript:a.jsx(jb,{}),codeline:a.jsx(qb,{}),clear:a.jsx($b,{}),"|":a.jsx(Wr,{orientation:"vertical",className:"wu-h-5"})},sy=["block","fontFamily","|","fontSize","|","bold","italic","underline","strike","|","color","|","list","alignment","|","image","link","table","|","blockquote","superscript","subscript","codeline","|","clear"],ay=e=>{const{editor:t,customFonts:n,children:r,items:s=sy,...o}=e;return a.jsx("div",{...o,children:a.jsx(_b,{editor:t,customFonts:n,children:a.jsxs("div",{className:"wu-flex wu-gap-1 wu-p-2 wu-items-center wu-justify-start wu-border-gray-40",children:[s.map((i,u)=>a.jsx(a.Fragment,{children:ry[i]},i+u)),r]})})})},oy=[Dc.configure({link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const n=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(n.href))return!1;const r=["ftp","file","mailto"],s=n.protocol.replace(":","");if(r.includes(s)||!t.protocols.map(l=>typeof l=="string"?l:l.scheme).includes(s))return!1;const i=["example-phishing.com","malicious-site.net"],u=n.hostname;return!i.includes(u)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),n=["example-no-autolink.com","another-no-autolink.com"],r=t.hostname;return!n.includes(r)}catch{return!1}}}}),Ic.configure({types:["heading","paragraph"]}),kc,Ac,pt.TextStyle,pt.Color,pt.BackgroundColor,ha.TaskList,ha.TaskItem,pt.LineHeight,pt.FontSize,pt.FontFamily,Pc.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),Mc.TableKit.configure({table:{resizable:!0}})],iy=e=>{const{defaultValue:t,onUpdate:n,className:r,readonly:s,toolbarPosition:o="top",classNames:i={},customToolbarChildren:u,toolbarItems:l,...c}=e,d=we.useEditor({editable:!s,extensions:oy,content:t,onUpdate:({editor:w})=>{n&&n(w.getHTML())}});return a.jsxs("div",{className:f(X.WuContentEditor,r,o==="top"?"wu-flex-col":"wu-flex-col-reverse"),...c,children:[a.jsx(ay,{editor:d,customFonts:e.customFonts,className:f("wu-sticky wu-z-10 wu-bg-white",i.toolbar,o==="top"?"wu-top-0 wu-border-b":"wu-bottom-0 wu-border-t"),items:l,children:u}),a.jsx(we.EditorContent,{editor:d,className:f("wu-p-4 wu-flex-grow",i.editor)})]})};window.wickUiVersion="1.24.1",Object.defineProperty(T,"useContext",{enumerable:!0,get:()=>p.useContext}),T.CHART_COLOR_SYSTEM=Hp,T.WuAccordion=_c,T.WuAppHeader=id,T.WuAppHeaderAccount=Ca,T.WuAppHeaderBar=Ma,T.WuAppHeaderHelp=Ta,T.WuAppHeaderMenu=ka,T.WuAppHeaderSearch=ad,T.WuButton=ce,T.WuCalender=Sr,T.WuCard=Oa,T.WuCardFooter=Ba,T.WuCardHeader=Wa,T.WuCheckbox=Ae,T.WuChip=pd,T.WuCombobox=Sd,T.WuContentEditor=iy,T.WuCopyToClipboard=Cd,T.WuDataTable=yp,T.WuDatePicker=ld,T.WuDateRangePicker=wd,T.WuDisplay=Kc,T.WuDrawer=Dd,T.WuDrawerClose=Pd,T.WuDrilldown=Ib,T.WuFooter=Ra,T.WuFormGroup=sd,T.WuHeading=jc,T.WuHelpButton=eo,T.WuIcon=re,T.WuInput=Te,T.WuInputError=td,T.WuInputHint=nd,T.WuLabel=Ce,T.WuListbox=Bd,T.WuLoader=gt,T.WuMenu=Fr,T.WuMenuCheckboxItem=zd,T.WuMenuIcon=Vr,T.WuMenuItem=An,T.WuMenuItemGroup=qd,T.WuMenuRadioItem=$d,T.WuMenuSeparatorItem=Hd,T.WuModal=kn,T.WuModalClose=Ye,T.WuModalContent=Mn,T.WuModalFooter=Rd,T.WuModalHeader=Qd,T.WuMonthPicker=sw,T.WuPagination=mo,T.WuPopover=uw,T.WuPopoverClose=lw,T.WuPrimaryNavbar=ow,T.WuRadioGroup=xo,T.WuScrollArea=cw,T.WuSecondaryNavbar=iw,T.WuSelect=fo,T.WuSidebar=kw,T.WuSidebarContent=Mw,T.WuSidebarFooter=Iw,T.WuSidebarGroup=Dw,T.WuSidebarItem=Fw,T.WuSidebarMenu=Pw,T.WuSidebarTrigger=_o,T.WuSpotlight=io,T.WuStackedCard=_w,T.WuStackedCardOverlay=Ow,T.WuStepper=lp,T.WuSubMenu=Ud,T.WuSubtext=Gc,T.WuSwitcher=_i,T.WuTab=mp,T.WuTable=xp,T.WuText=Uc,T.WuTextarea=Yi,T.WuTimePicker=Ri,T.WuToast=Wp,T.WuToggle=uu,T.WuTooltip=Sn,T.WuTranslationContext=Un,T.WuTranslationProvider=$p,T.WuTruncatedLabel=od,T.WuVirtualScroll=bt,T.calculatePosition=Lw,T.useTranslation=zp,T.useTranslationsContext=qp,T.useWuShowToast=Pp,T.useWuSidebar=tt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
15
+ `),()=>{x.contains(g)&&x.removeChild(g)}},[t]),a.jsx(mp,{isPresent:t,childRef:o,sizeRef:i,children:v.cloneElement(e,{ref:l})})}const bp=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,root:l})=>{const c=_r(yp),d=p.useId();let w=!0,h=p.useMemo(()=>(w=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{c.set(m,!0);for(const b of c.values())if(!b)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return o&&w&&(h={...h}),p.useMemo(()=>{c.forEach((m,b)=>c.set(b,!1))},[n]),v.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),i==="popLayout"&&(e=a.jsx(gp,{isPresent:n,anchorX:u,root:l,children:e})),a.jsx(Mn.Provider,{value:h,children:e})};function yp(){return new Map}function xp(e=!0){const t=p.useContext(Mn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=p.useId();p.useEffect(()=>{if(e)return s(o)},[e]);const i=p.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const zn=e=>e.key||"";function Ci(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const Ti=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",root:l})=>{const[c,d]=xp(i),w=p.useMemo(()=>Ci(e),[e]),h=i&&!c?[]:w.map(zn),m=p.useRef(!0),b=p.useRef(w),g=_r(()=>new Map),[x,S]=p.useState(w),[y,N]=p.useState(w);lo(()=>{m.current=!1,b.current=w;for(let M=0;M<y.length;M++){const A=zn(y[M]);h.includes(A)?g.delete(A):g.get(A)!==!0&&g.set(A,!1)}},[y,h.length,h.join("-")]);const C=[];if(w!==x){let M=[...w];for(let A=0;A<y.length;A++){const k=y[A],D=zn(k);h.includes(D)||(M.splice(A,0,k),C.push(k))}return o==="wait"&&C.length&&(M=C),N(Ci(M)),S(w),null}process.env.NODE_ENV!=="production"&&o==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:E}=p.useContext(uo);return a.jsx(a.Fragment,{children:y.map(M=>{const A=zn(M),k=i&&!c?!1:w===y||h.includes(A),D=()=>{if(g.has(A))g.set(A,!0);else return;let F=!0;g.forEach(V=>{V||(F=!1)}),F&&(E==null||E(),N(b.current),i&&(d==null||d()),r&&r())};return a.jsx(bp,{isPresent:k,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:k?void 0:D,anchorX:u,children:M},A)})})},bs=p.createContext({strict:!1}),Ei={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},At={};for(const e in Ei)At[e]={isEnabled:t=>Ei[e].some(n=>!!t[n])};function Ai(e){for(const t in e)At[t]={...At[t],...e[t]}}function ki({children:e,features:t,strict:n=!1}){const[,r]=p.useState(!ys(t)),s=p.useRef(void 0);if(!ys(t)){const{renderer:o,...i}=t;s.current=o,Ai(i)}return p.useEffect(()=>{ys(t)&&t().then(({renderer:o,...i})=>{Ai(i),s.current=o,r(!0)})},[]),a.jsx(bs.Provider,{value:{renderer:s.current,strict:n},children:e})}function ys(e){return typeof e=="function"}const vp=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vp.has(e)}let Mi=e=>!qn(e);function Np(e){typeof e=="function"&&(Mi=t=>t.startsWith("on")?!qn(t):e(t))}try{Np(require("@emotion/is-prop-valid").default)}catch{}function Sp(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Mi(s)||n===!0&&qn(s)||!t&&!qn(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const $n=p.createContext({});function Hn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function rn(e){return typeof e=="string"||Array.isArray(e)}const xs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vs=["initial",...xs];function Un(e){return Hn(e.animate)||vs.some(t=>rn(e[t]))}function Ii(e){return!!(Un(e)||e.variants)}function Cp(e,t){if(Un(e)){const{initial:n,animate:r}=e;return{initial:n===!1||rn(n)?n:void 0,animate:rn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Tp(e){const{initial:t,animate:n}=Cp(e,p.useContext($n));return p.useMemo(()=>({initial:t,animate:n}),[Di(t),Di(n)])}function Di(e){return Array.isArray(e)?e.join(" "):e}function Pi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Pi(e,t.target.x),r=Pi(e,t.target.y);return`${n}% ${r}%`}},Ep={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Xe.parse(e);if(s.length>5)return r;const o=Xe.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const c=tn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=c),typeof s[3+i]=="number"&&(s[3+i]/=c),o(s)}},Ap={borderRadius:{...sn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomLeftRadius:sn,borderBottomRightRadius:sn,boxShadow:Ep};function Fi(e,{layout:t,layoutId:n}){return Et.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ap[e]||e==="opacity")}const kp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mp=Tt.length;function Ip(e,t,n){let r="",s=!0;for(let o=0;o<Mp;o++){const i=Tt[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number"?l=u===(i.startsWith("scale")?1:0):l=parseFloat(u)===0,!l||n){const c=hi(u,hs[i]);if(!l){s=!1;const d=kp[i]||i;r+=`${d}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Ns(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const c=t[l];if(Et.has(l)){i=!0;continue}else if(Do(l)){s[l]=c;continue}else{const d=hi(c,hs[l]);l.startsWith("origin")?(u=!0,o[l]=d):r[l]=d}}if(t.transform||(i||n?r.transform=Ip(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;r.transformOrigin=`${l} ${c} ${d}`}}const Ss=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vi(e,t,n){for(const r in t)!ge(t[r])&&!Fi(r,n)&&(e[r]=t[r])}function Dp({transformTemplate:e},t){return p.useMemo(()=>{const n=Ss();return Ns(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Pp(e,t){const n=e.style||{},r={};return Vi(r,n,e),Object.assign(r,Dp(e,t)),r}function Fp(e,t){const n={},r=Pp(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Vp={offset:"stroke-dashoffset",array:"stroke-dasharray"},Lp={offset:"strokeDashoffset",array:"strokeDasharray"};function _p(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?Vp:Lp;e[o.offset]=L.transform(-r);const i=L.transform(t),u=L.transform(n);e[o.array]=`${i} ${u}`}function Li(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,c,d){if(Ns(e,u,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:h}=e;w.transform&&(h.transform=w.transform,delete w.transform),(h.transform||w.transformOrigin)&&(h.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete w.transformBox),t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&_p(w,s,o,i,!1)}const _i=()=>({...Ss(),attrs:{}}),Oi=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Op(e,t,n,r){const s=p.useMemo(()=>{const o=_i();return Li(o,t,Oi(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Vi(o,e.style,e),s.style={...o,...s.style}}return s}const Wp=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Cs(e){return typeof e!="string"||e.includes("-")?!1:!!(Wp.indexOf(e)>-1||/[A-Z]/u.test(e))}function Bp(e,t,n,{latestValues:r},s,o=!1){const u=(Cs(e)?Op:Fp)(t,r,s,e),l=Sp(t,typeof e=="string",o),c=e!==p.Fragment?{...l,...u,ref:n}:{},{children:d}=t,w=p.useMemo(()=>ge(d)?d.get():d,[d]);return p.createElement(e,{...c,children:w})}function Wi(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ts(e,t,n,r){if(typeof t=="function"){const[s,o]=Wi(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=Wi(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function zp(e){return ge(e)?e.get():e}function qp({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:$p(n,r,s,e),renderState:t()}}function $p(e,t,n,r){const s={},o=r(e,{});for(const h in o)s[h]=zp(o[h]);let{initial:i,animate:u}=e;const l=Un(e),c=Ii(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const w=d?u:i;if(w&&typeof w!="boolean"&&!Hn(w)){const h=Array.isArray(w)?w:[w];for(let m=0;m<h.length;m++){const b=Ts(e,h[m]);if(b){const{transitionEnd:g,transition:x,...S}=b;for(const y in S){let N=S[y];if(Array.isArray(N)){const C=d?N.length-1:0;N=N[C]}N!==null&&(s[y]=N)}for(const y in g)s[y]=g[y]}}}return s}const Bi=e=>(t,n)=>{const r=p.useContext($n),s=p.useContext(Mn),o=()=>qp(e,t,r,s);return n?o():_r(o)};function Es(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(ge(r[i])||t.style&&ge(t.style[i])||Fi(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const Hp=Bi({scrapeMotionValuesFromProps:Es,createRenderState:Ss});function zi(e,t,n){const r=Es(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const o=Tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const Up=Bi({scrapeMotionValuesFromProps:zi,createRenderState:_i}),jp=Symbol.for("motionComponentSymbol");function qi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Gp(e,t,n){return p.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):qi(n)&&(n.current=r))},[t])}const As=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$i="data-"+As("framerAppearId"),Kp=p.createContext({});function Yp(e,t,n,r,s){var g,x;const{visualElement:o}=p.useContext($n),i=p.useContext(bs),u=p.useContext(Mn),l=p.useContext(gs).reducedMotion,c=p.useRef(null);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,w=p.useContext(Kp);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Xp(c.current,n,s,w);const h=p.useRef(!1);p.useInsertionEffect(()=>{d&&h.current&&d.update(n,u)});const m=n[$i],b=p.useRef(!!m&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,m))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,m)));return lo(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),b.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!b.current&&d.animationState&&d.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,m)}),b.current=!1),d.enteringChildren=void 0)}),d}function Xp(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Hi(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&qi(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Hi(e){if(e)return e.options.allowProjection!==!1?e.projection:Hi(e.parent)}function Zp(e,{forwardMotionProps:t=!1}={},n,r){const s=Cs(e)?Up:Hp;function o(u,l){let c;const d={...p.useContext(gs),...u,layoutId:Jp(u)},{isStatic:w}=d,h=Tp(u),m=s(u,w);if(!w&&Or){Qp(d,n);const b=Rp(d);c=b.MeasureLayout,h.visualElement=Yp(e,m,d,r,b.ProjectionNode)}return a.jsxs($n.Provider,{value:h,children:[c&&h.visualElement?a.jsx(c,{visualElement:h.visualElement,...d}):null,Bp(e,u,Gp(m,h.visualElement,l),m,w,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=p.forwardRef(o);return i[jp]=e,i}function Jp({layoutId:e}){const t=p.useContext(uo).id;return t&&e!==void 0?t+"-"+e:e}function Qp(e,t){p.useContext(bs).strict,process.env.NODE_ENV}function Rp(e){const{drag:t,layout:n}=At;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function eh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function th(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function nh(e,t){return eh(th(e.getBoundingClientRect(),t))}const Ui=()=>({min:0,max:0}),ji=()=>({x:Ui(),y:Ui()}),ks={current:null},Gi={current:!1};function rh(){if(Gi.current=!0,!!Or)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ks.current=e.matches;e.addEventListener("change",t),t()}else ks.current=!1}const sh=new WeakMap;function ah(e,t,n){for(const r in t){const s=t[r],o=n[r];if(ge(s))e.addValue(r,s);else if(ge(o))e.addValue(r,Wn(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,Wn(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ki=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class oh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ws,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ke.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Pe.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Un(n),this.isVariantNode=Ii(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...w}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in w){const m=w[h];l[h]!==void 0&&ge(m)&&m.set(l[h])}}mount(t){var n;this.current=t,sh.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),Gi.current||rh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ks.current,process.env.NODE_ENV!=="production"&&go(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),$r(this.notifyUpdate),$r(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Et.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Pe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in At){const n=At[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ji()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Ki.length;r++){const s=Ki[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=ah(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Wn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(co(r)||wo(r))?r=parseFloat(r):!fp(r)&&Xe.test(n)&&(r=pi(t,n)),this.setBaseTarget(t,ge(r)?r.get():r)),ge(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Ts(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ge(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new po),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){rp.render(this.render)}}class Yi extends oh{constructor(){super(...arguments),this.KeyframeResolver=Rf}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Xi(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function ih(e){return window.getComputedStyle(e)}class uh extends Yi{constructor(){super(...arguments),this.type="html",this.renderInstance=Xi}readValueFromInstance(t,n){var r;if(Et.has(n))return(r=this.projection)!=null&&r.isProjecting?is(n):bf(t,n);{const s=ih(t),o=(Do(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return nh(t,n)}build(t,n,r){Ns(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Es(t,n,r)}}const Zi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lh(e,t,n,r){Xi(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Zi.has(s)?s:As(s),t.attrs[s])}class ch extends Yi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ji}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Et.has(n)){const r=fi(n);return r&&r.default||0}return n=Zi.has(n)?n:As(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zi(t,n,r)}build(t,n,r){Li(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){lh(t,n,r,s)}mount(t){this.isSVGTag=Oi(t.tagName),super.mount(t)}}const dh=(e,t)=>Cs(e)?new ch(t):new uh(t,{allowProjection:e!==p.Fragment});function kt(e,t,n){const r=e.getProps();return Ts(r,t,n!==void 0?n:r.custom,e)}const Ms=e=>Array.isArray(e);function wh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wn(n))}function fh(e){return Ms(e)?e[e.length-1]||0:e}function ph(e,t){const n=kt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=fh(o[i]);wh(e,i,u)}}function hh(e){return!!(ge(e)&&e.add)}function mh(e,t){const n=e.getValue("willChange");if(hh(n))return n.add(t);if(!n&&je.WillChange){const r=new je.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function gh(e){return e.props[$i]}const bh=e=>e!==null;function yh(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(bh),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const xh={type:"spring",stiffness:500,damping:25,restSpeed:10},vh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nh={type:"keyframes",duration:.8},Sh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ch=(e,{keyframes:t})=>t.length>2?Nh:Et.has(e)?e.startsWith("scale")?vh(t[1]):xh:Sh;function Th({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:u,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Eh=(e,t,n,r={},s,o)=>i=>{const u=ii(r,e)||{},l=u.delay||r.delay||0;let{elapsed:c=0}=r;c=c-qe(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-c,onUpdate:h=>{t.set(h),u.onUpdate&&u.onUpdate(h)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Th(u)||Object.assign(d,Ch(e,d)),d.duration&&(d.duration=qe(d.duration)),d.repeatDelay&&(d.repeatDelay=qe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let w=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(fs(d),d.delay===0&&(w=!0)),(je.instantAnimations||je.skipAnimations)&&(w=!0,fs(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const h=yh(d.keyframes,u);if(h!==void 0){Pe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return u.isSync?new ss(d):new qf(d)};function Ah({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ji(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...u}=t;r&&(o=r);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const d in u){const w=e.getValue(d,e.latestValues[d]??null),h=u[d];if(h===void 0||c&&Ah(c,d))continue;const m={delay:n,...ii(o||{},d)},b=w.get();if(b!==void 0&&!w.isAnimating&&!Array.isArray(h)&&h===b&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const S=gh(e);if(S){const y=window.MotionHandoffAnimation(S,d,Pe);y!==null&&(m.startTime=y,g=!0)}}mh(e,d),w.start(Eh(d,w,h,e.shouldReduceMotion&&ui.has(d)?{type:!1}:m,e,g));const x=w.animation;x&&l.push(x)}return i&&Promise.all(l).then(()=>{Pe.update(()=>{i&&ph(e,i)})}),l}function Qi(e,t,n,r=0,s=1){const o=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}function Is(e,t,n={}){var l;const r=kt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(Ji(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:w,staggerDirection:h}=s;return kh(e,t,c,d,w,h,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[c,d]=u==="beforeChildren"?[o,i]:[i,o];return c().then(()=>d())}else return Promise.all([o(),i(n.delay)])}function kh(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(Is(l,t,{...i,delay:n+(typeof r=="function"?0:r)+Qi(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function Mh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Is(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Is(e,t,n);else{const s=typeof t=="function"?kt(e,t,n.custom):t;r=Promise.all(Ji(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ri(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Ih=vs.length;function eu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?eu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ih;n++){const r=vs[n],s=e.props[r];(rn(s)||s===!1)&&(t[r]=s)}return t}const Dh=[...xs].reverse(),Ph=xs.length;function Fh(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Mh(e,n,r)))}function Vh(e){let t=Fh(e),n=tu(),r=!0;const s=l=>(c,d)=>{var h;const w=kt(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(w){const{transition:m,transitionEnd:b,...g}=w;c={...c,...g,...b}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,d=eu(e.parent)||{},w=[],h=new Set;let m={},b=1/0;for(let x=0;x<Ph;x++){const S=Dh[x],y=n[S],N=c[S]!==void 0?c[S]:d[S],C=rn(N),E=S===l?y.isActive:null;E===!1&&(b=x);let M=N===d[S]&&N!==c[S]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),y.protectedKeys={...m},!y.isActive&&E===null||!N&&!y.prevProp||Hn(N)||typeof N=="boolean")continue;const A=Lh(y.prevProp,N);let k=A||S===l&&y.isActive&&!M&&C||x>b&&C,D=!1;const F=Array.isArray(N)?N:[N];let V=F.reduce(s(S),{});E===!1&&(V={});const{prevResolvedValues:$={}}=y,W={...$,...V},G=I=>{k=!0,h.has(I)&&(D=!0,h.delete(I)),y.needsAnimating[I]=!0;const _=e.getValue(I);_&&(_.liveStyle=!1)};for(const I in W){const _=V[I],z=$[I];if(m.hasOwnProperty(I))continue;let B=!1;Ms(_)&&Ms(z)?B=!Ri(_,z):B=_!==z,B?_!=null?G(I):h.add(I):_!==void 0&&h.has(I)?G(I):y.protectedKeys[I]=!0}y.prevProp=N,y.prevResolvedValues=V,y.isActive&&(m={...m,...V}),r&&e.blockInitialAnimation&&(k=!1);const q=M&&A;k&&(!q||D)&&w.push(...F.map(I=>{const _={type:S};if(typeof I=="string"&&r&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,B=kt(z,I);if(z.enteringChildren&&B){const{delayChildren:ne}=B.transition||{};_.delay=Qi(z.enteringChildren,e,ne)}}return{animation:I,options:_}}))}if(h.size){const x={};if(typeof c.initial!="boolean"){const S=kt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);S&&S.transition&&(x.transition=S.transition)}h.forEach(S=>{const y=e.getBaseTarget(S),N=e.getValue(S);N&&(N.liveStyle=!0),x[S]=y??null}),w.push({animation:x})}let g=!!w.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(w):Promise.resolve()}function u(l,c){var w;if(n[l].isActive===c)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:i,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tu()}}}function Lh(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ri(t,e):!1}function it(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tu(){return{animate:it(!0),whileInView:it(),whileHover:it(),whileTap:it(),whileDrag:it(),whileFocus:it(),exit:it()}}class Mt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class _h extends Mt{constructor(t){super(t),t.animationState||(t.animationState=Vh(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Hn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Oh=0;class Wh extends Mt{constructor(){super(...arguments),this.id=Oh++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Bh={animation:{Feature:_h},exit:{Feature:Wh}};function nu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ru(e){return{point:{x:e.pageX,y:e.pageY}}}function su(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Pe.postRender(()=>o(t,ru(t)))}class zh extends Mt{mount(){const{current:t}=this.node;t&&(this.unmount=op(t,(n,r)=>(su(this.node,r,"Start"),s=>su(this.node,s,"End"))))}unmount(){}}class qh extends Mt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=In(nu(this.node.current,"focus",()=>this.onFocus()),nu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function au(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Pe.postRender(()=>o(t,ru(t)))}class $h extends Mt{mount(){const{current:t}=this.node;t&&(this.unmount=dp(t,(n,r)=>(au(this.node,r,"Start"),(s,{success:o})=>au(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ds=new WeakMap,Ps=new WeakMap,Hh=e=>{const t=Ds.get(e.target);t&&t(e)},Uh=e=>{e.forEach(Hh)};function jh({root:e,...t}){const n=e||document;Ps.has(n)||Ps.set(n,{});const r=Ps.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Uh,{root:e,...t})),r[s]}function Gh(e,t,n){const r=jh(t);return Ds.set(e,n),r.observe(e),()=>{Ds.delete(e),r.unobserve(e)}}const Kh={some:0,all:1};class Yh extends Mt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Kh[s]},u=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:w}=this.node.getProps(),h=c?d:w;h&&h(l)};return Gh(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Xh(t,n))&&this.startObserver()}unmount(){}}function Xh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ou={renderer:dh,...Bh,...{inView:{Feature:Yh},tap:{Feature:$h},focus:{Feature:qh},hover:{Feature:zh}}};function Zh(e,t){return Zp(e,t)}const iu=Zh("div"),Jh=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Ga,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},jn=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=f("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),c=d=>{i&&i(d),u&&d.preventDefault()};return a.jsxs(Kt,{onSelect:c,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Qh=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Ha,{...r,children:[a.jsx(Yt,{children:n||e.label}),t]})},Rh=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(yd,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ka,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},em=e=>{const{className:t,...n}=e,r=f("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(En,{...n,className:r})},It=v.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(Qe.Root,{ref:o,className:f("wu-relative wu-overflow-hidden",e),children:[a.jsx(Qe.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(Fs,{thumbColor:n,railColor:r}),a.jsx(Qe.Corner,{})]}));It.displayName=Qe.Root.displayName;const Fs=v.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(Qe.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(Qe.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));Fs.displayName=Qe.ScrollAreaScrollbar.displayName;const tm=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(bd,{...l,open:s,onOpenChange:o,children:[a.jsx(Ua,{dir:u,children:r||n}),a.jsx(gd,{children:a.jsx(ja,{onInteractOutside:c=>c.preventDefault(),children:a.jsx(It,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},nm="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",Vs=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:c,dir:d,Trigger:w,align:h="start",sideOffset:m=0,side:b="bottom",alignOffset:g,className:x,disabled:S,...y}=e;return a.jsxs(Mr,{...y,open:i,onOpenChange:u,dir:d,children:[a.jsx(Ir,{asChild:!0,dir:d,disabled:S,className:f("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??rm(s,o,S)}),a.jsx(Tn,{className:f("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",x,"wu-menu-content"),align:h,sideOffset:m,side:b,alignOffset:g,onInteractOutside:N=>c&&N.preventDefault(),children:a.jsxs(It,{className:"h-fit",style:{height:l},dir:d,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(Yt,{dir:d,className:"wu-menu-title",children:r||n}),a.jsx(En,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},rm=(e,t,n)=>{const r=f(nm,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:f("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},sm=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o})=>a.jsxs("div",{className:f("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-transform wu-items-center wu-origin-left wu-w-full wu-transition-[height_opacity] wu-duration-300",t!==n?"wu-opacity-100 wu-delay-200 wu-z-50 ":"wu-opacity-0 wu-delay-0 -wu-z-10",s),style:{height:t!==n?`${o}px`:"0px"},children:[a.jsx(Vs,{Trigger:a.jsx(ce,{variant:"iconOnly",className:"wu-w-6 wu-h-6 wu-shrink-0 wu-p-0",Icon:a.jsx("span",{className:"wm-arrow-drop-down wu-w-5 wu-h-5"})}),children:e.map(i=>a.jsx(jn,{onSelect:u=>r(u,i.id),children:i.title},i.id))}),a.jsx("div",{className:"wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-1 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(ki,{features:ou,children:a.jsxs(Ti,{initial:!1,mode:"popLayout",children:[am(e).map((i,u)=>a.jsx(iu,{initial:{y:8,opacity:0,zIndex:0},animate:{y:0,opacity:1,zIndex:50},exit:{y:-8,opacity:0,zIndex:0},transition:{duration:.3},children:a.jsxs("h6",{"data-id":i.id,onClick:r,className:f("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-1",u===2||u===1||i.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70",i.id==="LEVEL_DOTS"&&"wu-text-[#1B87E6]"),children:[u!==0&&a.jsx("span",{className:"wm-chevron-right wu-text-lg"}),i.title]})},i.id)),"``"]})})})]}),am=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},om=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default"})=>{const[u,l]=p.useState(n?[n]:[]),[[c,d],w]=p.useState([t,1]),h=(x,S)=>{S&&l([...u,S]),w([x,1])},m=x=>{const S=u.findIndex(y=>y.id===x);if(S!==-1){const y=u.slice(0,S+1);l(y)}w([x,-1])},b=(x,S)=>{const y=S||x.currentTarget.getAttribute("data-id")||"";if(y&&y!==c){const N=u.findIndex(C=>C.id===y);N!==-1&&(l(u.slice(0,N+1)),m(y))}},g=()=>{const x=e[c]?e[c]:null;if(!x)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const S=typeof x.component=="function"?x.component({goNext:h,goBack:m}):x.component;return a.jsx(iu,{custom:d,variants:im(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:S},c)};return a.jsxs("div",{className:"wu-h-full wu-relative wu-overflow-hidden wu-w-full wu-flex wu-flex-col",children:[a.jsx(sm,{titles:u,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o}),a.jsx(ki,{features:ou,children:a.jsx(Ti,{initial:!1,custom:d,mode:r,children:g()})})]})},im=e=>{switch(e){case"slideRight":return lm;case"slideLeft":return cm;case"fadeZoom":return dm;case"default":default:return um}},um={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},lm={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},cm={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},dm={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},uu=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(gt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});uu.displayName="WuFooter";const lu=p.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>pr(u),children:a.jsx("span",{className:f("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});lu.displayName="WuHelpButton";const Ze=(e,t)=>`wu-listbox-${e}`;function wm(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...c}=e,d=n.group&&Array.isArray(t[n.group]),w=({item:h,className:m})=>p.createElement(Gt,{...c,key:JSON.stringify(h),onSelect:()=>r==null?void 0:r(h),value:t[n.value],className:f("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(l!=null&&l(h))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,Ze("item")),disabled:h.disabled},s&&a.jsx(Ae,{checked:l==null?void 0:l(h)}),u?u({value:h,isSelected:l==null?void 0:l(h)}):a.jsx(a.Fragment,{children:h[n.label]}));if(d){const h=t[n.group],m=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(jt,{heading:m,children:h==null?void 0:h.map(b=>a.jsx(w,{item:b,className:"wu-pl-6"},JSON.stringify(b)))})}return a.jsx(w,{item:t})}const fm=p.memo(wm),pm=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(re,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(qa,{...n,"aria-label":"Search",className:f("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",Ze("input"),t)})]})},hm=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=p.useState(!1),[u,l]=p.useState(!1);return p.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(Gt,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(Ae,{checked:o,partial:u}),t||"Select All"]})},mm=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:c,className:d,...w}=e,[h,m]=p.useState(),b=p.useRef(null);return p.useEffect(()=>{if(!r){m(null);return}m(Array.isArray(r)?i?r.map((x,S)=>i({value:x,unselect:u,key:S})):r.map(x=>x[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,m]),a.jsx(et,{asChild:!0,id:e.id,disabled:n,ref:b,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:f("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",d,Ze("trigger")),children:[a.jsx("div",{className:f("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||s}),a.jsx(re,{icon:"wm-arrow-drop-down",className:f("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",Ze("drop-icon"))})]})})},cu=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},gm=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const c=l.filter(d=>cu(d,s,n));c.length>0&&o.push({...i,[u]:c})}else cu(i,s,n)&&o.push(i)}return o},bm=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:c,Chip:d,onSelect:w,onScroll:h,disabled:m,multiple:b,searchable:g,selectAll:x,virtualizedThreshold:S=100,id:y,dir:N,className:C,listClass:E,placeholder:M="Select items...",variant:A,labelPosition:k="top",maxContentWidth:D,maxContentHeight:F,modal:V,...$}=e,[W,G]=p.useState(!1),[q,ue]=p.useState(""),[I,_]=p.useState(r),z=p.useMemo(()=>n,[n]),B=p.useMemo(()=>{if(!g||!q)return t;const j=q.toLowerCase().trim();return gm(t,j,n)},[t,q,n.label,g]),ne=j=>{b?_(P=>{const U=j[n.value],Z=Array.isArray(P)?P:[],R=Z.some(H=>H[n.value]===U)?Z.filter(H=>H[n.value]!==U):[...Z,j];return w&&w(R),R}):(_(j),w&&w(j),G(!1))},ae=p.useCallback(j=>{const P=j?t:[];_(P),x!=null&&x.onSelectAll&&x.onSelectAll(j),w&&w(P)},[t,x,w]),xe=j=>Array.isArray(I)?I.some(P=>P[n.value]===j[n.value]):(I==null?void 0:I[n.value])===j[n.value];p.useEffect(()=>{_(r)},[r]);const He=j=>{const P=U=>a.jsx(fm,{option:U,accessorKey:z,multiple:b,onSelect:Z=>ne(Z),dir:N,GroupLabel:i,Item:s,isSelected:Z=>xe(Z)},JSON.stringify(U));return j.length>S?a.jsx(bt,{list:j,callback:(U,Z)=>P(Z),dir:N}):j.map(P)};return a.jsxs("div",{className:f("wu-flex wu-text-sm wu-gap-2",k==="top"&&"wu-flex-col wu-gap-1",k==="left"&&"wu-flex-row",k==="right"&&"wu-flex-row-reverse",Ze("container")),dir:N,children:[o&&a.jsx(Ce,{htmlFor:y,className:Ze("label"),children:o}),a.jsxs(ze,{open:W,onOpenChange:j=>{G(j),j||setTimeout(()=>{ue("")},100)},modal:V,children:[a.jsx(mm,{CustomTrigger:l,disabled:m,value:I,accessorKey:n,placeholder:M,Chip:d,className:C,handleUnselect:ne,variant:A,id:y,dir:N,...$}),a.jsx(Ie,{className:f("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",Ze("content")),align:"start",sideOffset:-1,style:{maxWidth:D},children:a.jsxs(Er,{id:e.id,shouldFilter:!1,children:[g&&a.jsx(pm,{value:q,onValueChange:ue}),u,a.jsxs(Ar,{className:f("wu-overflow-y-auto",Ze("list"),E),onScroll:h,style:{maxHeight:F||"420px"},children:[a.jsx(kr,{children:c||"No results found."}),a.jsx(jt,{children:b&&(x==null?void 0:x.enabled)&&!q&&a.jsx(hm,{data:t,value:I,onSelectAll:ae,label:x.label})}),a.jsx(jt,{children:He(B)})]})]})})]})]})},Ls=p.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=f("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:f("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});Ls.displayName="WuMenuIcon";const ym=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,width:w,...h})=>{const[m,b]=p.useState(""),[g,x]=p.useState(e);p.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){x(e),b("");return}const y=r.label;if(n&&Array.isArray(t)){const N=t.map(C=>C[y]).join(", ");b(N)}else!n&&!Array.isArray(t)&&b(t[y])},[t,r.label,n,e]);const S=()=>e&&!m?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:g}):a.jsx("span",{className:f("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:d?(c==null?void 0:c.triggerText)??m:m});return a.jsx(Ir,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...h,disabled:l,className:f("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",h.className),children:[i??S(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},du=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=d=>{e.disabled||(r(e),n&&d.preventDefault())};return a.jsxs(Kt,{onClick:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(wu,{option:e,accessorKey:s})]})},wu=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},fu=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Kt,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Ae,{"data-partial":s,checked:r||s,partial:s}),a.jsx(wu,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Ha,{dir:o.dir,children:[a.jsx(Yt,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>p.createElement(du,{...o,option:u,key:l}))]});case"divider":return a.jsx(En,{className:"wu-mx-4"});default:return a.jsx(du,{...o,option:t})}},xm=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},vm=100,Nm=400,pu=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:c,virtualizedThreshold:d=vm,maxHeight:w=Nm,hasGroup:h=!1,Header:m,CustomTrigger:b,selectAll:g,disabled:x,labelPosition:S="top",onScroll:y,maxContentWidth:N,...C})=>{const[E,M]=p.useState(),A=p.useRef(null),[k,D]=p.useState(!1),[F,V]=p.useState(!1),{cleanData:$,enabledOptions:W}=h||g!=null&&g.enable?xm(e):{cleanData:e,enabledOptions:[]},G=p.useMemo(()=>n&&g!=null&&g.enable&&e.length>0?[{type:"all",[o.label]:g.label||"Select All"},...e]:e,[e,g,n]),q=p.useCallback(z=>{const B=z[o.value];if(n)M((ne=[])=>{const ae=ne,He=ae.some(j=>j[o.value]===B)?ae.filter(j=>j[o.value]!==B):[...ae,z];return t==null||t(He),He});else{const ne=z;M(ne),t==null||t(ne)}},[n,o.value,t]);p.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&M(void 0),r!==void 0&&M(r),s!==void 0&&M(s)},[r,s]);const ue=G.length>d;p.useEffect(()=>{if(!n)return;const z=g!=null&&g.includeDisabled?(E==null?void 0:E.length)===e.length:(E==null?void 0:E.length)===W.length;D(z);const B=(E==null?void 0:E.length)>0&&!z;V(B)},[E,g]);const I=p.useCallback(()=>{const z=k?[]:g!=null&&g.includeDisabled?h?$:e:W;M(z),t==null||t(z)},[k,n,e,W,t,g]),_=Ut(S);return a.jsxs("div",{className:f(_,"wu-flex wu-select-container"),ref:A,dir:u,children:[a.jsxs(Mr,{children:[a.jsx(ym,{...C,value:E,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:b,id:C.id,disabled:x,selectAll:g,isCheckedAll:k}),a.jsxs(Tn,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:C.id,style:{maxWidth:N},children:[m,ue?a.jsx(bt,{list:G,containerHeight:w,callback:(z,B)=>a.jsx(fu,{option:B,accessorKey:o,multiple:n,onSelect:q,value:E,dir:u,handleSelectAll:I,isCheckedAll:k,isPartialSelected:F}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:G.map((z,B)=>a.jsx(fu,{option:z,accessorKey:o,multiple:n,onSelect:q,value:E,handleSelectAll:I,isCheckedAll:k,dir:u,isPartialSelected:F},`${B}`))})]})]}),c&&a.jsx(Ce,{htmlFor:C.id,className:"wu-select-label",children:c})]})},Gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sm=({value:e,onChange:t,min:n=K.sub(new Date,{years:5}),max:r=K.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:c,disabledMonths:d=[],...w})=>{const[h,m]=p.useState(null),[b,g]=p.useState(""),[x,S]=p.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=p.useMemo(()=>{const C=new Date(n).getFullYear(),E=new Date(r).getFullYear();return Array.from({length:E-C+1},(M,A)=>({value:E-A,label:E-A}))},[n,r]);p.useEffect(()=>{if(e){const C=new Date(e),E=C.getFullYear(),M=C.getMonth();m({year:E,month:M}),g(`${Gn[M]} ${E}`),S({value:E,label:E})}},[e]);const N=()=>{h&&t&&(t(new Date(h.year,h.month,15)),g(`${Gn[h.month]} ${h.year}`))};return a.jsxs("div",{className:f("wu-flex wu-flex-col wu-items-center",Ut(i),i==="top"&&"wu-items-start"),children:[a.jsxs(ze,{children:[a.jsx(Cr,{...w,disabled:u||c,id:l,dir:"ltr",placeholder:s,formattedString:b}),a.jsxs(Ie,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(pu,{data:y,accessorKey:{value:"value",label:"label"},value:x,onSelect:C=>S(C),multiple:!1,maxHeight:224})}),a.jsx(Cm,{year:x==null?void 0:x.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(C,E)=>m({year:E,month:C}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:N,children:"Apply"})})})]})]}),o&&a.jsx(Ce,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},Cm=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=p.useMemo(()=>{const c=new Set;return s.forEach(d=>{const w=typeof d=="string"?new Date(d):d;c.add(`${w.getFullYear()}-${w.getMonth()}`)}),c},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:Gn.map((c,d)=>{const w=e===i&&d===u,h=t===d&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${d}`),onClick:()=>r(d,e),className:f("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",h&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${Gn[d]} ${e}`,"data-month":d,"data-year":e,children:c},c)})})},hu=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=p.useState([]),[u,l]=p.useState([]);return p.useEffect(()=>{const c=()=>{var b,g;const d=((b=t.current)==null?void 0:b.clientWidth)||0,w=((g=n.current)==null?void 0:g.clientWidth)||0,h=d-w,m=Math.floor(h/r);i(e.slice(0,m)),l(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,r]),[o,u]},mu={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Tm=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((d,w)=>p.cloneElement(d,{className:f(mu.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:w})),[t]),i=p.useRef(null),u=p.useRef(null),[l,c]=hu(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),c.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(mu.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},_s={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Em=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((w,h)=>p.cloneElement(w.link,{key:h,className:f(_s.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[p.cloneElement(w.imgOrIcon,{className:f("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),[c,d]=hu(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:f(_s.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:c}),d.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(_s.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},gu=p.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,c]=p.useState(t),[d,w]=p.useState(n);p.useEffect(()=>{c(t),w(n)},[t,n]);const h=Math.ceil(e/d),m=l*d+1,b=Math.min((l+1)*d,e),g=Array.from({length:h},(y,N)=>N),x=p.useCallback(y=>{y>=0&&y<h&&(c(y),r==null||r(y))},[h,r]),S=224;return a.jsxs("div",{className:f("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(bu,{label:"Previous page",onClick:()=>x(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Vs,{name:`${m} - ${b}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(It,{style:{maxHeight:S+"px"},dir:i.dir,children:g.length>100?a.jsx(bt,{className:"wu-pagination-list",containerHeight:S,list:g,callback:(y,N)=>a.jsxs(jn,{onSelect:()=>x(N),className:f("wu-py-2",N===l&&"wu-bg-gray-20","wu-pagination-item"),children:[N*d+1," -"," ",Math.min((N+1)*d,e)]},y)}):g.map(y=>a.jsxs(jn,{onSelect:()=>x(y),className:f(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*d+1," -"," ",Math.min((y+1)*d,e)]},y))})}),a.jsx(bu,{label:"Next page",onClick:()=>x(l+1),disabled:l===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});gu.displayName="WuPagination";const bu=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(ce,{variant:"iconOnly",onClick:t,disabled:n,className:f("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:f("wu-text-sm",r)})}),Am=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(ze,{open:s,onOpenChange:o,modal:i,children:[a.jsx(et,{asChild:!0,dir:r,children:e}),a.jsx(Ie,{className:f("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),km=e=>a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{...e})}),yu=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Root,{className:f("wu-grid wu-gap-2",e),...t,ref:n}));yu.displayName=Ht.Root.displayName;const xu=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Item,{ref:n,className:f("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(Ht.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));xu.displayName=Ht.Item.displayName;const vu=p.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(yu,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:f("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Nn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(xu,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Nn,{htmlFor:l.value,className:f(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});vu.displayName="WuRadioGroup";const Mm=e=>{const{children:t,...n}=e;return a.jsxs(It,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Fs,{orientation:"horizontal"})]})};function Nu({className:e,...t}){return a.jsx("div",{className:f("animate-pulse rounded-md bg-muted",e),...t})}const Os=768;function Su(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Os-1}px)`),r=()=>{t(window.innerWidth<Os)};return n.addEventListener("change",r),t(window.innerWidth<Os),()=>n.removeEventListener("change",r)},[]),!!e}const Im="sidebar_state",Dm=3600*24*7,Pm="256px",Fm="256px",Vm="3rem",Lm="b",Cu=v.createContext(null);function ut(){const e=v.useContext(Cu);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Tu=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=Su(),[c,d]=v.useState(!1),[w,h]=v.useState(l?!0:e),m=t??w,b=v.useCallback(y=>{const N=typeof y=="function"?y(m):y;n?n(N):h(N),document.cookie=`${Im}=${N}; path=/; max-age=${Dm}`},[n,m]),g=v.useCallback(()=>l?d(y=>!y):b(y=>!y),[l,b,d]);v.useEffect(()=>{const y=N=>{N.key===Lm&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:m,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,b,l,c,d,g]);return a.jsx(Cu.Provider,{value:S,children:a.jsx(Ia,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":Pm,"--sidebar-width-icon":Vm,...s},className:f("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Tu.displayName="SidebarProvider";const Eu=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:c,setOpenMobile:d}=ut();return n==="none"?a.jsx("div",{className:f("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(ao,{open:c,onOpenChange:d,...o,children:a.jsx(Lr,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Fm},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:f("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:f("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});Eu.displayName="Sidebar";const Au=v.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=ut();return a.jsxs(mt,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:f("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Au.displayName="SidebarTrigger";const _m=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=ut();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:f("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});_m.displayName="SidebarRail";const ku=v.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:f("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));ku.displayName="SidebarInset";const Om=v.forwardRef(({className:e,...t},n)=>a.jsx(vr,{ref:n,"data-sidebar":"input",className:f("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));Om.displayName="SidebarInput";const Mu=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:f("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));Mu.displayName="SidebarHeader";const Iu=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:f("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Iu.displayName="SidebarFooter";const Wm=v.forwardRef(({className:e,...t},n)=>a.jsx(Dr,{ref:n,"data-sidebar":"separator",className:f("wu-mx-2 wu-w-auto",e),...t}));Wm.displayName="SidebarSeparator";const Du=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:f("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Du.displayName="SidebarContent";const Pu=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:f("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Pu.displayName="SidebarGroup";const Fu=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:f("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});Fu.displayName="SidebarGroupLabel";const Bm=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:f("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});Bm.displayName="SidebarGroupAction";const Vu=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:f("wu-w-full wu-text-sm",e),...t}));Vu.displayName="SidebarGroupContent";const Ws=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:f("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));Ws.displayName="SidebarMenu";const Lu=v.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:f("wu-group/menu-item wu-relative",e),...t}));Lu.displayName="SidebarMenuItem";const zm=Me.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),_u=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?ft.Slot:"button",{isMobile:c,state:d}=ut(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:f(zm({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Da,{children:[a.jsx(Pa,{asChild:!0,children:w}),a.jsx(Nr,{side:"right",align:"center",hidden:d!=="collapsed"||c,...s})]})):w});_u.displayName="SidebarMenuButton";const qm=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?ft.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:f("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});qm.displayName="SidebarMenuAction";const $m=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:f("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));$m.displayName="SidebarMenuBadge";const Hm=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:f("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Nu,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Nu,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});Hm.displayName="SidebarMenuSkeleton";const Um=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:f("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Um.displayName="SidebarMenuSub";const jm=v.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));jm.displayName="SidebarMenuSubItem";const Gm=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?ft.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:f("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Gm.displayName="SidebarMenuSubButton";const Km=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Tu,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(Eu,{variant:"sidebar",collapsible:"icon",className:f("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(Mu,{className:"wu-py-2",children:a.jsx(Ou,{})}),t]}),a.jsx(ku,{className:"wu-contain-inline-size",children:e})]}),Ou=e=>{const{state:t,isMobile:n,openMobile:r}=ut();return a.jsx(Au,{...e,children:a.jsx(Ls,{showMenu:n?r:t==="expanded"})})},Ym=({className:e,children:t,...n})=>{const r=p.useRef(null),s=p.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:c,scrollHeight:d}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+c!==d)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Du,{...n,className:f("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(It,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Xm=e=>a.jsx(Iu,{...e,children:e.children}),Zm=({label:e,children:t,...n})=>a.jsxs(Pu,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Fu,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Vu,{children:a.jsx(Ws,{children:t})})]}),Jm=e=>a.jsx(Ws,{...e}),Qm=({Icon:e,children:t,className:n,isActive:r,...s})=>{const{state:o}=ut(),[i,u]=p.useState(),l=Su(),c=t&&p.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,a.jsx("span",{className:f("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t.props.children})]})}),d=p.useRef(null);return p.useEffect(()=>{var w;u(((w=d.current)==null?void 0:w.textContent)||"")},[]),a.jsx(Lu,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(_u,{className:f("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:!0,ref:d,children:c})})},Rm=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),Bs=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},eg=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Rm.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},an={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},tg=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,c={border:l?`4px solid ${Bs(r,an.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:Bs(r,s*an.LIGHTNESS_STEP),fontSize:l?an.FONT_SIZE_ACTIVE:an.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:Bs(r,45+s*6),height:an.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:f("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:c,...i,children:[a.jsx("div",{style:d,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},ng=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(Qa,{open:o,onOpenChange:i,children:[a.jsx(Ra,{className:f("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(Fr,{className:f("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(yt,{}),a.jsx(pa.DialogClose,{className:f("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(re,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(Vr,{className:f("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})};function rg({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=v.useRef(e!==void 0),[o,i]=v.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){v.useEffect(()=>{s!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
16
+ `))},[r,n,e]);const{current:c}=v.useRef(t);v.useEffect(()=>{!s&&JSON.stringify(c)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
17
+ `))},[JSON.stringify(t)])}const l=v.useCallback(c=>{s||i(c)},[]);return[u,l]}const Wu={};function Dt(e,t){const n=v.useRef(Wu);return n.current===Wu&&(n.current=e(t)),n}const zs=v[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],sg=zs&&zs!==v.useLayoutEffect?zs:e=>e();function Fe(e){const t=Dt(ag).current;return t.next=e,sg(t.effect),t.trampoline}function ag(){const e={next:void 0,callback:og,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function og(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const ig=[];function Bu(e){v.useEffect(e,ig)}const on=0;class Kn{constructor(){yn(this,"currentId",on);yn(this,"clear",()=>{this.currentId!==on&&(clearTimeout(this.currentId),this.currentId=on)});yn(this,"disposeEffect",()=>this.clear)}static create(){return new Kn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=on,n()},t)}isStarted(){return this.currentId!==on}}function zu(){const e=Dt(Kn.create).current;return Bu(e.disposeEffect),e}const qu=0;class qs extends Kn{constructor(){super(...arguments);yn(this,"clear",()=>{this.currentId!==qu&&(clearInterval(this.currentId),this.currentId=qu)})}static create(){return new qs}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function ug(){const e=Dt(qs.create).current;return Bu(e.disposeEffect),e}const Ve=typeof document<"u"?v.useLayoutEffect:()=>{};function $u(e){const t=Dt(lg,e).current;return t.next=e,Ve(t.effect),t}function lg(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function cg(){const[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}function $s(e,t,n,r){const s=Dt(Hu).current;return wg(s,e,t,n,r)&&Uu(s,[e,t,n,r]),s.callback}function dg(e){const t=Dt(Hu).current;return fg(t,e)&&Uu(t,e),t.callback}function Hu(){return{callback:null,cleanup:null,refs:[]}}function wg(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function fg(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Uu(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const pg={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function ju(){return typeof window<"u"}function Hs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hg(e){return ju()?e instanceof Element||e instanceof Hs(e).Element:!1}function mg(e){return ju()?e instanceof HTMLElement||e instanceof Hs(e).HTMLElement:!1}function gg(e){return(e==null?void 0:e.ownerDocument)||document}const Yn=typeof navigator<"u",Us=vg(),bg=Sg(),yg=Ng();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const xg=Us.platform==="MacIntel"&&Us.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Us.platform);Yn&&bg.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,yg.includes("jsdom/");function vg(){if(!Yn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Ng(){if(!Yn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Sg(){if(!Yn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Xn(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const js=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(js.displayName="NumberFieldRootContext");function Zn(){const e=v.useContext(js);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Xn(43));return e}function Le(){}const $e=Object.freeze({});let Gu=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Cg={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Tg={valid(e){return e===null?null:e?{[Gu.valid]:""}:{[Gu.invalid]:""}}},Ku=v.createContext({invalid:void 0,name:void 0,validityData:{state:Cg,errors:[],error:"",value:"",initialValue:null},setValidityData:Le,disabled:void 0,touched:!1,setTouched:Le,dirty:!1,setDirty:Le,filled:!1,setFilled:Le,focused:!1,setFocused:Le,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=$e)=>e,getInputValidationProps:(e=$e)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Ku.displayName="FieldRootContext");function Gs(e=!0){const t=v.useContext(Ku);if(t.setValidityData===Le&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Xn(28));return t}const Eg={...v};let Yu=0;function Ag(e,t="mui"){const[n,r]=v.useState(e),s=e||n;return v.useEffect(()=>{n==null&&(Yu+=1,r(`${t}-${Yu}`))},[n,t]),s}const Xu=Eg.useId;function kg(e,t){if(Xu!==void 0){const n=Xu();return e??(t?`${t}-${n}`:n)}return Ag(e,t)}function Mg(e){return kg(e,"base-ui")}const Zu=v.createContext({controlId:void 0,setControlId:Le,labelId:void 0,setLabelId:Le,messageIds:[],setMessageIds:Le,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Zu.displayName="LabelableContext");function Ju(){return v.useContext(Zu)}function Ig(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,setControlId:o}=Ju(),i=Mg(t);return Ve(()=>{if(!(!n&&!t||o===Le)){if(n){const u=r==null?void 0:r.current;hg(u)&&u.closest("label")!=null?o(t??null):o(s??i)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,r,s,o,n,i]),s??i}const un={inputValue:()=>null,value:()=>null},Dg=parseInt(v.version,10);function Pg(e){return Dg>=e}function Qu(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(Pg(19)?n==null?void 0:n.ref:t.ref)??null}function Ks(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Fg(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Vg(e,t){return typeof e=="function"?e(t):e}function Lg(e,t){return typeof e=="function"?e(t):e}const ln={};function Ru(e,t,n,r,s){let o={...Ys(e,ln)};return t&&(o=Jn(o,t)),n&&(o=Jn(o,n)),r&&(o=Jn(o,r)),o}function _g(e){if(e.length===0)return ln;if(e.length===1)return Ys(e[0],ln);let t={...Ys(e[0],ln)};for(let n=1;n<e.length;n+=1)t=Jn(t,e[n]);return t}function Jn(e,t){return el(t)?t(e):Og(e,t)}function Og(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ks(e.style,r);break}case"className":{e[n]=tl(e.className,r);break}default:Wg(n,r)?e[n]=Bg(e[n],r):e[n]=r}}return e}function Wg(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function el(e){return typeof e=="function"}function Ys(e,t){return el(e)?e(t):e??ln}function Bg(e,t){return t?e?n=>{if(zg(n)){const s=n;Xs(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function Xs(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function tl(e,t){return t?e?t+" "+e:t:e}function zg(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function cn(e,t,n={}){const r=t.render,s=qg(t,n);if(n.enabled===!1)return null;const o=n.state??$e;return $g(e,r,s,o)}function qg(e,t={}){const{className:n,style:r,render:s}=e,{state:o=$e,ref:i,props:u,stateAttributesMapping:l,enabled:c=!0}=t,d=c?Vg(n,o):void 0,w=c?Lg(r,o):void 0,h=c?Fg(o,l):$e,m=c?Ks(h,Array.isArray(u)?_g(u):u)??$e:$e;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=dg([m.ref,Qu(s),...i]):m.ref=$s(m.ref,Qu(s),i):$s(null,null)),c?(d!==void 0&&(m.className=tl(m.className,d)),w!==void 0&&(m.style=Ks(m.style,w)),m):$e}function $g(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Ru(n,t.props);return s.ref=n.ref,v.cloneElement(t,s)}if(e&&typeof e=="string")return Hg(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Xn(8))}function Hg(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}const nl=new Map;function dn(e,t){const n=JSON.stringify({locale:e,options:t}),r=nl.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return nl.set(n,s),s}function Pt(e,t,n){return e==null?"":dn(t,n).format(e)}function rl(e,t,n){return Pt(e,t,{...n,maximumFractionDigits:20})}const Ug=["零","〇","一","二","三","四","五","六","七","八","九"],jg={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},sl=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],al=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Zs=["0","1","2","3","4","5","6","7","8","9"],ol=["%","٪","%","﹪"],il=["‰","؉"],ul=["−","-","‒","–","—","﹣"],ll=["+","﹢"],Gg=".",Kg=",",Yg=new RegExp(`[${sl.join("")}]`,"g"),Xg=new RegExp(`[${al.join("")}]`,"g"),Zg=new RegExp(`[${Zs.join("")}]`,"g"),Jg=new RegExp(`[${Ug.join("")}]`,"g"),Qg=new RegExp(`[${ol.join("")}]`),Rg=new RegExp(`[${il.join("")}]`),Js=/[٠١٢٣٤٥٦٧٨٩]/,cl=/[۰۱۲۳۴۵۶۷۸۹]/,Qs=/[零〇一二三四五六七八九]/,dl=new RegExp(`[${Zs.join("")}]`),eb=[".",",",Gg,Kg,"٫","٬"],wl=new RegExp("\\p{Zs}","u"),tb=["+",...ll],nb=["-",...ul],Qn=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),rb=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),fl=e=>`[${e.map(rb).join("")}]`,pl=fl(["-"].concat(ul)),hl=fl(["+"].concat(ll)),ml=new RegExp(pl,"gu"),gl=new RegExp(hl,"gu"),wn=new RegExp(pl),Rn=new RegExp(hl);function Rs(e,t){const n=dn(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),dn(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function Ft(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(ml,"-").replace(gl,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Js.test(r)||cl.test(r)?u="ar":Qs.test(r)&&(u="zh"));const{group:l,decimal:c,currency:d}=Rs(u,n),w=dn(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>Qn(A.value)),h=w.length?new RegExp(w.join("|"),"g"):null;let m=null;l&&(new RegExp("\\p{Zs}","u").test(l)?m=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?m=/['’]/g:m=new RegExp(Qn(l),"g"));let g=[{regex:l?m:null,replacement:""},{regex:c?new RegExp(Qn(c),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(Qn(d),"g"):null,replacement:""},{regex:h,replacement:""},{regex:Yg,replacement:A=>String(sl.indexOf(A))},{regex:Xg,replacement:A=>String(al.indexOf(A))},{regex:Zg,replacement:A=>String(Zs.indexOf(A))},{regex:Jg,replacement:A=>jg[A]}].reduce((A,{regex:k,replacement:D})=>k?A.replace(k,D):A,r);const x=g.lastIndexOf(".");if(x!==-1&&(g=`${g.slice(0,x).replace(/\./g,"")}.${g.slice(x+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const S=(s?"-":"")+g;let y=parseFloat(S);const N=n==null?void 0:n.style,C=N==="unit"&&(n==null?void 0:n.unit)==="percent",E=Qg.test(e)||N==="percent";return Rg.test(e)?y/=1e3:!C&&E&&(y/=100),Number.isNaN(y)?null:y}const sb=60,ab=400,ob=50,ib=3,ub=8,er=1;function lb(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const cb=1e-10;function db(e){const t=dn("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function wb(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function ea(e,t){const{maximumFractionDigits:n}=db(t);return wb(e,n)}function fb(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*cb*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let c;return r==="nearest"?c=Math.round(l):o>0?c=Math.floor(l):c=Math.ceil(l),t+c*(r==="nearest"?n:s)}function pb(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u}){if(e===null)return e;const l=lb(e,n,r);if(t!=null&&i){if(t===0)return ea(l,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const d=fb(l,c,t,u?"nearest":"directional");return ea(d,o)}return ea(l,o)}const hb="none",bl="input-change",ta="input-clear",yl="input-blur",mb="input-paste",fn="keyboard";function _e(e,t,n,r){let s=!1,o=!1;const i=r??$e;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function pn(e,t,n){const r=$e;return{reason:e,event:t??new Event("base-ui"),...r}}const xl=v.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:c=!1,disabled:d=!1,readOnly:w=!1,name:h,defaultValue:m,value:b,onValueChange:g,onValueCommitted:x,allowWheelScrub:S=!1,snapOnStep:y=!1,format:N,locale:C,render:E,className:M,inputRef:A,...k}=t,{setDirty:D,validityData:F,disabled:V,setFilled:$,invalid:W,name:G,state:q,validation:ue,shouldValidateOnChange:I}=Gs(),_=V||d,z=G??h,[B,ne]=v.useState(!1),ae=s??Number.MIN_SAFE_INTEGER,xe=o??Number.MAX_SAFE_INTEGER,He=s??0,j=N==null?void 0:N.style,P=v.useRef(null),U=$s(A,ue.inputRef),Z=Ig({id:r}),[O,R]=rg({controlled:b,default:m,name:"NumberField",state:"value"}),H=O??null,be=$u(H);Ve(()=>{$(H!==null)},[$,H]);const ve=cg(),Ne=$u(N),me=v.useRef(!1),Oe=Fe((J,Y)=>{me.current=!1,x==null||x(J,Y)}),Ge=zu(),Vt=ug(),Lt=zu(),ir=v.useRef(!1),ur=v.useRef(0),ct=v.useRef(!0),_t=v.useRef(null),dt=v.useRef(()=>{}),[oe,Ue]=v.useState(()=>b!==void 0?vl(H,C,N):Pt(H,C,N)),[lr,uy]=v.useState("numeric"),cc=Fe(()=>{const{decimal:J,group:Y,currency:le,literal:fe}=Rs(C,N),ee=new Set;eb.forEach(Ee=>ee.add(Ee)),J&&ee.add(J),Y&&(ee.add(Y),wl.test(Y)&&ee.add(" "));const We=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="percent",bn=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="permille";return We&&ol.forEach(Ee=>ee.add(Ee)),bn&&il.forEach(Ee=>ee.add(Ee)),j==="currency"&&le&&ee.add(le),fe&&(Array.from(fe).forEach(Ee=>ee.add(Ee)),wl.test(fe)&&ee.add(" ")),tb.forEach(Ee=>ee.add(Ee)),ae<0&&nb.forEach(Ee=>ee.add(Ee)),ee}),Ot=Fe(J=>J!=null&&J.altKey?i:J!=null&&J.shiftKey?l:u),cr=Fe((J,Y)=>{const le=Y.event,fe=Y.direction,ee=pb(J,{step:fe?Ot(le)*fe:void 0,format:Ne.current,minWithDefault:ae,maxWithDefault:xe,minWithZeroDefault:He,snapOnStep:y,small:(le==null?void 0:le.altKey)??!1});if(ee!==H||J!==H||ct.current===!1){if(_t.current=ee,g==null||g(ee,Y),Y.isCanceled)return;R(ee),D(ee!==F.initialValue),me.current=!0}ct.current&&Ue(Pt(ee,C,N)),ve()}),gn=Fe((J,{direction:Y,currentValue:le,event:fe,reason:ee})=>{const We=le??be.current,bn=typeof We=="number"?We+J*Y:Math.max(0,s??0);cr(bn,_e(ee,fe,void 0,{direction:Y}))}),Wt=Fe(()=>{Lt.clear(),Ge.clear(),Vt.clear(),dt.current(),ur.current=0}),dc=Fe((J,Y)=>{if(Wt(),!P.current)return;const le=Hs(P.current);function fe(We){We.preventDefault()}le.addEventListener("contextmenu",fe),dt.current=()=>{le.removeEventListener("contextmenu",fe)},le.addEventListener("pointerup",We=>{ir.current=!1,Wt();const bn=_t.current??be.current;Oe(bn,pn(J?"increment":"decrement",We))},{once:!0});function ee(){const We=Ot(Y)??er;gn(We,{direction:J?1:-1,event:Y,reason:J?"increment-press":"decrement-press"})}ee(),Ge.start(ab,()=>{Vt.start(sb,ee)})});Ve(function(){if(!ct.current)return;const Y=b!==void 0?vl(H,C,N):Pt(H,C,N);Y!==oe&&Ue(Y)}),Ve(function(){if(!xg)return;let Y="text";ae>=0&&(Y="decimal"),uy(Y)},[ae,j]),v.useEffect(()=>()=>Wt(),[Wt]),v.useEffect(function(){const Y=P.current;if(_||w||!S||!Y)return;function le(fe){if(fe.ctrlKey||gg(P.current).activeElement!==P.current)return;fe.preventDefault();const ee=Ot(fe)??er;gn(ee,{direction:fe.deltaY>0?-1:1,event:fe,reason:"wheel"})}return Y.addEventListener("wheel",le),()=>{Y.removeEventListener("wheel",le)}},[S,gn,_,w,l,u,Ot]);const wa=v.useMemo(()=>({...q,disabled:_,readOnly:w,required:c,value:H,inputValue:oe,scrubbing:B}),[q,_,w,c,H,oe,B]),ly=v.useMemo(()=>({inputRef:P,inputValue:oe,value:H,startAutoChange:dc,stopAutoChange:Wt,minWithDefault:ae,maxWithDefault:xe,disabled:_,readOnly:w,id:Z,setValue:cr,incrementValue:gn,getStepAmount:Ot,allowInputSyncRef:ct,formatOptionsRef:Ne,valueRef:be,lastChangedValueRef:_t,hasPendingCommitRef:me,isPressedRef:ir,intentionalTouchCheckTimeout:Lt,movesAfterTouchRef:ur,name:z,required:c,invalid:W,inputMode:lr,getAllowedNonNumericKeys:cc,min:s,max:o,setInputValue:Ue,locale:C,isScrubbing:B,setIsScrubbing:ne,state:wa,onValueCommitted:Oe}),[P,oe,H,dc,Wt,ae,xe,_,w,Z,cr,gn,Ot,Ne,be,Lt,z,c,W,lr,cc,s,o,Ue,C,B,wa,Oe]),cy=cn("div",t,{ref:n,state:wa,props:k,stateAttributesMapping:un});return a.jsxs(js.Provider,{value:ly,children:[cy,a.jsx("input",{...ue.getInputValidationProps({onChange(J){if(J.nativeEvent.defaultPrevented)return;const Y=J.currentTarget.valueAsNumber,le=Number.isNaN(Y)?null:Y,fe=_e(hb,J.nativeEvent);D(le!==F.initialValue),cr(le,fe),I()&&ue.commit(le)}}),ref:U,type:"number",name:z,value:H??"",min:s,max:o,step:u,disabled:_,required:c,"aria-hidden":!0,tabIndex:-1,style:pg})]})});process.env.NODE_ENV!=="production"&&(xl.displayName="NumberFieldRoot");function vl(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Pt(e,t,n):rl(e,t,n)}const Nl=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=Zn();return cn("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:un})});process.env.NODE_ENV!=="production"&&(Nl.displayName="NumberFieldGroup");let na;process.env.NODE_ENV!=="production"&&(na=new Set);function Sl(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");na.has(t)||(na.add(t),console.error(`Base UI: ${t}`))}}const Cl=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(Cl.displayName="CompositeRootContext");function gb(e=!1){const t=v.useContext(Cl);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Xn(16));return t}function bb(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:v.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||u)&&(c.disabled=n),c},[r,n,t,i,u,o,s])}}function Tl(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,o=v.useRef(null),i=gb(!0)!==void 0,u=Fe(()=>{const h=o.current;return!!((h==null?void 0:h.tagName)==="A"&&(h!=null&&h.href))}),{props:l}=bb({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&v.useEffect(()=>{if(!o.current)return;const h=o.current.tagName==="BUTTON";s?h||Sl("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):h&&Sl("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[s]);const c=v.useCallback(()=>{const h=o.current;yb(h)&&i&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,i]);Ve(c,[c]);const d=v.useCallback((h={})=>{const{onClick:m,onMouseDown:b,onKeyUp:g,onKeyDown:x,onPointerDown:S,...y}=h;return Ru({type:s?"button":void 0,onClick(C){if(t){C.preventDefault();return}m==null||m(C)},onMouseDown(C){t||b==null||b(C)},onKeyDown(C){if(t||(Xs(C),x==null||x(C)),C.baseUIHandlerPrevented)return;const E=C.target===C.currentTarget&&!s&&!u()&&!t,M=C.key==="Enter",A=C.key===" ";E&&((A||M)&&C.preventDefault(),M&&(m==null||m(C)))},onKeyUp(C){t||(Xs(C),g==null||g(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!s&&!t&&C.key===" "&&(m==null||m(C))},onPointerDown(C){if(t){C.preventDefault();return}S==null||S(C)}},s?void 0:{role:"button"},l,y)},[t,l,s,u]),w=Fe(h=>{o.current=h,c()});return{getButtonProps:d,buttonRef:w}}function yb(e){return mg(e)&&e.tagName==="BUTTON"}function El(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:c,isIncrement:d,isPressedRef:w,locale:h,maxWithDefault:m,minWithDefault:b,movesAfterTouchRef:g,readOnly:x,setValue:S,startAutoChange:y,stopAutoChange:N,value:C,valueRef:E,lastChangedValueRef:M,onValueCommitted:A}=e,k=v.useRef({x:0,y:0}),D=v.useRef(!1),F=v.useRef(!1),V=v.useRef(""),$=C!=null&&C<=b,W=C!=null&&C>=m,G=d?"increment-press":"decrement-press";function q(I){t.current=!0;const _=Ft(l,h,r.current);_!==null&&(E.current=_,S(_,_e(G,I,void 0,{direction:d?1:-1})))}return{disabled:n||(d?W:$),"aria-readonly":x||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(I){const _=n||x||(d?W:$);if(I.defaultPrevented||_||(V.current==="touch"?F.current:I.detail!==0))return;q(I.nativeEvent);const z=s(I)??er,B=E.current;i(z,{direction:d?1:-1,event:I.nativeEvent,reason:G});const ne=M.current??E.current;ne!==B&&A(ne,pn(G,I.nativeEvent))},onPointerDown(I){var B;const _=!I.button||I.button===0,z=n||(d?W:$);I.defaultPrevented||x||!_||z||(V.current=I.pointerType,F.current=!1,w.current=!0,k.current={x:I.clientX,y:I.clientY},q(I.nativeEvent),I.pointerType!=="touch"?(I.preventDefault(),(B=u.current)==null||B.focus(),y(d,I)):c.start(ob,()=>{const ne=g.current;g.current=0,w.current&&ne!=null&&ne<ib?(y(d,I),F.current=!0):(F.current=!1,N())}))},onPointerUp(I){I.pointerType==="touch"&&(w.current=!1)},onPointerMove(I){if(n||x||(d?W:$)||I.pointerType!=="touch"||!w.current)return;g.current!=null&&(g.current+=1);const{x:z,y:B}=k.current,ne=z-I.clientX,ae=B-I.clientY;ne**2+ae**2>ub**2&&N()},onMouseEnter(I){const _=n||x||(d?W:$);I.defaultPrevented||_||!w.current||D.current||V.current==="touch"||y(d,I)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Al=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,locale:y,maxWithDefault:N,minWithDefault:C,movesAfterTouchRef:E,readOnly:M,setValue:A,startAutoChange:k,state:D,stopAutoChange:F,value:V,valueRef:$,lastChangedValueRef:W,onValueCommitted:G}=Zn(),q=o||c,ue=El({isIncrement:!0,inputRef:b,startAutoChange:k,stopAutoChange:F,minWithDefault:C,maxWithDefault:N,value:V,inputValue:g,disabled:q,readOnly:M,id:h,setValue:A,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:$,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:E,locale:y,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Tl({disabled:q,native:i}),z=v.useMemo(()=>({...D,disabled:q}),[D,q]);return cn("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:un})});process.env.NODE_ENV!=="production"&&(Al.displayName="NumberFieldIncrement");const kl=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,maxWithDefault:y,minWithDefault:N,movesAfterTouchRef:C,readOnly:E,setValue:M,startAutoChange:A,state:k,stopAutoChange:D,value:F,valueRef:V,locale:$,lastChangedValueRef:W,onValueCommitted:G}=Zn(),q=o||c,ue=El({isIncrement:!1,inputRef:b,startAutoChange:A,stopAutoChange:D,minWithDefault:N,maxWithDefault:y,value:F,inputValue:g,disabled:q,readOnly:E,id:h,setValue:M,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:V,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:C,locale:$,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Tl({disabled:q,native:i}),z=v.useMemo(()=>({...k,disabled:q}),[k,q]);return cn("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:un})});process.env.NODE_ENV!=="production"&&(kl.displayName="NumberFieldDecrement");function xb(e){e.preventDefault(),e.stopPropagation()}function vb(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ml=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Le,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Ml.displayName="FormContext");function Il(){return v.useContext(Ml)}function Nb(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:o,commit:i}=e,{formRef:u}=Il(),{invalid:l,markedDirtyRef:c,validityData:d,setValidityData:w}=Gs(),h=Fe(e.getValue);Ve(()=>{if(!t)return;let m=n;m===void 0&&(m=h()),d.initialValue===null&&m!==null&&w(b=>({...b,initialValue:m}))},[t,w,n,d.initialValue,h]),Ve(()=>{!t||!r||u.current.fields.set(r,{getValue:h,name:s,controlRef:o,validityData:vb(d,l),validate(){let m=n;m===void 0&&(m=h()),c.current=!0,Fc.flushSync(()=>i(m))}})},[i,o,t,u,h,r,l,c,s,d,n]),Ve(()=>{const m=u.current.fields;return()=>{r&&m.delete(r)}},[u,r])}function Sb(e,t){const n=v.useRef(e),r=Fe(t);Ve(()=>{n.current!==e&&r(n.current)},[e,r]),Ve(()=>{n.current=e},[e])}const Cb={...Tg,...un},Tb=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Dl=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:c,getStepAmount:d,id:w,incrementValue:h,inputMode:m,inputValue:b,max:g,min:x,name:S,readOnly:y,required:N,setValue:C,state:E,setInputValue:M,locale:A,inputRef:k,value:D,onValueCommitted:F,lastChangedValueRef:V,hasPendingCommitRef:$,valueRef:W}=Zn(),{clearErrors:G}=Il(),{validationMode:q,setTouched:ue,setFocused:I,invalid:_,shouldValidateOnChange:z,validation:B}=Gs(),{labelId:ne}=Ju(),ae=v.useRef(!1),xe=v.useRef(!1);return Nb({id:w,commit:B.commit,value:D,controlRef:k,name:S,getValue:()=>D??null}),Sb(D,P=>{const U=z();if(G(S),U&&B.commit(D),!(P===D||U)){if(xe.current){xe.current=!1;return}B.commit(D,!0)}}),cn("input",t,{ref:[n,k],state:E,props:[{id:w,required:N,disabled:u,readOnly:y,inputMode:m,value:b,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":_||void 0,"aria-labelledby":ne,suppressHydrationWarning:!0,onFocus(P){if(P.defaultPrevented||y||u||ae.current)return;ae.current=!0,I(!0);const U=P.currentTarget,Z=U.value.length;U.setSelectionRange(Z,Z)},onBlur(P){if(P.defaultPrevented||y||u)return;ue(!0),I(!1);const U=!i.current,Z=$.current;if(i.current=!0,b.trim()===""){C(null,_e(ta,P.nativeEvent)),q==="onBlur"&&B.commit(null),F(null,pn(ta,P.nativeEvent));return}const O=l.current,R=Ft(b,A,O);if(R===null)return;const H=(O==null?void 0:O.maximumFractionDigits)!=null||(O==null?void 0:O.minimumFractionDigits)!=null,be=O==null?void 0:O.maximumFractionDigits,ve=H&&typeof be=="number"?Number(R.toFixed(be)):R,Ne=pn(yl,P.nativeEvent),me=D!==ve,Oe=U||me||Z;q==="onBlur"&&B.commit(ve),me&&(xe.current=!0,C(ve,_e(yl,P.nativeEvent))),Oe&&F(ve,Ne);const Ge=Pt(ve,A,O),Vt=rl(R,A,O);!(!H&&R===D&&b===Vt)&&b!==Ge&&M(Ge)},onChange(P){if(P.nativeEvent.defaultPrevented)return;i.current=!1;const U=P.target.value;if(U.trim()===""){M(U),C(null,_e(ta,P.nativeEvent));return}const Z=c();if(!Array.from(U).every(H=>{const be=H>="0"&&H<="9",ve=Js.test(H),Ne=Qs.test(H),me=cl.test(H),Oe=dl.test(H),Ge=wn.test(H);return be||ve||Ne||me||Oe||Ge||Z.has(H)}))return;if(P.isTrusted){M(U);const H=Ft(U,A,l.current);H!==null&&C(H,_e(bl,P.nativeEvent));return}const R=Ft(U,A,l.current);R!==null&&(M(U),C(R,_e(bl,P.nativeEvent)))},onKeyDown(P){if(P.defaultPrevented||y||u)return;const U=P.nativeEvent;i.current=!0;const Z=c();let O=Z.has(P.key);const{decimal:R,currency:H,percentSign:be}=Rs(A,l.current),ve=P.currentTarget.selectionStart,Ne=P.currentTarget.selectionEnd,me=ve===0&&Ne===b.length,Oe=oe=>ve!=null&&Ne!=null&&oe>=ve&&oe<Ne;if(wn.test(P.key)&&Array.from(Z).some(oe=>wn.test(oe||""))){const oe=b.search(ml),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(wn.test(b)||Rn.test(b))||me||Ue}if(Rn.test(P.key)&&Array.from(Z).some(oe=>Rn.test(oe||""))){const oe=b.search(gl),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(wn.test(b)||Rn.test(b))||me||Ue}[R,H,be].forEach(oe=>{if(P.key===oe){const Ue=b.indexOf(oe),lr=Oe(Ue);O=!b.includes(oe)||me||lr}});const Ge=P.key>="0"&&P.key<="9",Vt=Js.test(P.key),Lt=Qs.test(P.key),ir=dl.test(P.key),ur=Tb.has(P.key);if(P.which===229||P.altKey||P.ctrlKey||P.metaKey||O||Ge||Vt||ir||Lt||ur)return;const ct=Ft(b,A,l.current),_t=d(P)??er;xb(P);const dt=pn(fn,U);P.key==="ArrowUp"?(h(_t,{direction:1,currentValue:ct,event:U,reason:fn}),F(V.current??W.current,dt)):P.key==="ArrowDown"?(h(_t,{direction:-1,currentValue:ct,event:U,reason:fn}),F(V.current??W.current,dt)):P.key==="Home"&&x!=null?(C(x,_e(fn,U)),F(V.current??W.current,dt)):P.key==="End"&&g!=null&&(C(g,_e(fn,U)),F(V.current??W.current,dt))},onPaste(P){if(P.defaultPrevented||y||u)return;P.preventDefault();const Z=(P.clipboardData||window.Clipboard).getData("text/plain"),O=Ft(Z,A,l.current);O!==null&&(i.current=!1,C(O,_e(mb,P.nativeEvent)),M(Z))}},B.getValidationProps(),o],stateAttributesMapping:Cb})});process.env.NODE_ENV!=="production"&&(Dl.displayName="NumberFieldInput");const Eb={wuStepper:"_wuStepper_apbnq_1"},Ab=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:c,labelPosition:d="left",disabled:w,resetInvalidValueOnBlur:h=!0,...m})=>{const b=v.useId(),[g,x]=v.useState(l!==void 0?Number(l):n||0);v.useEffect(()=>{l!==void 0&&x(Number(l))},[l]);const S=A=>{x(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||x(k)},N=()=>{h&&(i!==void 0&&g<i?(x(i),e==null||e(i)):u!==void 0&&g>u&&(x(u),e==null||e(u)))};v.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const C={inc:r||u!==void 0&&g>=u||w,dec:r||i!==void 0&&g<=i||w},E=i!==void 0&&g<i||u!==void 0&&g>u,M=f("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(xl,{id:b,value:g,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&S(A),dir:s,className:f("wu-flex wu-stepper",s==="rtl"&&d!=="top"&&"wu-gap-2",Eb.wuStepper,kb({labelPosition:d}),c),children:[t&&a.jsx(Ce,{htmlFor:b,className:"wu-input-label",children:t}),a.jsxs(Nl,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(kl,{"aria-label":"decrement",className:f(M,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:C.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Dl,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":E||void 0,dir:s,className:f("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",E&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:N,disabled:w,min:i,max:u,step:o,value:g,...m}),a.jsx(Al,{"aria-label":"increment",className:f(M,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:C.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},kb=Me.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}}),Pl=Me.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Mb=v.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(ba.Root,{ref:s,className:f(Pl({variant:t,size:n,className:e})),...r}));Mb.displayName=ba.Root.displayName;const Fl=v.createContext({size:"default",variant:"default"}),tr=v.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(xn.Root,{ref:o,className:f("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Fl.Provider,{value:{variant:t,size:n},children:r})}));tr.displayName=xn.Root.displayName;const lt=v.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=v.useContext(Fl);return a.jsx(xn.Item,{ref:o,className:f(Pl({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});lt.displayName=xn.Item.displayName;const Vl=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>f("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(tr,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:f("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(lt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(lt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Vl.displayName="_IconTab";const Ll=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=c=>f("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",c===r&&"wu-text-white wu-font-medium",s&&r===c&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(tr,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:f("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(lt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(lt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Ll.displayName="_Tab";const _l=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>f("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=f("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=f("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),d=f("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(tr,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(lt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:c,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(lt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});_l.displayName="_Toggle";const Ol=p.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:c=!0,...d}=e,[w,h]=p.useState(),m=b=>{let g=w;b!==""?g=b:c&&(g=w==="opt1"?"opt2":"opt1");const x=g==="opt1"?r[0].value:r[1].value;l&&l(x),h(g)};if(p.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");h(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(_l,{...d,ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});case"iconTab":return a.jsx(Vl,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});default:return a.jsx(Ll,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i,size:u})}});Ol.displayName="WuSwitcher";const Wl=Re.Root,ra=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Re.List,{className:f("wu-relative wu-flex",e),...n,ref:r,children:t}));ra.displayName=Re.List.displayName;const sa=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Trigger,{ref:n,className:f("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));sa.displayName=Re.Trigger.displayName;const Bl=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Content,{ref:n,className:e,...t}));Bl.displayName=Re.Content.displayName;const zl=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:f("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx(Bl,{value:r.value,forceMount:t||void 0,className:f("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},Ib=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return p.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:c,behavior:"smooth"})}}}},ql=(e,t)=>{const[n,r]=p.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return p.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const c={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(c)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},Db=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var N;const l=p.useRef(null),c=ql(l,"horizontal"),{showLeftArrow:d,showRightArrow:w,scrollByTab:h}=Ib(l),[m,b]=p.useState(!1),g=()=>h("left"),x=()=>h("right"),S=C=>a.jsx("div",{"data-testid":`gradient-overlay-${C}`,className:f("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",C==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="left";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",M&&"wu-translate-x-0 wu-opacity-100",!M&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Wl,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:f("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("left"),y(g,"left",d&&m),a.jsxs(ra,{ref:l,className:f("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(sa,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&m&&S("right"),y(x,"right",w&&m)]}),a.jsx(zl,{items:e,enableAnimation:s})]})},Pb=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return p.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:c,behavior:"smooth"})}}}},Fb=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var N;const l=p.useRef(null),c=ql(l,"vertical"),{showTopArrow:d,showBottomArrow:w,scrollByTab:h}=Pb(l),[m,b]=p.useState(!1),g=()=>h("up"),x=()=>h("down"),S=C=>a.jsx("div",{className:f("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",C==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="up";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",M&&"wu-translate-y-0 wu-opacity-100",!M&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Wl,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:f("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("top"),y(g,"up",d&&m),a.jsxs(ra,{ref:l,className:f("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(sa,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:c.height,top:c.top}})]}),w&&m&&S("bottom"),y(x,"down",w&&m)]}),a.jsx(zl,{items:e,enableAnimation:s})]})},Vb=({...e})=>e.orientation==="vertical"?a.jsx(Fb,{...e}):a.jsx(Db,{...e}),aa=v.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:f("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));aa.displayName="Table";const $l=v.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:f("[&_tr]:wu-border-b",e),...t}));$l.displayName="TableHeader";const Hl=v.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:f("",e),...t}));Hl.displayName="TableBody";const Lb=v.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:f("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Lb.displayName="TableFooter";const hn=v.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:f("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));hn.displayName="TableRow";const oa=v.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:f("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));oa.displayName="TableHead";const nr=v.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:f("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));nr.displayName="TableCell";const ia=v.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:f("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));ia.displayName="TableCaption";const _b=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o}=t||{},i=p.useCallback(l=>c=>{s(()=>c?l:[])},[s]);return{finalColumns:p.useMemo(()=>n?[{id:"select",header:({table:l})=>{const c=l.getRowModel().rows.map(w=>w.original),d=i(c);return a.jsx(Ae,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:w=>{l.toggleAllRowsSelected(!!w),d(!!w)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ae,{checked:l.getIsSelected(),onChange:c=>{l.toggleSelected(!!c)},"aria-label":String(l.original[o])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,i])}};function Ul({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=_b({columns:t,rowSelection:n}),s=p.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const jl=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s})=>{var c;const[o,i]=p.useState(null),u=p.useCallback(d=>{i(d)},[]),l=p.useCallback(()=>{i(null)},[]);return a.jsx(Hl,{children:r?a.jsx(hn,{children:a.jsx(nr,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s||a.jsx(gt,{className:"wu-w-full"})})}):(c=e.getRowModel().rows)!=null&&c.length?e.getRowModel().rows.map((d,w)=>a.jsx(hn,{"data-state":d.getIsSelected()&&"selected",onMouseEnter:()=>u(d.id),onMouseLeave:l,className:f("wu-transition-colors wu-border-b wu-border-black/[12%]",d.getIsSelected()?o===d.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:d.getVisibleCells().map((h,m)=>a.jsx(nr,{className:f("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",h.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100 wu-ease-in-out":"",o===d.id&&h.column.id==="actions"?"wu-opacity-100":"",h.column.columnDef.cellAlign==="right"&&"wu-text-right",h.column.columnDef.cellAlign==="center"&&"wu-text-center",h.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:Be.flexRender(h.column.columnDef.cell,h.getContext())},`${h.id}-${m}`))},`${d.id}-${w}`)):a.jsx(hn,{children:a.jsx(nr,{colSpan:e.getAllColumns().length,children:n})})})},Gl=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u})=>{const l=s==="compact"?"wu-h-8":"wu-h-10",c=d=>{const{id:w,columnDef:h,getIsSorted:m,toggleSorting:b}=d,{header:g}=h;if(!t.includes(w))return g;const x=m(),S=x==="asc",y=x==="desc",N=()=>{n?(b(!y),r==null||r({id:w,desc:y})):b(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:N,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:f("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",S&&"wu-hidden",!x&&"-wu-top-[11px]")}),a.jsx("span",{className:f("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!x&&"-wu-bottom-[10px]")})]})]})};return a.jsxs($l,{className:f("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",l),children:[e.getHeaderGroups().map(d=>a.jsx(hn,{className:"wu-relative",children:d.headers.map(w=>w.column.id==="actions"?a.jsx(oa,{colSpan:w.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${w.getSize()}px`}},w.id):a.jsx(oa,{colSpan:w.colSpan,className:f("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",w.column.columnDef.headerAlign==="right"&&"wu-text-right",w.column.columnDef.headerAlign==="center"&&"wu-text-center",w.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${w.getSize()}px`},children:Be.flexRender(c(w.column),w.getContext())},w.id))},d.id)),o&&i&&a.jsxs("div",{className:f("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",l),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:a.jsx(Ae,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:d=>{e.toggleAllRowsSelected(!!d)},"aria-label":"Select all"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})]})},Kl=Me.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),Ob=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:c=!1,CustomLoader:d,caption:w,...h})=>{var N;const{finalColumns:m,rowSelectionState:b}=Ul({data:e,columns:t,rowSelection:i}),g=p.useMemo(()=>m.filter(C=>C.enableSorting).map(C=>C.accessorKey),[m]),x=((N=i==null?void 0:i.selectedRows)==null?void 0:N.length)??0,S=C=>{if(typeof C=="function"){const E=C(b),M=Object.keys(E).filter(A=>E[Number(A)]).map(A=>e[Number(A)]);i==null||i.onRowSelect(M)}},y=Be.useReactTable({data:e,columns:m,getCoreRowModel:Be.getCoreRowModel(),getPaginationRowModel:Be.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i==null?void 0:i.isEnabled,state:{...i!=null&&i.isEnabled?{rowSelection:b}:{}},onRowSelectionChange:S});return a.jsxs("div",{className:f("wu-text-gray-lead wu-table-container wu-relative"),children:[w&&a.jsx(ia,{className:"wu-font-light",children:w}),a.jsxs(aa,{...h,className:f(Kl({variant:r}),h.className),children:[a.jsx(Gl,{table:y,sortableColumns:g,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:x>0,isStickyHeader:c}),!n&&a.jsx(jl,{table:y,size:o,NoDataContent:l,CustomLoader:d})]}),n&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(gt,{})})]})},Wb=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:c,NoDataContent:d,isLoading:w,caption:h,rowSelection:m,...b})=>{var $;const[g,x]=p.useState((s==null?void 0:s.initial)||[]),[S,y]=p.useState([]),[N,C]=p.useState((i==null?void 0:i.pageIndex)??0),{finalColumns:E,rowSelectionState:M}=Ul({data:e,columns:t,rowSelection:m}),A=p.useMemo(()=>E.filter(W=>W.enableSorting).map(W=>W.accessorKey),[E]),k=p.useMemo(()=>E.filter(W=>W.filterable).map(W=>W.accessorKey),[E]),D=(($=m==null?void 0:m.selectedRows)==null?void 0:$.length)??0,F=W=>{const G=typeof W=="function"?W(M):W,q=Object.keys(G).filter(ue=>G[Number(ue)]).map(ue=>e[Number(ue)]);m==null||m.onRowSelect(q)},V=Be.useReactTable({data:e,columns:E,getCoreRowModel:Be.getCoreRowModel(),getFilteredRowModel:Be.getFilteredRowModel(),getSortedRowModel:Be.getSortedRowModel(),getPaginationRowModel:i?Be.getPaginationRowModel():void 0,state:{sorting:g,columnFilters:S,...i?{pagination:i}:{},...m!=null&&m.isEnabled?{rowSelection:M}:{}},onSortingChange:x,onColumnFiltersChange:y,onRowSelectionChange:F});return p.useEffect(()=>{k.forEach(W=>{var G;(G=V.getColumn(W))==null||G.setFilterValue(o)})},[o,k,V]),p.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==N&&(m==null||m.onRowSelect(()=>[]),V.resetRowSelection(),C(i.pageIndex))},[i==null?void 0:i.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(aa,{...b,className:f("wu-overflow-x-auto wu-w-full",Kl({variant:n}),"wu-table-fixed",b.className),children:[h&&a.jsx(ia,{children:h}),a.jsx(Gl,{table:V,sortableColumns:A,size:r,HeaderAction:l,isRowSelected:D>0,isStickyHeader:u}),a.jsx(jl,{table:V,size:r,NoDataContent:d,CustomLoader:c,isLoading:w})]})})},Yl=v.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:f("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));Yl.displayName="Textarea";const Xl=p.forwardRef((e,t)=>{const{Label:n,id:r=vn(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,c=w=>{l.onChange&&l.onChange(w)},d=Ut(u);return a.jsxs("div",{className:f(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(Yl,{...l,ref:t,id:r,className:f("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:c,readOnly:o,maxLength:i}),n&&a.jsx(Ce,{htmlFor:r,className:"wu-textarea-label",children:n})]})});Xl.displayName="WuTextarea";function Bb(e){if(typeof e=="string"&&e.includes("T")){const t=K.parseISO(e);return K.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=K.parse(e,"HH:mm:ss",new Date);return K.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Zl=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Jl=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Ql=["am","pm"],rr=50;function zb(e){return Array(rr).fill(e).flat()}function ua(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function qb(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function Rl(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const $b=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:f("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),la=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:f("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?zb(e):e).map((i,u)=>a.jsx($b,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function Hb(e,t,n,r){const s=p.useMemo(()=>e?ua(Zl,t.padStart(2,"0")):Zl,[e]),o=p.useMemo(()=>e?ua(Jl,n.padStart(2,"0")):Jl,[e]),i=p.useMemo(()=>e?ua(Ql,r):Ql,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function Ub(e,t,n){p.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/rr,l=Math.floor(rr/2);i.scrollTop=l*u;const c=()=>{const{scrollTop:d}=i,w=Math.round(d/u);(w<=1||w>=rr-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",c),()=>{i.removeEventListener("scroll",c)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const ec=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=p.useState(!1),[l,c]=p.useState(""),d=p.useRef(null),w=p.useRef(null),h=p.useRef(null),m=p.useRef(null),[b,g]=p.useState("12"),[x,S]=p.useState("00"),[y,N]=p.useState("am");p.useEffect(()=>{if(!t){c(""),g("12"),S("00"),N("am"),d.current&&(d.current.value="");return}const k=Bb(t);c(k);const[D,F]=k.split(":"),{hour:V,meridiem:$}=Rl(D);g(V),S(F),N($),d.current&&(d.current.value=k)},[t]),p.useEffect(()=>{const k=D=>{w.current&&!w.current.contains(D.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),Ub(i,h,m);const{rotatedHours:C,rotatedMinutes:E,rotatedMeridiem:M}=Hb(i,b,x,y),A=p.useCallback((k,D,F)=>{const V=k??b,$=D??x,W=F??y;g(V),S($),N(W);const G=`${qb(V,W)}:${$}`;c(G)},[b,x,y]);return a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(Ce,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:f("relative inline-block"),ref:w,dir:s,children:[a.jsx(Te,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{c(k.target.value);const[D,F]=k.target.value.split(":"),{hour:V,meridiem:$}=Rl(D);g(V),S(F),N($)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(re,{icon:"wm-schedule",className:f("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
18
+ input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
19
+ `}),i&&a.jsxs("div",{className:f("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(la,{values:C,selectedValue:b.padStart(2,"0"),scrollRef:h,onSelect:k=>A(k,x),className:"wu-time-hour-picker"}),a.jsx(la,{values:E,selectedValue:x.padStart(2,"0"),scrollRef:m,onSelect:k=>A(b,k),className:"wu-time-minute-picker"}),a.jsx(la,{values:M,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};ec.displayName="WuTimePicker";const jb=1,Gb=1e6;let ca=0;function Kb(){return ca=(ca+1)%Number.MAX_SAFE_INTEGER,ca.toString()}const da=new Map,tc=e=>{if(da.has(e))return;const t=setTimeout(()=>{da.delete(e),mn({type:"REMOVE_TOAST",toastId:e})},Gb);da.set(e,t)},Yb=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,jb)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?tc(n):e.toasts.forEach(r=>{tc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},sr=[];let ar={toasts:[]};function mn(e){ar=Yb(ar,e),sr.forEach(t=>{t(ar)})}function nc({...e}){const t=Kb(),n=s=>mn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>mn({type:"DISMISS_TOAST",toastId:t});return mn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Xb(){const[e,t]=p.useState(ar);return p.useEffect(()=>(sr.push(t),()=>{const n=sr.indexOf(t);n>-1&&sr.splice(n,1)}),[e]),{...e,toast:nc,dismiss:n=>mn({type:"DISMISS_TOAST",toastId:n})}}const Zb=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>nc({description:t,variant:n,duration:r,position:s})}),Jb=Se.Provider,Qb=Me.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),rc=v.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Se.Viewport,{ref:r,className:f(Qb({position:t}),e),...n}));rc.displayName=Se.Viewport.displayName;const Rb=Me.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),sc=v.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Se.Root,{ref:s,className:f(Rb({variant:t,position:n}),e),...r}));sc.displayName=Se.Root.displayName;const ey=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Action,{ref:n,className:f("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));ey.displayName=Se.Action.displayName;const ac=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Close,{ref:n,className:f("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));ac.displayName=Se.Close.displayName;const oc=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Title,{ref:n,className:f("wu-text-sm wu-font-semibold",e),...t}));oc.displayName=Se.Title.displayName;const ic=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Description,{ref:n,className:f("wu-text-sm wu-opacity-90",e),...t}));ic.displayName=Se.Description.displayName;function ty(){const{toasts:e}=Xb(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(Jb,{children:Object.entries(t).map(([n,r])=>a.jsx(rc,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:c,...d}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(sc,{variant:l||"success",position:c,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(oc,{children:o}),i&&a.jsxs(ic,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(re,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(ac,{})]},s)})},n))})}const ny=()=>a.jsx(ty,{}),uc=v.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(fr.Root,{className:f("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(fr.Thumb,{className:f("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));uc.displayName=fr.Root.displayName;const lc=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=vn(),...c}=e;return p.useEffect(()=>{const{checked:d,defaultChecked:w}=c;d!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),a.jsxs("div",{className:f(ry({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(uc,{...c,id:l,disabled:u,ref:t,onCheckedChange:s,className:f("wu-peer",o),dir:i}),a.jsx(Ce,{htmlFor:l,className:"wu-toggle-label",children:n})]})});lc.displayName="WuToggle";const ry=Me.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),or=p.createContext(null),sy=()=>{const e=p.useContext(or);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},ay=()=>{const e=p.useContext(or);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},oy=({children:e})=>{const[t,n]=p.useState({}),[r,s]=p.useState({}),o=p.useCallback(async(c,d)=>{try{const h=await(await fetch(c)).json();n(h)}catch(w){console.error("Failed to load translations:",w),d&&n(d)}d&&s(d)},[]),i=p.useCallback(c=>{s(c)},[]),u=p.useCallback(()=>({t:(d,w)=>t[d]?t[d]:r[d]?r[d]:w||d}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(or.Provider,{value:l,children:e})},iy={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}};window.wickUiVersion="1.24.2",Object.defineProperty(T,"useContext",{enumerable:!0,get:()=>p.useContext}),T.CHART_COLOR_SYSTEM=iy,T.WuAccordion=_c,T.WuAppHeader=id,T.WuAppHeaderAccount=Ca,T.WuAppHeaderBar=Ma,T.WuAppHeaderHelp=Ta,T.WuAppHeaderMenu=ka,T.WuAppHeaderSearch=ad,T.WuButton=ce,T.WuCalender=Sr,T.WuCard=Oa,T.WuCardFooter=Ba,T.WuCardHeader=Wa,T.WuCheckbox=Ae,T.WuChip=pd,T.WuCombobox=Sd,T.WuContentEditor=nw,T.WuCopyToClipboard=rw,T.WuDataTable=Ob,T.WuDatePicker=ld,T.WuDateRangePicker=wd,T.WuDisplay=Kc,T.WuDrawer=cw,T.WuDrawerClose=dw,T.WuDrilldown=om,T.WuFooter=uu,T.WuFormGroup=sd,T.WuHeading=jc,T.WuHelpButton=lu,T.WuIcon=re,T.WuInput=Te,T.WuInputError=td,T.WuInputHint=nd,T.WuLabel=Ce,T.WuListbox=bm,T.WuLoader=gt,T.WuMenu=Vs,T.WuMenuCheckboxItem=Jh,T.WuMenuIcon=Ls,T.WuMenuItem=jn,T.WuMenuItemGroup=Qh,T.WuMenuRadioItem=Rh,T.WuMenuSeparatorItem=em,T.WuModal=An,T.WuModalClose=Ke,T.WuModalContent=kn,T.WuModalFooter=Ud,T.WuModalHeader=Hd,T.WuMonthPicker=Sm,T.WuPagination=gu,T.WuPopover=Am,T.WuPopoverClose=km,T.WuPrimaryNavbar=Tm,T.WuRadioGroup=vu,T.WuScrollArea=Mm,T.WuSecondaryNavbar=Em,T.WuSelect=pu,T.WuSidebar=Km,T.WuSidebarContent=Ym,T.WuSidebarFooter=Xm,T.WuSidebarGroup=Zm,T.WuSidebarItem=Qm,T.WuSidebarMenu=Jm,T.WuSidebarTrigger=Ou,T.WuSpotlight=no,T.WuStackedCard=tg,T.WuStackedCardOverlay=ng,T.WuStepper=Ab,T.WuSubMenu=tm,T.WuSubtext=Gc,T.WuSwitcher=Ol,T.WuTab=Vb,T.WuTable=Wb,T.WuText=Uc,T.WuTextarea=Xl,T.WuTimePicker=ec,T.WuToast=ny,T.WuToggle=lc,T.WuTooltip=Sn,T.WuTranslationContext=or,T.WuTranslationProvider=oy,T.WuTruncatedLabel=od,T.WuVirtualScroll=bt,T.calculatePosition=eg,T.useTranslation=sy,T.useTranslationsContext=ay,T.useWuShowToast=Zb,T.useWuSidebar=ut,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
20
20
  //# sourceMappingURL=index.js.map