@npm-questionpro/wick-ui-lib 1.33.0 → 1.35.1

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,21 +1,21 @@
1
- (function(I,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("react-dom"),require("@tanstack/react-table"),require("date-fns"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","react-dom","@tanstack/react-table","date-fns","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@radix-ui/react-toast","@radix-ui/react-switch"],a):(I=typeof globalThis<"u"?globalThis:I||self,a(I["wick-ui-lib"]={},I["react/jsx-runtime"],I.RadixUIAvatar,I.React,I.clsx,I.tailwindMerge,I.RadixUIAccordion,I.RadixUISlot,I.ClassVarianceAuthority,I.ReactDayPicker,I.RadixUICheckbox,I.RadixUILabel,I.cmdk,I.RadixUIPopover,I.RadixUITooltip,I.ReactVirtuoso,I.RadixUIDropdownMenu,I.ReactDOM,I.TanstackReactTable,I.dateFns,I.RadixUIDialog,I.RadixUIScrollArea,I.RadixUIRadioGroup,I.RadixUISeparator,I.RadixUIToggleGroup,I.RadixUIToggle,I.RadixUITabs,I.RadixUIToast,I.RadixUISwitch))})(this,(function(I,a,Nt,h,pd,hd,md,St,Fe,La,gd,bd,ve,qt,Ts,Ba,yd,vd,We,j,qa,xd,Nd,Sd,Cd,Td,Ed,Id,Md){"use strict";var dv=Object.defineProperty;var wv=(I,a,Nt)=>a in I?dv(I,a,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):I[a]=Nt;var Se=(I,a,Nt)=>wv(I,typeof a!="symbol"?a+"":a,Nt);var cd;function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ct=pe(Nt),x=pe(h),it=pe(md),Es=pe(gd),$a=pe(bd),$t=pe(qt),Ht=pe(Ts),R=pe(yd),Ha=pe(vd),Q=pe(qa),ut=pe(xd),zt=pe(Nd),za=pe(Sd),Dn=pe(Cd),Ua=pe(Td),lt=pe(Ed),Ce=pe(Id),Is=pe(Md),Dd=hd.extendTailwindMerge({prefix:"wu-"});function p(...e){return Dd(pd.clsx(e))}const Ms=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Ds(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function An(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 Ad=e=>e?/\S+@questionpro\.com/.test(e):!1,ja=it.Root,As=x.forwardRef(({className:e,...t},n)=>a.jsx(it.Item,{ref:n,className:p("wu-border-b",e),...t}));As.displayName="AccordionItem";const ks=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(it.Header,{className:"wu-flex",children:a.jsxs(it.Trigger,{ref:s,className:p("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"})]})}));ks.displayName=it.Trigger.displayName;const _s=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(it.Content,{ref:s,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:p("wu-pb-4 wu-pt-0",e),children:t})}));_s.displayName=it.Content.displayName;const kd=e=>{const{items:t,className:n,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:r=[],value:o,onValueChange:i}=e;return a.jsx(ja,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:r,value:o,onValueChange:i,dir:s,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(As,{value:u,dir:s,className:p(n,d),children:[a.jsx(ks,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(_s,{dir:s,className:"wu-accordion-details",children:c})]},u))})}else{const{defaultValue:r,value:o,onValueChange:i}=e;return a.jsx(ja,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:r,value:o,onValueChange:i,dir:s,collapsible:!0,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(As,{value:u,dir:s,className:p(n,d),children:[a.jsx(ks,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(_s,{dir:s,className:"wu-accordion-details",children:c})]},u))})}},Ps=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Root,{ref:n,className:p("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Ps.displayName=Ct.Root.displayName;const Vs=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Image,{ref:n,className:p("wu-aspect-square wu-h-full wu-w-full",e),...t}));Vs.displayName=Ct.Image.displayName;const Os=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Fallback,{ref:n,className:p("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Os.displayName=Ct.Fallback.displayName;const we={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Ze=(e,t)=>t.includes(".")?t.split(".").reduce((n,s)=>n==null?void 0:n[s],e):e==null?void 0:e[t],_d=({log:e,accessorKey:t})=>{const n=Ze(e,t.time),s=Ze(e,t.userName),r=Ze(e,t.userInitials),o=Ze(e,t.userImage??""),i=Ze(e,t.tags??""),u=Ze(e,t.description);return a.jsxs("div",{className:we.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:we.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:we.content,"data-slot":"content",children:[a.jsx("div",{className:we.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:we.tags,"data-slot":"tags",children:i.map((l,c)=>a.jsx("span",{className:p(we.tag,c===0?we.tagPrimary:we.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:we.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(Ps,{className:we.avatar,"data-slot":"avatar",children:[a.jsx(Vs,{src:o,alt:s,"data-slot":"log-user-avatar-image"}),a.jsx(Os,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:r})]}),a.jsxs("p",{className:we.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:we.userName,"data-slot":"log-username",children:s})," ",u]})]})]})]})},Pd=h.memo(_d),Vd=({logs:e,accessorKey:t,className:n,...s})=>{const r=h.useMemo(()=>e.reduce((o,i)=>{const u=Ze(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:p(we.timelineContainer,n),"data-slot":"timeline-container",...s,children:[a.jsx("div",{className:we.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(r).map(([o,i])=>a.jsxs("div",{className:we.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:we.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:we.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:we.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:we.logList,"data-slot":"log-list",children:i.map(u=>{const l=Ze(u,t.id);return a.jsx(Pd,{log:u,accessorKey:t},l)})})]},o))]})};function Fs(e,t){h.useEffect(()=>{const n=s=>{Array.isArray(e)&&e.some(r=>!r.current||r.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Ws={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ga=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:s,isAllowActiveStyle:r})=>{const[o,i]=h.useState(!1),u=h.useRef(null),l=h.useRef(null);Fs([u,l],()=>i(!1));const c=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Ws.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:p("wu-flex wu-relative",o&&Ws.open),children:[a.jsx("button",{className:p("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,r&&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:p(Ws.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:s})]})})})})},Ls=Fe.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal 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 wu-leading-normal"],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-rounded-lg","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 disabled:wu-ring-gray-subtle"],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:[]}),Tt=x.forwardRef(({className:e,variant:t,size:n,color:s,asChild:r=!1,...o},i)=>{const u=r?St.Slot:"button";return a.jsx(u,{className:p(Ls({size:n,color:s,variant:t,className:e})),ref:i,...o})});Tt.displayName="Button";const ct=h.forwardRef((e,t)=>Od(e,t)),Od=(e,t)=>{const{size:n="md",color:s="#1B87E6",variant:r="dots",...o}=e,i=p("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:s,width:u,height:u},c=a.jsxs("div",{...o,ref:t,className:p("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:s}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:p("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:r==="spinner"?c:d})};ct.displayName="WuLoader";const Te=h.forwardRef(({disabled:e,loading:t,variant:n="primary",size:s="md",Icon:r,iconPosition:o="left",children:i,floating:u,className:l,color:c="primary",selected:d,...w},f)=>{const m={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Tt,{...w,disabled:e||t,variant:n,size:s,className:p(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:f,children:[!t&&r&&a.jsx(a.Fragment,{children:r}),t&&a.jsx(ct,{color:"#fff",size:"sm"}),!t&&i]})});Te.displayName="WuButton";const Fd=({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(Te,{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"})]}),Wd=({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:s,url:r,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:r,className:p("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:p(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:s})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},Ld=({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:p("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:p("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"})]}),Bd=({user:e,dir:t})=>{var n,s,r,o,i,u,l,c,d;return a.jsxs("section",{className:p("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:p("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:(s=e==null?void 0:e.license)==null?void 0:s.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:(r=e==null?void 0:e.profile)==null?void 0:r.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})]})]})]})]})},Ka=({user:e,onLogout:t,dir:n,DataCenter:s})=>{var r,o;return e?a.jsx(Ga,{Trigger:a.jsxs(Ps,{className:p("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(Vs,{className:"hover:wu-opacity-80",src:(r=e==null?void 0:e.profile)==null?void 0:r.profilePicture,alt:"User"}),a.jsx(Os,{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:p("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(Bd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Ld,{settings:e.settings,dir:n}),a.jsx(Wd,{user:e,dir:n}),a.jsx(Fd,{onLogout:t,DataCenter:s})]})}):null},Ya=({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(Ga,{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((s,r)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:s.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Ms(s.link),onKeyDown:o=>{o.key==="Enter"&&Ms(s.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(I,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("react-dom"),require("@tanstack/react-table"),require("date-fns"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","react-dom","@tanstack/react-table","date-fns","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@radix-ui/react-toast","@radix-ui/react-switch"],a):(I=typeof globalThis<"u"?globalThis:I||self,a(I["wick-ui-lib"]={},I["react/jsx-runtime"],I.RadixUIAvatar,I.React,I.clsx,I.tailwindMerge,I.RadixUIAccordion,I.RadixUISlot,I.ClassVarianceAuthority,I.ReactDayPicker,I.RadixUICheckbox,I.RadixUILabel,I.cmdk,I.RadixUIPopover,I.RadixUITooltip,I.ReactVirtuoso,I.RadixUIDropdownMenu,I.ReactDOM,I.TanstackReactTable,I.dateFns,I.RadixUIDialog,I.RadixUIScrollArea,I.RadixUIRadioGroup,I.RadixUISeparator,I.RadixUIToggleGroup,I.RadixUIToggle,I.RadixUITabs,I.RadixUIToast,I.RadixUISwitch))})(this,(function(I,a,Nt,h,yd,vd,xd,St,Le,La,Nd,Sd,xe,$t,Ts,Ba,Cd,Td,Me,z,qa,Ed,Md,Id,Dd,Ad,kd,_d,Pd){"use strict";var gv=Object.defineProperty;var bv=(I,a,Nt)=>a in I?gv(I,a,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):I[a]=Nt;var Ee=(I,a,Nt)=>bv(I,typeof a!="symbol"?a+"":a,Nt);var hd;function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ct=he(Nt),x=he(h),ut=he(xd),Es=he(Nd),$a=he(Sd),Ht=he($t),zt=he(Ts),ne=he(Cd),Ha=he(Td),te=he(qa),lt=he(Ed),Ut=he(Md),za=he(Id),In=he(Dd),Ua=he(Ad),ct=he(kd),Ie=he(_d),Ms=he(Pd),Vd=vd.extendTailwindMerge({prefix:"wu-"});function m(...e){return Vd(yd.clsx(e))}const Is=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Ds(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Dn(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 Od=e=>e?/\S+@questionpro\.com/.test(e):!1,ja=ut.Root,As=x.forwardRef(({className:e,...t},n)=>a.jsx(ut.Item,{ref:n,className:m("wu-border-b",e),...t}));As.displayName="AccordionItem";const ks=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(ut.Header,{className:"wu-flex",children:a.jsxs(ut.Trigger,{ref:s,className:m("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"})]})}));ks.displayName=ut.Trigger.displayName;const _s=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(ut.Content,{ref:s,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:m("wu-pb-4 wu-pt-0",e),children:t})}));_s.displayName=ut.Content.displayName;const Fd=e=>{const{items:t,className:n,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:r=[],value:o,onValueChange:i}=e;return a.jsx(ja,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:r,value:o,onValueChange:i,dir:s,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(As,{value:u,dir:s,className:m(n,d),children:[a.jsx(ks,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(_s,{dir:s,className:"wu-accordion-details",children:c})]},u))})}else{const{defaultValue:r,value:o,onValueChange:i}=e;return a.jsx(ja,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:r,value:o,onValueChange:i,dir:s,collapsible:!0,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(As,{value:u,dir:s,className:m(n,d),children:[a.jsx(ks,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(_s,{dir:s,className:"wu-accordion-details",children:c})]},u))})}},Ps=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Root,{ref:n,className:m("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Ps.displayName=Ct.Root.displayName;const Vs=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Image,{ref:n,className:m("wu-aspect-square wu-h-full wu-w-full",e),...t}));Vs.displayName=Ct.Image.displayName;const Os=x.forwardRef(({className:e,...t},n)=>a.jsx(Ct.Fallback,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Os.displayName=Ct.Fallback.displayName;const we={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Ze=(e,t)=>t.includes(".")?t.split(".").reduce((n,s)=>n==null?void 0:n[s],e):e==null?void 0:e[t],Wd=({log:e,accessorKey:t})=>{const n=Ze(e,t.time),s=Ze(e,t.userName),r=Ze(e,t.userInitials),o=Ze(e,t.userImage??""),i=Ze(e,t.tags??""),u=Ze(e,t.description);return a.jsxs("div",{className:we.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:we.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:we.content,"data-slot":"content",children:[a.jsx("div",{className:we.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:we.tags,"data-slot":"tags",children:i.map((l,c)=>a.jsx("span",{className:m(we.tag,c===0?we.tagPrimary:we.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:we.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(Ps,{className:we.avatar,"data-slot":"avatar",children:[a.jsx(Vs,{src:o,alt:s,"data-slot":"log-user-avatar-image"}),a.jsx(Os,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:r})]}),a.jsxs("p",{className:we.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:we.userName,"data-slot":"log-username",children:s})," ",u]})]})]})]})},Ld=h.memo(Wd),Bd=({logs:e,accessorKey:t,className:n,...s})=>{const r=h.useMemo(()=>e.reduce((o,i)=>{const u=Ze(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:m(we.timelineContainer,n),"data-slot":"timeline-container",...s,children:[a.jsx("div",{className:we.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(r).map(([o,i])=>a.jsxs("div",{className:we.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:we.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:we.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:we.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:we.logList,"data-slot":"log-list",children:i.map(u=>{const l=Ze(u,t.id);return a.jsx(Ld,{log:u,accessorKey:t},l)})})]},o))]})};function Fs(e,t){h.useEffect(()=>{const n=s=>{Array.isArray(e)&&e.some(r=>!r.current||r.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Ws={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ga=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:s,isAllowActiveStyle:r})=>{const[o,i]=h.useState(!1),u=h.useRef(null),l=h.useRef(null);Fs([u,l],()=>i(!1));const c=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Ws.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&Ws.open),children:[a.jsx("button",{className:m("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,r&&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:m(Ws.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:s})]})})})})},Ls=Le.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal 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 wu-leading-normal"],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-rounded-lg","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 disabled:wu-ring-gray-subtle"],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:[]}),Tt=x.forwardRef(({className:e,variant:t,size:n,color:s,asChild:r=!1,...o},i)=>{const u=r?St.Slot:"button";return a.jsx(u,{className:m(Ls({size:n,color:s,variant:t,className:e})),ref:i,...o})});Tt.displayName="Button";const dt=h.forwardRef((e,t)=>qd(e,t)),qd=(e,t)=>{const{size:n="md",color:s="#1B87E6",variant:r="dots",...o}=e,i=m("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:s,width:u,height:u},c=a.jsxs("div",{...o,ref:t,className:m("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:s}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:m("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:r==="spinner"?c:d})};dt.displayName="WuLoader";const De=h.forwardRef(({disabled:e,loading:t,variant:n="primary",size:s="md",Icon:r,iconPosition:o="left",children:i,floating:u,className:l,color:c="primary",selected:d,...w},f)=>{const p={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Tt,{...w,disabled:e||t,variant:n,size:s,className:m(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?p[c]:"",...w.style},ref:f,children:[!t&&r&&a.jsx(a.Fragment,{children:r}),t&&a.jsx(dt,{color:"#fff",size:"sm"}),!t&&i]})});De.displayName="WuButton";const $d=({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(De,{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"})]}),Hd=({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:s,url:r,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:r,className:m("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:m(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:s})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},zd=({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:m("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:m("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"})]}),Ud=({user:e,dir:t})=>{var n,s,r,o,i,u,l,c,d;return a.jsxs("section",{className:m("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:m("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:(s=e==null?void 0:e.license)==null?void 0:s.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:(r=e==null?void 0:e.profile)==null?void 0:r.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})]})]})]})]})},Ka=({user:e,onLogout:t,dir:n,DataCenter:s})=>{var r,o;return e?a.jsx(Ga,{Trigger:a.jsxs(Ps,{className:m("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(Vs,{className:"hover:wu-opacity-80",src:(r=e==null?void 0:e.profile)==null?void 0:r.profilePicture,alt:"User"}),a.jsx(Os,{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:m("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(Ud,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(zd,{settings:e.settings,dir:n}),a.jsx(Hd,{user:e,dir:n}),a.jsx($d,{onLogout:t,DataCenter:s})]})}):null},Ya=({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(Ga,{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((s,r)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:s.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Is(s.link),onKeyDown:o=>{o.key==="Enter"&&Is(s.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(Xa,{item:s,dir:t})}):a.jsx("a",{href:s.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(Xa,{item:s,dir:t})})},r))})})},Xa=({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:p("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),qd=e=>{const[t,n]=h.useState(()=>window.innerWidth<=e);return h.useEffect(()=>{const s=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function $d({productCategories:e,openCategory:t,setOpenCategory:n}){const s=(u,l)=>{const c=l[u];if(c){c.focus();const d=e[u]||null;n(d)}},r=(u,l,c,d)=>{u.preventDefault();const w=c==="down"?l+1:l-1;s(w,d)},o=(u,l,c,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(u.preventDefault(),s(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:f}=l;switch(f){case"ArrowDown":r(l,c,"down",w);break;case"ArrowUp":r(l,c,"up",w);break;case"Tab":o(l,c,w,d);break;case"Enter":case" ":i(l,c);break}}}const Hd=e=>{const{size:t="lg",className:n,children:s,...r}=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,{...r,className:p(o[t],n),children:s})},zd=e=>{const{size:t="xl",className:n,children:s,...r}=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,{...r,className:p(i[t],n),children:s})},Ud=e=>{const{size:t="lg",className:n,children:s,...r}=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,{...r,className:p(o[t],n),children:s})},jd=e=>{const{size:t="lg",className:n,children:s,...r}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...r,className:p(o[t],n),children:s})},De=e=>{const{icon:t,className:n,...s}=e;return a.jsx("span",{...s,className:p(t,n),role:"presentation","aria-label":t})},Gd=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:s,activeProductName:r,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:p("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=>{s&&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(De,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),r,a.jsx("span",{className:p("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ne={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"},Kd=({category:e,dir:t="ltr",openCategory:n})=>{const s=e.active?"#c5cce0":"#f0c36a",r=(n==null?void 0:n.name)===e.name,o=p("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",r&&"wu-hidden","wu-relative wu-top-[5px]"),i=p("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",r&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:p("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:ne.productCategoryBorderTop,style:{backgroundColor:s}}),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})]})},Yd={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"},Xd=({product:e,currentProduct:t,activeProductName:n,dir:s,focusItem:r,setFocusItem:o})=>{const[i,u]=h.useState(e.name===t),l=e.name===n,c=e.name===t,d=!e.active,w="#1b3380",f="#c5cce0",m="#ffcf70",g=p("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"),b=p("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"),v=i||r===e.name||l?w:f;return a.jsxs("li",{className:p(ne.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&ne.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",r===e.name&&ne.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":d,dir:s,onKeyDown:y=>{if(y.key==="Enter"){y.preventDefault();const N=y.currentTarget.querySelector("a");N&&N.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:p(ne.topBorder,s==="rtl"&&ne.topBorderRtl),style:{backgroundColor:d?m:v}}),a.jsxs("a",{className:p(ne.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:p(b,Yd[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:p(g),children:e.name})]})]},e.name)},Zd=({category:e,currentProduct:t,activeProductName:n,dir:s="ltr",focusItem:r,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,c=h.useMemo(()=>u.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[u]),d=h.useMemo(()=>u.filter(g=>!g.active),[u]),[w,f]=h.useState(i),m=g=>g.map((b,v)=>a.jsx(Xd,{product:b,currentProduct:t,activeProductName:n,dir:s,focusItem:r,setFocusItem:o},v));return l?a.jsxs(a.Fragment,{children:[m(c),d.length>0&&a.jsxs("li",{className:p(ne.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>f("#f5a300"),onMouseOut:()=>f(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:p(ne.topBorder,s==="rtl"&&ne.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:p(ne.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:p(ne.productListItem,ne.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",r==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:p(ne.topBorder,s==="rtl"&&ne.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:ne.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Za=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:s,openCategory:r,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:c,setFocusItem:d})=>{const w="#ffcf70",[f,m]=h.useState(window.innerWidth>768);return h.useEffect(()=>{const g=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.jsx("ul",{className:p(ne.productDropdownMenu,n&&ne.productDropdownMenuOpen,t==="rtl"&&ne.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:s.map((g,b)=>a.jsxs("li",{className:p(ne.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",r===g&&ne.open,u&&ne.open),onMouseEnter:()=>f&&o(g),onMouseLeave:()=>f&&o(null),"aria-label":g.name,dir:t,onKeyDown:v=>i(v,b),tabIndex:0,"data-product-category":!0,children:[a.jsx(Kd,{category:g,dir:t,openCategory:r}),a.jsx("ul",{className:p(ne.productList,t==="rtl"&&ne.rtlProductList),dir:t,children:a.jsx(Zd,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:c,setFocusItem:d,borderColorLocked:w})})]},g.name))})},Jd=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:s,activeProductName:r,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:p("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:s},children:a.jsxs("button",{ref:i,type:"button",className:p("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:[r,a.jsx("span",{className:p("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),Qd=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:s,setDropdownOpen:r})=>{const o=()=>{s(i=>!i),t&&r(!1)};return a.jsxs("button",{className:p("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"}`})]})},Ja=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:r,expandAll:o})=>{const i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),c=h.useRef(null),[d,w]=h.useState(!1),[f,m]=h.useState(null),[g,b]=h.useState(n.base),[v,y]=h.useState(""),[N,C]=h.useState(!1),S=qd(768);Fs([u,i],()=>{w(!1),m(null)}),Fs([l,c,u],()=>{C(!1),w(!1),m(null)}),h.useEffect(()=>{const k=E=>{E.key==="Escape"&&w(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[d]),h.useEffect(()=>b(n.base),[n.base]);const T=k=>{k.preventDefault(),k.stopPropagation(),w(E=>{const D=!E;return D||m(null),D})},A=(k,E)=>{$d({productCategories:e,openCategory:f,setOpenCategory:m})(k,E,v)};return a.jsx("div",{className:p("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:S?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(Qd,{dir:s,isProductButtonShow:N,smallScreenToggleButtonRef:c,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(Jd,{isProductButtonShow:N,isDropdownOpen:d,activeProductColor:n,activeProductBgColor:g,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:l,handleKeyDown:A,dir:s}),a.jsx("div",{className:p("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Za,{activeProductName:t,focusItem:v,setFocusItem:y,handleKeyDown:A,isDropdownOpen:d,openCategory:f,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:s})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:d?n.hover:g},onMouseOver:()=>b(n.hover),onMouseOut:()=>b(n.base),children:[a.jsx(Gd,{activeProductName:t,dir:s,homeLink:r,buttonRef:i,handleDropdownToggle:T,handleKeyDown:A,isDropdownOpen:d}),a.jsx(Za,{activeProductName:t,focusItem:v,setFocusItem:y,handleKeyDown:A,isDropdownOpen:d,openCategory:f,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:s})]})})},Qa=({children:e,dir:t,className:n})=>a.jsx("section",{className:p("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})}),Rd=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:s,...r})=>{const[o,i]=h.useState(n);return h.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(De,{"data-testid":"search-icon",icon:"wm-search",className:p("wu-absolute wu-top-1 wu-left-1.5","wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)}),a.jsx("input",{placeholder:t,onChange:u=>s(u.target.value),className:p("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","wu-h-8 wu-pl-8 wu-pr-4 wu-text-xs wu-text-gray-lead",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",...r})]})},Ra=Ht.Provider,eo=Ht.Root,to=Ht.Trigger,Bs=x.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(Ht.Content,{ref:s,sideOffset:t,className:p("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}));Bs.displayName=Ht.Content.displayName;const kn=h.forwardRef(({content:e,position:t,positionOffset:n,duration:s,children:r,className:o,showArrow:i=!1,open:u,onOpenChange:l,...c},d)=>a.jsx(Ra,{delayDuration:s||200,children:a.jsxs(eo,{open:u,onOpenChange:l,children:[a.jsx(to,{asChild:!0,children:a.jsx("span",{ref:d,children:r})}),a.jsx(Ts.Portal,{children:e&&a.jsxs(Bs,{...c,side:t||"top",sideOffset:n||0,className:p("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(Ts.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));kn.displayName="WuTooltip";const ew=({label:e,className:t})=>{const n=h.useRef(null),[s,r]=h.useState(!1);return h.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,c=e.length*l;r(c>i||u>i)}},[e]),a.jsx("p",{ref:n,className:p("wu-w-full wu-truncate",t),children:s?a.jsx(kn,{content:e,positionOffset:8,children:e}):e})},tw=e=>{var w;const{productName:t,categories:n=[],user:s,children:r,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:p("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:[Ad((w=s==null?void 0:s.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(Ja,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:c})}),a.jsx(Qa,{dir:l,children:r}),a.jsxs("section",{className:p("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(Ya,{dir:l}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(Ka,{user:s,onLogout:o,dir:l,DataCenter:d})]})]})})},ze=$t.Root,dt=$t.Trigger,Le=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},r)=>a.jsx($t.Portal,{children:a.jsx($t.Content,{ref:r,align:t,sideOffset:n,className:p("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),...s})}));Le.displayName=$t.Content.displayName;function no({className:e,classNames:t,dir:n="ltr",...s}){const r=La.getDefaultClassNames();return a.jsx(La.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:p("wu-p-3",e),classNames:{root:p(r.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:p("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:p(r.month_caption,"wu-mb-5"),months:p(r.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:p(r.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:p(r.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:p(r.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:p(r.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:p(r.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:p(r.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:p("rm",r.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:p(r.range_end,"wu-rounded-none"),range_start:p(r.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:p(r.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:p(r.button_next,Ls({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:p(r.button_previous,Ls({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:p(r.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:p(r.chevron,"!wu-text-red-500"),outside:p(r.outside,"wu-invisible"),disabled:p(r.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"})},...s})}no.displayName="Calendar";const qs=e=>a.jsx(no,{...e}),so=e=>{const{handleDateChange:t,disabled:n,onReset:s,showResetButton:r}=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:[r&&a.jsx(Te,{variant:"secondary",onClick:s,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(qt.PopoverClose,{asChild:!0,children:a.jsx(Te,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},$s=({formattedString:e,dir:t,placeholder:n="Select Date",className:s,variant:r="primary",color:o,CustomTrigger:i,...u})=>a.jsx(qt.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(Te,{...u,className:p("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",r==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),ro=(e,t,n,s)=>{const r=j.startOfDay(e).getTime();return!!(t||n&&r<j.startOfDay(n).getTime()||s&&r>j.startOfDay(s).getTime())},_n=e=>e?typeof e=="string"?new Date(e):e:new Date,Hs="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",nw=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],sw=e=>{const{message:t,className:n,...s}=e;return a.jsx("p",{...s,className:p("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},rw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:s,...r}=e,[o,i]=h.useState(!1);return h.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",{...r,className:p("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...r.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},aw=Fe.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"),Pn=x.forwardRef(({className:e,...t},n)=>a.jsx($a.Root,{ref:n,className:p(aw(),e),...t}));Pn.displayName=$a.Root.displayName;const Ee=e=>a.jsx(Pn,{...e,className:p("wu-text-gray-lead wu-leading-6",e.className)}),ow=({Label:e,Error:t,Hint:n,Input:s,labelPosition:r="top",dir:o="ltr",className:i,...u})=>{const c=p("wu-flex",r==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),d=p("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=p("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),f=p("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:[s,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:f,children:t})]})]})},iw=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:s,minDate:r=j.sub(new Date,{years:5}),maxDate:o=j.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:c,showResetButton:d=!1,placeholder:w="Select Date",CustomTrigger:f,...m})=>{const[g,b]=h.useState(),[v,y]=h.useState(""),N=h.useCallback(()=>{const S=_n(g);y(j.format(S,e)),n&&n(g)},[g,e,n]),C=h.useCallback(()=>{c?c():(b(void 0),y(""),n&&n(void 0))},[n,c]);return h.useEffect(()=>{const S=_n(t);b(S),y(j.format(S,e))},[t,e]),a.jsxs(Ee,{className:p("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($s,{formattedString:v,dir:i,placeholder:w,CustomTrigger:f,...m}),a.jsx(Le,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(qs,{dir:i,mode:"single",captionLayout:"dropdown",selected:g,onSelect:b,disabled:S=>ro(S,s,r,o),startMonth:r,endMonth:o,required:!0,autoFocus:!0,defaultMonth:g,className:p("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(so,{handleDateChange:N,disabled:s,onReset:C,showResetButton:d})})})]})]})},ao={};function Je(e,t){const n=x.useRef(ao);return n.current===ao&&(n.current=e(t)),n}const zs=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],uw=zs&&zs!==x.useLayoutEffect?zs:e=>e();function he(e){const t=Je(lw).current;return t.next=e,uw(t.effect),t.trampoline}function lw(){const e={next:void 0,callback:cw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function cw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function Ut(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}function Ae(){}const Ue=Object.freeze({});let oo=(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 dw={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Us={valid(e){return e===null?null:e?{[oo.valid]:""}:{[oo.invalid]:""}}},io=x.createContext({invalid:void 0,name:void 0,validityData:{state:dw,errors:[],error:"",value:"",initialValue:null},setValidityData:Ae,disabled:void 0,touched:!1,setTouched:Ae,dirty:!1,setDirty:Ae,filled:!1,setFilled:Ae,focused:!1,setFocused:Ae,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=Ue)=>e,getInputValidationProps:(e=Ue)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(io.displayName="FieldRootContext");function Vn(e=!0){const t=x.useContext(io);if(t.setValidityData===Ae&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Ut(28));return t}const uo=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ae,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(uo.displayName="FormContext");function lo(){return x.useContext(uo)}function js(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const jt={};function co(e,t,n,s,r){let o={...Gs(e,jt)};return t&&(o=On(o,t)),n&&(o=On(o,n)),s&&(o=On(o,s)),o}function ww(e){if(e.length===0)return jt;if(e.length===1)return Gs(e[0],jt);let t={...Gs(e[0],jt)};for(let n=1;n<e.length;n+=1)t=On(t,e[n]);return t}function On(e,t){return wo(t)?t(e):fw(e,t)}function fw(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=js(e.style,s);break}case"className":{e[n]=fo(e.className,s);break}default:pw(n,s)?e[n]=hw(e[n],s):e[n]=s}}return e}function pw(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&s===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wo(e){return typeof e=="function"}function Gs(e,t){return wo(e)?e(t):e??jt}function hw(e,t){return t?e?n=>{if(mw(n)){const r=n;Ks(r);const o=t(r);return r.baseUIHandlerPrevented||e==null||e(r),o}const s=t(n);return e==null||e(n),s}:t:e}function Ks(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fo(e,t){return t?e?t+" "+e:t:e}function mw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const wt={...x};let po=0;function gw(e,t="mui"){const[n,s]=x.useState(e),r=e||n;return x.useEffect(()=>{n==null&&(po+=1,s(`${t}-${po}`))},[n,t]),r}const ho=wt.useId;function bw(e,t){if(ho!==void 0){const n=ho();return e??(t?`${t}-${n}`:n)}return gw(e,t)}function mo(e){return bw(e,"base-ui")}const go=x.createContext({controlId:void 0,registerControlId:Ae,labelId:void 0,setLabelId:Ae,messageIds:[],setMessageIds:Ae,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(go.displayName="LabelableContext");function Ys(){return x.useContext(go)}function Fn(e,t,n,s){const r=Je(bo).current;return vw(r,e,t,n,s)&&yo(r,[e,t,n,s]),r.callback}function yw(e){const t=Je(bo).current;return xw(t,e)&&yo(t,e),t.callback}function bo(){return{callback:null,cleanup:null,refs:[]}}function vw(e,t,n,s,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==r}function xw(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function yo(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 s=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const o=t[r];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(s[r]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const o=t[r];if(o!=null)switch(typeof o){case"function":{const i=s[r];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Nw=parseInt(x.version,10);function Sw(e){return Nw>=e}function vo(e){if(!x.isValidElement(e))return null;const t=e,n=t.props;return(Sw(19)?n==null?void 0:n.ref:t.ref)??null}function Cw(e,t){const n={};for(const s in e){const r=e[s];if(t!=null&&t.hasOwnProperty(s)){const o=t[s](r);o!=null&&Object.assign(n,o);continue}r===!0?n[`data-${s.toLowerCase()}`]="":r&&(n[`data-${s.toLowerCase()}`]=r.toString())}return n}function Tw(e,t){return typeof e=="function"?e(t):e}function Ew(e,t){return typeof e=="function"?e(t):e}function Ke(e,t,n={}){const s=t.render,r=Iw(t,n);if(n.enabled===!1)return null;const o=n.state??Ue;return Dw(e,s,r,o)}function Iw(e,t={}){const{className:n,style:s,render:r}=e,{state:o=Ue,ref:i,props:u,stateAttributesMapping:l,enabled:c=!0}=t,d=c?Tw(n,o):void 0,w=c?Ew(s,o):void 0,f=c?Cw(o,l):Ue,m=c?js(f,Array.isArray(u)?ww(u):u)??Ue:Ue;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=yw([m.ref,vo(r),...i]):m.ref=Fn(m.ref,vo(r),i):Fn(null,null)),c?(d!==void 0&&(m.className=fo(m.className,d)),w!==void 0&&(m.style=js(m.style,w)),m):Ue}const Mw=Symbol.for("react.lazy");function Dw(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const r=co(n,t.props);r.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===Mw&&(o=x.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!x.isValidElement(o))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
5
- `));return x.cloneElement(o,r)}if(e&&typeof e=="string")return Aw(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Ut(8))}function Aw(e,t){return e==="button"?h.createElement("button",{type:"button",...t,key:t.key}):e==="img"?h.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const kw=[];function Wn(e){x.useEffect(e,kw)}const Gt=0;class Ln{constructor(){Se(this,"currentId",Gt);Se(this,"clear",()=>{this.currentId!==Gt&&(clearTimeout(this.currentId),this.currentId=Gt)});Se(this,"disposeEffect",()=>this.clear)}static create(){return new Ln}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Gt,n()},t)}isStarted(){return this.currentId!==Gt}}function xo(){const e=Je(Ln.create).current;return Wn(e.disposeEffect),e}function _w(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let Xs;process.env.NODE_ENV!=="production"&&(Xs=new Set);function No(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Xs.has(t)||(Xs.add(t),console.error(`Base UI: ${t}`))}}function So(){return typeof window<"u"}function Zs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pw(e){return So()?e instanceof Element||e instanceof Zs(e).Element:!1}function Vw(e){return So()?e instanceof HTMLElement||e instanceof Zs(e).HTMLElement:!1}const ee=typeof document<"u"?x.useLayoutEffect:()=>{};function Co(e){return(e==null?void 0:e.ownerDocument)||document}const Bn=typeof navigator<"u",Js=Lw(),Ow=qw(),Fw=Bw();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Ww=Js.platform==="MacIntel"&&Js.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Js.platform);Bn&&Ow.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Fw.includes("jsdom/");function Lw(){if(!Bn)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 Bw(){if(!Bn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function qw(){if(!Bn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function $w(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Hw(e){e.preventDefault(),e.stopPropagation()}const qn=null;let To=globalThis.requestAnimationFrame;class zw{constructor(){Se(this,"callbacks",[]);Se(this,"callbacksCount",0);Se(this,"nextId",1);Se(this,"startId",1);Se(this,"isScheduled",!1);Se(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)(r=n[o])==null||r.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const s=process.env.NODE_ENV!=="production"&&To!==requestAnimationFrame&&(To=requestAnimationFrame,!0);return(!this.isScheduled||s)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $n=new zw;class ie{constructor(){Se(this,"currentId",qn);Se(this,"cancel",()=>{this.currentId!==qn&&($n.cancel(this.currentId),this.currentId=qn)});Se(this,"disposeEffect",()=>this.cancel)}static create(){return new ie}static request(t){return $n.request(t)}static cancel(t){return $n.cancel(t)}request(t){this.cancel(),this.currentId=$n.request(()=>{this.currentId=qn,t()})}}function Eo(){const e=Je(ie.create).current;return Wn(e.disposeEffect),e}function Uw(e){return e==null?e:"current"in e?e.current:e}let Kt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const jw={[Kt.startingStyle]:""},Gw={[Kt.endingStyle]:""},Io={transitionStatus(e){return e==="starting"?jw:e==="ending"?Gw:null}};function Mo(e,t=!1,n=!0){const s=Eo();return he((r,o=null)=>{s.cancel();function i(){Ha.flushSync(r)}const u=Uw(e);if(u==null)return;const l=u;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let c=function(){const w=Kt.startingStyle;if(!l.hasAttribute(w)){s.request(d);return}const f=new MutationObserver(()=>{l.hasAttribute(w)||(f.disconnect(),d())});f.observe(l,{attributes:!0,attributeFilter:[w]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0})},d=function(){Promise.all(l.getAnimations().map(w=>w.finished)).then(()=>{o!=null&&o.aborted||i()}).catch(()=>{const w=l.getAnimations();if(n){if(o!=null&&o.aborted)return;i()}else w.length>0&&w.some(f=>f.pending||f.playState!=="finished")&&d()})};if(t){c();return}s.request(d)}})}function Kw(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,o=he(r),i=Mo(s,n,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return i(o,u.signal),()=>{u.abort()}},[t,n,o,i])}function Yw(e,t=!1,n=!1){const[s,r]=x.useState(e&&t?"idle":void 0),[o,i]=x.useState(e);return e&&!o&&(i(!0),r("starting")),!e&&o&&s!=="ending"&&!n&&r("ending"),!e&&!o&&s==="ending"&&r(void 0),ee(()=>{if(!e&&o&&s!=="ending"&&n){const u=ie.request(()=>{r("ending")});return()=>{ie.cancel(u)}}},[e,o,s,n]),ee(()=>{if(!e||t)return;const u=ie.request(()=>{r(void 0)});return()=>{ie.cancel(u)}},[t,e]),ee(()=>{if(!e||!t)return;e&&o&&s!=="idle"&&r("starting");const u=ie.request(()=>{r("idle")});return()=>{ie.cancel(u)}},[t,e,o,r,s]),x.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:s}),[o,s])}function Qs({controlled:e,default:t,name:n,state:s="value"}){const{current:r}=x.useRef(e!==void 0),[o,i]=x.useState(t),u=r?e:o;if(process.env.NODE_ENV!=="production"){x.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${s} state of ${n} to be ${r?"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(`
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(Xa,{item:s,dir:t})})},r))})})},Xa=({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:m("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),jd=e=>{const[t,n]=h.useState(()=>window.innerWidth<=e);return h.useEffect(()=>{const s=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function Gd({productCategories:e,openCategory:t,setOpenCategory:n}){const s=(u,l)=>{const c=l[u];if(c){c.focus();const d=e[u]||null;n(d)}},r=(u,l,c,d)=>{u.preventDefault();const w=c==="down"?l+1:l-1;s(w,d)},o=(u,l,c,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(u.preventDefault(),s(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:f}=l;switch(f){case"ArrowDown":r(l,c,"down",w);break;case"ArrowUp":r(l,c,"up",w);break;case"Tab":o(l,c,w,d);break;case"Enter":case" ":i(l,c);break}}}const Kd=e=>{const{size:t="lg",className:n,children:s,...r}=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,{...r,className:m(o[t],n),children:s})},Yd=e=>{const{size:t="xl",className:n,children:s,...r}=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,{...r,className:m(i[t],n),children:s})},Xd=e=>{const{size:t="lg",className:n,children:s,...r}=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,{...r,className:m(o[t],n),children:s})},Zd=e=>{const{size:t="lg",className:n,children:s,...r}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...r,className:m(o[t],n),children:s})},Pe=e=>{const{icon:t,className:n,...s}=e;return a.jsx("span",{...s,className:m(t,n),role:"presentation","aria-label":t})},Jd=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:s,activeProductName:r,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:m("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=>{s&&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(Pe,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),r,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ae={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"},Qd=({category:e,dir:t="ltr",openCategory:n})=>{const s=e.active?"#c5cce0":"#f0c36a",r=(n==null?void 0:n.name)===e.name,o=m("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",r&&"wu-hidden","wu-relative wu-top-[5px]"),i=m("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",r&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:m("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:ae.productCategoryBorderTop,style:{backgroundColor:s}}),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})]})},Rd={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"},ew=({product:e,currentProduct:t,activeProductName:n,dir:s,focusItem:r,setFocusItem:o})=>{const[i,u]=h.useState(e.name===t),l=e.name===n,c=e.name===t,d=!e.active,w="#1b3380",f="#c5cce0",p="#ffcf70",g=m("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"),b=m("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"),v=i||r===e.name||l?w:f;return a.jsxs("li",{className:m(ae.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&ae.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",r===e.name&&ae.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":d,dir:s,onKeyDown:N=>{if(N.key==="Enter"){N.preventDefault();const y=N.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:m(ae.topBorder,s==="rtl"&&ae.topBorderRtl),style:{backgroundColor:d?p:v}}),a.jsxs("a",{className:m(ae.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:m(b,Rd[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:m(g),children:e.name})]})]},e.name)},tw=({category:e,currentProduct:t,activeProductName:n,dir:s="ltr",focusItem:r,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,c=h.useMemo(()=>u.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[u]),d=h.useMemo(()=>u.filter(g=>!g.active),[u]),[w,f]=h.useState(i),p=g=>g.map((b,v)=>a.jsx(ew,{product:b,currentProduct:t,activeProductName:n,dir:s,focusItem:r,setFocusItem:o},v));return l?a.jsxs(a.Fragment,{children:[p(c),d.length>0&&a.jsxs("li",{className:m(ae.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>f("#f5a300"),onMouseOut:()=>f(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:m(ae.topBorder,s==="rtl"&&ae.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:m(ae.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"]})]})]}),p(d)]}):a.jsxs("li",{className:m(ae.productListItem,ae.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",r==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:m(ae.topBorder,s==="rtl"&&ae.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:ae.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Za=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:s,openCategory:r,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:c,setFocusItem:d})=>{const w="#ffcf70",[f,p]=h.useState(window.innerWidth>768);return h.useEffect(()=>{const g=()=>{p(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.jsx("ul",{className:m(ae.productDropdownMenu,n&&ae.productDropdownMenuOpen,t==="rtl"&&ae.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:s.map((g,b)=>a.jsxs("li",{className:m(ae.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",r===g&&ae.open,u&&ae.open),onMouseEnter:()=>f&&o(g),onMouseLeave:()=>f&&o(null),"aria-label":g.name,dir:t,onKeyDown:v=>i(v,b),tabIndex:0,"data-product-category":!0,children:[a.jsx(Qd,{category:g,dir:t,openCategory:r}),a.jsx("ul",{className:m(ae.productList,t==="rtl"&&ae.rtlProductList),dir:t,children:a.jsx(tw,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:c,setFocusItem:d,borderColorLocked:w})})]},g.name))})},nw=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:s,activeProductName:r,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:m("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:s},children:a.jsxs("button",{ref:i,type:"button",className:m("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:[r,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),sw=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:s,setDropdownOpen:r})=>{const o=()=>{s(i=>!i),t&&r(!1)};return a.jsxs("button",{className:m("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"}`})]})},Ja=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:r,expandAll:o})=>{const i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),c=h.useRef(null),[d,w]=h.useState(!1),[f,p]=h.useState(null),[g,b]=h.useState(n.base),[v,N]=h.useState(""),[y,C]=h.useState(!1),S=jd(768);Fs([u,i],()=>{w(!1),p(null)}),Fs([l,c,u],()=>{C(!1),w(!1),p(null)}),h.useEffect(()=>{const D=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[d]),h.useEffect(()=>b(n.base),[n.base]);const T=D=>{D.preventDefault(),D.stopPropagation(),w(k=>{const M=!k;return M||p(null),M})},A=(D,k)=>{Gd({productCategories:e,openCategory:f,setOpenCategory:p})(D,k,v)};return a.jsx("div",{className:m("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:S?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(sw,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(nw,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:n,activeProductBgColor:g,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:l,handleKeyDown:A,dir:s}),a.jsx("div",{className:m("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Za,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:A,isDropdownOpen:d,openCategory:f,productCategories:e,setOpenCategory:p,dropdownRef:u,expandAll:o,dir:s})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:d?n.hover:g},onMouseOver:()=>b(n.hover),onMouseOut:()=>b(n.base),children:[a.jsx(Jd,{activeProductName:t,dir:s,homeLink:r,buttonRef:i,handleDropdownToggle:T,handleKeyDown:A,isDropdownOpen:d}),a.jsx(Za,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:A,isDropdownOpen:d,openCategory:f,productCategories:e,setOpenCategory:p,dropdownRef:u,expandAll:o,dir:s})]})})},Qa=({children:e,dir:t,className:n})=>a.jsx("section",{className:m("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})}),rw=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:s,...r})=>{const[o,i]=h.useState(n);return h.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{"data-testid":"search-icon",icon:"wm-search",className:m("wu-absolute wu-top-1 wu-left-1.5","wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)}),a.jsx("input",{placeholder:t,onChange:u=>s(u.target.value),className:m("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","wu-h-8 wu-pl-8 wu-pr-4 wu-text-xs wu-text-gray-lead",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",...r})]})},Ra=zt.Provider,eo=zt.Root,to=zt.Trigger,Bs=x.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(zt.Content,{ref:s,sideOffset:t,className:m("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}));Bs.displayName=zt.Content.displayName;const An=h.forwardRef(({content:e,position:t,positionOffset:n,duration:s,children:r,className:o,showArrow:i=!1,open:u,onOpenChange:l,...c},d)=>a.jsx(Ra,{delayDuration:s||200,children:a.jsxs(eo,{open:u,onOpenChange:l,children:[a.jsx(to,{asChild:!0,children:a.jsx("span",{ref:d,children:r})}),a.jsx(Ts.Portal,{children:e&&a.jsxs(Bs,{...c,side:t||"top",sideOffset:n||0,className:m("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(Ts.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));An.displayName="WuTooltip";const aw=({label:e,className:t})=>{const n=h.useRef(null),[s,r]=h.useState(!1);return h.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,c=e.length*l;r(c>i||u>i)}},[e]),a.jsx("p",{ref:n,className:m("wu-w-full wu-truncate",t),children:s?a.jsx(An,{content:e,positionOffset:8,children:e}):e})},ow=e=>{var w;const{productName:t,categories:n=[],user:s,children:r,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:m("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:[Od((w=s==null?void 0:s.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(Ja,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:c})}),a.jsx(Qa,{dir:l,children:r}),a.jsxs("section",{className:m("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(Ya,{dir:l}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(Ka,{user:s,onLogout:o,dir:l,DataCenter:d})]})]})})},Ue=Ht.Root,wt=Ht.Trigger,Be=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},r)=>a.jsx(Ht.Portal,{children:a.jsx(Ht.Content,{ref:r,align:t,sideOffset:n,className:m("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),...s})}));Be.displayName=Ht.Content.displayName;function no({className:e,classNames:t,dir:n="ltr",...s}){const r=La.getDefaultClassNames();return a.jsx(La.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:m("wu-p-3",e),classNames:{root:m(r.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:m("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:m(r.month_caption,"wu-mb-5"),months:m(r.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:m(r.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:m(r.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:m(r.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:m(r.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:m(r.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:m(r.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:m("rm",r.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:m(r.range_end,"wu-rounded-none"),range_start:m(r.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:m(r.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:m(r.button_next,Ls({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:m(r.button_previous,Ls({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:m(r.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:m(r.chevron,"!wu-text-red-500"),outside:m(r.outside,"wu-invisible"),disabled:m(r.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"})},...s})}no.displayName="Calendar";const qs=e=>a.jsx(no,{...e}),so=e=>{const{handleDateChange:t,disabled:n,onReset:s,showResetButton:r}=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:[r&&a.jsx(De,{variant:"secondary",onClick:s,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($t.PopoverClose,{asChild:!0,children:a.jsx(De,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},$s=({formattedString:e,dir:t,placeholder:n="Select Date",className:s,variant:r="primary",color:o,CustomTrigger:i,...u})=>a.jsx($t.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(De,{...u,className:m("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",r==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),ro=(e,t,n,s)=>{const r=z.startOfDay(e).getTime();return!!(t||n&&r<z.startOfDay(n).getTime()||s&&r>z.startOfDay(s).getTime())},kn=e=>e?typeof e=="string"?new Date(e):e:new Date,Hs="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",iw=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],uw=e=>{const{message:t,className:n,...s}=e;return a.jsx("p",{...s,className:m("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},lw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:s,...r}=e,[o,i]=h.useState(!1);return h.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",{...r,className:m("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...r.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},cw=Le.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"),_n=x.forwardRef(({className:e,...t},n)=>a.jsx($a.Root,{ref:n,className:m(cw(),e),...t}));_n.displayName=$a.Root.displayName;const Ae=e=>a.jsx(_n,{...e,className:m("wu-text-gray-lead wu-leading-6",e.className)}),dw=({Label:e,Error:t,Hint:n,Input:s,labelPosition:r="top",dir:o="ltr",className:i,...u})=>{const c=m("wu-flex",r==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),d=m("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),f=m("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:[s,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:f,children:t})]})]})},ww=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:s,minDate:r=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:c,showResetButton:d=!1,placeholder:w="Select Date",CustomTrigger:f,...p})=>{const[g,b]=h.useState(),[v,N]=h.useState(""),y=h.useCallback(()=>{const S=kn(g);N(z.format(S,e)),n&&n(g)},[g,e,n]),C=h.useCallback(()=>{c?c():(b(void 0),N(""),n&&n(void 0))},[n,c]);return h.useEffect(()=>{const S=kn(t);b(S),N(z.format(S,e))},[t,e]),a.jsxs(Ae,{className:m("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(Ue,{children:[a.jsx($s,{formattedString:v,dir:i,placeholder:w,CustomTrigger:f,...p}),a.jsx(Be,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(qs,{dir:i,mode:"single",captionLayout:"dropdown",selected:g,onSelect:b,disabled:S=>ro(S,s,r,o),startMonth:r,endMonth:o,required:!0,autoFocus:!0,defaultMonth:g,className:m("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(so,{handleDateChange:y,disabled:s,onReset:C,showResetButton:d})})})]})]})},ao={};function Je(e,t){const n=x.useRef(ao);return n.current===ao&&(n.current=e(t)),n}const zs=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],fw=zs&&zs!==x.useLayoutEffect?zs:e=>e();function ge(e){const t=Je(pw).current;return t.next=e,fw(t.effect),t.trampoline}function pw(){const e={next:void 0,callback:hw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function hw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function jt(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}function Ve(){}const je=Object.freeze({});let oo=(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 mw={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Us={valid(e){return e===null?null:e?{[oo.valid]:""}:{[oo.invalid]:""}}},io=x.createContext({invalid:void 0,name:void 0,validityData:{state:mw,errors:[],error:"",value:"",initialValue:null},setValidityData:Ve,disabled:void 0,touched:!1,setTouched:Ve,dirty:!1,setDirty:Ve,filled:!1,setFilled:Ve,focused:!1,setFocused:Ve,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=je)=>e,getInputValidationProps:(e=je)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(io.displayName="FieldRootContext");function Pn(e=!0){const t=x.useContext(io);if(t.setValidityData===Ve&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":jt(28));return t}const uo=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ve,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(uo.displayName="FormContext");function lo(){return x.useContext(uo)}function js(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Gt={};function co(e,t,n,s,r){let o={...Gs(e,Gt)};return t&&(o=Vn(o,t)),n&&(o=Vn(o,n)),s&&(o=Vn(o,s)),o}function gw(e){if(e.length===0)return Gt;if(e.length===1)return Gs(e[0],Gt);let t={...Gs(e[0],Gt)};for(let n=1;n<e.length;n+=1)t=Vn(t,e[n]);return t}function Vn(e,t){return wo(t)?t(e):bw(e,t)}function bw(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=js(e.style,s);break}case"className":{e[n]=fo(e.className,s);break}default:yw(n,s)?e[n]=vw(e[n],s):e[n]=s}}return e}function yw(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&s===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wo(e){return typeof e=="function"}function Gs(e,t){return wo(e)?e(t):e??Gt}function vw(e,t){return t?e?n=>{if(xw(n)){const r=n;Ks(r);const o=t(r);return r.baseUIHandlerPrevented||e==null||e(r),o}const s=t(n);return e==null||e(n),s}:t:e}function Ks(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fo(e,t){return t?e?t+" "+e:t:e}function xw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const ft={...x};let po=0;function Nw(e,t="mui"){const[n,s]=x.useState(e),r=e||n;return x.useEffect(()=>{n==null&&(po+=1,s(`${t}-${po}`))},[n,t]),r}const ho=ft.useId;function Sw(e,t){if(ho!==void 0){const n=ho();return e??(t?`${t}-${n}`:n)}return Nw(e,t)}function mo(e){return Sw(e,"base-ui")}const go=x.createContext({controlId:void 0,registerControlId:Ve,labelId:void 0,setLabelId:Ve,messageIds:[],setMessageIds:Ve,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(go.displayName="LabelableContext");function Ys(){return x.useContext(go)}function On(e,t,n,s){const r=Je(bo).current;return Tw(r,e,t,n,s)&&yo(r,[e,t,n,s]),r.callback}function Cw(e){const t=Je(bo).current;return Ew(t,e)&&yo(t,e),t.callback}function bo(){return{callback:null,cleanup:null,refs:[]}}function Tw(e,t,n,s,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==r}function Ew(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function yo(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 s=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const o=t[r];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(s[r]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const o=t[r];if(o!=null)switch(typeof o){case"function":{const i=s[r];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Mw=parseInt(x.version,10);function Iw(e){return Mw>=e}function vo(e){if(!x.isValidElement(e))return null;const t=e,n=t.props;return(Iw(19)?n==null?void 0:n.ref:t.ref)??null}function Dw(e,t){const n={};for(const s in e){const r=e[s];if(t!=null&&t.hasOwnProperty(s)){const o=t[s](r);o!=null&&Object.assign(n,o);continue}r===!0?n[`data-${s.toLowerCase()}`]="":r&&(n[`data-${s.toLowerCase()}`]=r.toString())}return n}function Aw(e,t){return typeof e=="function"?e(t):e}function kw(e,t){return typeof e=="function"?e(t):e}function Ke(e,t,n={}){const s=t.render,r=_w(t,n);if(n.enabled===!1)return null;const o=n.state??je;return Vw(e,s,r,o)}function _w(e,t={}){const{className:n,style:s,render:r}=e,{state:o=je,ref:i,props:u,stateAttributesMapping:l,enabled:c=!0}=t,d=c?Aw(n,o):void 0,w=c?kw(s,o):void 0,f=c?Dw(o,l):je,p=c?js(f,Array.isArray(u)?gw(u):u)??je:je;return typeof document<"u"&&(c?Array.isArray(i)?p.ref=Cw([p.ref,vo(r),...i]):p.ref=On(p.ref,vo(r),i):On(null,null)),c?(d!==void 0&&(p.className=fo(p.className,d)),w!==void 0&&(p.style=js(p.style,w)),p):je}const Pw=Symbol.for("react.lazy");function Vw(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const r=co(n,t.props);r.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===Pw&&(o=x.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!x.isValidElement(o))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
5
+ `));return x.cloneElement(o,r)}if(e&&typeof e=="string")return Ow(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":jt(8))}function Ow(e,t){return e==="button"?h.createElement("button",{type:"button",...t,key:t.key}):e==="img"?h.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const Fw=[];function Fn(e){x.useEffect(e,Fw)}const Kt=0;class Wn{constructor(){Ee(this,"currentId",Kt);Ee(this,"clear",()=>{this.currentId!==Kt&&(clearTimeout(this.currentId),this.currentId=Kt)});Ee(this,"disposeEffect",()=>this.clear)}static create(){return new Wn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Kt,n()},t)}isStarted(){return this.currentId!==Kt}}function xo(){const e=Je(Wn.create).current;return Fn(e.disposeEffect),e}function Ww(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let Xs;process.env.NODE_ENV!=="production"&&(Xs=new Set);function No(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Xs.has(t)||(Xs.add(t),console.error(`Base UI: ${t}`))}}function So(){return typeof window<"u"}function Zs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lw(e){return So()?e instanceof Element||e instanceof Zs(e).Element:!1}function Bw(e){return So()?e instanceof HTMLElement||e instanceof Zs(e).HTMLElement:!1}const se=typeof document<"u"?x.useLayoutEffect:()=>{};function Co(e){return(e==null?void 0:e.ownerDocument)||document}const Ln=typeof navigator<"u",Js=zw(),qw=jw(),$w=Uw();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Hw=Js.platform==="MacIntel"&&Js.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Js.platform);Ln&&qw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,$w.includes("jsdom/");function zw(){if(!Ln)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 Uw(){if(!Ln)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function jw(){if(!Ln)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Gw(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Kw(e){e.preventDefault(),e.stopPropagation()}const Bn=null;let To=globalThis.requestAnimationFrame;class Yw{constructor(){Ee(this,"callbacks",[]);Ee(this,"callbacksCount",0);Ee(this,"nextId",1);Ee(this,"startId",1);Ee(this,"isScheduled",!1);Ee(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)(r=n[o])==null||r.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const s=process.env.NODE_ENV!=="production"&&To!==requestAnimationFrame&&(To=requestAnimationFrame,!0);return(!this.isScheduled||s)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const qn=new Yw;class le{constructor(){Ee(this,"currentId",Bn);Ee(this,"cancel",()=>{this.currentId!==Bn&&(qn.cancel(this.currentId),this.currentId=Bn)});Ee(this,"disposeEffect",()=>this.cancel)}static create(){return new le}static request(t){return qn.request(t)}static cancel(t){return qn.cancel(t)}request(t){this.cancel(),this.currentId=qn.request(()=>{this.currentId=Bn,t()})}}function Eo(){const e=Je(le.create).current;return Fn(e.disposeEffect),e}function Xw(e){return e==null?e:"current"in e?e.current:e}let Yt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Zw={[Yt.startingStyle]:""},Jw={[Yt.endingStyle]:""},Mo={transitionStatus(e){return e==="starting"?Zw:e==="ending"?Jw:null}};function Io(e,t=!1,n=!0){const s=Eo();return ge((r,o=null)=>{s.cancel();function i(){Ha.flushSync(r)}const u=Xw(e);if(u==null)return;const l=u;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let c=function(){const w=Yt.startingStyle;if(!l.hasAttribute(w)){s.request(d);return}const f=new MutationObserver(()=>{l.hasAttribute(w)||(f.disconnect(),d())});f.observe(l,{attributes:!0,attributeFilter:[w]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0})},d=function(){Promise.all(l.getAnimations().map(w=>w.finished)).then(()=>{o!=null&&o.aborted||i()}).catch(()=>{const w=l.getAnimations();if(n){if(o!=null&&o.aborted)return;i()}else w.length>0&&w.some(f=>f.pending||f.playState!=="finished")&&d()})};if(t){c();return}s.request(d)}})}function Qw(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,o=ge(r),i=Io(s,n,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return i(o,u.signal),()=>{u.abort()}},[t,n,o,i])}function Rw(e,t=!1,n=!1){const[s,r]=x.useState(e&&t?"idle":void 0),[o,i]=x.useState(e);return e&&!o&&(i(!0),r("starting")),!e&&o&&s!=="ending"&&!n&&r("ending"),!e&&!o&&s==="ending"&&r(void 0),se(()=>{if(!e&&o&&s!=="ending"&&n){const u=le.request(()=>{r("ending")});return()=>{le.cancel(u)}}},[e,o,s,n]),se(()=>{if(!e||t)return;const u=le.request(()=>{r(void 0)});return()=>{le.cancel(u)}},[t,e]),se(()=>{if(!e||!t)return;e&&o&&s!=="idle"&&r("starting");const u=le.request(()=>{r("idle")});return()=>{le.cancel(u)}},[t,e,o,r,s]),x.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:s}),[o,s])}function Qs({controlled:e,default:t,name:n,state:s="value"}){const{current:r}=x.useRef(e!==void 0),[o,i]=x.useState(t),u=r?e:o;if(process.env.NODE_ENV!=="production"){x.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${s} state of ${n} to be ${r?"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(`
6
6
  `))},[s,n,e]);const{current:c}=x.useRef(t);x.useEffect(()=>{!r&&JSON.stringify(c)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${s} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
7
- `))},[JSON.stringify(t)])}const l=x.useCallback(c=>{r||i(c)},[]);return[u,l]}function Do(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:r,registerControlId:o}=Ys(),i=mo(t),u=n?r:void 0,l=Je(()=>Symbol("labelable-control")),c=x.useRef(!1),d=x.useRef(t!=null),w=he(()=>{!c.current||o===Ae||(c.current=!1,o(l.current,void 0))});return ee(()=>{if(o===Ae)return;let f;if(n){const m=s==null?void 0:s.current;Pw(m)&&m.closest("label")!=null?f=t??null:f=u??i}else if(t!=null)d.current=!0,f=t;else if(d.current)f=i;else{w();return}if(f===void 0){w();return}c.current=!0,o(l.current,f)},[t,s,u,o,n,i,l,w]),x.useEffect(()=>w,[w]),r??i}function Ao(e){const{enabled:t=!0,value:n,id:s,name:r,controlRef:o,commit:i}=e,{formRef:u}=lo(),{invalid:l,markedDirtyRef:c,validityData:d,setValidityData:w}=Vn(),f=he(e.getValue);ee(()=>{if(!t)return;let m=n;m===void 0&&(m=f()),d.initialValue===null&&m!==null&&w(g=>({...g,initialValue:m}))},[t,w,n,d.initialValue,f]),ee(()=>{!t||!s||u.current.fields.set(s,{getValue:f,name:r,controlRef:o,validityData:_w(d,l),validate(m=!0){let g=n;g===void 0&&(g=f()),c.current=!0,m?Ha.flushSync(()=>i(g)):i(g)}})},[i,o,t,u,f,s,l,c,r,d,n]),ee(()=>{const m=u.current.fields;return()=>{s&&m.delete(s)}},[u,s])}const Yt="none",Xw="trigger-press",Rs="input-change",Xt="input-clear",Hn="input-blur",er="input-paste",Zt="keyboard";function Ie(e,t,n,s){let r=!1,o=!1;const i=s??Ue;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:n,...i}}function Jt(e,t,n){const s=Ue;return{reason:e,event:t??new Event("base-ui"),...s}}const ko=x.forwardRef(function(t,n){const{render:s,className:r,id:o,name:i,value:u,disabled:l=!1,onValueChange:c,defaultValue:d,autoFocus:w=!1,...f}=t,{state:m,name:g,disabled:b,setTouched:v,setDirty:y,validityData:N,setFocused:C,setFilled:S,validationMode:T,validation:A}=Vn(),k=b||l,E=g??i,D={...m,disabled:k},{labelId:P}=Ys(),_=Do({id:o});ee(()=>{var H;const V=u!=null;(H=A.inputRef.current)!=null&&H.value||V&&u!==""?S(!0):V&&u===""&&S(!1)},[A.inputRef,S,u]);const M=x.useRef(null);ee(()=>{w&&M.current===$w(Co(M.current))&&C(!0)},[w,C]);const[F]=Qs({controlled:u,default:d,name:"FieldControl",state:"value"}),B=u!==void 0,O=B?F:void 0;return Ao({id:_,name:E,commit:A.commit,value:O,getValue:()=>{var V;return(V=A.inputRef.current)==null?void 0:V.value},controlRef:A.inputRef}),Ke("input",t,{ref:[n,M],state:D,props:[{id:_,disabled:k,name:E,ref:A.inputRef,"aria-labelledby":P,autoFocus:w,...B?{value:O}:{defaultValue:d},onChange(V){const H=V.currentTarget.value;c==null||c(H,Ie(Yt,V.nativeEvent)),y(H!==N.initialValue),S(H!=="")},onFocus(){C(!0)},onBlur(V){v(!0),C(!1),T==="onBlur"&&A.commit(V.currentTarget.value)},onKeyDown(V){V.currentTarget.tagName==="INPUT"&&V.key==="Enter"&&(v(!0),A.commit(V.currentTarget.value))}},A.getInputValidationProps(),f],stateAttributesMapping:Us})});process.env.NODE_ENV!=="production"&&(ko.displayName="FieldControl");const _o=x.forwardRef(function(t,n){return a.jsx(ko,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(_o.displayName="Input");const Qt={wuInputGroup:"_wuInputGroup_wkb8f_1",wuInputIcon:"_wuInputIcon_wkb8f_20",wuInput:"_wuInput_wkb8f_1",passwordToggle:"_passwordToggle_wkb8f_89"},Po=h.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:s})=>{const r=h.useCallback(i=>{if(n||s){i.preventDefault(),i.stopPropagation();return}t()},[n,s,t]),o=n||s;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:Qt.passwordToggle,onClick:r,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(De,{icon:e?"wm-visibility":"wm-visibility-off"})})});Po.displayName="PasswordToggle";const Qe=h.memo(h.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:s,iconPosition:r="left",variant:o="flat",type:i,readonly:u,invalid:l,id:c,...d},w)=>{const f=h.useId(),m=c||f;if(i==="submit")return a.jsx(Te,{className:e,id:m,"aria-label":d["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:d.disabled,children:t||"Submit"});const[g,b]=h.useState(!1),v=h.useCallback(()=>{b(T=>!T)},[]),{finalIcon:y,finalIconPosition:N}=h.useMemo(()=>i==="password"?{finalIcon:a.jsx(Po,{showPassword:g,onToggle:v,readOnly:u,disabled:d.disabled}),finalIconPosition:"right"}:{finalIcon:s,finalIconPosition:r},[i,s,r,g,v]),C=h.useMemo(()=>i==="password"&&g?"text":i,[i,g]),S=h.useMemo(()=>p(Qt.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:Qt.wuInputGroup,"data-label-position":n,"data-icon-position":y&&N,children:[y&&a.jsx("span",{className:Qt.wuInputIcon,children:y}),a.jsx(_o,{ref:w,className:S,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:m,...d}),t&&a.jsx(Ee,{className:Qt.wuInputLabel,htmlFor:m,children:t})]})}));Qe.displayName="WuInput";const Vo="yyyy-MM-dd",Zw=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],Jw=({current:e,onSelect:t,presetRanges:n=nw})=>{const[s,r]=h.useState(),[o,i]=h.useState(!1),[u,l]=h.useState(""),[c,d]=h.useState(""),[w,f]=h.useState(!1),m=h.useMemo(()=>n.map(N=>N.value),[n]),g=p("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"),b=h.useCallback(N=>{if(N===void 0){r(void 0),i(!0);return}const C=Number(N)-1;r(C),i(!1),t({from:j.sub(new Date,{days:C}),to:new Date})},[t]),v=h.useCallback((N,C)=>{if(!N||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Hs).test(N))return!1;const T=new Date(C==="start"?N:e.from),A=new Date(C==="end"?N:e.to);return j.isBefore(A,T)?(f(!0),!1):(f(!1),!(j.isSameDay(T,e.from)&&j.isSameDay(A,e.to)))},[e]),y=h.useCallback((N,C)=>{if((C==="start"?l:d)(N),v(N,C)){const T={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(T.from=new Date(N)),C==="end"&&(T.to=new Date(N)),t(T)}},[e,t,v]);return h.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&j.isValid(e.to)&&j.isValid(e.from)){l(j.format(e.from,Vo)),d(j.format(e.to,Vo));const N=j.differenceInCalendarDays(e.to,e.from);j.isToday(e.to)&&m.includes(N+1)?(r(N),i(!1)):(r(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:Zw.map(({label:N,value:C})=>a.jsx(Tt,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:N},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:N,value:C})=>a.jsx("li",{children:a.jsx("button",{className:p(g,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:N})},C)),a.jsx("li",{children:a.jsx("button",{className:p(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),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(Qe,{placeholder:"Start Date",pattern:Hs,value:u,onChange:N=>y(N.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Qe,{placeholder:"End Date",pattern:Hs,value:c,onChange:N=>y(N.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"})]})]})},Qw=({Trigger:e,children:t,className:n,dir:s,open:r,onOpenChange:o,modal:i,...u})=>a.jsxs(ze,{open:r,onOpenChange:o,modal:i,children:[a.jsx(dt,{asChild:!0,dir:s,children:e}),a.jsx(Le,{className:p("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:s,...u,children:t})]}),tr=e=>a.jsx(qt.PopoverClose,{asChild:!0,children:a.jsx(Te,{...e})}),Et={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},Rw=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],xe=e=>{if(!e)return"";try{const t=new Date(e);if(!j.isValid(t))return"";const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${r}`}catch{return""}},Oo=e=>{if(!e)return null;try{const t=j.parseISO(e);return j.isValid(t)?j.startOfDay(t):null}catch{return null}},ef=(e,t,n)=>!(t&&e<j.startOfDay(t)||n&&e>j.startOfDay(n)),Fo=e=>j.sub(new Date,{days:e}),Wo=e=>e?j.sub(new Date,{days:1}):new Date;function tf({ranges:e=Rw,excludeToday:t=!0,current:n,onSelect:s,onReset:r,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...c}){const[d,w]=h.useState(xe(n==null?void 0:n.from)||xe(l)),[f,m]=h.useState(xe(n==null?void 0:n.to)||xe(u)),[g,b]=h.useState(!1),[v,y]=h.useState(""),[N,C]=h.useState("");h.useEffect(()=>{w(xe(n==null?void 0:n.from)||xe(l)),m(xe(n==null?void 0:n.to)||xe(u)),y(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const S=h.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const D=j.differenceInCalendarDays(n.to,n.from)+1;return e.find(P=>P.value===D)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),T=h.useCallback(D=>{const P=Fo(D),_=Wo(t);w(xe(P)),m(xe(_)),y(""),C(""),b(!1),s==null||s({from:P,to:_})},[t,s]),A=h.useCallback((D,P)=>{const _=Oo(D);if(P==="start"?(w(D),y("")):(m(D),C("")),!_){if(D){const B="Please enter a valid date";P==="start"?y(B):C(B)}return}if(!ef(_,l,u)){const B=l&&_<j.startOfDay(l)?`Date must be on or after ${j.format(l,"MMM d, yyyy")}`:`Date must be on or before ${j.format(u,"MMM d, yyyy")}`;P==="start"?y(B):C(B);return}const F=Oo(P==="start"?f:d);P==="start"&&F?_<=F?s==null||s({from:_,to:F}):y("Start date must be before or equal to end date"):P==="end"&&F&&(_>=F?s==null||s({from:F,to:_}):C("End date must be after or equal to start date"))},[d,f,s,l,u]),k=h.useMemo(()=>e.map(D=>{const P=Fo(D.value),_=Wo(t);return{...D,displayStartDate:j.format(P,"MMM d, yyyy"),displayEndDate:j.format(_,"MMM d, yyyy")}}),[e,t]),E=g||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!S;return a.jsxs("div",{className:Et.wuDateRangeNativeSidebar,...c,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>b(!0),"data-selected":E,"aria-pressed":E,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:Et.customInputs,"data-expanded":E,children:[a.jsxs("div",{className:Et.inputsRow,children:[a.jsx(Qe,{type:"date",value:d,onChange:D=>A(D.target.value,"start"),Label:"Start",min:xe(l),max:xe(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Qe,{type:"date",value:f,onChange:D=>A(D.target.value,"end"),Label:"End",min:d||xe(l),max:xe(u),"aria-describedby":N?"end-date-error":void 0})]}),(v||N)&&a.jsxs("div",{className:Et.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:Et.errorText,children:v}),N&&a.jsx("p",{id:"end-date-error",className:Et.errorText,children:N})]})]}),k.map(D=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>T(D.value),"data-selected":!E&&(S==null?void 0:S.value)===D.value,"aria-pressed":!E&&(S==null?void 0:S.value)===D.value,"aria-label":`Select ${D.label}`,children:[D.label," ",a.jsxs("small",{children:["(",D.displayStartDate," - ",D.displayEndDate,")"]})]})},D.value))]}),a.jsxs("footer",{children:[i&&a.jsx(tr,{variant:"secondary",Icon:a.jsx(De,{icon:"wm-refresh"}),onClick:r,children:"Reset"}),a.jsx(tr,{onClick:o,disabled:!!(v||N),children:"Apply"})]})]})}const nf=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:s,minDate:r=j.sub(new Date,{years:5}),maxDate:o=j.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:c,Label:d,labelPosition:w="top",onReset:f,showResetButton:m=!0,placeholder:g="Select Date Range",CustomTrigger:b,native:v,...y})=>{const[N,C]=h.useState(t),[S,T]=h.useState(t),[A,k]=h.useState(""),E=h.useCallback(()=>{if(S){const _=S.from,M=S.to;C({from:_,to:M}),k(`${j.format(_,e)} - ${j.format(M,e)}`),n&&n({from:_,to:M})}},[S,e,n]),D=h.useCallback(()=>{T(N)},[N]),P=h.useCallback(()=>{f?f():(C(void 0),T(void 0),k(""),n&&n(void 0))},[f,n]);return h.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const _=_n(t.from),M=_n(t.to);C(t),T(t),k(`${j.format(_,e)} - ${j.format(M,e)}`)}else C(void 0),T({to:new Date,from:new Date})},[t,e]),a.jsxs(Ee,{className:p("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:_=>!_&&D(),children:[a.jsx($s,{formattedString:A,dir:i,placeholder:g,CustomTrigger:b,...y}),a.jsx(Le,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:"start",sideOffset:-.5,dir:i,children:v?a.jsx(tf,{current:S,onSelect:_=>{T(_)},ranges:c,onApply:E,onReset:P,showResetButton:m,minDate:r,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(Jw,{current:S,onSelect:T,presetRanges:c}),a.jsx(qs,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:T,disabled:_=>ro(_,s,r,o),startMonth:r,endMonth:o,required:!0,autoFocus:!0,defaultMonth:N==null?void 0:N.from,className:p("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(so,{handleDateChange:E,disabled:s,onReset:P,showResetButton:m})})]})})]})]})},Lo=h.forwardRef((e,t)=>{const{className:n,rounded:s,...r}=e;return a.jsx("div",{className:p("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",s?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...r})});Lo.displayName="WuCard";const Bo=h.forwardRef((e,t)=>{const{className:n,...s}=e;return a.jsx("div",{ref:t,...s,className:p("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Bo.displayName="WuCardHeader";const qo=h.forwardRef((e,t)=>{const{className:n,...s}=e;return a.jsx("div",{ref:t,...s,className:p("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});qo.displayName="WuCardHeader";const $o=x.forwardRef(({className:e,partial:t,...n},s)=>a.jsx(Es.Root,{ref:s,className:p("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(Es.Indicator,{className:p("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"})]})}));$o.displayName=Es.Root.displayName;const Be=h.forwardRef((e,t)=>{const{disabled:n,checked:s,Label:r,labelPosition:o="right",className:i,id:u=Ds(),partial:l,onChange:c,required:d,readonly:w,...f}=e;return h.useEffect(()=>{f.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[f.defaultChecked,s]),a.jsxs("div",{className:sf({labelPosition:o,className:"wu-checkbox-container"}),dir:f.dir,children:[a.jsx($o,{id:u,...f,partial:l,checked:s,disabled:n||w,onCheckedChange:c,className:p("wu-peer wu-checkbox",i),required:d,ref:t}),r&&a.jsx(Ee,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:r})]})}),sf=Fe.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"}}});Be.displayName="WuCheckbox";const rf=e=>{const{className:t,children:n,...s}=e;return a.jsx("span",{...s,className:p("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})},nr=x.forwardRef(({className:e,...t},n)=>a.jsx(ve.Command,{ref:n,className:p("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));nr.displayName=ve.Command.displayName;const Ho=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(ve.Command.Input,{ref:n,className:p("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})}));Ho.displayName=ve.Command.Input.displayName;const sr=x.forwardRef(({className:e,...t},n)=>a.jsx(ve.Command.List,{ref:n,className:p("",e),...t}));sr.displayName=ve.Command.List.displayName;const rr=x.forwardRef((e,t)=>a.jsx(ve.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));rr.displayName=ve.Command.Empty.displayName;const Rt=x.forwardRef(({className:e,...t},n)=>a.jsx(ve.Command.Group,{ref:n,className:p("",e),...t}));Rt.displayName=ve.Command.Group.displayName;const ar=x.forwardRef(({className:e,...t},n)=>a.jsx(ve.Command.Separator,{ref:n,className:p("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));ar.displayName=ve.Command.Separator.displayName;const en=x.forwardRef(({className:e,...t},n)=>a.jsx(ve.Command.Item,{ref:n,className:p("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}));en.displayName=ve.Command.Item.displayName;const It=h.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:s,className:r,style:o},i)=>a.jsx(Ba.Virtuoso,{ref:i,dir:s,className:r,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));It.displayName="WuVirtualScroll";const af=({tags:e,triggerRef:t})=>{const[n,s]=h.useState([]),[r,o]=h.useState([]),i=h.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:r.map((l,c)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},c))}),[r]),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 h.useEffect(()=>{const l=()=>{if(t.current){const f=t.current.offsetWidth-20-36;let m=0;const g=[],b=[];e.forEach(v=>{const y=u(v);m+y+8<f?(g.push(v),m+=y+8):b.push(v)}),s(g),o(b)}};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)),r.length>0&&a.jsx(kn,{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:["+",r.length]})})]})},of=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:s="flat",dir:r="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,className:w,...f})=>{const[m,g]=h.useState([]),b=h.useRef(null);h.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){g([]);return}if(i){const y=n;g(y==null?void 0:y.map(N=>N[o.label]));return}else g([n[o.label]])},[n]);const v=()=>{var y;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:`${(((y=b.current)==null?void 0:y.offsetWidth)||0)-32}px`},children:m.join(", ")}):a.jsx(af,{tags:m,triggerRef:b}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(dt,{dir:r,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...f,ref:b,disabled:l,className:p("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",s==="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:[v(),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"})]})})},zo=R.Root,Uo=R.Trigger,jo=R.Group,uf=R.Portal,lf=R.Sub,cf=R.RadioGroup,Go=x.forwardRef(({className:e,inset:t,children:n,position:s,...r},o)=>a.jsxs(R.SubTrigger,{ref:o,className:p("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),...r,children:[s==="left"&&a.jsx("span",{className:p("wm-chevron-right",r.dir==="rtl"&&"ml-2")}),n,s!=="left"&&a.jsx("span",{className:p("wu-text-base wu-leading-4",r.dir==="rtl"&&"wu-mr-auto wm-chevron-left",r.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Go.displayName=R.SubTrigger.displayName;const Ko=x.forwardRef(({className:e,...t},n)=>a.jsx(R.SubContent,{ref:n,className:p("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}));Ko.displayName=R.SubContent.displayName;const or=x.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(R.Portal,{children:a.jsx(R.Content,{ref:s,sideOffset:t,className:p("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})}));or.displayName=R.Content.displayName;const zn=x.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(R.Item,{ref:s,className:p("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}));zn.displayName=R.Item.displayName;const Yo=x.forwardRef(({className:e,children:t,checked:n,dir:s,...r},o)=>a.jsxs(R.CheckboxItem,{ref:o,className:p("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",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...r,children:[a.jsx("span",{className:p("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",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:a.jsx(R.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Yo.displayName=R.CheckboxItem.displayName;const Xo=x.forwardRef(({className:e,children:t,...n},s)=>a.jsxs(R.RadioItem,{ref:s,className:p("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(R.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]}));Xo.displayName=R.RadioItem.displayName;const tn=x.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(R.Label,{ref:s,className:p("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));tn.displayName=R.Label.displayName;const Un=x.forwardRef(({className:e,...t},n)=>a.jsx(R.Separator,{ref:n,className:p("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Un.displayName=R.Separator.displayName;const Zo=({option:e,value:t,multiple:n=!1,onSelect:s,accessorKey:r,dir:o})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[r.value])):JSON.stringify(t[r.value]))},[t,r.value,n]);const l=n?i.includes(JSON.stringify(e[r.value])):i===JSON.stringify(e[r.value]),c=()=>{e.disabled||s(e)};return a.jsxs(en,{onSelect:c,disabled:e.disabled,className:p("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(Be,{checked:l}),a.jsx(df,{option:e,accessorKey:r})]})},df=({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"})]})},Jo=e=>{const{option:t,selectAll:n,handleSelectAll:s,isCheckedAll:r,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(en,{onSelect:s,className:p("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(Be,{checked:r||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(Rt,{children:[a.jsx(tn,{children:t.label}),t.options.map((l,c)=>h.createElement(Zo,{...i,option:l,key:c}))]});case"divider":return a.jsx(ar,{className:"wu-mx-4"});default:return a.jsx(Zo,{...i,option:t})}},wf=e=>{const t=[],n=[],s=[],r=[];return e.forEach(o=>{o.type==="group"?(t.push(o),s.push(...o.options),r.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):s.push(o),o!=null&&o.disabled||r.push(o)}),{groups:t,dividers:n,allOptions:s,enabledOptions:r}},ff=h.memo(Qe),pf=({data:e,accessorKey:t,value:n,defaultValue:s,Header:r,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:c,onSelect:d,Label:w,maxHeight:f=420,multiple:m=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:y,labelPosition:N="top",className:C,onScroll:S,maxContentWidth:T,enableSearch:A=!0,noDataContent:k,...E})=>{const[D,P]=h.useState(""),[_,M]=h.useState(),[F,B]=h.useState(!1),[O,$]=h.useState(!1),[V,H]=h.useState(!1),z=h.useRef(null),{allOptions:U,enabledOptions:ce}=h.useMemo(()=>g||b&&!b.includeDisabled?wf(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),se=h.useMemo(()=>{if(!D)return e;const q=D.toLowerCase();return U.filter(Z=>Z[t.label].toLowerCase().includes(q))},[D,U,e,t.label]),_e=h.useMemo(()=>m&&b!=null&&b.enable&&!D&&se.length>0?[{type:"all"},...se]:se,[se,D,m]),ge=h.useCallback(q=>{const Z=q[t.value];m?M(ae=>{const de=ae||[],be=de.some(Ne=>Ne[t.value]===Z)?de.filter(Ne=>Ne[t.value]!==Z):[...de,q];return d==null||d(be),be}):(B(!1),M(q),d==null||d(q))},[m,t.value,d]),Pe=h.useCallback(q=>P(q.target.value),[]),W=h.useCallback(()=>P(""),[]);h.useEffect(()=>{if(n!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?M(n):s!==void 0&&M(s)},[n,s]),h.useEffect(()=>{if(!m)return;const q=b!=null&&b.includeDisabled?(_==null?void 0:_.length)===U.length:(_==null?void 0:_.length)===ce.length;$(q);const Z=(_==null?void 0:_.length)>0&&!q;H(Z)},[_,b]);const G=h.useCallback(()=>{const q=O?[]:b!=null&&b.includeDisabled?U:ce;M(q),d==null||d(q)},[O,m,U,ce,d,b]),K=An(N);return a.jsxs("div",{className:p(K,"wu-flex wu-combobox-container"),ref:z,children:[a.jsxs(ze,{onOpenChange:q=>{q&&W(),B(q)},open:F,modal:!0,children:[a.jsx(of,{selectedOptions:_,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:c,multiple:m,disabled:y,selectAll:b,isCheckedAll:O,className:C,id:v,...E}),a.jsx(Le,{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:T},children:a.jsxs(nr,{id:v,children:[A&&a.jsx("div",{className:"wu-m-2",children:a.jsx(ff,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:Pe,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),r,a.jsxs(sr,{children:[a.jsx(rr,{children:k||"No results found."}),_e.length>=o?a.jsx(It,{className:"wu-combobox-list",containerHeight:f,list:_e,callback:(q,Z)=>a.jsx(Jo,{option:Z,value:_,onSelect:ge,multiple:m,accessorKey:t,dir:c,selectAll:b,handleSelectAll:G,isCheckedAll:O,isPartialSelected:V},q),dir:c}):a.jsx("div",{style:{height:"fit-content",maxHeight:f,overflow:"auto"},className:"wu-combobox-list",onScroll:S,children:_e.map((q,Z)=>a.jsx(Jo,{option:q,value:_,onSelect:ge,multiple:m,accessorKey:t,dir:c,selectAll:b,handleSelectAll:G,isCheckedAll:O,isPartialSelected:V},Z))})]})]})})]}),w&&a.jsx(Ee,{htmlFor:v,className:"wu-combobox-label",children:w})]})},hf=e=>{const{textToCopy:t,notificationText:n,...s}=e,[r,o]=h.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(Te,{...s,onClick:i,variant:"iconOnly",className:p("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:p("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",r?"wu-block":"wu-hidden"),children:n}),a.jsx(De,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Qo=Q.Root,mf=Q.Trigger,gf=Q.Close,bf=Q.Portal,Ro=x.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{className:p("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}));Ro.displayName=Q.Overlay.displayName;const yf=Fe.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"}}),ir=x.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:s,overlayClassName:r,closeButtonClassName:o,...i},u)=>a.jsxs(bf,{children:[a.jsx(Ro,{className:r}),a.jsxs(Q.Content,{ref:u,className:p(yf({side:e}),t),...i,children:[n,!s&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Tt,{variant:"iconOnly",className:p("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"})]})})]})]}));ir.displayName=Q.Content.displayName;const ei=x.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:p("wu-text-lg wu-font-semibold",e),...t}));ei.displayName=Q.Title.displayName;const vf=x.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:p("wu-text-sm",e),...t}));vf.displayName=Q.Description.displayName;const xf=e=>t=>{e&&t.preventDefault()},Nf=e=>{const{Trigger:t,children:n,hideCloseButton:s,className:r,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:c,closeButtonClassName:d,...w}=e;return a.jsxs(Qo,{open:i,onOpenChange:u,children:[a.jsx(mf,{asChild:!0,children:t}),a.jsxs(ir,{onInteractOutside:xf(l),side:o,className:p("wu-bg-white wu-text-gray-lead wu-px-0",r),hideCloseButton:s,overlayClassName:c,closeButtonClassName:d,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(ei,{})}),n]})]})},Sf=({children:e,...t})=>a.jsx(gf,{...t,children:e}),ti=h.createContext({});function ur(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const ni=typeof window<"u",si=ni?h.useLayoutEffect:h.useEffect,jn=h.createContext(null);function Cf(e,t){e.indexOf(t)===-1&&e.push(t)}function Tf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Re=(e,t,n)=>n>t?t:n<e?e:n;function lr(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let nn=()=>{},ft=()=>{};typeof process<"u"&&((cd=process.env)==null?void 0:cd.NODE_ENV)!=="production"&&(nn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(lr(t,n))},ft=(e,t,n)=>{if(!e)throw new Error(lr(t,n))});const Ye={},ri=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ef(e){return typeof e=="object"&&e!==null}const ai=e=>/^0[^.\s]+$/u.test(e);function cr(e){let t;return()=>(t===void 0&&(t=e()),t)}const Mt=e=>e,If=(e,t)=>n=>t(e(n)),Gn=(...e)=>e.reduce(If),oi=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class ii{constructor(){this.subscriptions=[]}add(t){return Cf(this.subscriptions,t),()=>Tf(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let o=0;o<r;o++){const i=this.subscriptions[o];i&&i(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const je=e=>e*1e3,qe=e=>e/1e3;function ui(e,t){return t?e*(1e3/t):0}const li=new Set;function ci(e,t,n){e||li.has(t)||(console.warn(lr(t,n)),li.add(t))}const di=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Mf=1e-7,Df=12;function Af(e,t,n,s,r){let o,i,u=0;do i=t+(n-t)/2,o=di(i,s,r)-e,o>0?n=i:t=i;while(Math.abs(o)>Mf&&++u<Df);return i}function sn(e,t,n,s){if(e===t&&n===s)return Mt;const r=o=>Af(o,0,1,e,n);return o=>o===0||o===1?o:di(r(o),t,s)}const wi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fi=e=>t=>1-e(1-t),pi=sn(.33,1.53,.69,.99),dr=fi(pi),hi=wi(dr),mi=e=>(e*=2)<1?.5*dr(e):.5*(2-Math.pow(2,-10*(e-1))),wr=e=>1-Math.sin(Math.acos(e)),kf=fi(wr),gi=wi(wr),_f=sn(.42,0,1,1),Pf=sn(0,0,.58,1),bi=sn(.42,0,.58,1),Vf=e=>Array.isArray(e)&&typeof e[0]!="number",yi=e=>Array.isArray(e)&&typeof e[0]=="number",vi={linear:Mt,easeIn:_f,easeInOut:bi,easeOut:Pf,circIn:wr,circInOut:gi,circOut:kf,backIn:dr,backInOut:hi,backOut:pi,anticipate:mi},Of=e=>typeof e=="string",xi=e=>{if(yi(e)){ft(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return sn(t,n,s,r)}else if(Of(e))return ft(vi[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),vi[e];return e},Kn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ff(e,t){let n=new Set,s=new Set,r=!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,f=!1)=>{const g=f&&r?n:s;return w&&i.add(d),g.has(d)||g.add(d),d},cancel:d=>{s.delete(d),i.delete(d)},process:d=>{if(u=d,r){o=!0;return}r=!0,[n,s]=[s,n],n.forEach(l),n.clear(),r=!1,o&&(o=!1,c.process(d))}};return c}const Wf=40;function Ni(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Kn.reduce((C,S)=>(C[S]=Ff(o),C),{}),{setup:u,read:l,resolveKeyframes:c,preUpdate:d,update:w,preRender:f,render:m,postRender:g}=i,b=()=>{const C=Ye.useManualTiming?r.timestamp:performance.now();n=!1,Ye.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(C-r.timestamp,Wf),1)),r.timestamp=C,r.isProcessing=!0,u.process(r),l.process(r),c.process(r),d.process(r),w.process(r),f.process(r),m.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(b))},v=()=>{n=!0,s=!0,r.isProcessing||e(b)};return{schedule:Kn.reduce((C,S)=>{const T=i[S];return C[S]=(A,k=!1,E=!1)=>(n||v(),T.schedule(A,k,E)),C},{}),cancel:C=>{for(let S=0;S<Kn.length;S++)i[Kn[S]].cancel(C)},state:r,steps:i}}const{schedule:$e,cancel:fr,state:Yn}=Ni(typeof requestAnimationFrame<"u"?requestAnimationFrame:Mt,!0);let Xn;function Lf(){Xn=void 0}const Me={now:()=>(Xn===void 0&&Me.set(Yn.isProcessing||Ye.useManualTiming?Yn.timestamp:performance.now()),Xn),set:e=>{Xn=e,queueMicrotask(Lf)}},Si=e=>t=>typeof t=="string"&&t.startsWith(e),Ci=Si("--"),Bf=Si("var(--"),pr=e=>Bf(e)?qf.test(e.split("/*")[0].trim()):!1,qf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ti(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Dt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},rn={...Dt,transform:e=>Re(0,1,e)},Zn={...Dt,default:1},an=e=>Math.round(e*1e5)/1e5,hr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $f(e){return e==null}const Hf=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mr=(e,t)=>n=>!!(typeof n=="string"&&Hf.test(n)&&n.startsWith(e)||t&&!$f(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ei=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,o,i,u]=s.match(hr);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},zf=e=>Re(0,255,e),gr={...Dt,transform:e=>Math.round(zf(e))},pt={test:mr("rgb","red"),parse:Ei("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+gr.transform(e)+", "+gr.transform(t)+", "+gr.transform(n)+", "+an(rn.transform(s))+")"};function Uf(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const br={test:mr("#"),parse:Uf,transform:pt.transform},on=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=on("deg"),At=on("%"),L=on("px"),jf=on("vh"),Gf=on("vw"),Ii={...At,parse:e=>At.parse(e)/100,transform:e=>At.transform(e*100)},kt={test:mr("hsl","hue"),parse:Ei("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+At.transform(an(t))+", "+At.transform(an(n))+", "+an(rn.transform(s))+")"},le={test:e=>pt.test(e)||br.test(e)||kt.test(e),parse:e=>pt.test(e)?pt.parse(e):kt.test(e)?kt.parse(e):br.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?pt.transform(e):kt.transform(e),getAnimatableNone:e=>{const t=le.parse(e);return t.alpha=0,le.transform(t)}},Kf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Yf(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(hr))==null?void 0:t.length)||0)+(((n=e.match(Kf))==null?void 0:n.length)||0)>0}const Mi="number",Di="color",Xf="var",Zf="var(",Ai="${}",Jf=/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 un(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let o=0;const u=t.replace(Jf,l=>(le.test(l)?(s.color.push(o),r.push(Di),n.push(le.parse(l))):l.startsWith(Zf)?(s.var.push(o),r.push(Xf),n.push(l)):(s.number.push(o),r.push(Mi),n.push(parseFloat(l))),++o,Ai)).split(Ai);return{values:n,split:u,indexes:s,types:r}}function ki(e){return un(e).values}function _i(e){const{split:t,types:n}=un(e),s=t.length;return r=>{let o="";for(let i=0;i<s;i++)if(o+=t[i],r[i]!==void 0){const u=n[i];u===Mi?o+=an(r[i]):u===Di?o+=le.transform(r[i]):o+=r[i]}return o}}const Qf=e=>typeof e=="number"?0:le.test(e)?le.getAnimatableNone(e):e;function Rf(e){const t=ki(e);return _i(e)(t.map(Qf))}const tt={test:Yf,parse:ki,createTransformer:_i,getAnimatableNone:Rf};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 ep({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,o=0,i=0;if(!t)r=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;r=yr(l,u,e+1/3),o=yr(l,u,e),i=yr(l,u,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:s}}function Jn(e,t){return n=>n>0?t:e}const ln=(e,t,n)=>e+(t-e)*n,vr=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},tp=[br,pt,kt],np=e=>tp.find(t=>t.test(e));function Pi(e){const t=np(e);if(nn(!!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===kt&&(n=ep(n)),n}const Vi=(e,t)=>{const n=Pi(e),s=Pi(t);if(!n||!s)return Jn(e,t);const r={...n};return o=>(r.red=vr(n.red,s.red,o),r.green=vr(n.green,s.green,o),r.blue=vr(n.blue,s.blue,o),r.alpha=ln(n.alpha,s.alpha,o),pt.transform(r))},xr=new Set(["none","hidden"]);function sp(e,t){return xr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function rp(e,t){return n=>ln(e,t,n)}function Nr(e){return typeof e=="number"?rp:typeof e=="string"?pr(e)?Jn:le.test(e)?Vi:ip:Array.isArray(e)?Oi:typeof e=="object"?le.test(e)?Vi:ap:Jn}function Oi(e,t){const n=[...e],s=n.length,r=e.map((o,i)=>Nr(o)(o,t[i]));return o=>{for(let i=0;i<s;i++)n[i]=r[i](o);return n}}function ap(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Nr(e[r])(e[r],t[r]));return r=>{for(const o in s)n[o]=s[o](r);return n}}function op(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],i=e.indexes[o][s[o]],u=e.values[i]??0;n[r]=u,s[o]++}return n}const ip=(e,t)=>{const n=tt.createTransformer(t),s=un(e),r=un(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?xr.has(e)&&!r.values.length||xr.has(t)&&!s.values.length?sp(e,t):Gn(Oi(op(s,r),r.values),n):(nn(!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 Fi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ln(e,t,n):Nr(e)(e,t)}const up=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>$e.update(t,n),stop:()=>fr(t),now:()=>Yn.isProcessing?Yn.timestamp:Me.now()}},Wi=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)s+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Qn=2e4;function Sr(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Qn;)t+=n,s=e.next(t);return t>=Qn?1/0:t}function lp(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Sr(s),Qn);return{type:"keyframes",ease:o=>s.next(r*o).value/t,duration:qe(r)}}const cp=5;function Li(e,t,n){const s=Math.max(t-cp,0);return ui(n-e(s),t-s)}const re={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},Cr=.001;function dp({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:s=re.mass}){let r,o;nn(e<=je(re.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Re(re.minDamping,re.maxDamping,i),e=Re(re.minDuration,re.maxDuration,qe(e)),i<1?(r=c=>{const d=c*i,w=d*e,f=d-n,m=Tr(c,i),g=Math.exp(-w);return Cr-f/m*g},o=c=>{const w=c*i*e,f=w*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,g=Math.exp(-w),b=Tr(Math.pow(c,2),i);return(-r(c)+Cr>0?-1:1)*((f-m)*g)/b}):(r=c=>{const d=Math.exp(-c*e),w=(c-n)*e+1;return-Cr+d*w},o=c=>{const d=Math.exp(-c*e),w=(n-c)*(e*e);return d*w});const u=5/e,l=fp(r,o,u);if(e=je(e),isNaN(l))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:i*2*Math.sqrt(s*c),duration:e}}}const wp=12;function fp(e,t,n){let s=n;for(let r=1;r<wp;r++)s=s-e(s)/t(s);return s}function Tr(e,t){return e*Math.sqrt(1-t*t)}const pp=["duration","bounce"],hp=["stiffness","damping","mass"];function Bi(e,t){return t.some(n=>e[n]!==void 0)}function mp(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!Bi(e,hp)&&Bi(e,pp))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,o=2*Re(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:re.mass,stiffness:r,damping:o}}else{const n=dp(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function Rn(e=re.visualDuration,t=re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=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:f,isResolvedFromDuration:m}=mp({...n,velocity:-qe(n.velocity||0)}),g=f||0,b=c/(2*Math.sqrt(l*d)),v=i-o,y=qe(Math.sqrt(l/d)),N=Math.abs(v)<5;s||(s=N?re.restSpeed.granular:re.restSpeed.default),r||(r=N?re.restDelta.granular:re.restDelta.default);let C;if(b<1){const T=Tr(y,b);C=A=>{const k=Math.exp(-b*y*A);return i-k*((g+b*y*v)/T*Math.sin(T*A)+v*Math.cos(T*A))}}else if(b===1)C=T=>i-Math.exp(-y*T)*(v+(g+y*v)*T);else{const T=y*Math.sqrt(b*b-1);C=A=>{const k=Math.exp(-b*y*A),E=Math.min(T*A,300);return i-k*((g+b*y*v)*Math.sinh(E)+T*v*Math.cosh(E))/T}}const S={calculatedDuration:m&&w||null,next:T=>{const A=C(T);if(m)u.done=T>=w;else{let k=T===0?g:0;b<1&&(k=T===0?je(g):Li(C,T,A));const E=Math.abs(k)<=s,D=Math.abs(i-A)<=r;u.done=E&&D}return u.value=u.done?i:A,u},toString:()=>{const T=Math.min(Sr(S),Qn),A=Wi(k=>S.next(T*k).value,T,30);return T+"ms "+A},toTransition:()=>{}};return S}Rn.applyToOptions=e=>{const t=lp(e,100,Rn);return e.ease=t.ease,e.duration=je(t.duration),e.type="keyframes",e};function Er({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:c=.5,restSpeed:d}){const w=e[0],f={done:!1,value:w},m=E=>u!==void 0&&E<u||l!==void 0&&E>l,g=E=>u===void 0?l:l===void 0||Math.abs(u-E)<Math.abs(l-E)?u:l;let b=n*t;const v=w+b,y=i===void 0?v:i(v);y!==v&&(b=y-w);const N=E=>-b*Math.exp(-E/s),C=E=>y+N(E),S=E=>{const D=N(E),P=C(E);f.done=Math.abs(D)<=c,f.value=f.done?y:P};let T,A;const k=E=>{m(f.value)&&(T=E,A=Rn({keyframes:[f.value,g(f.value)],velocity:Li(C,E,f.value),damping:r,stiffness:o,restDelta:c,restSpeed:d}))};return k(0),{calculatedDuration:null,next:E=>{let D=!1;return!A&&T===void 0&&(D=!0,S(E),k(E)),T!==void 0&&E>=T?A.next(E-T):(!D&&S(E),f)}}}function gp(e,t,n){const s=[],r=n||Ye.mix||Fi,o=e.length-1;for(let i=0;i<o;i++){let u=r(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Mt:t;u=Gn(l,u)}s.push(u)}return s}function bp(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const o=e.length;if(ft(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=gp(t,s,r),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 f=oi(e[w],e[w+1],d);return u[w](f)};return n?d=>c(Re(e[0],e[o-1],d)):c}function yp(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=oi(0,t,s);e.push(ln(n,1,r))}}function vp(e){const t=[0];return yp(t,e.length-1),t}function xp(e,t){return e.map(n=>n*t)}function Np(e,t){return e.map(()=>t||bi).splice(0,e.length-1)}function _t({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Vf(s)?s.map(xi):xi(s),o={done:!1,value:t[0]},i=xp(n&&n.length===t.length?n:vp(t),e),u=bp(i,t,{ease:Array.isArray(r)?r:Np(t,r)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const Sp=e=>e!==null;function Ir(e,{repeat:t,repeatType:n="loop"},s,r=1){const o=e.filter(Sp),u=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||s===void 0?o[u]:s}const Cp={decay:Er,inertia:Er,tween:_t,keyframes:_t,spring:Rn};function qi(e){typeof e.type=="string"&&(e.type=Cp[e.type])}class Mr{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 Tp=e=>e/100;class Dr extends Mr{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==Me.now()&&this.tick(Me.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;qi(t);const{type:n=_t,repeat:s=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||_t;process.env.NODE_ENV!=="production"&&l!==_t&&ft(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==_t&&typeof u[0]!="number"&&(this.mixKeyframes=Gn(Tp,Fi(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=Sr(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(s+1)-r,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:s,totalDuration:r,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:d,repeat:w,repeatType:f,repeatDelay:m,type:g,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),N=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let C=this.currentTime,S=s;if(w){const E=Math.min(this.currentTime,r)/u;let D=Math.floor(E),P=E%1;!P&&E>=1&&(P=1),P===1&&D--,D=Math.min(D,w+1),!!(D%2)&&(f==="reverse"?(P=1-P,m&&(P-=m/u)):f==="mirror"&&(S=i)),C=Re(0,1,P)*u}const T=N?{done:!1,value:d[0]}:S.next(C);o&&(T.value=o(T.value));let{done:A}=T;!N&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return k&&g!==Er&&(T.value=Ir(d,this.options,v,this.speed)),b&&b(T.value),k&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return qe(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qe(t)}get time(){return qe(this.currentTime)}set time(t){var n;t=je(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(Me.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=qe(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:t=up,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(r=this.options).onPlay)==null||o.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(Me.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 Ep(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ht=e=>e*180/Math.PI,Ar=e=>{const t=ht(Math.atan2(e[1],e[0]));return kr(t)},Ip={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ar,rotateZ:Ar,skewX:e=>ht(Math.atan(e[1])),skewY:e=>ht(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kr=e=>(e=e%360,e<0&&(e+=360),e),$i=Ar,Hi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Mp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hi,scaleY:zi,scale:e=>(Hi(e)+zi(e))/2,rotateX:e=>kr(ht(Math.atan2(e[6],e[5]))),rotateY:e=>kr(ht(Math.atan2(-e[2],e[0]))),rotateZ:$i,rotate:$i,skewX:e=>ht(Math.atan(e[4])),skewY:e=>ht(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _r(e){return e.includes("scale")?1:0}function Pr(e,t){if(!e||e==="none")return _r(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Mp,r=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ip,r=u}if(!r)return _r(t);const o=s[t],i=r[1].split(",").map(Ap);return typeof o=="function"?o(i):i[o]}const Dp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Pr(n,t)};function Ap(e){return parseFloat(e.trim())}const Pt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(Pt),Ui=e=>e===Dt||e===L,kp=new Set(["x","y","z"]),_p=Pt.filter(e=>!kp.has(e));function Pp(e){const t=[];return _p.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const nt={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})=>Pr(t,"x"),y:(e,{transform:t})=>Pr(t,"y")};nt.translateX=nt.x,nt.translateY=nt.y;const mt=new Set;let Vr=!1,Or=!1,Fr=!1;function ji(){if(Or){const e=Array.from(mt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Pp(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([o,i])=>{var u;(u=s.getValue(o))==null||u.set(i)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Or=!1,Vr=!1,mt.forEach(e=>e.complete(Fr)),mt.clear()}function Gi(){mt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Or=!0)})}function Vp(){Fr=!0,Gi(),ji(),Fr=!1}class Wr{constructor(t,n,s,r,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),Vr||(Vr=!0,$e.read(Gi),$e.resolveKeyframes(ji))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const o=r==null?void 0:r.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const u=s.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),r&&o===void 0&&r.set(t[0])}Ep(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Op=e=>e.startsWith("--");function Fp(e,t,n){Op(t)?e.style.setProperty(t,n):e.style[t]=n}const Wp=cr(()=>window.ScrollTimeline!==void 0),Lp={};function Bp(e,t){const n=cr(e);return()=>Lp[t]??n()}const Ki=Bp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cn=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Yi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cn([0,.65,.55,1]),circOut:cn([.55,0,1,.45]),backIn:cn([.31,.01,.66,-.59]),backOut:cn([.33,1.53,.69,.99])};function Xi(e,t){if(e)return typeof e=="function"?Ki()?Wi(e,t):"ease-out":yi(e)?cn(e):Array.isArray(e)?e.map(n=>Xi(n,t)||Yi.easeOut):Yi[e]}function qp(e,t,n,{delay:s=0,duration:r=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=Xi(u,r);Array.isArray(w)&&(d.easing=w);const f={delay:s,duration:r,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(d,f)}function Zi(e){return typeof e=="function"&&"applyToOptions"in e}function $p({type:e,...t}){return Zi(e)&&Ki()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ji extends Mr{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,ft(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=$p(t);this.animation=qp(n,s,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Ir(r,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):Fp(n,s,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,s,r;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return qe(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qe(t)}get time(){return qe(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=je(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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Wp()?(this.animation.timeline=t,Mt):n(this)}}const Qi={anticipate:mi,backInOut:hi,circInOut:gi};function Hp(e){return e in Qi}function zp(e){typeof e.ease=="string"&&Hp(e.ease)&&(e.ease=Qi[e.ease])}const Lr=10;class Up extends Ji{constructor(t){zp(t),qi(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new Dr({...i,autoplay:!1}),l=Math.max(Lr,Me.now()-this.startTime),c=Re(0,Lr,l-Lr);n.setWithVelocity(u.sample(Math.max(0,l-c)).value,u.sample(l).value,c),u.stop()}}const Ri=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(tt.test(e)||e==="0")&&!e.startsWith("url("));function jp(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 Gp(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=Ri(r,t),u=Ri(o,t);return nn(i===u,`You are trying to animate ${t} from "${r}" to "${o}". "${i?o:r}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:jp(e)||(n==="spring"||Zi(n))&&s}function Br(e){e.duration=0,e.type="keyframes"}const Kp=new Set(["opacity","clipPath","filter","transform"]),Yp=cr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xp(e){var d;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,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 Yp()&&n&&Kp.has(n)&&(n!=="transform"||!c)&&!l&&!s&&r!=="mirror"&&o!==0&&i!=="inertia"}const Zp=40;class Jp extends Mr{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:c,element:d,...w}){var g;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Me.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:o,repeatType:i,name:l,motionValue:c,element:d,...w},m=(d==null?void 0:d.KeyframeResolver)||Wr;this.keyframeResolver=new m(u,(b,v,y)=>this.onKeyframesResolved(b,v,f,!y),l,c,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){var v,y;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:c,onUpdate:d}=s;this.resolvedAt=Me.now(),Gp(t,o,i,u)||((Ye.instantAnimations||!l)&&(d==null||d(Ir(t,s,n))),t[0]=t[t.length-1],Br(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Zp?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},m=!c&&Xp(f),g=(y=(v=f.motionValue)==null?void 0:v.owner)==null?void 0:y.current,b=m?new Up({...f,element:g}):new Dr(f);b.finished.then(()=>{this.notifyFinished()}).catch(Mt),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}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(),Vp()),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()}}function eu(e,t,n,s=0,r=1){const o=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),i=e.size,u=(i-1)*s;return typeof n=="function"?n(o,i):r===1?o*s:u-o*s}const Qp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rp(e){const t=Qp.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const eh=4;function tu(e,t,n=1){ft(n<=eh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Rp(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const i=o.trim();return ri(i)?parseFloat(i):i}return pr(r)?tu(r,t,n+1):r}const th={type:"spring",stiffness:500,damping:25,restSpeed:10},nh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sh={type:"keyframes",duration:.8},rh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ah=(e,{keyframes:t})=>t.length>2?sh:Vt.has(e)?e.startsWith("scale")?nh(t[1]):th:rh,oh=e=>e!==null;function ih(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(oh),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function nu(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function su(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?nu(n,e):n}function uh({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:o,repeatType:i,repeatDelay:u,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const lh=(e,t,n,s={},r,o)=>i=>{const u=su(s,e)||{},l=u.delay||s.delay||0;let{elapsed:c=0}=s;c=c-je(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-c,onUpdate:f=>{t.set(f),u.onUpdate&&u.onUpdate(f)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:r};uh(u)||Object.assign(d,ah(e,d)),d.duration&&(d.duration=je(d.duration)),d.repeatDelay&&(d.repeatDelay=je(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let w=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Br(d),d.delay===0&&(w=!0)),(Ye.instantAnimations||Ye.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(w=!0,Br(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const f=ih(d.keyframes,u);if(f!==void 0){$e.update(()=>{d.onUpdate(f),d.onComplete()});return}}return u.isSync?new Dr(d):new Jp(d)};function ru(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function qr(e,t,n,s){if(typeof t=="function"){const[r,o]=ru(s);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=ru(s);t=t(n!==void 0?n:e.custom,r,o)}return t}function Ot(e,t,n){const s=e.getProps();return qr(s,t,n!==void 0?n:s.custom,e)}const au=new Set(["width","height","top","left","right","bottom",...Pt]),ou=30,ch=e=>!isNaN(parseFloat(e));class dh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const r=Me.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),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=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ch(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ci(!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 ii);const s=this.events[t].add(n);return t==="change"?()=>{s(),$e.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ou)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ou);return ui(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 es(e,t){return new dh(e,t)}const $r=e=>Array.isArray(e);function wh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,es(n))}function fh(e){return $r(e)?e[e.length-1]||0:e}function ph(e,t){const n=Ot(e,t);let{transitionEnd:s={},transition:r={},...o}=n||{};o={...o,...s};for(const i in o){const u=fh(o[i]);wh(e,i,u)}}const me=e=>!!(e&&e.getVelocity);function hh(e){return!!(me(e)&&e.add)}function mh(e,t){const n=e.getValue("willChange");if(hh(n))return n.add(t);if(!n&&Ye.WillChange){const s=new Ye.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Hr(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const iu="data-"+Hr("framerAppearId");function gh(e){return e.props[iu]}function bh({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function uu(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?nu(o,l):l;const c=o==null?void 0:o.reduceMotion;s&&(o=s);const d=[],w=r&&e.animationState&&e.animationState.getState()[r];for(const f in u){const m=e.getValue(f,e.latestValues[f]??null),g=u[f];if(g===void 0||w&&bh(w,f))continue;const b={delay:n,...su(o||{},f)},v=m.get();if(v!==void 0&&!m.isAnimating&&!Array.isArray(g)&&g===v&&!b.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const S=gh(e);if(S){const T=window.MotionHandoffAnimation(S,f,$e);T!==null&&(b.startTime=T,y=!0)}}mh(e,f);const N=c??e.shouldReduceMotion;m.start(lh(f,m,g,N&&au.has(f)?{type:!1}:b,e,y));const C=m.animation;C&&d.push(C)}if(i){const f=()=>$e.update(()=>{i&&ph(e,i)});d.length?Promise.all(d).then(f):f()}return d}function zr(e,t,n={}){var l;const s=Ot(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const o=s?()=>Promise.all(uu(e,s,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:w,staggerDirection:f}=r;return yh(e,t,c,d,w,f,n)}:()=>Promise.resolve(),{when:u}=r;if(u){const[c,d]=u==="beforeChildren"?[o,i]:[i,o];return c().then(()=>d())}else return Promise.all([o(),i(n.delay)])}function yh(e,t,n=0,s=0,r=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(zr(l,t,{...i,delay:n+(typeof s=="function"?0:s)+eu(e.variantChildren,l,s,r,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function vh(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(o=>zr(e,o,n));s=Promise.all(r)}else if(typeof t=="string")s=zr(e,t,n);else{const r=typeof t=="function"?Ot(e,t,n.custom):t;s=Promise.all(uu(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const xh={test:e=>e==="auto",parse:e=>e},lu=e=>t=>t.test(e),cu=[Dt,L,At,et,Gf,jf,xh],du=e=>cu.find(lu(e));function Nh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ai(e):!0}const Sh=new Set(["brightness","contrast","saturate","opacity"]);function Ch(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(hr)||[];if(!s)return e;const r=n.replace(s,"");let o=Sh.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+r+")"}const Th=/\b([a-z-]*)\(.*?\)/gu,Ur={...tt,getAnimatableNone:e=>{const t=e.match(Th);return t?t.map(Ch).join(" "):e}},wu={...Dt,transform:Math.round},jr={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius: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,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,...{rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Zn,scaleX:Zn,scaleY:Zn,scaleZ:Zn,skew:et,skewX:et,skewY:et,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:rn,originX:Ii,originY:Ii,originZ:L},zIndex:wu,fillOpacity:rn,strokeOpacity:rn,numOctaves:wu},Eh={...jr,color:le,backgroundColor:le,outlineColor:le,fill:le,stroke:le,borderColor:le,borderTopColor:le,borderRightColor:le,borderBottomColor:le,borderLeftColor:le,filter:Ur,WebkitFilter:Ur},fu=e=>Eh[e];function pu(e,t){let n=fu(e);return n!==Ur&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ih=new Set(["auto","none","0"]);function Mh(e,t,n){let s=0,r;for(;s<e.length&&!r;){const o=e[s];typeof o=="string"&&!Ih.has(o)&&un(o).values.length&&(r=e[s]),s++}if(r&&n)for(const o of t)e[o]=pu(n,r)}class Dh extends Wr{constructor(t,n,s,r,o){super(t,n,s,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let w=t[d];if(typeof w=="string"&&(w=w.trim(),pr(w))){const f=tu(w,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!au.has(s)||t.length!==2)return;const[r,o]=t,i=du(r),u=du(o),l=Ti(r),c=Ti(o);if(l!==c&&nt[s]){this.needsMeasurement=!0;return}if(i!==u)if(Ui(i)&&Ui(u))for(let d=0;d<t.length;d++){const w=t[d];typeof w=="string"&&(t[d]=parseFloat(w))}else nt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Nh(t[r]))&&s.push(r);s.length&&Mh(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,i=s[o];s[o]=nt[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()}}const Ah=new Set(["opacity","clipPath","filter","transform"]);function kh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const hu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gr(e){return Ef(e)&&"offsetHeight"in e}const{schedule:_h}=Ni(queueMicrotask,!1),Ph={y:!1};function Vh(){return Ph.y}function mu(e,t){const n=kh(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function Oh(e){return!(e.pointerType==="touch"||Vh())}function Fh(e,t,n={}){const[s,r,o]=mu(e,n);return s.forEach(i=>{let u=!1,l=!1,c;const d=()=>{i.removeEventListener("pointerleave",g)},w=v=>{c&&(c(v),c=void 0),d()},f=v=>{u=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,w(v))},m=()=>{u=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},g=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},b=v=>{if(!Oh(v))return;l=!1;const y=t(i,v);typeof y=="function"&&(c=y,i.addEventListener("pointerleave",g,r))};i.addEventListener("pointerenter",b,r),i.addEventListener("pointerdown",m,r)}),o}const gu=(e,t)=>t?e===t?!0:gu(e,t.parentElement):!1,Wh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Lh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Bh(e){return Lh.has(e.tagName)||e.isContentEditable===!0}const ts=new WeakSet;function bu(e){return t=>{t.key==="Enter"&&e(t)}}function Kr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qh=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=bu(()=>{if(ts.has(n))return;Kr(n,"down");const r=bu(()=>{Kr(n,"up")}),o=()=>Kr(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function yu(e){return Wh(e)&&!0}const vu=new WeakSet;function $h(e,t,n={}){const[s,r,o]=mu(e,n),i=u=>{const l=u.currentTarget;if(!yu(u)||vu.has(u))return;ts.add(l),n.stopPropagation&&vu.add(u);const c=t(l,u),d=(m,g)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",f),ts.has(l)&&ts.delete(l),yu(m)&&typeof c=="function"&&c(m,{success:g})},w=m=>{d(m,l===window||l===document||n.useGlobalTarget||gu(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",w,r),window.addEventListener("pointercancel",f,r)};return s.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,r),Gr(u)&&(u.addEventListener("focus",c=>qh(c,r)),!Bh(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const Hh=[...cu,le,tt],zh=e=>Hh.find(lu(e)),xu=()=>({min:0,max:0}),Nu=()=>({x:xu(),y:xu()}),Uh=new WeakMap;function ns(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dn(e){return typeof e=="string"||Array.isArray(e)}const Yr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xr=["initial",...Yr];function ss(e){return ns(e.animate)||Xr.some(t=>dn(e[t]))}function Su(e){return!!(ss(e)||e.variants)}function jh(e,t,n){for(const s in t){const r=t[s],o=n[s];if(me(r))e.addValue(s,r);else if(me(o))e.addValue(s,es(r,{owner:e}));else if(o!==r)if(e.hasValue(s)){const i=e.getValue(s);i.liveStyle===!0?i.jump(r):i.hasAnimated||i.set(r)}else{const i=e.getStaticValue(s);e.addValue(s,es(i!==void 0?i:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Zr={current:null},Cu={current:!1},Gh=typeof window<"u";function Kh(){if(Cu.current=!0,!!Gh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Zr.current=e.matches;e.addEventListener("change",t),t()}else Zr.current=!1}const Tu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rs={};function Eu(e){rs=e}function Yh(){return rs}class Xh{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Wr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 m=Me.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,$e.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=u;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ss(n),this.isVariantNode=Su(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const g=f[m];c[m]!==void 0&&me(g)&&g.set(c[m])}}mount(t){var n,s;if(this.hasBeenMounted)for(const r in this.initialValues)(n=this.values.get(r))==null||n.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=t,Uh.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,o)=>this.bindToMotionValue(o,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Cu.current||Kh(),this.shouldReduceMotion=Zr.current),process.env.NODE_ENV!=="production"&&ci(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),fr(this.notifyUpdate),fr(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 s=this.features[n];s&&(s.unmount(),s.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){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Ah.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:c,duration:d}=n.accelerate,w=new Ji({element:this.current,name:t,keyframes:u,times:l,ease:c,duration:je(d)}),f=i(w);this.valueSubscriptions.set(t,()=>{f(),w.cancel()});return}const s=Vt.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&$e.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),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 rs){const n=rs[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(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):Nu()}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 s=0;s<Tu.length;s++){const r=Tu[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,i=t[o];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=jh(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 s=this.values.get(t);n!==s&&(s&&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 s=this.values.get(t);return s===void 0&&n!==void 0&&(s=es(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ri(s)||ai(s))?s=parseFloat(s):!zh(s)&&tt.test(n)&&(s=pu(t,n)),this.setBaseTarget(t,me(s)?s.get():s)),me(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const i=qr(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(s=i[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!me(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ii),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){_h.render(this.render)}}class Iu extends Xh{constructor(){super(...arguments),this.KeyframeResolver=Dh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;me(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ft{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Zh({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Jh(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Qh(e,t){return Zh(Jh(e.getBoundingClientRect(),t))}const Rh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},em=Pt.length;function tm(e,t,n){let s="",r=!0;for(let o=0;o<em;o++){const i=Pt[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const c=parseFloat(u);l=i.startsWith("scale")?c===1:c===0}if(!l||n){const c=hu(u,jr[i]);if(!l){r=!1;const d=Rh[i]||i;s+=`${d}(${c}) `}n&&(t[i]=c)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Jr(e,t,n){const{style:s,vars:r,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const c=t[l];if(Vt.has(l)){i=!0;continue}else if(Ci(l)){r[l]=c;continue}else{const d=hu(c,jr[l]);l.startsWith("origin")?(u=!0,o[l]=d):s[l]=d}}if(t.transform||(i||n?s.transform=tm(t,e.transform,n):s.transform&&(s.transform="none")),u){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;s.transformOrigin=`${l} ${c} ${d}`}}function Mu(e,{style:t,vars:n},s,r){const o=e.style;let i;for(i in t)o[i]=t[i];r==null||r.applyProjectionStyles(o,s);for(i in n)o.setProperty(i,n[i])}function Du(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Du(e,t.target.x),s=Du(e,t.target.y);return`${n}% ${s}%`}},nm={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=tt.parse(e);if(r.length>5)return s;const o=tt.createTransformer(e),i=typeof r[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;r[0+i]/=u,r[1+i]/=l;const c=ln(u,l,.5);return typeof r[2+i]=="number"&&(r[2+i]/=c),typeof r[3+i]=="number"&&(r[3+i]/=c),o(r)}},sm={borderRadius:{...wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wn,borderTopRightRadius:wn,borderBottomLeftRadius:wn,borderBottomRightRadius:wn,boxShadow:nm};function Au(e,{layout:t,layoutId:n}){return Vt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!sm[e]||e==="opacity")}function Qr(e,t,n){var i;const s=e.style,r=t==null?void 0:t.style,o={};if(!s)return o;for(const u in s)(me(s[u])||r&&me(r[u])||Au(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=s[u]);return o}function rm(e){return window.getComputedStyle(e)}class am extends Iu{constructor(){super(...arguments),this.type="html",this.renderInstance=Mu}readValueFromInstance(t,n){var s;if(Vt.has(n))return(s=this.projection)!=null&&s.isProjecting?_r(n):Dp(t,n);{const r=rm(t),o=(Ci(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qh(t,n)}build(t,n,s){Jr(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Qr(t,n,s)}}const om={offset:"stroke-dashoffset",array:"stroke-dasharray"},im={offset:"strokeDashoffset",array:"strokeDasharray"};function um(e,t,n=1,s=0,r=!0){e.pathLength=1;const o=r?om:im;e[o.offset]=`${-s}`,e[o.array]=`${t} ${n}`}const lm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ku(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:o=1,pathOffset:i=0,...u},l,c,d){if(Jr(e,u,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:f}=e;w.transform&&(f.transform=w.transform,delete w.transform),(f.transform||w.transformOrigin)&&(f.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete w.transformBox);for(const m of lm)w[m]!==void 0&&(f[m]=w[m],delete w[m]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),s!==void 0&&(w.scale=s),r!==void 0&&um(w,r,o,i,!1)}const _u=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"]),Pu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cm(e,t,n,s){Mu(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(_u.has(r)?r:Hr(r),t.attrs[r])}function Vu(e,t,n){const s=Qr(e,t,n);for(const r in e)if(me(e[r])||me(t[r])){const o=Pt.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[o]=e[r]}return s}class dm extends Iu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nu}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vt.has(n)){const s=fu(n);return s&&s.default||0}return n=_u.has(n)?n:Hr(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Vu(t,n,s)}build(t,n,s){ku(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){cm(t,n,s,r)}mount(t){this.isSVGTag=Pu(t.tagName),super.mount(t)}}const wm=Xr.length;function Ou(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ou(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wm;n++){const s=Xr[n],r=e.props[s];(dn(r)||r===!1)&&(t[s]=r)}return t}function Fu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const fm=[...Yr].reverse(),pm=Yr.length;function hm(e){return t=>Promise.all(t.map(({animation:n,options:s})=>vh(e,n,s)))}function mm(e){let t=hm(e),n=Wu(),s=!0;const r=l=>(c,d)=>{var f;const w=Ot(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(w){const{transition:m,transitionEnd:g,...b}=w;c={...c,...b,...g}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,d=Ou(e.parent)||{},w=[],f=new Set;let m={},g=1/0;for(let v=0;v<pm;v++){const y=fm[v],N=n[y],C=c[y]!==void 0?c[y]:d[y],S=dn(C),T=y===l?N.isActive:null;T===!1&&(g=v);let A=C===d[y]&&C!==c[y]&&S;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),N.protectedKeys={...m},!N.isActive&&T===null||!C&&!N.prevProp||ns(C)||typeof C=="boolean")continue;if(y==="exit"&&N.isActive&&T!==!0){N.prevResolvedValues&&(m={...m,...N.prevResolvedValues});continue}const k=gm(N.prevProp,C);let E=k||y===l&&N.isActive&&!A&&S||v>g&&S,D=!1;const P=Array.isArray(C)?C:[C];let _=P.reduce(r(y),{});T===!1&&(_={});const{prevResolvedValues:M={}}=N,F={...M,..._},B=V=>{E=!0,f.has(V)&&(D=!0,f.delete(V)),N.needsAnimating[V]=!0;const H=e.getValue(V);H&&(H.liveStyle=!1)};for(const V in F){const H=_[V],z=M[V];if(m.hasOwnProperty(V))continue;let U=!1;$r(H)&&$r(z)?U=!Fu(H,z):U=H!==z,U?H!=null?B(V):f.add(V):H!==void 0&&f.has(V)?B(V):N.protectedKeys[V]=!0}N.prevProp=C,N.prevResolvedValues=_,N.isActive&&(m={...m,..._}),s&&e.blockInitialAnimation&&(E=!1);const O=A&&k;E&&(!O||D)&&w.push(...P.map(V=>{const H={type:y};if(typeof V=="string"&&s&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,U=Ot(z,V);if(z.enteringChildren&&U){const{delayChildren:ce}=U.transition||{};H.delay=eu(z.enteringChildren,e,ce)}}return{animation:V,options:H}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const y=Ot(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const N=e.getBaseTarget(y),C=e.getValue(y);C&&(C.liveStyle=!0),v[y]=N??null}),w.push({animation:v})}let b=!!w.length;return s&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(w):Promise.resolve()}function u(l,c){var w;if(n[l].isActive===c)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(f=>{var m;return(m=f.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Wu()}}}function gm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fu(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Wu(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function Lu(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function bm(e){return me(e)?e.get():e}const Rr=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Bu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ym(...e){return t=>{let n=!1;const s=e.map(r=>{const o=Bu(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():Bu(e[r],null)}}}}function vm(...e){return x.useCallback(ym(...e),e)}class xm extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,r=Gr(s)&&s.offsetWidth||0,o=Gr(s)&&s.offsetHeight||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left,i.bottom=o-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Nm({children:e,isPresent:t,anchorX:n,anchorY:s,root:r,pop:o}){var f;const i=h.useId(),u=h.useRef(null),l=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=h.useContext(Rr),d=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),w=vm(u,d);return h.useInsertionEffect(()=>{const{width:m,height:g,top:b,left:v,right:y,bottom:N}=l.current;if(t||o===!1||!u.current||!m||!g)return;const C=n==="left"?`left: ${v}`:`right: ${y}`,S=s==="bottom"?`bottom: ${N}`:`top: ${b}`;u.current.dataset.motionPopId=i;const T=document.createElement("style");c&&(T.nonce=c);const A=r??document.head;return A.appendChild(T),T.sheet&&T.sheet.insertRule(`
7
+ `))},[JSON.stringify(t)])}const l=x.useCallback(c=>{r||i(c)},[]);return[u,l]}function Do(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:r,registerControlId:o}=Ys(),i=mo(t),u=n?r:void 0,l=Je(()=>Symbol("labelable-control")),c=x.useRef(!1),d=x.useRef(t!=null),w=ge(()=>{!c.current||o===Ve||(c.current=!1,o(l.current,void 0))});return se(()=>{if(o===Ve)return;let f;if(n){const p=s==null?void 0:s.current;Lw(p)&&p.closest("label")!=null?f=t??null:f=u??i}else if(t!=null)d.current=!0,f=t;else if(d.current)f=i;else{w();return}if(f===void 0){w();return}c.current=!0,o(l.current,f)},[t,s,u,o,n,i,l,w]),x.useEffect(()=>w,[w]),r??i}function Ao(e){const{enabled:t=!0,value:n,id:s,name:r,controlRef:o,commit:i}=e,{formRef:u}=lo(),{invalid:l,markedDirtyRef:c,validityData:d,setValidityData:w}=Pn(),f=ge(e.getValue);se(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),d.initialValue===null&&p!==null&&w(g=>({...g,initialValue:p}))},[t,w,n,d.initialValue,f]),se(()=>{!t||!s||u.current.fields.set(s,{getValue:f,name:r,controlRef:o,validityData:Ww(d,l),validate(p=!0){let g=n;g===void 0&&(g=f()),c.current=!0,p?Ha.flushSync(()=>i(g)):i(g)}})},[i,o,t,u,f,s,l,c,r,d,n]),se(()=>{const p=u.current.fields;return()=>{s&&p.delete(s)}},[u,s])}const Xt="none",ef="trigger-press",Rs="input-change",Zt="input-clear",$n="input-blur",er="input-paste",Jt="keyboard";function ke(e,t,n,s){let r=!1,o=!1;const i=s??je;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:n,...i}}function Qt(e,t,n){const s=je;return{reason:e,event:t??new Event("base-ui"),...s}}const ko=x.forwardRef(function(t,n){const{render:s,className:r,id:o,name:i,value:u,disabled:l=!1,onValueChange:c,defaultValue:d,autoFocus:w=!1,...f}=t,{state:p,name:g,disabled:b,setTouched:v,setDirty:N,validityData:y,setFocused:C,setFilled:S,validationMode:T,validation:A}=Pn(),D=b||l,k=g??i,M={...p,disabled:D},{labelId:_}=Ys(),P=Do({id:o});se(()=>{var $;const W=u!=null;($=A.inputRef.current)!=null&&$.value||W&&u!==""?S(!0):W&&u===""&&S(!1)},[A.inputRef,S,u]);const E=x.useRef(null);se(()=>{w&&E.current===Gw(Co(E.current))&&C(!0)},[w,C]);const[O]=Qs({controlled:u,default:d,name:"FieldControl",state:"value"}),L=u!==void 0,F=L?O:void 0;return Ao({id:P,name:k,commit:A.commit,value:F,getValue:()=>{var W;return(W=A.inputRef.current)==null?void 0:W.value},controlRef:A.inputRef}),Ke("input",t,{ref:[n,E],state:M,props:[{id:P,disabled:D,name:k,ref:A.inputRef,"aria-labelledby":_,autoFocus:w,...L?{value:F}:{defaultValue:d},onChange(W){const $=W.currentTarget.value;c==null||c($,ke(Xt,W.nativeEvent)),N($!==y.initialValue),S($!=="")},onFocus(){C(!0)},onBlur(W){v(!0),C(!1),T==="onBlur"&&A.commit(W.currentTarget.value)},onKeyDown(W){W.currentTarget.tagName==="INPUT"&&W.key==="Enter"&&(v(!0),A.commit(W.currentTarget.value))}},A.getInputValidationProps(),f],stateAttributesMapping:Us})});process.env.NODE_ENV!=="production"&&(ko.displayName="FieldControl");const _o=x.forwardRef(function(t,n){return a.jsx(ko,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(_o.displayName="Input");const Hn={wuInputGroup:"_wuInputGroup_dz2g7_1",wuInputIcon:"_wuInputIcon_dz2g7_20",wuInput:"_wuInput_dz2g7_1",passwordToggle:"_passwordToggle_dz2g7_89"},Po=h.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:s})=>{const r=h.useCallback(i=>{if(n||s){i.preventDefault(),i.stopPropagation();return}t()},[n,s,t]),o=n||s;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:Hn.passwordToggle,onClick:r,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(Pe,{icon:e?"wm-visibility":"wm-visibility-off"})})});Po.displayName="PasswordToggle";const Qe=h.memo(h.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:s,iconPosition:r="left",variant:o="flat",type:i,readonly:u,invalid:l,id:c,...d},w)=>{const f=h.useId(),p=c||f;if(i==="submit")return a.jsx(De,{className:e,id:p,"aria-label":d["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:d.disabled,children:t||"Submit"});const[g,b]=h.useState(!1),v=h.useCallback(()=>{b(T=>!T)},[]),{finalIcon:N,finalIconPosition:y}=h.useMemo(()=>i==="password"?{finalIcon:a.jsx(Po,{showPassword:g,onToggle:v,readOnly:u,disabled:d.disabled}),finalIconPosition:"right"}:{finalIcon:s,finalIconPosition:r},[i,s,r,g,v]),C=h.useMemo(()=>i==="password"&&g?"text":i,[i,g]),S=h.useMemo(()=>m(Hn.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:Hn.wuInputGroup,"data-label-position":n,"data-icon-position":N&&y,children:[N&&a.jsx("span",{className:Hn.wuInputIcon,children:N}),a.jsx(_o,{ref:w,className:S,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:p,...d}),t&&a.jsx(Ae,{htmlFor:p,children:t})]})}));Qe.displayName="WuInput";const Vo="yyyy-MM-dd",tf=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],nf=({current:e,onSelect:t,presetRanges:n=iw})=>{const[s,r]=h.useState(),[o,i]=h.useState(!1),[u,l]=h.useState(""),[c,d]=h.useState(""),[w,f]=h.useState(!1),p=h.useMemo(()=>n.map(y=>y.value),[n]),g=m("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"),b=h.useCallback(y=>{if(y===void 0){r(void 0),i(!0);return}const C=Number(y)-1;r(C),i(!1),t({from:z.sub(new Date,{days:C}),to:new Date})},[t]),v=h.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Hs).test(y))return!1;const T=new Date(C==="start"?y:e.from),A=new Date(C==="end"?y:e.to);return z.isBefore(A,T)?(f(!0),!1):(f(!1),!(z.isSameDay(T,e.from)&&z.isSameDay(A,e.to)))},[e]),N=h.useCallback((y,C)=>{if((C==="start"?l:d)(y),v(y,C)){const T={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(T.from=new Date(y)),C==="end"&&(T.to=new Date(y)),t(T)}},[e,t,v]);return h.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&z.isValid(e.to)&&z.isValid(e.from)){l(z.format(e.from,Vo)),d(z.format(e.to,Vo));const y=z.differenceInCalendarDays(e.to,e.from);z.isToday(e.to)&&p.includes(y+1)?(r(y),i(!1)):(r(void 0),i(!0))}},[e,p]),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:tf.map(({label:y,value:C})=>a.jsx(Tt,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:C})=>a.jsx("li",{children:a.jsx("button",{className:m(g,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:m(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),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(Qe,{placeholder:"Start Date",pattern:Hs,value:u,onChange:y=>N(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Qe,{placeholder:"End Date",pattern:Hs,value:c,onChange:y=>N(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"})]})]})},sf=({Trigger:e,children:t,className:n,dir:s,open:r,onOpenChange:o,modal:i,...u})=>a.jsxs(Ue,{open:r,onOpenChange:o,modal:i,children:[a.jsx(wt,{asChild:!0,dir:s,children:e}),a.jsx(Be,{className:m("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:s,...u,children:t})]}),tr=e=>a.jsx($t.PopoverClose,{asChild:!0,children:a.jsx(De,{...e})}),Et={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},rf=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],Ne=e=>{if(!e)return"";try{const t=new Date(e);if(!z.isValid(t))return"";const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${r}`}catch{return""}},Oo=e=>{if(!e)return null;try{const t=z.parseISO(e);return z.isValid(t)?z.startOfDay(t):null}catch{return null}},af=(e,t,n)=>!(t&&e<z.startOfDay(t)||n&&e>z.startOfDay(n)),Fo=e=>z.sub(new Date,{days:e}),Wo=e=>e?z.sub(new Date,{days:1}):new Date;function of({ranges:e=rf,excludeToday:t=!0,current:n,onSelect:s,onReset:r,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...c}){const[d,w]=h.useState(Ne(n==null?void 0:n.from)||Ne(l)),[f,p]=h.useState(Ne(n==null?void 0:n.to)||Ne(u)),[g,b]=h.useState(!1),[v,N]=h.useState(""),[y,C]=h.useState("");h.useEffect(()=>{w(Ne(n==null?void 0:n.from)||Ne(l)),p(Ne(n==null?void 0:n.to)||Ne(u)),N(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const S=h.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const M=z.differenceInCalendarDays(n.to,n.from)+1;return e.find(_=>_.value===M)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),T=h.useCallback(M=>{const _=Fo(M),P=Wo(t);w(Ne(_)),p(Ne(P)),N(""),C(""),b(!1),s==null||s({from:_,to:P})},[t,s]),A=h.useCallback((M,_)=>{const P=Oo(M);if(_==="start"?(w(M),N("")):(p(M),C("")),!P){if(M){const L="Please enter a valid date";_==="start"?N(L):C(L)}return}if(!af(P,l,u)){const L=l&&P<z.startOfDay(l)?`Date must be on or after ${z.format(l,"MMM d, yyyy")}`:`Date must be on or before ${z.format(u,"MMM d, yyyy")}`;_==="start"?N(L):C(L);return}const O=Oo(_==="start"?f:d);_==="start"&&O?P<=O?s==null||s({from:P,to:O}):N("Start date must be before or equal to end date"):_==="end"&&O&&(P>=O?s==null||s({from:O,to:P}):C("End date must be after or equal to start date"))},[d,f,s,l,u]),D=h.useMemo(()=>e.map(M=>{const _=Fo(M.value),P=Wo(t);return{...M,displayStartDate:z.format(_,"MMM d, yyyy"),displayEndDate:z.format(P,"MMM d, yyyy")}}),[e,t]),k=g||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!S;return a.jsxs("div",{className:Et.wuDateRangeNativeSidebar,...c,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>b(!0),"data-selected":k,"aria-pressed":k,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:Et.customInputs,"data-expanded":k,children:[a.jsxs("div",{className:Et.inputsRow,children:[a.jsx(Qe,{type:"date",value:d,onChange:M=>A(M.target.value,"start"),Label:"Start",min:Ne(l),max:Ne(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Qe,{type:"date",value:f,onChange:M=>A(M.target.value,"end"),Label:"End",min:d||Ne(l),max:Ne(u),"aria-describedby":y?"end-date-error":void 0})]}),(v||y)&&a.jsxs("div",{className:Et.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:Et.errorText,children:v}),y&&a.jsx("p",{id:"end-date-error",className:Et.errorText,children:y})]})]}),D.map(M=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>T(M.value),"data-selected":!k&&(S==null?void 0:S.value)===M.value,"aria-pressed":!k&&(S==null?void 0:S.value)===M.value,"aria-label":`Select ${M.label}`,children:[M.label," ",a.jsxs("small",{children:["(",M.displayStartDate," - ",M.displayEndDate,")"]})]})},M.value))]}),a.jsxs("footer",{children:[i&&a.jsx(tr,{variant:"secondary",Icon:a.jsx(Pe,{icon:"wm-refresh"}),onClick:r,children:"Reset"}),a.jsx(tr,{onClick:o,disabled:!!(v||y),children:"Apply"})]})]})}const uf=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:s,minDate:r=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:c,Label:d,labelPosition:w="top",onReset:f,showResetButton:p=!0,placeholder:g="Select Date Range",CustomTrigger:b,native:v,...N})=>{const[y,C]=h.useState(t),[S,T]=h.useState(t),[A,D]=h.useState(""),k=h.useCallback(()=>{if(S){const P=S.from,E=S.to;C({from:P,to:E}),D(`${z.format(P,e)} - ${z.format(E,e)}`),n&&n({from:P,to:E})}},[S,e,n]),M=h.useCallback(()=>{T(y)},[y]),_=h.useCallback(()=>{f?f():(C(void 0),T(void 0),D(""),n&&n(void 0))},[f,n]);return h.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const P=kn(t.from),E=kn(t.to);C(t),T(t),D(`${z.format(P,e)} - ${z.format(E,e)}`)}else C(void 0),T({to:new Date,from:new Date})},[t,e]),a.jsxs(Ae,{className:m("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(Ue,{onOpenChange:P=>!P&&M(),children:[a.jsx($s,{formattedString:A,dir:i,placeholder:g,CustomTrigger:b,...N}),a.jsx(Be,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:"start",sideOffset:-.5,dir:i,children:v?a.jsx(of,{current:S,onSelect:P=>{T(P)},ranges:c,onApply:k,onReset:_,showResetButton:p,minDate:r,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(nf,{current:S,onSelect:T,presetRanges:c}),a.jsx(qs,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:T,disabled:P=>ro(P,s,r,o),startMonth:r,endMonth:o,required:!0,autoFocus:!0,defaultMonth:y==null?void 0:y.from,className:m("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(so,{handleDateChange:k,disabled:s,onReset:_,showResetButton:p})})]})})]})]})},Lo=h.forwardRef((e,t)=>{const{className:n,rounded:s,...r}=e;return a.jsx("div",{className:m("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",s?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...r})});Lo.displayName="WuCard";const Bo=h.forwardRef((e,t)=>{const{className:n,...s}=e;return a.jsx("div",{ref:t,...s,className:m("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Bo.displayName="WuCardHeader";const qo=h.forwardRef((e,t)=>{const{className:n,...s}=e;return a.jsx("div",{ref:t,...s,className:m("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});qo.displayName="WuCardHeader";const $o=x.forwardRef(({className:e,partial:t,...n},s)=>a.jsx(Es.Root,{ref:s,className:m("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(Es.Indicator,{className:m("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"})]})}));$o.displayName=Es.Root.displayName;const qe=h.forwardRef((e,t)=>{const{disabled:n,checked:s,Label:r,labelPosition:o="right",className:i,id:u=Ds(),partial:l,onChange:c,required:d,readonly:w,...f}=e;return h.useEffect(()=>{f.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[f.defaultChecked,s]),a.jsxs("div",{className:lf({labelPosition:o,className:"wu-checkbox-container"}),dir:f.dir,children:[a.jsx($o,{id:u,...f,partial:l,checked:s,disabled:n||w,onCheckedChange:c,className:m("wu-peer wu-checkbox",i),required:d,ref:t}),r&&a.jsx(Ae,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:r})]})}),lf=Le.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"}}});qe.displayName="WuCheckbox";const cf=e=>{const{className:t,children:n,...s}=e;return a.jsx("span",{...s,className:m("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})},nr=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));nr.displayName=xe.Command.displayName;const Ho=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(xe.Command.Input,{ref:n,className:m("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})}));Ho.displayName=xe.Command.Input.displayName;const sr=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.List,{ref:n,className:m("",e),...t}));sr.displayName=xe.Command.List.displayName;const rr=x.forwardRef((e,t)=>a.jsx(xe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));rr.displayName=xe.Command.Empty.displayName;const Rt=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Group,{ref:n,className:m("",e),...t}));Rt.displayName=xe.Command.Group.displayName;const ar=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Separator,{ref:n,className:m("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));ar.displayName=xe.Command.Separator.displayName;const en=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Item,{ref:n,className:m("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}));en.displayName=xe.Command.Item.displayName;const zo=(e,t,n,s)=>h.useMemo(()=>{if(!e||!n||t.length===0)return t;const r=Array.isArray(n)?n:[n];if(r.length===0)return t;const o=new Set(r.map(c=>String(c[s.value]))),i=[],u=[],l=[];return t.forEach(c=>{const d=c[s.value];d===void 0?i.push(c):o.has(String(d))?u.push(c):l.push(c)}),[...i,...u,...l]},[t,n,s.value,e]),Mt=h.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:s,className:r,style:o},i)=>a.jsx(Ba.Virtuoso,{ref:i,dir:s,className:r,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));Mt.displayName="WuVirtualScroll";const df=({tags:e,triggerRef:t})=>{const[n,s]=h.useState([]),[r,o]=h.useState([]),i=h.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:r.map((l,c)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},c))}),[r]),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 h.useEffect(()=>{const l=()=>{if(t.current){const f=t.current.offsetWidth-20-36;let p=0;const g=[],b=[];e.forEach(v=>{const N=u(v);p+N+8<f?(g.push(v),p+=N+8):b.push(v)}),s(g),o(b)}};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)),r.length>0&&a.jsx(An,{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:["+",r.length]})})]})},wf=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:s="flat",dir:r="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,className:w,...f})=>{const[p,g]=h.useState([]),b=h.useRef(null);h.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){g([]);return}if(i){const N=n;g(N==null?void 0:N.map(y=>y[o.label]));return}else g([n[o.label]])},[n]);const v=()=>{var N;return p.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:`${(((N=b.current)==null?void 0:N.offsetWidth)||0)-32}px`},children:p.join(", ")}):a.jsx(df,{tags:p,triggerRef:b}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(wt,{dir:r,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...f,ref:b,disabled:l,className:m("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",s==="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:[v(),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"})]})})},Uo=ne.Root,jo=ne.Trigger,Go=ne.Group,ff=ne.Portal,pf=ne.Sub,hf=ne.RadioGroup,Ko=x.forwardRef(({className:e,inset:t,children:n,position:s,...r},o)=>a.jsxs(ne.SubTrigger,{ref:o,className:m("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),...r,children:[s==="left"&&a.jsx("span",{className:m("wm-chevron-right",r.dir==="rtl"&&"ml-2")}),n,s!=="left"&&a.jsx("span",{className:m("wu-text-base wu-leading-4",r.dir==="rtl"&&"wu-mr-auto wm-chevron-left",r.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ko.displayName=ne.SubTrigger.displayName;const Yo=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.SubContent,{ref:n,className:m("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}));Yo.displayName=ne.SubContent.displayName;const or=x.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(ne.Portal,{children:a.jsx(ne.Content,{ref:s,sideOffset:t,className:m("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})}));or.displayName=ne.Content.displayName;const zn=x.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(ne.Item,{ref:s,className:m("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}));zn.displayName=ne.Item.displayName;const Xo=x.forwardRef(({className:e,children:t,checked:n,dir:s,...r},o)=>a.jsxs(ne.CheckboxItem,{ref:o,className:m("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",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...r,children:[a.jsx("span",{className:m("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",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:a.jsx(ne.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Xo.displayName=ne.CheckboxItem.displayName;const Zo=x.forwardRef(({className:e,children:t,...n},s)=>a.jsxs(ne.RadioItem,{ref:s,className:m("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(ne.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]}));Zo.displayName=ne.RadioItem.displayName;const tn=x.forwardRef(({className:e,inset:t,...n},s)=>a.jsx(ne.Label,{ref:s,className:m("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));tn.displayName=ne.Label.displayName;const Un=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.Separator,{ref:n,className:m("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Un.displayName=ne.Separator.displayName;const Jo=({option:e,value:t,multiple:n=!1,onSelect:s,accessorKey:r,dir:o})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[r.value])):JSON.stringify(t[r.value]))},[t,r.value,n]);const l=n?i.includes(JSON.stringify(e[r.value])):i===JSON.stringify(e[r.value]),c=()=>{e.disabled||s(e)};return a.jsxs(en,{onSelect:c,disabled:e.disabled,className:m("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(qe,{checked:l}),a.jsx(mf,{option:e,accessorKey:r})]})},mf=({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"})]})},Qo=e=>{const{option:t,selectAll:n,handleSelectAll:s,isCheckedAll:r,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(en,{onSelect:s,className:m("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(qe,{checked:r||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(Rt,{children:[a.jsx(tn,{children:t.label}),t.options.map((l,c)=>h.createElement(Jo,{...i,option:l,key:c}))]});case"divider":return a.jsx(ar,{className:"wu-mx-4"});default:return a.jsx(Jo,{...i,option:t})}},gf=e=>{const t=[],n=[],s=[],r=[];return e.forEach(o=>{o.type==="group"?(t.push(o),s.push(...o.options),r.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):s.push(o),o!=null&&o.disabled||r.push(o)}),{groups:t,dividers:n,allOptions:s,enabledOptions:r}},bf=h.memo(Qe),yf=({data:e,accessorKey:t,value:n,defaultValue:s,Header:r,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:c,onSelect:d,Label:w,maxHeight:f=420,multiple:p=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:N,labelPosition:y="top",className:C,onScroll:S,maxContentWidth:T,enableSearch:A=!0,noDataContent:D,selectedToTop:k=!1,...M})=>{const[_,P]=h.useState(""),[E,O]=h.useState(),[L,F]=h.useState(!1),[B,W]=h.useState(!1),[$,G]=h.useState(!1),Z=h.useRef(null),{allOptions:U,enabledOptions:J}=h.useMemo(()=>g||b&&!b.includeDisabled?gf(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ie=h.useMemo(()=>{if(!_)return e;const j=_.toLowerCase();return U.filter(ee=>ee[t.label].toLowerCase().includes(j))},[_,U,e,t.label]),fe=h.useMemo(()=>p&&b!=null&&b.enable&&!_&&ie.length>0?[{type:"all"},...ie]:ie,[ie,_,p]),Se=zo(k,fe,E,t),V=h.useCallback(j=>{const ee=j[t.value];p?O(Q=>{const be=Q||[],Ce=be.some(Te=>Te[t.value]===ee)?be.filter(Te=>Te[t.value]!==ee):[...be,j];return d==null||d(Ce),Ce}):(F(!1),O(j),d==null||d(j))},[p,t.value,d]),H=h.useCallback(j=>P(j.target.value),[]),Y=h.useCallback(()=>P(""),[]);h.useEffect(()=>{if(n!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?O(n):s!==void 0&&O(s)},[n,s]),h.useEffect(()=>{if(!p)return;const j=b!=null&&b.includeDisabled?(E==null?void 0:E.length)===U.length:(E==null?void 0:E.length)===J.length;W(j);const ee=(E==null?void 0:E.length)>0&&!j;G(ee)},[E,b]);const K=h.useCallback(()=>{const j=B?[]:b!=null&&b.includeDisabled?U:J;O(j),d==null||d(j)},[B,p,U,J,d,b]),me=Dn(y);return a.jsxs("div",{className:m(me,"wu-flex wu-combobox-container"),ref:Z,children:[a.jsxs(Ue,{onOpenChange:j=>{j&&Y(),F(j)},open:L,modal:!0,children:[a.jsx(wf,{selectedOptions:E,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:c,multiple:p,disabled:N,selectAll:b,isCheckedAll:B,className:C,id:v,...M}),a.jsx(Be,{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:T},children:a.jsxs(nr,{id:v,children:[A&&a.jsx("div",{className:"wu-m-2",children:a.jsx(bf,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:H,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),r,a.jsxs(sr,{children:[a.jsx(rr,{children:D||"No results found."}),Se.length>=o?a.jsx(Mt,{className:"wu-combobox-list",containerHeight:f,list:Se,callback:(j,ee)=>a.jsx(Qo,{option:ee,value:E,onSelect:V,multiple:p,accessorKey:t,dir:c,selectAll:b,handleSelectAll:K,isCheckedAll:B,isPartialSelected:$},j),dir:c}):a.jsx("div",{style:{height:"fit-content",maxHeight:f,overflow:"auto"},className:"wu-combobox-list",onScroll:S,children:Se.map(j=>{const ee=j,Q=String(ee[t.value]??ee.type);return a.jsx(Qo,{option:ee,value:E,onSelect:V,multiple:p,accessorKey:t,dir:c,selectAll:b,handleSelectAll:K,isCheckedAll:B,isPartialSelected:$},Q)})})]})]})})]}),w&&a.jsx(Ae,{htmlFor:v,className:"wu-combobox-label",children:w})]})},vf=e=>{const{textToCopy:t,notificationText:n,...s}=e,[r,o]=h.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(De,{...s,onClick:i,variant:"iconOnly",className:m("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:m("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",r?"wu-block":"wu-hidden"),children:n}),a.jsx(Pe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Ro=te.Root,xf=te.Trigger,Nf=te.Close,Sf=te.Portal,ei=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{className:m("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}));ei.displayName=te.Overlay.displayName;const Cf=Le.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"}}),ir=x.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:s,overlayClassName:r,closeButtonClassName:o,...i},u)=>a.jsxs(Sf,{children:[a.jsx(ei,{className:r}),a.jsxs(te.Content,{ref:u,className:m(Cf({side:e}),t),...i,children:[n,!s&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Tt,{variant:"iconOnly",className:m("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"})]})})]})]}));ir.displayName=te.Content.displayName;const ti=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-semibold",e),...t}));ti.displayName=te.Title.displayName;const Tf=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm",e),...t}));Tf.displayName=te.Description.displayName;const Ef=e=>t=>{e&&t.preventDefault()},Mf=e=>{const{Trigger:t,children:n,hideCloseButton:s,className:r,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:c,closeButtonClassName:d,...w}=e;return a.jsxs(Ro,{open:i,onOpenChange:u,children:[a.jsx(xf,{asChild:!0,children:t}),a.jsxs(ir,{onInteractOutside:Ef(l),side:o,className:m("wu-bg-white wu-text-gray-lead wu-px-0",r),hideCloseButton:s,overlayClassName:c,closeButtonClassName:d,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(ti,{})}),n]})]})},If=({children:e,...t})=>a.jsx(Nf,{...t,children:e}),ni=h.createContext({});function ur(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const si=typeof window<"u",ri=si?h.useLayoutEffect:h.useEffect,jn=h.createContext(null);function Df(e,t){e.indexOf(t)===-1&&e.push(t)}function Af(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Re=(e,t,n)=>n>t?t:n<e?e:n;function lr(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let nn=()=>{},pt=()=>{};typeof process<"u"&&((hd=process.env)==null?void 0:hd.NODE_ENV)!=="production"&&(nn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(lr(t,n))},pt=(e,t,n)=>{if(!e)throw new Error(lr(t,n))});const Ye={},ai=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function kf(e){return typeof e=="object"&&e!==null}const oi=e=>/^0[^.\s]+$/u.test(e);function cr(e){let t;return()=>(t===void 0&&(t=e()),t)}const It=e=>e,_f=(e,t)=>n=>t(e(n)),Gn=(...e)=>e.reduce(_f),ii=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class ui{constructor(){this.subscriptions=[]}add(t){return Df(this.subscriptions,t),()=>Af(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let o=0;o<r;o++){const i=this.subscriptions[o];i&&i(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ge=e=>e*1e3,$e=e=>e/1e3;function li(e,t){return t?e*(1e3/t):0}const ci=new Set;function di(e,t,n){e||ci.has(t)||(console.warn(lr(t,n)),ci.add(t))}const wi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Pf=1e-7,Vf=12;function Of(e,t,n,s,r){let o,i,u=0;do i=t+(n-t)/2,o=wi(i,s,r)-e,o>0?n=i:t=i;while(Math.abs(o)>Pf&&++u<Vf);return i}function sn(e,t,n,s){if(e===t&&n===s)return It;const r=o=>Of(o,0,1,e,n);return o=>o===0||o===1?o:wi(r(o),t,s)}const fi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pi=e=>t=>1-e(1-t),hi=sn(.33,1.53,.69,.99),dr=pi(hi),mi=fi(dr),gi=e=>(e*=2)<1?.5*dr(e):.5*(2-Math.pow(2,-10*(e-1))),wr=e=>1-Math.sin(Math.acos(e)),Ff=pi(wr),bi=fi(wr),Wf=sn(.42,0,1,1),Lf=sn(0,0,.58,1),yi=sn(.42,0,.58,1),Bf=e=>Array.isArray(e)&&typeof e[0]!="number",vi=e=>Array.isArray(e)&&typeof e[0]=="number",xi={linear:It,easeIn:Wf,easeInOut:yi,easeOut:Lf,circIn:wr,circInOut:bi,circOut:Ff,backIn:dr,backInOut:mi,backOut:hi,anticipate:gi},qf=e=>typeof e=="string",Ni=e=>{if(vi(e)){pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return sn(t,n,s,r)}else if(qf(e))return pt(xi[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),xi[e];return e},Kn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $f(e,t){let n=new Set,s=new Set,r=!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,f=!1)=>{const g=f&&r?n:s;return w&&i.add(d),g.has(d)||g.add(d),d},cancel:d=>{s.delete(d),i.delete(d)},process:d=>{if(u=d,r){o=!0;return}r=!0,[n,s]=[s,n],n.forEach(l),n.clear(),r=!1,o&&(o=!1,c.process(d))}};return c}const Hf=40;function Si(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Kn.reduce((C,S)=>(C[S]=$f(o),C),{}),{setup:u,read:l,resolveKeyframes:c,preUpdate:d,update:w,preRender:f,render:p,postRender:g}=i,b=()=>{const C=Ye.useManualTiming?r.timestamp:performance.now();n=!1,Ye.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(C-r.timestamp,Hf),1)),r.timestamp=C,r.isProcessing=!0,u.process(r),l.process(r),c.process(r),d.process(r),w.process(r),f.process(r),p.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(b))},v=()=>{n=!0,s=!0,r.isProcessing||e(b)};return{schedule:Kn.reduce((C,S)=>{const T=i[S];return C[S]=(A,D=!1,k=!1)=>(n||v(),T.schedule(A,D,k)),C},{}),cancel:C=>{for(let S=0;S<Kn.length;S++)i[Kn[S]].cancel(C)},state:r,steps:i}}const{schedule:He,cancel:fr,state:Yn}=Si(typeof requestAnimationFrame<"u"?requestAnimationFrame:It,!0);let Xn;function zf(){Xn=void 0}const _e={now:()=>(Xn===void 0&&_e.set(Yn.isProcessing||Ye.useManualTiming?Yn.timestamp:performance.now()),Xn),set:e=>{Xn=e,queueMicrotask(zf)}},Ci=e=>t=>typeof t=="string"&&t.startsWith(e),Ti=Ci("--"),Uf=Ci("var(--"),pr=e=>Uf(e)?jf.test(e.split("/*")[0].trim()):!1,jf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ei(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Dt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},rn={...Dt,transform:e=>Re(0,1,e)},Zn={...Dt,default:1},an=e=>Math.round(e*1e5)/1e5,hr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Gf(e){return e==null}const Kf=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mr=(e,t)=>n=>!!(typeof n=="string"&&Kf.test(n)&&n.startsWith(e)||t&&!Gf(n)&&Object.prototype.hasOwnProperty.call(n,t)),Mi=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,o,i,u]=s.match(hr);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},Yf=e=>Re(0,255,e),gr={...Dt,transform:e=>Math.round(Yf(e))},ht={test:mr("rgb","red"),parse:Mi("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+gr.transform(e)+", "+gr.transform(t)+", "+gr.transform(n)+", "+an(rn.transform(s))+")"};function Xf(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const br={test:mr("#"),parse:Xf,transform:ht.transform},on=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=on("deg"),At=on("%"),q=on("px"),Zf=on("vh"),Jf=on("vw"),Ii={...At,parse:e=>At.parse(e)/100,transform:e=>At.transform(e*100)},kt={test:mr("hsl","hue"),parse:Mi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+At.transform(an(t))+", "+At.transform(an(n))+", "+an(rn.transform(s))+")"},de={test:e=>ht.test(e)||br.test(e)||kt.test(e),parse:e=>ht.test(e)?ht.parse(e):kt.test(e)?kt.parse(e):br.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ht.transform(e):kt.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},Qf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rf(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(hr))==null?void 0:t.length)||0)+(((n=e.match(Qf))==null?void 0:n.length)||0)>0}const Di="number",Ai="color",ep="var",tp="var(",ki="${}",np=/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 un(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let o=0;const u=t.replace(np,l=>(de.test(l)?(s.color.push(o),r.push(Ai),n.push(de.parse(l))):l.startsWith(tp)?(s.var.push(o),r.push(ep),n.push(l)):(s.number.push(o),r.push(Di),n.push(parseFloat(l))),++o,ki)).split(ki);return{values:n,split:u,indexes:s,types:r}}function _i(e){return un(e).values}function Pi(e){const{split:t,types:n}=un(e),s=t.length;return r=>{let o="";for(let i=0;i<s;i++)if(o+=t[i],r[i]!==void 0){const u=n[i];u===Di?o+=an(r[i]):u===Ai?o+=de.transform(r[i]):o+=r[i]}return o}}const sp=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e;function rp(e){const t=_i(e);return Pi(e)(t.map(sp))}const tt={test:Rf,parse:_i,createTransformer:Pi,getAnimatableNone:rp};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 ap({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,o=0,i=0;if(!t)r=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;r=yr(l,u,e+1/3),o=yr(l,u,e),i=yr(l,u,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:s}}function Jn(e,t){return n=>n>0?t:e}const ln=(e,t,n)=>e+(t-e)*n,vr=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},op=[br,ht,kt],ip=e=>op.find(t=>t.test(e));function Vi(e){const t=ip(e);if(nn(!!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===kt&&(n=ap(n)),n}const Oi=(e,t)=>{const n=Vi(e),s=Vi(t);if(!n||!s)return Jn(e,t);const r={...n};return o=>(r.red=vr(n.red,s.red,o),r.green=vr(n.green,s.green,o),r.blue=vr(n.blue,s.blue,o),r.alpha=ln(n.alpha,s.alpha,o),ht.transform(r))},xr=new Set(["none","hidden"]);function up(e,t){return xr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function lp(e,t){return n=>ln(e,t,n)}function Nr(e){return typeof e=="number"?lp:typeof e=="string"?pr(e)?Jn:de.test(e)?Oi:wp:Array.isArray(e)?Fi:typeof e=="object"?de.test(e)?Oi:cp:Jn}function Fi(e,t){const n=[...e],s=n.length,r=e.map((o,i)=>Nr(o)(o,t[i]));return o=>{for(let i=0;i<s;i++)n[i]=r[i](o);return n}}function cp(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Nr(e[r])(e[r],t[r]));return r=>{for(const o in s)n[o]=s[o](r);return n}}function dp(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],i=e.indexes[o][s[o]],u=e.values[i]??0;n[r]=u,s[o]++}return n}const wp=(e,t)=>{const n=tt.createTransformer(t),s=un(e),r=un(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?xr.has(e)&&!r.values.length||xr.has(t)&&!s.values.length?up(e,t):Gn(Fi(dp(s,r),r.values),n):(nn(!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 Wi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ln(e,t,n):Nr(e)(e,t)}const fp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>He.update(t,n),stop:()=>fr(t),now:()=>Yn.isProcessing?Yn.timestamp:_e.now()}},Li=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)s+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Qn=2e4;function Sr(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Qn;)t+=n,s=e.next(t);return t>=Qn?1/0:t}function pp(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Sr(s),Qn);return{type:"keyframes",ease:o=>s.next(r*o).value/t,duration:$e(r)}}const hp=5;function Bi(e,t,n){const s=Math.max(t-hp,0);return li(n-e(s),t-s)}const oe={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},Cr=.001;function mp({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:s=oe.mass}){let r,o;nn(e<=Ge(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Re(oe.minDamping,oe.maxDamping,i),e=Re(oe.minDuration,oe.maxDuration,$e(e)),i<1?(r=c=>{const d=c*i,w=d*e,f=d-n,p=Tr(c,i),g=Math.exp(-w);return Cr-f/p*g},o=c=>{const w=c*i*e,f=w*n+n,p=Math.pow(i,2)*Math.pow(c,2)*e,g=Math.exp(-w),b=Tr(Math.pow(c,2),i);return(-r(c)+Cr>0?-1:1)*((f-p)*g)/b}):(r=c=>{const d=Math.exp(-c*e),w=(c-n)*e+1;return-Cr+d*w},o=c=>{const d=Math.exp(-c*e),w=(n-c)*(e*e);return d*w});const u=5/e,l=bp(r,o,u);if(e=Ge(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:i*2*Math.sqrt(s*c),duration:e}}}const gp=12;function bp(e,t,n){let s=n;for(let r=1;r<gp;r++)s=s-e(s)/t(s);return s}function Tr(e,t){return e*Math.sqrt(1-t*t)}const yp=["duration","bounce"],vp=["stiffness","damping","mass"];function qi(e,t){return t.some(n=>e[n]!==void 0)}function xp(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!qi(e,vp)&&qi(e,yp))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,o=2*Re(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:oe.mass,stiffness:r,damping:o}}else{const n=mp(e);t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function Rn(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=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:f,isResolvedFromDuration:p}=xp({...n,velocity:-$e(n.velocity||0)}),g=f||0,b=c/(2*Math.sqrt(l*d)),v=i-o,N=$e(Math.sqrt(l/d)),y=Math.abs(v)<5;s||(s=y?oe.restSpeed.granular:oe.restSpeed.default),r||(r=y?oe.restDelta.granular:oe.restDelta.default);let C;if(b<1){const T=Tr(N,b);C=A=>{const D=Math.exp(-b*N*A);return i-D*((g+b*N*v)/T*Math.sin(T*A)+v*Math.cos(T*A))}}else if(b===1)C=T=>i-Math.exp(-N*T)*(v+(g+N*v)*T);else{const T=N*Math.sqrt(b*b-1);C=A=>{const D=Math.exp(-b*N*A),k=Math.min(T*A,300);return i-D*((g+b*N*v)*Math.sinh(k)+T*v*Math.cosh(k))/T}}const S={calculatedDuration:p&&w||null,next:T=>{const A=C(T);if(p)u.done=T>=w;else{let D=T===0?g:0;b<1&&(D=T===0?Ge(g):Bi(C,T,A));const k=Math.abs(D)<=s,M=Math.abs(i-A)<=r;u.done=k&&M}return u.value=u.done?i:A,u},toString:()=>{const T=Math.min(Sr(S),Qn),A=Li(D=>S.next(T*D).value,T,30);return T+"ms "+A},toTransition:()=>{}};return S}Rn.applyToOptions=e=>{const t=pp(e,100,Rn);return e.ease=t.ease,e.duration=Ge(t.duration),e.type="keyframes",e};function Er({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:c=.5,restSpeed:d}){const w=e[0],f={done:!1,value:w},p=k=>u!==void 0&&k<u||l!==void 0&&k>l,g=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let b=n*t;const v=w+b,N=i===void 0?v:i(v);N!==v&&(b=N-w);const y=k=>-b*Math.exp(-k/s),C=k=>N+y(k),S=k=>{const M=y(k),_=C(k);f.done=Math.abs(M)<=c,f.value=f.done?N:_};let T,A;const D=k=>{p(f.value)&&(T=k,A=Rn({keyframes:[f.value,g(f.value)],velocity:Bi(C,k,f.value),damping:r,stiffness:o,restDelta:c,restSpeed:d}))};return D(0),{calculatedDuration:null,next:k=>{let M=!1;return!A&&T===void 0&&(M=!0,S(k),D(k)),T!==void 0&&k>=T?A.next(k-T):(!M&&S(k),f)}}}function Np(e,t,n){const s=[],r=n||Ye.mix||Wi,o=e.length-1;for(let i=0;i<o;i++){let u=r(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||It:t;u=Gn(l,u)}s.push(u)}return s}function Sp(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const o=e.length;if(pt(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=Np(t,s,r),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 f=ii(e[w],e[w+1],d);return u[w](f)};return n?d=>c(Re(e[0],e[o-1],d)):c}function Cp(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=ii(0,t,s);e.push(ln(n,1,r))}}function Tp(e){const t=[0];return Cp(t,e.length-1),t}function Ep(e,t){return e.map(n=>n*t)}function Mp(e,t){return e.map(()=>t||yi).splice(0,e.length-1)}function _t({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Bf(s)?s.map(Ni):Ni(s),o={done:!1,value:t[0]},i=Ep(n&&n.length===t.length?n:Tp(t),e),u=Sp(i,t,{ease:Array.isArray(r)?r:Mp(t,r)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const Ip=e=>e!==null;function Mr(e,{repeat:t,repeatType:n="loop"},s,r=1){const o=e.filter(Ip),u=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||s===void 0?o[u]:s}const Dp={decay:Er,inertia:Er,tween:_t,keyframes:_t,spring:Rn};function $i(e){typeof e.type=="string"&&(e.type=Dp[e.type])}class Ir{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 Ap=e=>e/100;class Dr extends Ir{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==_e.now()&&this.tick(_e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;$i(t);const{type:n=_t,repeat:s=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||_t;process.env.NODE_ENV!=="production"&&l!==_t&&pt(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==_t&&typeof u[0]!="number"&&(this.mixKeyframes=Gn(Ap,Wi(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=Sr(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(s+1)-r,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:s,totalDuration:r,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:d,repeat:w,repeatType:f,repeatDelay:p,type:g,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?N<0:N>r;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let C=this.currentTime,S=s;if(w){const k=Math.min(this.currentTime,r)/u;let M=Math.floor(k),_=k%1;!_&&k>=1&&(_=1),_===1&&M--,M=Math.min(M,w+1),!!(M%2)&&(f==="reverse"?(_=1-_,p&&(_-=p/u)):f==="mirror"&&(S=i)),C=Re(0,1,_)*u}const T=y?{done:!1,value:d[0]}:S.next(C);o&&(T.value=o(T.value));let{done:A}=T;!y&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return D&&g!==Er&&(T.value=Mr(d,this.options,v,this.speed)),b&&b(T.value),D&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return $e(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+$e(t)}get time(){return $e(this.currentTime)}set time(t){var n;t=Ge(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(_e.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=$e(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:t=fp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(r=this.options).onPlay)==null||o.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(_e.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 kp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const mt=e=>e*180/Math.PI,Ar=e=>{const t=mt(Math.atan2(e[1],e[0]));return kr(t)},_p={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ar,rotateZ:Ar,skewX:e=>mt(Math.atan(e[1])),skewY:e=>mt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kr=e=>(e=e%360,e<0&&(e+=360),e),Hi=Ar,zi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ui=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Pp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zi,scaleY:Ui,scale:e=>(zi(e)+Ui(e))/2,rotateX:e=>kr(mt(Math.atan2(e[6],e[5]))),rotateY:e=>kr(mt(Math.atan2(-e[2],e[0]))),rotateZ:Hi,rotate:Hi,skewX:e=>mt(Math.atan(e[4])),skewY:e=>mt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _r(e){return e.includes("scale")?1:0}function Pr(e,t){if(!e||e==="none")return _r(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Pp,r=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=_p,r=u}if(!r)return _r(t);const o=s[t],i=r[1].split(",").map(Op);return typeof o=="function"?o(i):i[o]}const Vp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Pr(n,t)};function Op(e){return parseFloat(e.trim())}const Pt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(Pt),ji=e=>e===Dt||e===q,Fp=new Set(["x","y","z"]),Wp=Pt.filter(e=>!Fp.has(e));function Lp(e){const t=[];return Wp.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const nt={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})=>Pr(t,"x"),y:(e,{transform:t})=>Pr(t,"y")};nt.translateX=nt.x,nt.translateY=nt.y;const gt=new Set;let Vr=!1,Or=!1,Fr=!1;function Gi(){if(Or){const e=Array.from(gt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Lp(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([o,i])=>{var u;(u=s.getValue(o))==null||u.set(i)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Or=!1,Vr=!1,gt.forEach(e=>e.complete(Fr)),gt.clear()}function Ki(){gt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Or=!0)})}function Bp(){Fr=!0,Ki(),Gi(),Fr=!1}class Wr{constructor(t,n,s,r,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(gt.add(this),Vr||(Vr=!0,He.read(Ki),He.resolveKeyframes(Gi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const o=r==null?void 0:r.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const u=s.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),r&&o===void 0&&r.set(t[0])}kp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gt.delete(this)}cancel(){this.state==="scheduled"&&(gt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qp=e=>e.startsWith("--");function $p(e,t,n){qp(t)?e.style.setProperty(t,n):e.style[t]=n}const Hp=cr(()=>window.ScrollTimeline!==void 0),zp={};function Up(e,t){const n=cr(e);return()=>zp[t]??n()}const Yi=Up(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cn=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Xi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cn([0,.65,.55,1]),circOut:cn([.55,0,1,.45]),backIn:cn([.31,.01,.66,-.59]),backOut:cn([.33,1.53,.69,.99])};function Zi(e,t){if(e)return typeof e=="function"?Yi()?Li(e,t):"ease-out":vi(e)?cn(e):Array.isArray(e)?e.map(n=>Zi(n,t)||Xi.easeOut):Xi[e]}function jp(e,t,n,{delay:s=0,duration:r=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=Zi(u,r);Array.isArray(w)&&(d.easing=w);const f={delay:s,duration:r,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(d,f)}function Ji(e){return typeof e=="function"&&"applyToOptions"in e}function Gp({type:e,...t}){return Ji(e)&&Yi()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Qi extends Ir{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Gp(t);this.animation=jp(n,s,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Mr(r,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):$p(n,s,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,s,r;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return $e(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+$e(t)}get time(){return $e(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ge(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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Hp()?(this.animation.timeline=t,It):n(this)}}const Ri={anticipate:gi,backInOut:mi,circInOut:bi};function Kp(e){return e in Ri}function Yp(e){typeof e.ease=="string"&&Kp(e.ease)&&(e.ease=Ri[e.ease])}const Lr=10;class Xp extends Qi{constructor(t){Yp(t),$i(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new Dr({...i,autoplay:!1}),l=Math.max(Lr,_e.now()-this.startTime),c=Re(0,Lr,l-Lr);n.setWithVelocity(u.sample(Math.max(0,l-c)).value,u.sample(l).value,c),u.stop()}}const eu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(tt.test(e)||e==="0")&&!e.startsWith("url("));function Zp(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 Jp(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=eu(r,t),u=eu(o,t);return nn(i===u,`You are trying to animate ${t} from "${r}" to "${o}". "${i?o:r}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:Zp(e)||(n==="spring"||Ji(n))&&s}function Br(e){e.duration=0,e.type="keyframes"}const Qp=new Set(["opacity","clipPath","filter","transform"]),Rp=cr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function eh(e){var d;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,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 Rp()&&n&&Qp.has(n)&&(n!=="transform"||!c)&&!l&&!s&&r!=="mirror"&&o!==0&&i!=="inertia"}const th=40;class nh extends Ir{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:c,element:d,...w}){var g;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=_e.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:o,repeatType:i,name:l,motionValue:c,element:d,...w},p=(d==null?void 0:d.KeyframeResolver)||Wr;this.keyframeResolver=new p(u,(b,v,N)=>this.onKeyframesResolved(b,v,f,!N),l,c,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){var v,N;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:c,onUpdate:d}=s;this.resolvedAt=_e.now(),Jp(t,o,i,u)||((Ye.instantAnimations||!l)&&(d==null||d(Mr(t,s,n))),t[0]=t[t.length-1],Br(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>th?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},p=!c&&eh(f),g=(N=(v=f.motionValue)==null?void 0:v.owner)==null?void 0:N.current,b=p?new Xp({...f,element:g}):new Dr(f);b.finished.then(()=>{this.notifyFinished()}).catch(It),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}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(),Bp()),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()}}function tu(e,t,n,s=0,r=1){const o=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),i=e.size,u=(i-1)*s;return typeof n=="function"?n(o,i):r===1?o*s:u-o*s}const sh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rh(e){const t=sh.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const ah=4;function nu(e,t,n=1){pt(n<=ah,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=rh(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const i=o.trim();return ai(i)?parseFloat(i):i}return pr(r)?nu(r,t,n+1):r}const oh={type:"spring",stiffness:500,damping:25,restSpeed:10},ih=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uh={type:"keyframes",duration:.8},lh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ch=(e,{keyframes:t})=>t.length>2?uh:Vt.has(e)?e.startsWith("scale")?ih(t[1]):oh:lh,dh=e=>e!==null;function wh(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(dh),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function su(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function ru(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?su(n,e):n}function fh({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:o,repeatType:i,repeatDelay:u,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const ph=(e,t,n,s={},r,o)=>i=>{const u=ru(s,e)||{},l=u.delay||s.delay||0;let{elapsed:c=0}=s;c=c-Ge(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-c,onUpdate:f=>{t.set(f),u.onUpdate&&u.onUpdate(f)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:r};fh(u)||Object.assign(d,ch(e,d)),d.duration&&(d.duration=Ge(d.duration)),d.repeatDelay&&(d.repeatDelay=Ge(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let w=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Br(d),d.delay===0&&(w=!0)),(Ye.instantAnimations||Ye.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(w=!0,Br(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const f=wh(d.keyframes,u);if(f!==void 0){He.update(()=>{d.onUpdate(f),d.onComplete()});return}}return u.isSync?new Dr(d):new nh(d)};function au(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function qr(e,t,n,s){if(typeof t=="function"){const[r,o]=au(s);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=au(s);t=t(n!==void 0?n:e.custom,r,o)}return t}function Ot(e,t,n){const s=e.getProps();return qr(s,t,n!==void 0?n:s.custom,e)}const ou=new Set(["width","height","top","left","right","bottom",...Pt]),iu=30,hh=e=>!isNaN(parseFloat(e));class mh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const r=_e.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),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=_e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&di(!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 ui);const s=this.events[t].add(n);return t==="change"?()=>{s(),He.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=_e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>iu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,iu);return li(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 es(e,t){return new mh(e,t)}const $r=e=>Array.isArray(e);function gh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,es(n))}function bh(e){return $r(e)?e[e.length-1]||0:e}function yh(e,t){const n=Ot(e,t);let{transitionEnd:s={},transition:r={},...o}=n||{};o={...o,...s};for(const i in o){const u=bh(o[i]);gh(e,i,u)}}const ye=e=>!!(e&&e.getVelocity);function vh(e){return!!(ye(e)&&e.add)}function xh(e,t){const n=e.getValue("willChange");if(vh(n))return n.add(t);if(!n&&Ye.WillChange){const s=new Ye.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Hr(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const uu="data-"+Hr("framerAppearId");function Nh(e){return e.props[uu]}function Sh({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function lu(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?su(o,l):l;const c=o==null?void 0:o.reduceMotion;s&&(o=s);const d=[],w=r&&e.animationState&&e.animationState.getState()[r];for(const f in u){const p=e.getValue(f,e.latestValues[f]??null),g=u[f];if(g===void 0||w&&Sh(w,f))continue;const b={delay:n,...ru(o||{},f)},v=p.get();if(v!==void 0&&!p.isAnimating&&!Array.isArray(g)&&g===v&&!b.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const S=Nh(e);if(S){const T=window.MotionHandoffAnimation(S,f,He);T!==null&&(b.startTime=T,N=!0)}}xh(e,f);const y=c??e.shouldReduceMotion;p.start(ph(f,p,g,y&&ou.has(f)?{type:!1}:b,e,N));const C=p.animation;C&&d.push(C)}if(i){const f=()=>He.update(()=>{i&&yh(e,i)});d.length?Promise.all(d).then(f):f()}return d}function zr(e,t,n={}){var l;const s=Ot(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const o=s?()=>Promise.all(lu(e,s,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:w,staggerDirection:f}=r;return Ch(e,t,c,d,w,f,n)}:()=>Promise.resolve(),{when:u}=r;if(u){const[c,d]=u==="beforeChildren"?[o,i]:[i,o];return c().then(()=>d())}else return Promise.all([o(),i(n.delay)])}function Ch(e,t,n=0,s=0,r=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(zr(l,t,{...i,delay:n+(typeof s=="function"?0:s)+tu(e.variantChildren,l,s,r,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function Th(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(o=>zr(e,o,n));s=Promise.all(r)}else if(typeof t=="string")s=zr(e,t,n);else{const r=typeof t=="function"?Ot(e,t,n.custom):t;s=Promise.all(lu(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Eh={test:e=>e==="auto",parse:e=>e},cu=e=>t=>t.test(e),du=[Dt,q,At,et,Jf,Zf,Eh],wu=e=>du.find(cu(e));function Mh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oi(e):!0}const Ih=new Set(["brightness","contrast","saturate","opacity"]);function Dh(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(hr)||[];if(!s)return e;const r=n.replace(s,"");let o=Ih.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+r+")"}const Ah=/\b([a-z-]*)\(.*?\)/gu,Ur={...tt,getAnimatableNone:e=>{const t=e.match(Ah);return t?t.map(Dh).join(" "):e}},fu={...Dt,transform:Math.round},jr={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...{rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Zn,scaleX:Zn,scaleY:Zn,scaleZ:Zn,skew:et,skewX:et,skewY:et,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:rn,originX:Ii,originY:Ii,originZ:q},zIndex:fu,fillOpacity:rn,strokeOpacity:rn,numOctaves:fu},kh={...jr,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Ur,WebkitFilter:Ur},pu=e=>kh[e];function hu(e,t){let n=pu(e);return n!==Ur&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _h=new Set(["auto","none","0"]);function Ph(e,t,n){let s=0,r;for(;s<e.length&&!r;){const o=e[s];typeof o=="string"&&!_h.has(o)&&un(o).values.length&&(r=e[s]),s++}if(r&&n)for(const o of t)e[o]=hu(n,r)}class Vh extends Wr{constructor(t,n,s,r,o){super(t,n,s,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let w=t[d];if(typeof w=="string"&&(w=w.trim(),pr(w))){const f=nu(w,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!ou.has(s)||t.length!==2)return;const[r,o]=t,i=wu(r),u=wu(o),l=Ei(r),c=Ei(o);if(l!==c&&nt[s]){this.needsMeasurement=!0;return}if(i!==u)if(ji(i)&&ji(u))for(let d=0;d<t.length;d++){const w=t[d];typeof w=="string"&&(t[d]=parseFloat(w))}else nt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Mh(t[r]))&&s.push(r);s.length&&Ph(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,i=s[o];s[o]=nt[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()}}const Oh=new Set(["opacity","clipPath","filter","transform"]);function Fh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const mu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gr(e){return kf(e)&&"offsetHeight"in e}const{schedule:Wh}=Si(queueMicrotask,!1),Lh={y:!1};function Bh(){return Lh.y}function gu(e,t){const n=Fh(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function qh(e){return!(e.pointerType==="touch"||Bh())}function $h(e,t,n={}){const[s,r,o]=gu(e,n);return s.forEach(i=>{let u=!1,l=!1,c;const d=()=>{i.removeEventListener("pointerleave",g)},w=v=>{c&&(c(v),c=void 0),d()},f=v=>{u=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,w(v))},p=()=>{u=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},g=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},b=v=>{if(!qh(v))return;l=!1;const N=t(i,v);typeof N=="function"&&(c=N,i.addEventListener("pointerleave",g,r))};i.addEventListener("pointerenter",b,r),i.addEventListener("pointerdown",p,r)}),o}const bu=(e,t)=>t?e===t?!0:bu(e,t.parentElement):!1,Hh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Uh(e){return zh.has(e.tagName)||e.isContentEditable===!0}const ts=new WeakSet;function yu(e){return t=>{t.key==="Enter"&&e(t)}}function Kr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const jh=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=yu(()=>{if(ts.has(n))return;Kr(n,"down");const r=yu(()=>{Kr(n,"up")}),o=()=>Kr(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function vu(e){return Hh(e)&&!0}const xu=new WeakSet;function Gh(e,t,n={}){const[s,r,o]=gu(e,n),i=u=>{const l=u.currentTarget;if(!vu(u)||xu.has(u))return;ts.add(l),n.stopPropagation&&xu.add(u);const c=t(l,u),d=(p,g)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",f),ts.has(l)&&ts.delete(l),vu(p)&&typeof c=="function"&&c(p,{success:g})},w=p=>{d(p,l===window||l===document||n.useGlobalTarget||bu(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",w,r),window.addEventListener("pointercancel",f,r)};return s.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,r),Gr(u)&&(u.addEventListener("focus",c=>jh(c,r)),!Uh(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const Kh=[...du,de,tt],Yh=e=>Kh.find(cu(e)),Nu=()=>({min:0,max:0}),Su=()=>({x:Nu(),y:Nu()}),Xh=new WeakMap;function ns(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dn(e){return typeof e=="string"||Array.isArray(e)}const Yr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xr=["initial",...Yr];function ss(e){return ns(e.animate)||Xr.some(t=>dn(e[t]))}function Cu(e){return!!(ss(e)||e.variants)}function Zh(e,t,n){for(const s in t){const r=t[s],o=n[s];if(ye(r))e.addValue(s,r);else if(ye(o))e.addValue(s,es(r,{owner:e}));else if(o!==r)if(e.hasValue(s)){const i=e.getValue(s);i.liveStyle===!0?i.jump(r):i.hasAnimated||i.set(r)}else{const i=e.getStaticValue(s);e.addValue(s,es(i!==void 0?i:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Zr={current:null},Tu={current:!1},Jh=typeof window<"u";function Qh(){if(Tu.current=!0,!!Jh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Zr.current=e.matches;e.addEventListener("change",t),t()}else Zr.current=!1}const Eu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let rs={};function Mu(e){rs=e}function Rh(){return rs}class em{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Wr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 p=_e.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,He.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=u;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ss(n),this.isVariantNode=Cu(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const g=f[p];c[p]!==void 0&&ye(g)&&g.set(c[p])}}mount(t){var n,s;if(this.hasBeenMounted)for(const r in this.initialValues)(n=this.values.get(r))==null||n.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=t,Xh.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,o)=>this.bindToMotionValue(o,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Tu.current||Qh(),this.shouldReduceMotion=Zr.current),process.env.NODE_ENV!=="production"&&di(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),fr(this.notifyUpdate),fr(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 s=this.features[n];s&&(s.unmount(),s.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){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Oh.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:c,duration:d}=n.accelerate,w=new Qi({element:this.current,name:t,keyframes:u,times:l,ease:c,duration:Ge(d)}),f=i(w);this.valueSubscriptions.set(t,()=>{f(),w.cancel()});return}const s=Vt.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&He.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),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 rs){const n=rs[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(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):Su()}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 s=0;s<Eu.length;s++){const r=Eu[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,i=t[o];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=Zh(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 s=this.values.get(t);n!==s&&(s&&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 s=this.values.get(t);return s===void 0&&n!==void 0&&(s=es(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ai(s)||oi(s))?s=parseFloat(s):!Yh(s)&&tt.test(n)&&(s=hu(t,n)),this.setBaseTarget(t,ye(s)?s.get():s)),ye(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const i=qr(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(s=i[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!ye(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ui),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Wh.render(this.render)}}class Iu extends em{constructor(){super(...arguments),this.KeyframeResolver=Vh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ft{constructor(t){this.isMounted=!1,this.node=t}update(){}}function tm({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function nm(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function sm(e,t){return tm(nm(e.getBoundingClientRect(),t))}const rm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},am=Pt.length;function om(e,t,n){let s="",r=!0;for(let o=0;o<am;o++){const i=Pt[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const c=parseFloat(u);l=i.startsWith("scale")?c===1:c===0}if(!l||n){const c=mu(u,jr[i]);if(!l){r=!1;const d=rm[i]||i;s+=`${d}(${c}) `}n&&(t[i]=c)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Jr(e,t,n){const{style:s,vars:r,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const c=t[l];if(Vt.has(l)){i=!0;continue}else if(Ti(l)){r[l]=c;continue}else{const d=mu(c,jr[l]);l.startsWith("origin")?(u=!0,o[l]=d):s[l]=d}}if(t.transform||(i||n?s.transform=om(t,e.transform,n):s.transform&&(s.transform="none")),u){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;s.transformOrigin=`${l} ${c} ${d}`}}function Du(e,{style:t,vars:n},s,r){const o=e.style;let i;for(i in t)o[i]=t[i];r==null||r.applyProjectionStyles(o,s);for(i in n)o.setProperty(i,n[i])}function Au(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=Au(e,t.target.x),s=Au(e,t.target.y);return`${n}% ${s}%`}},im={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=tt.parse(e);if(r.length>5)return s;const o=tt.createTransformer(e),i=typeof r[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;r[0+i]/=u,r[1+i]/=l;const c=ln(u,l,.5);return typeof r[2+i]=="number"&&(r[2+i]/=c),typeof r[3+i]=="number"&&(r[3+i]/=c),o(r)}},um={borderRadius:{...wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wn,borderTopRightRadius:wn,borderBottomLeftRadius:wn,borderBottomRightRadius:wn,boxShadow:im};function ku(e,{layout:t,layoutId:n}){return Vt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!um[e]||e==="opacity")}function Qr(e,t,n){var i;const s=e.style,r=t==null?void 0:t.style,o={};if(!s)return o;for(const u in s)(ye(s[u])||r&&ye(r[u])||ku(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=s[u]);return o}function lm(e){return window.getComputedStyle(e)}class cm extends Iu{constructor(){super(...arguments),this.type="html",this.renderInstance=Du}readValueFromInstance(t,n){var s;if(Vt.has(n))return(s=this.projection)!=null&&s.isProjecting?_r(n):Vp(t,n);{const r=lm(t),o=(Ti(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return sm(t,n)}build(t,n,s){Jr(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Qr(t,n,s)}}const dm={offset:"stroke-dashoffset",array:"stroke-dasharray"},wm={offset:"strokeDashoffset",array:"strokeDasharray"};function fm(e,t,n=1,s=0,r=!0){e.pathLength=1;const o=r?dm:wm;e[o.offset]=`${-s}`,e[o.array]=`${t} ${n}`}const pm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _u(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:o=1,pathOffset:i=0,...u},l,c,d){if(Jr(e,u,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:f}=e;w.transform&&(f.transform=w.transform,delete w.transform),(f.transform||w.transformOrigin)&&(f.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete w.transformBox);for(const p of pm)w[p]!==void 0&&(f[p]=w[p],delete w[p]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),s!==void 0&&(w.scale=s),r!==void 0&&fm(w,r,o,i,!1)}const Pu=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"]),Vu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function hm(e,t,n,s){Du(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Pu.has(r)?r:Hr(r),t.attrs[r])}function Ou(e,t,n){const s=Qr(e,t,n);for(const r in e)if(ye(e[r])||ye(t[r])){const o=Pt.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[o]=e[r]}return s}class mm extends Iu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Su}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vt.has(n)){const s=pu(n);return s&&s.default||0}return n=Pu.has(n)?n:Hr(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ou(t,n,s)}build(t,n,s){_u(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){hm(t,n,s,r)}mount(t){this.isSVGTag=Vu(t.tagName),super.mount(t)}}const gm=Xr.length;function Fu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Fu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<gm;n++){const s=Xr[n],r=e.props[s];(dn(r)||r===!1)&&(t[s]=r)}return t}function Wu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const bm=[...Yr].reverse(),ym=Yr.length;function vm(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Th(e,n,s)))}function xm(e){let t=vm(e),n=Lu(),s=!0;const r=l=>(c,d)=>{var f;const w=Ot(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(w){const{transition:p,transitionEnd:g,...b}=w;c={...c,...b,...g}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,d=Fu(e.parent)||{},w=[],f=new Set;let p={},g=1/0;for(let v=0;v<ym;v++){const N=bm[v],y=n[N],C=c[N]!==void 0?c[N]:d[N],S=dn(C),T=N===l?y.isActive:null;T===!1&&(g=v);let A=C===d[N]&&C!==c[N]&&S;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),y.protectedKeys={...p},!y.isActive&&T===null||!C&&!y.prevProp||ns(C)||typeof C=="boolean")continue;if(N==="exit"&&y.isActive&&T!==!0){y.prevResolvedValues&&(p={...p,...y.prevResolvedValues});continue}const D=Nm(y.prevProp,C);let k=D||N===l&&y.isActive&&!A&&S||v>g&&S,M=!1;const _=Array.isArray(C)?C:[C];let P=_.reduce(r(N),{});T===!1&&(P={});const{prevResolvedValues:E={}}=y,O={...E,...P},L=W=>{k=!0,f.has(W)&&(M=!0,f.delete(W)),y.needsAnimating[W]=!0;const $=e.getValue(W);$&&($.liveStyle=!1)};for(const W in O){const $=P[W],G=E[W];if(p.hasOwnProperty(W))continue;let Z=!1;$r($)&&$r(G)?Z=!Wu($,G):Z=$!==G,Z?$!=null?L(W):f.add(W):$!==void 0&&f.has(W)?L(W):y.protectedKeys[W]=!0}y.prevProp=C,y.prevResolvedValues=P,y.isActive&&(p={...p,...P}),s&&e.blockInitialAnimation&&(k=!1);const F=A&&D;k&&(!F||M)&&w.push(..._.map(W=>{const $={type:N};if(typeof W=="string"&&s&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:G}=e,Z=Ot(G,W);if(G.enteringChildren&&Z){const{delayChildren:U}=Z.transition||{};$.delay=tu(G.enteringChildren,e,U)}}return{animation:W,options:$}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const N=Ot(e,Array.isArray(c.initial)?c.initial[0]:c.initial);N&&N.transition&&(v.transition=N.transition)}f.forEach(N=>{const y=e.getBaseTarget(N),C=e.getValue(N);C&&(C.liveStyle=!0),v[N]=y??null}),w.push({animation:v})}let b=!!w.length;return s&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(w):Promise.resolve()}function u(l,c){var w;if(n[l].isActive===c)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Lu()}}}function Nm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wu(t,e):!1}function bt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Lu(){return{animate:bt(!0),whileInView:bt(),whileHover:bt(),whileTap:bt(),whileDrag:bt(),whileFocus:bt(),exit:bt()}}function Bu(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Sm(e){return ye(e)?e.get():e}const Rr=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function qu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cm(...e){return t=>{let n=!1;const s=e.map(r=>{const o=qu(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():qu(e[r],null)}}}}function Tm(...e){return x.useCallback(Cm(...e),e)}class Em extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,r=Gr(s)&&s.offsetWidth||0,o=Gr(s)&&s.offsetHeight||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left,i.bottom=o-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Mm({children:e,isPresent:t,anchorX:n,anchorY:s,root:r,pop:o}){var f;const i=h.useId(),u=h.useRef(null),l=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=h.useContext(Rr),d=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),w=Tm(u,d);return h.useInsertionEffect(()=>{const{width:p,height:g,top:b,left:v,right:N,bottom:y}=l.current;if(t||o===!1||!u.current||!p||!g)return;const C=n==="left"?`left: ${v}`:`right: ${N}`,S=s==="bottom"?`bottom: ${y}`:`top: ${b}`;u.current.dataset.motionPopId=i;const T=document.createElement("style");c&&(T.nonce=c);const A=r??document.head;return A.appendChild(T),T.sheet&&T.sheet.insertRule(`
8
8
  [data-motion-pop-id="${i}"] {
9
9
  position: absolute !important;
10
- width: ${m}px !important;
10
+ width: ${p}px !important;
11
11
  height: ${g}px !important;
12
12
  ${C}px !important;
13
13
  ${S}px !important;
14
14
  }
15
- `),()=>{A.contains(T)&&A.removeChild(T)}},[t]),a.jsx(xm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Sm=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:c})=>{const d=ur(Cm),w=h.useId();let f=!0,m=h.useMemo(()=>(f=!1,{id:w,initial:t,isPresent:n,custom:r,onExitComplete:g=>{d.set(g,!0);for(const b of d.values())if(!b)return;s&&s()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,s]);return o&&f&&(m={...m}),h.useMemo(()=>{d.forEach((g,b)=>d.set(b,!1))},[n]),x.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=a.jsx(Nm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:c,children:e}),a.jsx(jn.Provider,{value:m,children:e})};function Cm(){return new Map}function Tm(e=!0){const t=h.useContext(jn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,o=h.useId();h.useEffect(()=>{if(e)return r(o)},[e]);const i=h.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,i]:[!0]}const as=e=>e.key||"";function qu(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const $u=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:c})=>{const[d,w]=Tm(i),f=h.useMemo(()=>qu(e),[e]),m=i&&!d?[]:f.map(as),g=h.useRef(!0),b=h.useRef(f),v=ur(()=>new Map),y=h.useRef(new Set),[N,C]=h.useState(f),[S,T]=h.useState(f);si(()=>{g.current=!1,b.current=f;for(let E=0;E<S.length;E++){const D=as(S[E]);m.includes(D)?(v.delete(D),y.current.delete(D)):v.get(D)!==!0&&v.set(D,!1)}},[S,m.length,m.join("-")]);const A=[];if(f!==N){let E=[...f];for(let D=0;D<S.length;D++){const P=S[D],_=as(P);m.includes(_)||(E.splice(D,0,P),A.push(P))}return o==="wait"&&A.length&&(E=A),T(qu(E)),C(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.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:k}=h.useContext(ti);return a.jsx(a.Fragment,{children:S.map(E=>{const D=as(E),P=i&&!d?!1:f===S||m.includes(D),_=()=>{if(y.current.has(D))return;if(y.current.add(D),v.has(D))v.set(D,!0);else return;let M=!0;v.forEach(F=>{F||(M=!1)}),M&&(k==null||k(),T(b.current),i&&(w==null||w()),s&&s())};return a.jsx(Sm,{isPresent:P,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:c,onExitComplete:P?void 0:_,anchorX:u,anchorY:l,children:E},D)})})},ea=h.createContext({strict:!1}),Hu={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"]};let zu=!1;function Em(){if(zu)return;const e={};for(const t in Hu)e[t]={isEnabled:n=>Hu[t].some(s=>!!n[s])};Eu(e),zu=!0}function Uu(){return Em(),Yh()}function ju(e){const t=Uu();for(const n in e)t[n]={...t[n],...e[n]};Eu(t)}function Gu({children:e,features:t,strict:n=!1}){const[,s]=h.useState(!ta(t)),r=h.useRef(void 0);if(!ta(t)){const{renderer:o,...i}=t;r.current=o,ju(i)}return h.useEffect(()=>{ta(t)&&t().then(({renderer:o,...i})=>{ju(i),r.current=o,s(!0)})},[]),a.jsx(ea.Provider,{value:{renderer:r.current,strict:n},children:e})}function ta(e){return typeof e=="function"}const Im=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","propagate","ignoreStrict","viewport"]);function os(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Im.has(e)}let Ku=e=>!os(e);function Mm(e){typeof e=="function"&&(Ku=t=>t.startsWith("on")?!os(t):e(t))}try{Mm(require("@emotion/is-prop-valid").default)}catch{}function Dm(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(Ku(r)||n===!0&&os(r)||!t&&!os(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const is=h.createContext({});function Am(e,t){if(ss(e)){const{initial:n,animate:s}=e;return{initial:n===!1||dn(n)?n:void 0,animate:dn(s)?s:void 0}}return e.inherit!==!1?t:{}}function km(e){const{initial:t,animate:n}=Am(e,h.useContext(is));return h.useMemo(()=>({initial:t,animate:n}),[Yu(t),Yu(n)])}function Yu(e){return Array.isArray(e)?e.join(" "):e}const na=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xu(e,t,n){for(const s in t)!me(t[s])&&!Au(s,n)&&(e[s]=t[s])}function _m({transformTemplate:e},t){return h.useMemo(()=>{const n=na();return Jr(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Pm(e,t){const n=e.style||{},s={};return Xu(s,n,e),Object.assign(s,_m(e,t)),s}function Vm(e,t){const n={},s=Pm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const Zu=()=>({...na(),attrs:{}});function Om(e,t,n,s){const r=h.useMemo(()=>{const o=Zu();return ku(o,t,Pu(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Xu(o,e.style,e),r.style={...o,...r.style}}return r}const Fm=["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 sa(e){return typeof e!="string"||e.includes("-")?!1:!!(Fm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Wm(e,t,n,{latestValues:s},r,o=!1,i){const l=(i??sa(e)?Om:Vm)(t,s,r,e),c=Dm(t,typeof e=="string",o),d=e!==h.Fragment?{...c,...l,ref:n}:{},{children:w}=t,f=h.useMemo(()=>me(w)?w.get():w,[w]);return h.createElement(e,{...d,children:f})}function Lm({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Bm(n,s,r,e),renderState:t()}}function Bm(e,t,n,s){const r={},o=s(e,{});for(const f in o)r[f]=bm(o[f]);let{initial:i,animate:u}=e;const l=ss(e),c=Su(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"&&!ns(w)){const f=Array.isArray(w)?w:[w];for(let m=0;m<f.length;m++){const g=qr(e,f[m]);if(g){const{transitionEnd:b,transition:v,...y}=g;for(const N in y){let C=y[N];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(r[N]=C)}for(const N in b)r[N]=b[N]}}}return r}const Ju=e=>(t,n)=>{const s=h.useContext(is),r=h.useContext(jn),o=()=>Lm(e,t,s,r);return n?o():ur(o)},qm=Ju({scrapeMotionValuesFromProps:Qr,createRenderState:na}),$m=Ju({scrapeMotionValuesFromProps:Vu,createRenderState:Zu}),Hm=Symbol.for("motionComponentSymbol");function zm(e,t,n){const s=h.useRef(n);h.useInsertionEffect(()=>{s.current=n});const r=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=s.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(r.current=l)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o)},[t])}const Um=h.createContext({});function jm(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Gm(e,t,n,s,r,o){var C,S;const{visualElement:i}=h.useContext(is),u=h.useContext(ea),l=h.useContext(jn),c=h.useContext(Rr),d=c.reducedMotion,w=c.skipAnimations,f=h.useRef(null),m=h.useRef(!1);s=s||u.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:w,isSVG:o}),m.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const g=f.current,b=h.useContext(Um);g&&!g.projection&&r&&(g.type==="html"||g.type==="svg")&&Km(f.current,n,r,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const y=n[iu],N=h.useRef(!!y&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,y))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,y)));return si(()=>{m.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),N.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!N.current&&g.animationState&&g.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,y)}),N.current=!1),g.enteringChildren=void 0)}),g}function Km(e,t,n,s){const{layoutId:r,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:Qu(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||u&&jm(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:l,layoutRoot:c})}function Qu(e){if(e)return e.options.allowProjection!==!1?e.projection:Qu(e.parent)}function Ym(e,{forwardMotionProps:t=!1,type:n}={},s,r){const o=n?n==="svg":sa(e),i=o?$m:qm;function u(c,d){let w;const f={...h.useContext(Rr),...c,layoutId:Xm(c)},{isStatic:m}=f,g=km(c),b=i(c,m);if(!m&&ni){Zm(f,s);const v=Jm(f);w=v.MeasureLayout,g.visualElement=Gm(e,b,f,r,v.ProjectionNode,o)}return a.jsxs(is.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...f}):null,Wm(e,c,zm(b,g.visualElement,d),b,m,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[Hm]=e,l}function Xm({layoutId:e}){const t=h.useContext(ti).id;return t&&e!==void 0?t+"-"+e:e}function Zm(e,t){h.useContext(ea).strict,process.env.NODE_ENV}function Jm(e){const t=Uu(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Qm=(e,t)=>t.isSVG??sa(e)?new dm(t):new am(t,{allowProjection:e!==h.Fragment});class Rm extends Ft{constructor(t){super(t),t.animationState||(t.animationState=mm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ns(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 eg=0;class tg extends Ft{constructor(){super(...arguments),this.id=eg++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.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 ng={animation:{Feature:Rm},exit:{Feature:tg}};function Ru(e){return{point:{x:e.pageX,y:e.pageY}}}function el(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=s[r];o&&$e.postRender(()=>o(t,Ru(t)))}class sg extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=Fh(t,(n,s)=>(el(this.node,s,"Start"),r=>el(this.node,r,"End"))))}unmount(){}}class rg 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(Lu(this.node.current,"focus",()=>this.onFocus()),Lu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tl(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=s[r];o&&$e.postRender(()=>o(t,Ru(t)))}class ag extends Ft{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=$h(t,(r,o)=>(tl(this.node,o,"Start"),(i,{success:u})=>tl(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const ra=new WeakMap,aa=new WeakMap,og=e=>{const t=ra.get(e.target);t&&t(e)},ig=e=>{e.forEach(og)};function ug({root:e,...t}){const n=e||document;aa.has(n)||aa.set(n,{});const s=aa.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(ig,{root:e,...t})),s[r]}function lg(e,t,n){const s=ug(t);return ra.set(e,n),s.observe(e),()=>{ra.delete(e),s.unobserve(e)}}const cg={some:0,all:1};class dg extends Ft{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:cg[r]},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(),f=c?d:w;f&&f(l)};return lg(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(wg(t,n))&&this.startObserver()}unmount(){}}function wg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const nl={renderer:Qm,...ng,...{inView:{Feature:dg},tap:{Feature:ag},focus:{Feature:rg},hover:{Feature:sg}}};function fg(e,t){return Ym(e,t)}const sl=fg("div"),pg=e=>{const{checked:t,onSelect:n,children:s,disabled:r,preventCloseOnSelect:o}=e;return a.jsx(Yo,{disabled:r,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:s})},us=e=>{const{children:t,className:n,Icon:s,iconPosition:r="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=p("wu-flex wu-items-center wu-gap-2",s&&(r==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),c=d=>{i&&i(d),u&&d.preventDefault()};return a.jsxs(zn,{onSelect:c,disabled:o,className:l,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},hg=e=>{const{children:t,Label:n,...s}=e;return a.jsxs(jo,{...s,children:[a.jsx(tn,{children:n||e.label}),t]})},mg=e=>{const{options:t,value:n,onSelect:s}=e;return a.jsx(cf,{value:n,onValueChange:s,children:t.map(r=>a.jsx(Xo,{value:r.value,disabled:r.disabled,children:r.Label||r.label},r.value))})},gg=e=>{const{className:t,...n}=e,s=p("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Un,{...n,className:s})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:s,...r},o)=>a.jsxs(ut.Root,{ref:o,className:p("wu-relative wu-overflow-hidden",e),children:[a.jsx(ut.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...r,children:t}),a.jsx(oa,{thumbColor:n,railColor:s}),a.jsx(ut.Corner,{})]}));Wt.displayName=ut.Root.displayName;const oa=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:s="#eeeeee",...r},o)=>a.jsx(ut.ScrollAreaScrollbar,{ref:o,orientation:t,className:p("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:s},...r,children:a.jsx(ut.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));oa.displayName=ut.ScrollAreaScrollbar.displayName;const bg=e=>{const{children:t,label:n,Label:s,open:r,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(lf,{...l,open:r,onOpenChange:o,children:[a.jsx(Go,{dir:u,children:s||n}),a.jsx(uf,{children:a.jsx(Ko,{onInteractOutside:c=>c.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},yg="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",ia=e=>{const{children:t,menuTitle:n,MenuTitle:s,variant:r="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:c,dir:d,Trigger:w,align:f="start",sideOffset:m=0,side:g="bottom",alignOffset:b,className:v,disabled:y,...N}=e;return a.jsxs(zo,{...N,open:i,onOpenChange:u,dir:d,children:[a.jsx(Uo,{asChild:!0,dir:d,disabled:y,className:p("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??vg(r,o,y)}),a.jsx(or,{className:p("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:f,sideOffset:m,side:g,alignOffset:b,onInteractOutside:C=>c&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:d,children:[(n||s)&&a.jsxs(a.Fragment,{children:[a.jsx(tn,{dir:d,className:"wu-menu-title",children:s||n}),a.jsx(Un,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},vg=(e,t,n)=>{const s=p(yg,"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:s,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:p("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")})]})},xg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[s,r]=h.useState(!1);return a.jsx(ia,{className:"wu-rounded-sm",open:s,onOpenChange:r,align:t==="rtl"?"end":"start",sideOffset:8,Trigger:a.jsx(Te,{variant:"iconOnly",className:p("wu-w-6 wu-h-6 wu-shrink-0 wu-p-0"),Icon:a.jsx("span",{className:p("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",s&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(us,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Ng=({titles:e,currentLevel:t,initial:n,handleTitleClick:s,headerClasses:r,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:p("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition",t!==n?"wu-translate-y-0 wu-opacity-100 wu-z-50 wu-delay-200":"wu-translate-y-1 wu-opacity-0 wu-z-0 wu-delay-0",r),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(xg,{titles:e,handleTitleClick:s,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Gu,{features:nl,children:a.jsxs($u,{initial:!1,mode:"popLayout",children:[Sg(e).map((l,c)=>a.jsx(sl,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:s,className:p("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-2 wu-h-6",c===2||c===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[c!==0&&a.jsx("span",{className:p("wm-keyboard-arrow-right wu-text-[16px] wu-font-light",i==="rtl"&&"wu-rotate-180")}),l.title]})},l.id)),"``"]})})})]})},Sg=e=>{const t=e.length;if(t>2){const n=e[0],s=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},s]}return e},Cg=({items:e,initial:t,baseTitle:n,mode:s="popLayout",headerClasses:r="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,c]=h.useState(n?[n]:[]),[[d,w],f]=h.useState([t,1]),m=(y,N)=>{N&&c([...l,N]),f([y,1])},g=y=>{const N=l.findIndex(C=>C.id===y);if(N!==-1){const C=l.slice(0,N+1);c(C)}f([y,-1])},b=(y,N)=>{const C=N||y.currentTarget.getAttribute("data-id")||"";if(C&&C!==d){const S=l.findIndex(T=>T.id===C);S!==-1&&(c(l.slice(0,S+1)),g(C))}},v=()=>{const y=e[d]?e[d]:null;if(!y)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 N=typeof y.component=="function"?y.component({goNext:m,goBack:g}):y.component;return a.jsx(sl,{dir:u,custom:w,variants:Tg(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:d!==t?`${o}px`:"0px"},children:N},d)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Ng,{titles:l,currentLevel:d,initial:t,handleTitleClick:b,headerClasses:r,offsetHeight:o,dir:u}),a.jsx(Gu,{features:nl,children:a.jsx($u,{initial:!1,custom:w,mode:s,children:v()})})]})},Tg=e=>{switch(e){case"slideRight":return Ig;case"slideLeft":return Mg;case"fadeZoom":return Dg;case"default":default:return Eg}},Eg={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})},Ig={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})},Mg={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})},Dg={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}},rl=({className:e,isLoading:t,loadingText:n,children:s,...r})=>a.jsxs("footer",{className:p("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),...r,children:[a.jsx("div",{className:"wu-flex-1",children:s}),t&&a.jsx(ct,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});rl.displayName="WuFooter";const al=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:s,variant:r="primary",...o}=e,i=n==="sm"?16:18,u=s.includes("http")?s:`/help/${s}.html`,l=r==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Ms(u),children:a.jsx("span",{className:p("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});al.displayName="WuHelpButton";const st=(e,t)=>`wu-listbox-${e}`;function Ag(e){const{option:t,accessorKey:n,onSelect:s,multiple:r,dir:o,GroupLabel:i,Item:u,isSelected:l,...c}=e,d=n.group&&Array.isArray(t[n.group]),w=({item:f,className:m})=>h.createElement(en,{...c,key:JSON.stringify(f),onSelect:()=>s==null?void 0:s(f),value:t[n.value],className:p("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(f))&&!r&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,st("item")),disabled:f.disabled},r&&a.jsx(Be,{checked:l==null?void 0:l(f)}),u?u({value:f,isSelected:l==null?void 0:l(f)}):a.jsx(a.Fragment,{children:f[n.label]}));if(d){const f=t[n.group],m=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(Rt,{heading:m,children:f==null?void 0:f.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const kg=h.memo(Ag),_g=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(De,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Ho,{...n,"aria-label":"Search",className:p("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;",st("input"),t)})]})},Pg=e=>{const{label:t,onSelectAll:n,data:s,value:r}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!r||!s||(i(r.length>0),l(r.length>0&&r.length<s.length))},[s,r]),a.jsxs(en,{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(Be,{checked:o,partial:u}),t||"Select All"]})},Vg=e=>{const{CustomTrigger:t,disabled:n,value:s,placeholder:r,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:c,className:d,...w}=e,[f,m]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!s){m(null);return}m(Array.isArray(s)?i?s.map((v,y)=>i({value:v,unselect:u,key:y})):s.map(v=>v[o.label]).join(", "):i?i({value:s,unselect:u}):s[o.label])},[s,i,o.label,m]),a.jsx(dt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(s))||a.jsxs("button",{...w,className:p("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,st("trigger")),children:[a.jsx("div",{className:p("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!f&&"wu-font-light"),children:f||r}),a.jsx(De,{icon:"wm-arrow-drop-down",className:p("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",st("drop-icon"))})]})})},ol=(e,t,n)=>{const s=String(e[n.label]??"").toLowerCase(),r=String(e[n.value]??"").toLowerCase();return s.includes(t)||r.includes(t)},Og=(e,t,n)=>{const s=t.trim();if(s==="")return e;const r=s.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=>ol(d,r,n));c.length>0&&o.push({...i,[u]:c})}else ol(i,r,n)&&o.push(i)}return o},il=e=>{const{data:t,accessorKey:n,value:s,Item:r,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:c,Chip:d,onSelect:w,onScroll:f,disabled:m,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:y=100,showGroupSeparator:N,id:C,dir:S,className:T,listClass:A,placeholder:k="Select items...",variant:E,labelPosition:D="top",maxContentWidth:P,maxContentHeight:_,modal:M,...F}=e,[B,O]=h.useState(!1),[$,V]=h.useState(""),[H,z]=h.useState(s),U=h.useMemo(()=>n,[n]),ce=h.useMemo(()=>{if(!b||!$)return t;const W=$.toLowerCase().trim();return Og(t,W,n)},[t,$,n.label,b]),se=W=>{g?z(G=>{const K=W[n.value],q=Array.isArray(G)?G:[],ae=q.some(de=>de[n.value]===K)?q.filter(de=>de[n.value]!==K):[...q,W];return w&&w(ae),ae}):(z(W),w&&w(W),O(!1))},_e=h.useCallback(W=>{const G=W?t:[];z(G),v!=null&&v.onSelectAll&&v.onSelectAll(W),w&&w(G)},[t,v,w]),ge=W=>Array.isArray(H)?H.some(G=>G[n.value]===W[n.value]):(H==null?void 0:H[n.value])===W[n.value];h.useEffect(()=>{z(s)},[s]);const Pe=W=>{const G=(K,q)=>{const Z=n.group&&Array.isArray(K[n.group]),ae=N&&Z&&q>0&&W.length>1;return a.jsxs(h.Fragment,{children:[ae&&a.jsx(ar,{}),a.jsx(kg,{option:K,accessorKey:U,multiple:g,onSelect:de=>se(de),dir:S,GroupLabel:i,Item:r,isSelected:de=>ge(de)})]},JSON.stringify(K))};return W.length>y?a.jsx(It,{list:W,callback:(K,q)=>G(q,K),dir:S}):W.map((K,q)=>G(K,q))};return a.jsxs("div",{className:p("wu-flex wu-text-sm wu-gap-2",D==="top"&&"wu-flex-col wu-gap-1",D==="left"&&"wu-flex-row",D==="right"&&"wu-flex-row-reverse",st("container")),dir:S,children:[o&&a.jsx(Ee,{htmlFor:C,className:st("label"),children:o}),a.jsxs(ze,{open:B,onOpenChange:W=>{O(W),W||setTimeout(()=>{V("")},100)},modal:M,children:[a.jsx(Vg,{CustomTrigger:l,disabled:m,value:H,accessorKey:n,placeholder:k,Chip:d,className:T,handleUnselect:se,variant:E,id:C,dir:S,...F}),a.jsx(Le,{className:p("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",st("content")),align:"start",sideOffset:-1,style:{maxWidth:P},children:a.jsxs(nr,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(_g,{value:$,onValueChange:V}),u,a.jsxs(sr,{className:p("wu-overflow-y-auto",st("list"),A),onScroll:f,style:{maxHeight:_||"420px"},children:[a.jsx(rr,{children:c||"No results found."}),a.jsx(Rt,{children:g&&(v==null?void 0:v.enabled)&&!$&&a.jsx(Pg,{data:t,value:H,onSelectAll:_e,label:v.label})}),a.jsx(Rt,{children:Pe(ce)})]})]})})]})]})},ua=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...s},r)=>{const o=p("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...s,className:p("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:r,"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}})]})});ua.displayName="WuMenuIcon";const ul={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%]"},ll=Q.Root,cl=Q.Trigger,Fg=Q.Portal,Wg=Q.Close,dl=h.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{ref:n,className:p("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ul.overlay,e),...t}));dl.displayName=Q.Overlay.displayName;const la=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:s,...r},o)=>a.jsxs(Fg,{children:[a.jsx(dl,{className:s?"wu-bg-transparent":""}),a.jsxs(Q.Content,{ref:o,className:p("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",ul.content,e),...r,children:[t,!n&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Tt,{variant:"iconOnly",className:p("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-top-3 wu-right-4 wu-p-1.5","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-text-xl wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));la.displayName=Q.Content.displayName;const ca=({className:e,...t})=>a.jsx("div",{className:p("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});ca.displayName="DialogHeader";const wl=({className:e,...t})=>a.jsx("div",{className:p("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});wl.displayName="DialogFooter";const da=h.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:p("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}));da.displayName=Q.Title.displayName;const Lg=h.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:p("wu-text-sm wu-text-muted-foreground",e),...t}));Lg.displayName=Q.Description.displayName;const Bg={gradientBackground:"_gradientBackground_1uc4j_1"},fl=e=>{const{colors:t,size:n=.55,children:s,className:r,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.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 f=m=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=c.getBoundingClientRect();let b=m.clientX-g.left,v=m.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const y=`radial-gradient(
15
+ `),()=>{A.contains(T)&&A.removeChild(T)}},[t]),a.jsx(Em,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Im=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:c})=>{const d=ur(Dm),w=h.useId();let f=!0,p=h.useMemo(()=>(f=!1,{id:w,initial:t,isPresent:n,custom:r,onExitComplete:g=>{d.set(g,!0);for(const b of d.values())if(!b)return;s&&s()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,s]);return o&&f&&(p={...p}),h.useMemo(()=>{d.forEach((g,b)=>d.set(b,!1))},[n]),x.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=a.jsx(Mm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:c,children:e}),a.jsx(jn.Provider,{value:p,children:e})};function Dm(){return new Map}function Am(e=!0){const t=h.useContext(jn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,o=h.useId();h.useEffect(()=>{if(e)return r(o)},[e]);const i=h.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,i]:[!0]}const as=e=>e.key||"";function $u(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Hu=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:c})=>{const[d,w]=Am(i),f=h.useMemo(()=>$u(e),[e]),p=i&&!d?[]:f.map(as),g=h.useRef(!0),b=h.useRef(f),v=ur(()=>new Map),N=h.useRef(new Set),[y,C]=h.useState(f),[S,T]=h.useState(f);ri(()=>{g.current=!1,b.current=f;for(let k=0;k<S.length;k++){const M=as(S[k]);p.includes(M)?(v.delete(M),N.current.delete(M)):v.get(M)!==!0&&v.set(M,!1)}},[S,p.length,p.join("-")]);const A=[];if(f!==y){let k=[...f];for(let M=0;M<S.length;M++){const _=S[M],P=as(_);p.includes(P)||(k.splice(M,0,_),A.push(_))}return o==="wait"&&A.length&&(k=A),T($u(k)),C(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.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:D}=h.useContext(ni);return a.jsx(a.Fragment,{children:S.map(k=>{const M=as(k),_=i&&!d?!1:f===S||p.includes(M),P=()=>{if(N.current.has(M))return;if(N.current.add(M),v.has(M))v.set(M,!0);else return;let E=!0;v.forEach(O=>{O||(E=!1)}),E&&(D==null||D(),T(b.current),i&&(w==null||w()),s&&s())};return a.jsx(Im,{isPresent:_,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:c,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:k},M)})})},ea=h.createContext({strict:!1}),zu={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"]};let Uu=!1;function km(){if(Uu)return;const e={};for(const t in zu)e[t]={isEnabled:n=>zu[t].some(s=>!!n[s])};Mu(e),Uu=!0}function ju(){return km(),Rh()}function Gu(e){const t=ju();for(const n in e)t[n]={...t[n],...e[n]};Mu(t)}function Ku({children:e,features:t,strict:n=!1}){const[,s]=h.useState(!ta(t)),r=h.useRef(void 0);if(!ta(t)){const{renderer:o,...i}=t;r.current=o,Gu(i)}return h.useEffect(()=>{ta(t)&&t().then(({renderer:o,...i})=>{Gu(i),r.current=o,s(!0)})},[]),a.jsx(ea.Provider,{value:{renderer:r.current,strict:n},children:e})}function ta(e){return typeof e=="function"}const _m=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","propagate","ignoreStrict","viewport"]);function os(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||_m.has(e)}let Yu=e=>!os(e);function Pm(e){typeof e=="function"&&(Yu=t=>t.startsWith("on")?!os(t):e(t))}try{Pm(require("@emotion/is-prop-valid").default)}catch{}function Vm(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(Yu(r)||n===!0&&os(r)||!t&&!os(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const is=h.createContext({});function Om(e,t){if(ss(e)){const{initial:n,animate:s}=e;return{initial:n===!1||dn(n)?n:void 0,animate:dn(s)?s:void 0}}return e.inherit!==!1?t:{}}function Fm(e){const{initial:t,animate:n}=Om(e,h.useContext(is));return h.useMemo(()=>({initial:t,animate:n}),[Xu(t),Xu(n)])}function Xu(e){return Array.isArray(e)?e.join(" "):e}const na=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zu(e,t,n){for(const s in t)!ye(t[s])&&!ku(s,n)&&(e[s]=t[s])}function Wm({transformTemplate:e},t){return h.useMemo(()=>{const n=na();return Jr(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lm(e,t){const n=e.style||{},s={};return Zu(s,n,e),Object.assign(s,Wm(e,t)),s}function Bm(e,t){const n={},s=Lm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const Ju=()=>({...na(),attrs:{}});function qm(e,t,n,s){const r=h.useMemo(()=>{const o=Ju();return _u(o,t,Vu(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Zu(o,e.style,e),r.style={...o,...r.style}}return r}const $m=["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 sa(e){return typeof e!="string"||e.includes("-")?!1:!!($m.indexOf(e)>-1||/[A-Z]/u.test(e))}function Hm(e,t,n,{latestValues:s},r,o=!1,i){const l=(i??sa(e)?qm:Bm)(t,s,r,e),c=Vm(t,typeof e=="string",o),d=e!==h.Fragment?{...c,...l,ref:n}:{},{children:w}=t,f=h.useMemo(()=>ye(w)?w.get():w,[w]);return h.createElement(e,{...d,children:f})}function zm({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Um(n,s,r,e),renderState:t()}}function Um(e,t,n,s){const r={},o=s(e,{});for(const f in o)r[f]=Sm(o[f]);let{initial:i,animate:u}=e;const l=ss(e),c=Cu(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"&&!ns(w)){const f=Array.isArray(w)?w:[w];for(let p=0;p<f.length;p++){const g=qr(e,f[p]);if(g){const{transitionEnd:b,transition:v,...N}=g;for(const y in N){let C=N[y];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(r[y]=C)}for(const y in b)r[y]=b[y]}}}return r}const Qu=e=>(t,n)=>{const s=h.useContext(is),r=h.useContext(jn),o=()=>zm(e,t,s,r);return n?o():ur(o)},jm=Qu({scrapeMotionValuesFromProps:Qr,createRenderState:na}),Gm=Qu({scrapeMotionValuesFromProps:Ou,createRenderState:Ju}),Km=Symbol.for("motionComponentSymbol");function Ym(e,t,n){const s=h.useRef(n);h.useInsertionEffect(()=>{s.current=n});const r=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=s.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(r.current=l)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o)},[t])}const Xm=h.createContext({});function Zm(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Jm(e,t,n,s,r,o){var C,S;const{visualElement:i}=h.useContext(is),u=h.useContext(ea),l=h.useContext(jn),c=h.useContext(Rr),d=c.reducedMotion,w=c.skipAnimations,f=h.useRef(null),p=h.useRef(!1);s=s||u.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:w,isSVG:o}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const g=f.current,b=h.useContext(Xm);g&&!g.projection&&r&&(g.type==="html"||g.type==="svg")&&Qm(f.current,n,r,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const N=n[uu],y=h.useRef(!!N&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,N)));return ri(()=>{p.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),y.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,N)}),y.current=!1),g.enteringChildren=void 0)}),g}function Qm(e,t,n,s){const{layoutId:r,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:Ru(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||u&&Zm(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:l,layoutRoot:c})}function Ru(e){if(e)return e.options.allowProjection!==!1?e.projection:Ru(e.parent)}function Rm(e,{forwardMotionProps:t=!1,type:n}={},s,r){const o=n?n==="svg":sa(e),i=o?Gm:jm;function u(c,d){let w;const f={...h.useContext(Rr),...c,layoutId:eg(c)},{isStatic:p}=f,g=Fm(c),b=i(c,p);if(!p&&si){tg(f,s);const v=ng(f);w=v.MeasureLayout,g.visualElement=Jm(e,b,f,r,v.ProjectionNode,o)}return a.jsxs(is.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...f}):null,Hm(e,c,Ym(b,g.visualElement,d),b,p,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[Km]=e,l}function eg({layoutId:e}){const t=h.useContext(ni).id;return t&&e!==void 0?t+"-"+e:e}function tg(e,t){h.useContext(ea).strict,process.env.NODE_ENV}function ng(e){const t=ju(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const sg=(e,t)=>t.isSVG??sa(e)?new mm(t):new cm(t,{allowProjection:e!==h.Fragment});class rg extends Ft{constructor(t){super(t),t.animationState||(t.animationState=xm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ns(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 ag=0;class og extends Ft{constructor(){super(...arguments),this.id=ag++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.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 ig={animation:{Feature:rg},exit:{Feature:og}};function el(e){return{point:{x:e.pageX,y:e.pageY}}}function tl(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=s[r];o&&He.postRender(()=>o(t,el(t)))}class ug extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=$h(t,(n,s)=>(tl(this.node,s,"Start"),r=>tl(this.node,r,"End"))))}unmount(){}}class lg 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(Bu(this.node.current,"focus",()=>this.onFocus()),Bu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nl(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=s[r];o&&He.postRender(()=>o(t,el(t)))}class cg extends Ft{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Gh(t,(r,o)=>(nl(this.node,o,"Start"),(i,{success:u})=>nl(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const ra=new WeakMap,aa=new WeakMap,dg=e=>{const t=ra.get(e.target);t&&t(e)},wg=e=>{e.forEach(dg)};function fg({root:e,...t}){const n=e||document;aa.has(n)||aa.set(n,{});const s=aa.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(wg,{root:e,...t})),s[r]}function pg(e,t,n){const s=fg(t);return ra.set(e,n),s.observe(e),()=>{ra.delete(e),s.unobserve(e)}}const hg={some:0,all:1};class mg extends Ft{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:hg[r]},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(),f=c?d:w;f&&f(l)};return pg(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(gg(t,n))&&this.startObserver()}unmount(){}}function gg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sl={renderer:sg,...ig,...{inView:{Feature:mg},tap:{Feature:cg},focus:{Feature:lg},hover:{Feature:ug}}};function bg(e,t){return Rm(e,t)}const rl=bg("div"),yg=e=>{const{checked:t,onSelect:n,children:s,disabled:r,preventCloseOnSelect:o}=e;return a.jsx(Xo,{disabled:r,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:s})},us=e=>{const{children:t,className:n,Icon:s,iconPosition:r="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",s&&(r==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),c=d=>{i&&i(d),u&&d.preventDefault()};return a.jsxs(zn,{onSelect:c,disabled:o,className:l,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},vg=e=>{const{children:t,Label:n,...s}=e;return a.jsxs(Go,{...s,children:[a.jsx(tn,{children:n||e.label}),t]})},xg=e=>{const{options:t,value:n,onSelect:s}=e;return a.jsx(hf,{value:n,onValueChange:s,children:t.map(r=>a.jsx(Zo,{value:r.value,disabled:r.disabled,children:r.Label||r.label},r.value))})},Ng=e=>{const{className:t,...n}=e,s=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Un,{...n,className:s})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:s,...r},o)=>a.jsxs(lt.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(lt.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...r,children:t}),a.jsx(oa,{thumbColor:n,railColor:s}),a.jsx(lt.Corner,{})]}));Wt.displayName=lt.Root.displayName;const oa=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:s="#eeeeee",...r},o)=>a.jsx(lt.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("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:s},...r,children:a.jsx(lt.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));oa.displayName=lt.ScrollAreaScrollbar.displayName;const Sg=e=>{const{children:t,label:n,Label:s,open:r,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(pf,{...l,open:r,onOpenChange:o,children:[a.jsx(Ko,{dir:u,children:s||n}),a.jsx(ff,{children:a.jsx(Yo,{onInteractOutside:c=>c.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Cg="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",ia=e=>{const{children:t,menuTitle:n,MenuTitle:s,variant:r="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:c,dir:d,Trigger:w,align:f="start",sideOffset:p=0,side:g="bottom",alignOffset:b,className:v,disabled:N,...y}=e;return a.jsxs(Uo,{...y,open:i,onOpenChange:u,dir:d,children:[a.jsx(jo,{asChild:!0,dir:d,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Tg(r,o,N)}),a.jsx(or,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:f,sideOffset:p,side:g,alignOffset:b,onInteractOutside:C=>c&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:d,children:[(n||s)&&a.jsxs(a.Fragment,{children:[a.jsx(tn,{dir:d,className:"wu-menu-title",children:s||n}),a.jsx(Un,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Tg=(e,t,n)=>{const s=m(Cg,"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:s,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("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")})]})},Eg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[s,r]=h.useState(!1);return a.jsx(ia,{className:"wu-rounded-sm",open:s,onOpenChange:r,align:t==="rtl"?"end":"start",sideOffset:8,Trigger:a.jsx(De,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-p-0"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",s&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(us,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Mg=({titles:e,currentLevel:t,initial:n,handleTitleClick:s,headerClasses:r,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition",t!==n?"wu-translate-y-0 wu-opacity-100 wu-z-50 wu-delay-200":"wu-translate-y-1 wu-opacity-0 wu-z-0 wu-delay-0",r),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Eg,{titles:e,handleTitleClick:s,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Ku,{features:sl,children:a.jsxs(Hu,{initial:!1,mode:"popLayout",children:[Ig(e).map((l,c)=>a.jsx(rl,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:s,className:m("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-2 wu-h-6",c===2||c===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[c!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light",i==="rtl"&&"wu-rotate-180")}),l.title]})},l.id)),"``"]})})})]})},Ig=e=>{const t=e.length;if(t>2){const n=e[0],s=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},s]}return e},Dg=({items:e,initial:t,baseTitle:n,mode:s="popLayout",headerClasses:r="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,c]=h.useState(n?[n]:[]),[[d,w],f]=h.useState([t,1]),p=(N,y)=>{y&&c([...l,y]),f([N,1])},g=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);c(C)}f([N,-1])},b=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==d){const S=l.findIndex(T=>T.id===C);S!==-1&&(c(l.slice(0,S+1)),g(C))}},v=()=>{const N=e[d]?e[d]:null;if(!N)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 y=typeof N.component=="function"?N.component({goNext:p,goBack:g}):N.component;return a.jsx(rl,{dir:u,custom:w,variants:Ag(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:d!==t?`${o}px`:"0px"},children:y},d)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Mg,{titles:l,currentLevel:d,initial:t,handleTitleClick:b,headerClasses:r,offsetHeight:o,dir:u}),a.jsx(Ku,{features:sl,children:a.jsx(Hu,{initial:!1,custom:w,mode:s,children:v()})})]})},Ag=e=>{switch(e){case"slideRight":return _g;case"slideLeft":return Pg;case"fadeZoom":return Vg;case"default":default:return kg}},kg={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})},_g={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})},Pg={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})},Vg={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}},al=({className:e,isLoading:t,loadingText:n,children:s,...r})=>a.jsxs("footer",{className:m("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),...r,children:[a.jsx("div",{className:"wu-flex-1",children:s}),t&&a.jsx(dt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});al.displayName="WuFooter";const ol=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:s,variant:r="primary",...o}=e,i=n==="sm"?16:18,u=s.includes("http")?s:`/help/${s}.html`,l=r==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Is(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});ol.displayName="WuHelpButton";const st=(e,t)=>`wu-listbox-${e}`;function Og(e){const{option:t,accessorKey:n,onSelect:s,multiple:r,dir:o,GroupLabel:i,Item:u,isSelected:l,...c}=e,d=n.group&&Array.isArray(t[n.group]),w=({item:f,className:p})=>h.createElement(en,{...c,key:JSON.stringify(f),onSelect:()=>s==null?void 0:s(f),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(f))&&!r&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",p,st("item")),disabled:f.disabled},r&&a.jsx(qe,{checked:l==null?void 0:l(f)}),u?u({value:f,isSelected:l==null?void 0:l(f)}):a.jsx(a.Fragment,{children:f[n.label]}));if(d){const f=t[n.group],p=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(Rt,{heading:p,children:f==null?void 0:f.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const Fg=h.memo(Og),Wg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Ho,{...n,"aria-label":"Search",className:m("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;",st("input"),t)})]})},Lg=e=>{const{label:t,onSelectAll:n,data:s,value:r}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!r||!s||(i(r.length>0),l(r.length>0&&r.length<s.length))},[s,r]),a.jsxs(en,{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(qe,{checked:o,partial:u}),t||"Select All"]})},Bg=e=>{const{CustomTrigger:t,disabled:n,value:s,placeholder:r,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:c,className:d,...w}=e,[f,p]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!s){p(null);return}p(Array.isArray(s)?i?s.map((v,N)=>i({value:v,unselect:u,key:N})):s.map(v=>v[o.label]).join(", "):i?i({value:s,unselect:u}):s[o.label])},[s,i,o.label,p]),a.jsx(wt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(s))||a.jsxs("button",{...w,className:m("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,st("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!f&&"wu-font-light"),children:f||r}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("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",st("drop-icon"))})]})})},il=(e,t,n)=>{const s=String(e[n.label]??"").toLowerCase(),r=String(e[n.value]??"").toLowerCase();return s.includes(t)||r.includes(t)},qg=(e,t,n)=>{const s=t.trim();if(s==="")return e;const r=s.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=>il(d,r,n));c.length>0&&o.push({...i,[u]:c})}else il(i,r,n)&&o.push(i)}return o},ul=e=>{const{data:t,accessorKey:n,value:s,Item:r,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:c,Chip:d,onSelect:w,onScroll:f,disabled:p,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:S,className:T,listClass:A,placeholder:D="Select items...",variant:k,labelPosition:M="top",maxContentWidth:_,maxContentHeight:P,modal:E,...O}=e,[L,F]=h.useState(!1),[B,W]=h.useState(""),[$,G]=h.useState(s),Z=h.useMemo(()=>n,[n]),U=h.useMemo(()=>{if(!b||!B)return t;const V=B.toLowerCase().trim();return qg(t,V,n)},[t,B,n.label,b]),J=V=>{g?G(H=>{const Y=V[n.value],K=Array.isArray(H)?H:[],j=K.some(ee=>ee[n.value]===Y)?K.filter(ee=>ee[n.value]!==Y):[...K,V];return w&&w(j),j}):(G(V),w&&w(V),F(!1))},ie=h.useCallback(V=>{const H=V?t:[];G(H),v!=null&&v.onSelectAll&&v.onSelectAll(V),w&&w(H)},[t,v,w]),fe=V=>Array.isArray($)?$.some(H=>H[n.value]===V[n.value]):($==null?void 0:$[n.value])===V[n.value];h.useEffect(()=>{G(s)},[s]);const Se=V=>{const H=(Y,K)=>{const me=n.group&&Array.isArray(Y[n.group]),j=y&&me&&K>0&&V.length>1;return a.jsxs(h.Fragment,{children:[j&&a.jsx(ar,{}),a.jsx(Fg,{option:Y,accessorKey:Z,multiple:g,onSelect:ee=>J(ee),dir:S,GroupLabel:i,Item:r,isSelected:ee=>fe(ee)})]},JSON.stringify(Y))};return V.length>N?a.jsx(Mt,{list:V,callback:(Y,K)=>H(K,Y),dir:S}):V.map((Y,K)=>H(Y,K))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",st("container")),dir:S,children:[o&&a.jsx(Ae,{htmlFor:C,className:st("label"),children:o}),a.jsxs(Ue,{open:L,onOpenChange:V=>{F(V),V||setTimeout(()=>{W("")},100)},modal:E,children:[a.jsx(Bg,{CustomTrigger:l,disabled:p,value:$,accessorKey:n,placeholder:D,Chip:d,className:T,handleUnselect:J,variant:k,id:C,dir:S,...O}),a.jsx(Be,{className:m("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",st("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(nr,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(Wg,{value:B,onValueChange:W}),u,a.jsxs(sr,{className:m("wu-overflow-y-auto",st("list"),A),onScroll:f,style:{maxHeight:P||"420px"},children:[a.jsx(rr,{children:c||"No results found."}),a.jsx(Rt,{children:g&&(v==null?void 0:v.enabled)&&!B&&a.jsx(Lg,{data:t,value:$,onSelectAll:ie,label:v.label})}),a.jsx(Rt,{children:Se(U)})]})]})})]})]})},ua=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...s},r)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...s,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:r,"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}})]})});ua.displayName="WuMenuIcon";const ll={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%]"},cl=te.Root,dl=te.Trigger,$g=te.Portal,Hg=te.Close,wl=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ll.overlay,e),...t}));wl.displayName=te.Overlay.displayName;const la=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:s,...r},o)=>a.jsxs($g,{children:[a.jsx(wl,{className:s?"wu-bg-transparent":""}),a.jsxs(te.Content,{ref:o,className:m("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",ll.content,e),...r,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Tt,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));la.displayName=te.Content.displayName;const ca=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});ca.displayName="DialogHeader";const fl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});fl.displayName="DialogFooter";const da=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("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}));da.displayName=te.Title.displayName;const zg=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));zg.displayName=te.Description.displayName;const Ug={gradientBackground:"_gradientBackground_1uc4j_1"},pl=e=>{const{colors:t,size:n=.55,children:s,className:r,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.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 f=p=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=c.getBoundingClientRect();let b=p.clientX-g.left,v=p.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const N=`radial-gradient(
16
16
  var(--width) var(--height) ellipse at ${b}px ${v}px,
17
17
  var(--colors)
18
- )`;c.style.setProperty("--spotlight-background",y)})};return window.addEventListener("mousemove",f),()=>{window.removeEventListener("mousemove",f),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:p(Bg.gradientBackground,"wu-transform-gpu",r),...u,children:s})},ls={wuModalBodyWrapper:"_wuModalBodyWrapper_10o33_1","wu-modal-footer":"_wu-modal-footer_10o33_5","wu-modal-content":"_wu-modal-content_10o33_5","wu-modal-header":"_wu-modal-header_10o33_9"},pl="calc(100vh - 64px)",qg={sm:"400px",md:"600px",lg:"1200px"},$g=({Trigger:e,children:t,size:n="md",hideCloseButton:s,preventClickOutside:r,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:c,className:d,style:w,variant:f="action",...m})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(ll,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(cl,{asChild:!0,children:e}),a.jsx(la,{style:{width:"calc(100% - 64px)",maxWidth:l||qg[n],maxHeight:c||pl,...w},hideCloseButton:s,onInteractOutside:b=>r&&b.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":f,className:p("wu-group wu-rounded-[1.1rem]",ls.wuModalBodyWrapper,d),...m,children:a.jsx(fl,{colors:g[f],strokeWidth:4,className:p("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:c||pl},children:t})})]})},Hg=({children:e,className:t,...n})=>a.jsx("div",{className:p("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",ls["wu-modal-content"],t),...n,children:e}),zg=({children:e,className:t,...n})=>a.jsx(ca,{...n,"data-variant":"action",className:p("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-xl wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",ls["wu-modal-header"],t),children:a.jsx(da,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),Ug=({children:e,className:t,...n})=>a.jsx(wl,{...n,className:p("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-xl wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",ls["wu-modal-footer"],t),children:e}),jg=({children:e,className:t,...n})=>{const s=h.useRef(null);return a.jsx(Wg,{asChild:!0,children:a.jsx(Te,{className:t,ref:s,...n,children:e})})},Gg=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:s,variant:r="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,width:w,...f})=>{const[m,g]=h.useState(""),[b,v]=h.useState(e);h.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),g("");return}const N=s.label;if(n&&Array.isArray(t)){const C=t.map(S=>S[N]).join(", ");g(C)}else!n&&!Array.isArray(t)&&g(t[N])},[t,s.label,n,e]);const y=()=>e&&!m?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):a.jsx("span",{className:p("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(Uo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...f,disabled:l,className:p("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",r==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",f.className),children:[i??y(),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"})]})})},hl=({option:e,value:t,multiple:n=!1,onSelect:s,accessorKey:r,dir:o="ltr"})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[r.value])):JSON.stringify(t[r.value]))},[t,r.value,n]);const l=n?i.includes(JSON.stringify(e[r.value])):i===JSON.stringify(e[r.value]),c=d=>{e.disabled||(s(e),n&&d.preventDefault())};return a.jsxs(zn,{onClick:c,disabled:e.disabled,className:p("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(Be,{checked:l}),a.jsx(ml,{option:e,accessorKey:r})]})},ml=({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"})]})},gl=e=>{const{option:t,handleSelectAll:n,isCheckedAll:s,isPartialSelected:r,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(zn,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:p("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Be,{"data-partial":r,checked:s||r,partial:r}),a.jsx(ml,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(jo,{dir:o.dir,children:[a.jsx(tn,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>h.createElement(hl,{...o,option:u,key:l}))]});case"divider":return a.jsx(Un,{className:"wu-mx-4"});default:return a.jsx(hl,{...o,option:t})}},Kg=e=>{let t=0,n=0;const s=[],r=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(s.push(i),i.disabled||r.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:r,totalData:s.length,cleanData:s}},Yg=100,Xg=400,bl=({data:e,onSelect:t,multiple:n=!1,defaultValue:s,value:r,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:c,virtualizedThreshold:d=Yg,maxHeight:w=Xg,hasGroup:f=!1,Header:m,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:y="top",onScroll:N,maxContentWidth:C,...S})=>{const[T,A]=h.useState(),k=h.useRef(null),[E,D]=h.useState(!1),[P,_]=h.useState(!1),{cleanData:M,enabledOptions:F}=f||b!=null&&b.enable?Kg(e):{cleanData:e,enabledOptions:[]},B=h.useMemo(()=>n&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,n]),O=h.useCallback(z=>{const U=z[o.value];if(n)A((ce=[])=>{const se=ce,ge=se.some(Pe=>Pe[o.value]===U)?se.filter(Pe=>Pe[o.value]!==U):[...se,z];return t==null||t(ge),ge});else{const ce=z;A(ce),t==null||t(ce)}},[n,o.value,t]);h.useEffect(()=>{if(s&&r){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!r&&A(void 0),s!==void 0&&A(s),r!==void 0&&A(r)},[s,r]);const $=B.length>d;h.useEffect(()=>{if(!n)return;const z=b!=null&&b.includeDisabled?(T==null?void 0:T.length)===e.length:(T==null?void 0:T.length)===F.length;D(z);const U=(T==null?void 0:T.length)>0&&!z;_(U)},[T,b]);const V=h.useCallback(()=>{const z=E?[]:b!=null&&b.includeDisabled?f?M:e:F;A(z),t==null||t(z)},[E,n,e,F,t,b]),H=An(y);return a.jsxs("div",{className:p(H,"wu-flex wu-select-container"),ref:k,dir:u,children:[a.jsxs(zo,{children:[a.jsx(Gg,{...S,value:T,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:g,id:S.id,disabled:v,selectAll:b,isCheckedAll:E}),a.jsxs(or,{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:S.id,style:{maxWidth:C},children:[m,$?a.jsx(It,{list:B,containerHeight:w,callback:(z,U)=>a.jsx(gl,{option:U,accessorKey:o,multiple:n,onSelect:O,value:T,dir:u,handleSelectAll:V,isCheckedAll:E,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:N,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:B.map((z,U)=>a.jsx(gl,{option:z,accessorKey:o,multiple:n,onSelect:O,value:T,handleSelectAll:V,isCheckedAll:E,dir:u,isPartialSelected:P},`${U}`))})]})]}),c&&a.jsx(Ee,{htmlFor:S.id,className:"wu-select-label",children:c})]})},cs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zg=({value:e,onChange:t,min:n=j.sub(new Date,{years:5}),max:s=j.add(new Date,{years:1}),placeholder:r="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:c,disabledMonths:d=[],...w})=>{const[f,m]=h.useState(null),[g,b]=h.useState(""),[v,y]=h.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),N=h.useMemo(()=>{const S=new Date(n).getFullYear(),T=new Date(s).getFullYear();return Array.from({length:T-S+1},(A,k)=>({value:T-k,label:T-k}))},[n,s]);h.useEffect(()=>{if(e){const S=new Date(e),T=S.getFullYear(),A=S.getMonth();m({year:T,month:A}),b(`${cs[A]} ${T}`),y({value:T,label:T})}},[e]);const C=()=>{f&&t&&(t(new Date(f.year,f.month,15)),b(`${cs[f.month]} ${f.year}`))};return a.jsxs("div",{className:p("wu-flex wu-flex-col wu-items-center",An(i),i==="top"&&"wu-items-start"),children:[a.jsxs(ze,{children:[a.jsx($s,{...w,disabled:u||c,id:l,dir:"ltr",placeholder:r,formattedString:g}),a.jsxs(Le,{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(bl,{data:N,accessorKey:{value:"value",label:"label"},value:v,onSelect:S=>y(S),multiple:!1,maxHeight:224})}),a.jsx(Jg,{year:v==null?void 0:v.value,selectedMonth:f==null?void 0:f.month,selectedYear:f==null?void 0:f.year,onClick:(S,T)=>m({year:T,month:S}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(qt.PopoverClose,{asChild:!0,children:a.jsx(Te,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(Ee,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},Jg=({year:e,selectedMonth:t,selectedYear:n,onClick:s,disabledMonths:r=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=h.useMemo(()=>{const c=new Set;return r.forEach(d=>{const w=typeof d=="string"?new Date(d):d;c.add(`${w.getFullYear()}-${w.getMonth()}`)}),c},[r]);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:cs.map((c,d)=>{const w=e===i&&d===u,f=t===d&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${d}`),onClick:()=>s(d,e),className:p("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",f&&"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":`${cs[d]} ${e}`,"data-month":d,"data-year":e,children:c},c)})})},yl=(e,t,n,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,i]=h.useState([]),[u,l]=h.useState([]);return h.useEffect(()=>{const c=()=>{var g,b;const d=((g=t.current)==null?void 0:g.clientWidth)||0,w=((b=n.current)==null?void 0:b.clientWidth)||0,f=d-w,m=Math.floor(f/s);i(e.slice(0,m)),l(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,s]),[o,u]},vl={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Qg=e=>{const{Links:t,children:n,className:s,...r}=e,o=h.useMemo(()=>t.map((d,w)=>h.cloneElement(d,{className:p(vl.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:w})),[t]),i=h.useRef(null),u=h.useRef(null),[l,c]=yl(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:p("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...r,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(dt,{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(Le,{className:p(vl.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(dt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Le,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},wa={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Rg=e=>{const{Links:t,children:n,className:s,...r}=e,o=h.useMemo(()=>t.map((w,f)=>h.cloneElement(w.link,{key:f,className:p(wa.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[h.cloneElement(w.imgOrIcon,{className:p("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=h.useRef(null),u=h.useRef(null),l=h.useRef(null),[c,d]=yl(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:p("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...r,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:p(wa.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(dt,{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(Le,{className:p(wa.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(dt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Le,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},xl=h.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:s,className:r,disabled:o=!1,...i},u)=>{const[l,c]=h.useState(t),[d,w]=h.useState(n);h.useEffect(()=>{c(t),w(n)},[t,n]);const f=Math.ceil(e/d),m=l*d+1,g=Math.min((l+1)*d,e),b=Array.from({length:f},(N,C)=>C),v=h.useCallback(N=>{N>=0&&N<f&&(c(N),s==null||s(N))},[f,s]),y=224;return a.jsxs("div",{className:p("wu-flex wu-items-center wu-gap-[2px]",r,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Nl,{label:"Previous page",onClick:()=>v(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(ia,{name:`${m} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Wt,{style:{maxHeight:y+"px"},dir:i.dir,children:b.length>100?a.jsx(It,{className:"wu-pagination-list",containerHeight:y,list:b,callback:(N,C)=>a.jsxs(us,{onSelect:()=>v(C),className:p("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*d+1," -"," ",Math.min((C+1)*d,e)]},N)}):b.map(N=>a.jsxs(us,{onSelect:()=>v(N),className:p(N===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[N*d+1," -"," ",Math.min((N+1)*d,e)]},N))})}),a.jsx(Nl,{label:"Next page",onClick:()=>v(l+1),disabled:l===f-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});xl.displayName="WuPagination";const Nl=({label:e,onClick:t,disabled:n,icon:s,className:r})=>a.jsx(Te,{variant:"iconOnly",onClick:t,disabled:n,className:p("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",r),"aria-label":e,children:a.jsx("span",{className:p("wu-text-sm",s)})}),Sl=x.forwardRef(({className:e,...t},n)=>a.jsx(zt.Root,{className:p("wu-grid wu-gap-2",e),...t,ref:n}));Sl.displayName=zt.Root.displayName;const Cl=x.forwardRef(({className:e,...t},n)=>a.jsx(zt.Item,{ref:n,className:p("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(zt.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"})})}));Cl.displayName=zt.Item.displayName;const Tl=h.forwardRef((e,t)=>{const{options:n,defaultValue:s,onChange:r,label:o,dir:i,...u}=e;return a.jsxs(Sl,{defaultValue:s,required:u.required,disabled:u.disabled,onValueChange:r,id:u.id,dir:i,name:u.name,className:p("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Pn,{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(Cl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Pn,{htmlFor:l.value,className:p(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});Tl.displayName="WuRadioGroup";const eb=e=>{const{children:t,...n}=e;return a.jsxs(Wt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(oa,{orientation:"horizontal"})]})},El=x.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:p("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:s,...n}));El.displayName="Input";const Il=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...s},r)=>a.jsx(za.Root,{ref:r,decorative:n,orientation:t,className:p("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...s}));Il.displayName=za.Root.displayName;function Ml({className:e,...t}){return a.jsx("div",{className:p("animate-pulse rounded-md bg-muted",e),...t})}const fa=768;function pa(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${fa-1}px)`),s=()=>{t(window.innerWidth<fa)};return n.addEventListener("change",s),t(window.innerWidth<fa),()=>n.removeEventListener("change",s)},[]),!!e}const tb="sidebar_state",nb=3600*24*7,sb="256px",rb="256px",ab="3rem",ob="b",Dl=x.createContext(null);function rt(){const e=x.useContext(Dl);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Al=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:s,style:r,children:o,...i},u)=>{const l=pa(),[c,d]=x.useState(!1),[w,f]=x.useState(l?!0:e),m=t??w,g=x.useCallback(N=>{const C=typeof N=="function"?N(m):N;n?n(C):f(C),document.cookie=`${tb}=${C}; path=/; max-age=${nb}`},[n,m]),b=x.useCallback(()=>l?d(N=>!N):g(N=>!N),[l,g,d]);x.useEffect(()=>{const N=C=>{C.key===ob&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const v=m?"expanded":"collapsed",y=x.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:b}),[v,m,g,l,c,d,b]);return a.jsx(Dl.Provider,{value:y,children:a.jsx(Ra,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":sb,"--sidebar-width-icon":ab,...r},className:p("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:u,...i,children:o})})})});Al.displayName="SidebarProvider";const kl=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:s,children:r,...o},i)=>{const{isMobile:u,state:l,openMobile:c,setOpenMobile:d}=rt();return n==="none"?a.jsx("div",{className:p("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:i,...o,children:r}):u?a.jsx(Qo,{open:c,onOpenChange:d,...o,children:a.jsx(ir,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":rb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:r})})}):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:p("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:p("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",s),...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:r})})]})});kl.displayName="Sidebar";const _l=x.forwardRef(({className:e,onClick:t,children:n,...s},r)=>{const{toggleSidebar:o}=rt();return a.jsxs(Tt,{ref:r,"data-sidebar":"trigger",variant:"secondary",className:p("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()},...s,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});_l.displayName="SidebarTrigger";const ib=x.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:s}=rt();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:p("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})});ib.displayName="SidebarRail";const Pl=x.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:p("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}));Pl.displayName="SidebarInset";const ub=x.forwardRef(({className:e,...t},n)=>a.jsx(El,{ref:n,"data-sidebar":"input",className:p("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));ub.displayName="SidebarInput";const Vl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:p("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));Vl.displayName="SidebarHeader";const Ol=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:p("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Ol.displayName="SidebarFooter";const lb=x.forwardRef(({className:e,...t},n)=>a.jsx(Il,{ref:n,"data-sidebar":"separator",className:p("wu-mx-2 wu-w-auto",e),...t}));lb.displayName="SidebarSeparator";const Fl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:p("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}));Fl.displayName="SidebarContent";const Wl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:p("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Wl.displayName="SidebarGroup";const Ll=x.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const r=t?St.Slot:"div";return a.jsx(r,{ref:s,"data-sidebar":"group-label",className:p("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})});Ll.displayName="SidebarGroupLabel";const cb=x.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const r=t?St.Slot:"button";return a.jsx(r,{ref:s,"data-sidebar":"group-action",className:p("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})});cb.displayName="SidebarGroupAction";const Bl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:p("wu-w-full wu-text-sm",e),...t}));Bl.displayName="SidebarGroupContent";const ha=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:p("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));ha.displayName="SidebarMenu";const ql=x.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:p("wu-group/menu-item wu-relative",e),...t}));ql.displayName="SidebarMenuItem";const db=Fe.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"}}),$l=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:s="default",tooltip:r,className:o,...i},u)=>{const l=e?St.Slot:"button",{isMobile:c,state:d}=rt(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:p(db({variant:n,size:s}),o),...i});return r?(typeof r=="string"&&(r={children:r}),a.jsxs(eo,{children:[a.jsx(to,{asChild:!0,children:w}),a.jsx(Bs,{side:"right",align:"center",hidden:d!=="collapsed"||c,...r})]})):w});$l.displayName="SidebarMenuButton";const wb=x.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...s},r)=>{const o=t?St.Slot:"button";return a.jsx(o,{ref:r,"data-sidebar":"menu-action",className:p("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),...s})});wb.displayName="SidebarMenuAction";const fb=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:p("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}));fb.displayName="SidebarMenuBadge";const pb=x.forwardRef(({className:e,showIcon:t=!1,...n},s)=>{const r=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:p("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Ml,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Ml,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});pb.displayName="SidebarMenuSkeleton";const hb=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:p("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}));hb.displayName="SidebarMenuSub";const mb=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));mb.displayName="SidebarMenuSubItem";const gb=x.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:s,...r},o)=>{const i=e?St.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:p("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",s),...r})});gb.displayName="SidebarMenuSubButton";function bb(e){const{open:t,defaultOpen:n,onOpenChange:s,disabled:r}=e,o=t!==void 0,[i,u]=Qs({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:d}=Yw(i,!0,!0),[w,f]=x.useState(i),[{height:m,width:g},b]=x.useState({height:void 0,width:void 0}),v=mo(),[y,N]=x.useState(),C=y??v,[S,T]=x.useState(!1),[A,k]=x.useState(!1),E=x.useRef(null),D=x.useRef(null),P=x.useRef(null),_=x.useRef(null),M=Mo(_,!1),F=he(B=>{const O=!i,$=Ie(Xw,B.nativeEvent);if(s(O,$),$.isCanceled)return;const V=_.current;D.current==="css-animation"&&V!=null&&V.style.removeProperty("animation-name"),!S&&!A&&(D.current!=null&&D.current!=="css-animation"&&!l&&O&&c(!0),D.current==="css-animation"&&(!w&&O&&f(!0),!l&&O&&c(!0))),u(O),D.current==="none"&&l&&!O&&c(!1)});return ee(()=>{o&&D.current==="none"&&!A&&!i&&c(!1)},[o,A,i,t,c]),x.useMemo(()=>({abortControllerRef:E,animationTypeRef:D,disabled:r,handleTrigger:F,height:m,mounted:l,open:i,panelId:C,panelRef:_,runOnceAnimationsFinish:M,setDimensions:b,setHiddenUntilFound:T,setKeepMounted:k,setMounted:c,setOpen:u,setPanelIdState:N,setVisible:f,transitionDimensionRef:P,transitionStatus:d,visible:w,width:g}),[E,D,r,F,m,l,i,C,_,M,b,T,k,c,u,f,P,d,w,g])}const ma=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(ma.displayName="CollapsibleRootContext");function Hl(){const e=x.useContext(ma);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Ut(15));return e}let fn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Kt.startingStyle]="startingStyle",e[e.endingStyle=Kt.endingStyle]="endingStyle",e})({}),yb=(function(e){return e.panelOpen="data-panel-open",e})({});const vb={[fn.open]:""},xb={[fn.closed]:""},Nb={open(e){return e?{[yb.panelOpen]:""}:null}},zl={...{open(e){return e?vb:xb}},...Io},Ul=x.forwardRef(function(t,n){const{render:s,className:r,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,...c}=t,d=he(u),w=bb({open:l,defaultOpen:o,onOpenChange:d,disabled:i}),f=x.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),m=x.useMemo(()=>({...w,onOpenChange:d,state:f}),[w,d,f]),g=Ke("div",t,{state:f,ref:n,props:c,stateAttributesMapping:zl});return a.jsx(ma.Provider,{value:m,children:g})});process.env.NODE_ENV!=="production"&&(Ul.displayName="CollapsibleRoot");const jl=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(jl.displayName="CompositeRootContext");function Sb(e=!1){const t=x.useContext(jl);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>.":Ut(16));return t}function Cb(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:r=0,isNativeButton:o}=e,i=s&&t!==!1,u=s&&t===!1;return{props:x.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(c.tabIndex=r,!o&&n&&(c.tabIndex=t?r:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||u)&&(c.disabled=n),c},[s,n,t,i,u,o,r])}}function ga(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:r=!0}=e,o=x.useRef(null),i=Sb(!0)!==void 0,u=he(()=>{const f=o.current;return!!((f==null?void 0:f.tagName)==="A"&&(f!=null&&f.href))}),{props:l}=Cb({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:s,isNativeButton:r});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{var m,g;if(!o.current)return;const f=o.current.tagName==="BUTTON";if(r){if(!f){const b=((m=wt.captureOwnerStack)==null?void 0:m.call(wt))||"";No(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${b}`)}}else if(f){const b=((g=wt.captureOwnerStack)==null?void 0:g.call(wt))||"";No(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${b}`)}},[r]);const c=x.useCallback(()=>{const f=o.current;Tb(f)&&i&&t&&l.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,l.disabled,i]);ee(c,[c]);const d=x.useCallback((f={})=>{const{onClick:m,onMouseDown:g,onKeyUp:b,onKeyDown:v,onPointerDown:y,...N}=f;return co({type:r?"button":void 0,onClick(S){if(t){S.preventDefault();return}m==null||m(S)},onMouseDown(S){t||g==null||g(S)},onKeyDown(S){if(t||(Ks(S),v==null||v(S)),S.baseUIHandlerPrevented)return;const T=S.target===S.currentTarget&&!r&&!u()&&!t,A=S.key==="Enter",k=S.key===" ";T&&((k||A)&&S.preventDefault(),A&&(m==null||m(S)))},onKeyUp(S){t||(Ks(S),b==null||b(S)),!S.baseUIHandlerPrevented&&S.target===S.currentTarget&&!r&&!t&&S.key===" "&&(m==null||m(S))},onPointerDown(S){if(t){S.preventDefault();return}y==null||y(S)}},r?void 0:{role:"button"},l,N)},[t,l,r,u]),w=he(f=>{o.current=f,c()});return{getButtonProps:d,buttonRef:w}}function Tb(e){return Vw(e)&&e.tagName==="BUTTON"}const Eb={...Nb,...Io},Gl=x.forwardRef(function(t,n){const{panelId:s,open:r,handleTrigger:o,state:i,disabled:u}=Hl(),{className:l,disabled:c=u,id:d,render:w,nativeButton:f=!0,...m}=t,{getButtonProps:g,buttonRef:b}=ga({disabled:c,focusableWhenDisabled:!0,native:f}),v=x.useMemo(()=>({"aria-controls":r?s:void 0,"aria-expanded":r,onClick:o}),[s,r,o]);return Ke("button",t,{state:i,ref:[n,b],props:[v,m,g],stateAttributesMapping:Eb})});process.env.NODE_ENV!=="production"&&(Gl.displayName="CollapsibleTrigger");let ba;process.env.NODE_ENV!=="production"&&(ba=new Set);function Kl(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ba.has(t)||(ba.add(t),console.warn(`Base UI: ${t}`))}}let Ib=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Mb(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:s,height:r,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:c,open:d,panelRef:w,runOnceAnimationsFinish:f,setDimensions:m,setMounted:g,setOpen:b,setVisible:v,transitionDimensionRef:y,visible:N,width:C}=e,S=x.useRef(!1),T=x.useRef(null),A=x.useRef(d),k=x.useRef(d),E=Eo(),D=x.useMemo(()=>n.current==="css-animation"?!N:!d&&!l,[d,l,N,n]),P=he(M=>{if(!M)return;if(n.current==null||y.current==null){const O=getComputedStyle(M),$=O.animationName!=="none"&&O.animationName!=="",V=O.transitionDuration!=="0s"&&O.transitionDuration!=="";$&&V?process.env.NODE_ENV!=="production"&&Kl("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):O.animationName==="none"&&O.transitionDuration!=="0s"?n.current="css-transition":O.animationName!=="none"&&O.transitionDuration==="0s"?n.current="css-animation":n.current="none",M.getAttribute(Ib.orientation)==="horizontal"||O.transitionProperty.indexOf("width")>-1?y.current="width":y.current="height"}if(n.current!=="css-transition")return;(r===void 0||C===void 0)&&(m({height:M.scrollHeight,width:M.scrollWidth}),k.current&&M.style.setProperty("transition-duration","0s"));let F=-1,B=-1;return F=ie.request(()=>{k.current=!1,B=ie.request(()=>{setTimeout(()=>{M.style.removeProperty("transition-duration")})})}),()=>{ie.cancel(F),ie.cancel(B)}}),_=Fn(s,w,P);return ee(()=>{if(n.current!=="css-transition")return;const M=w.current;if(!M)return;let F=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const B={"justify-content":M.style.justifyContent,"align-items":M.style.alignItems,"align-content":M.style.alignContent,"justify-items":M.style.justifyItems};Object.keys(B).forEach(O=>{M.style.setProperty(O,"initial","important")}),!k.current&&!i&&M.setAttribute(fn.startingStyle,""),m({height:M.scrollHeight,width:M.scrollWidth}),F=ie.request(()=>{Object.entries(B).forEach(([O,$])=>{$===""?M.style.removeProperty(O):M.style.setProperty(O,$)})})}else{if(M.scrollHeight===0&&M.scrollWidth===0)return;m({height:M.scrollHeight,width:M.scrollWidth});const B=new AbortController;t.current=B;const O=B.signal;let $=null;const V=fn.endingStyle;return $=new MutationObserver(H=>{H.some(U=>U.type==="attributes"&&U.attributeName===V)&&($==null||$.disconnect(),$=null,f(()=>{m({height:0,width:0}),M.style.removeProperty("content-visibility"),g(!1),t.current===B&&(t.current=null)},O))}),$.observe(M,{attributes:!0,attributeFilter:[V]}),()=>{$==null||$.disconnect(),E.cancel(),t.current===B&&(B.abort(),t.current=null)}}return()=>{ie.cancel(F)}},[t,n,E,o,i,l,d,w,f,m,g]),ee(()=>{if(n.current!=="css-animation")return;const M=w.current;M&&(T.current=M.style.animationName||T.current,M.style.setProperty("animation-name","none"),m({height:M.scrollHeight,width:M.scrollWidth}),!A.current&&!S.current&&M.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,f(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,d,w,f,m,g,v,N]),Wn(()=>{const M=ie.request(()=>{A.current=!1});return()=>ie.cancel(M)}),ee(()=>{if(!o)return;const M=w.current;if(!M)return;let F=-1,B=-1;return d&&S.current&&(M.style.transitionDuration="0s",m({height:M.scrollHeight,width:M.scrollWidth}),F=ie.request(()=>{S.current=!1,B=ie.request(()=>{setTimeout(()=>{M.style.removeProperty("transition-duration")})})})),()=>{ie.cancel(F),ie.cancel(B)}},[o,d,w,m]),ee(()=>{const M=w.current;M&&o&&D&&(M.setAttribute("hidden","until-found"),n.current==="css-transition"&&M.setAttribute(fn.startingStyle,""))},[o,D,n,w]),x.useEffect(function(){const F=w.current;if(!F)return;function B(O){S.current=!0,b(!0),c(!0,Ie(Yt,O))}return F.addEventListener("beforematch",B),()=>{F.removeEventListener("beforematch",B)}},[c,w,b]),x.useMemo(()=>({props:{hidden:D,id:u,ref:_}}),[D,u,_])}let Yl=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const Xl=x.forwardRef(function(t,n){const{className:s,hiddenUntilFound:r,keepMounted:o,render:i,id:u,...l}=t;process.env.NODE_ENV!=="production"&&ee(()=>{r&&o===!1&&Kl("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[r,o]);const{abortControllerRef:c,animationTypeRef:d,height:w,mounted:f,onOpenChange:m,open:g,panelId:b,panelRef:v,runOnceAnimationsFinish:y,setDimensions:N,setHiddenUntilFound:C,setKeepMounted:S,setMounted:T,setPanelIdState:A,setOpen:k,setVisible:E,state:D,transitionDimensionRef:P,visible:_,width:M,transitionStatus:F}=Hl(),B=r??!1,O=o??!1;ee(()=>{if(u)return A(u),()=>{A(void 0)}},[u,A]),ee(()=>{C(B)},[C,B]),ee(()=>{S(O)},[S,O]);const{props:$}=Mb({abortControllerRef:c,animationTypeRef:d,externalRef:n,height:w,hiddenUntilFound:B,id:b,keepMounted:O,mounted:f,onOpenChange:m,open:g,panelRef:v,runOnceAnimationsFinish:y,setDimensions:N,setMounted:T,setOpen:k,setVisible:E,transitionDimensionRef:P,visible:_,width:M});Kw({open:g&&F==="idle",ref:v,onComplete(){g&&N({height:void 0,width:void 0})}});const V=x.useMemo(()=>({...D,transitionStatus:F}),[D,F]),H=Ke("div",t,{state:V,ref:[n,v],props:[$,{style:{[Yl.collapsiblePanelHeight]:w===void 0?"auto":`${w}px`,[Yl.collapsiblePanelWidth]:M===void 0?"auto":`${M}px`}},l],stateAttributesMapping:zl});return O||B||!O&&f?H:null});process.env.NODE_ENV!=="production"&&(Xl.displayName="CollapsiblePanel");const Db=({children:e,Sidebar:t,className:n,defaultOpen:s=!0,open:r,onOpenChange:o,style:i})=>a.jsxs(Al,{defaultOpen:s,open:r,onOpenChange:o,children:[a.jsxs(kl,{variant:"sidebar",collapsible:"icon",className:p("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(Vl,{className:"wu-py-2",children:a.jsx(Zl,{})}),t]}),a.jsx(Pl,{className:"wu-contain-inline-size",children:e})]}),Zl=e=>{const{state:t,isMobile:n,openMobile:s}=rt();return a.jsx(_l,{...e,children:a.jsx(ua,{showMenu:n?s:t==="expanded"})})},Ab=({className:e,children:t,...n})=>{const s=h.useRef(null),r=h.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:c,scrollHeight:d}=u;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l!==0),r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l+c!==d)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Fl,{...n,className:p("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:s}),a.jsx(Wt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:r})]})},kb=e=>a.jsx(Ol,{...e,children:e.children}),_b=({label:e,children:t,...n})=>a.jsxs(Wl,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Ll,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Bl,{children:a.jsx(ha,{children:t})})]}),Pb=e=>a.jsx(ha,{...e}),Jl=({Icon:e,children:t,className:n,isActive:s,...r})=>{var w;const{state:o}=rt(),[i,u]=h.useState(),l=pa(),c=h.isValidElement(t)?h.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:p("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:p("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),d=h.useRef(null);return h.useEffect(()=>{var f;u(((f=d.current)==null?void 0:f.textContent)||"")},[]),a.jsx(ql,{...r,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx($l,{className:p("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,s&&"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:s,tooltip:i,asChild:h.isValidElement(t),ref:d,children:c})})},Vb=({Title:e,Icon:t,children:n,className:s,...r})=>{const{state:o}=rt(),i=pa();return a.jsxs(Ul,{children:[a.jsx(Gl,{render:u=>{const l="data-panel-open"in u;return a.jsxs(Jl,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(De,{icon:"wm-arrow-forward-ios",className:p("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(Xl,{className:p(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',s),...r,children:n})]})},Ob=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"}]]),ya=(e,t,n=1)=>{const s=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!s)throw new Error("Invalid HSL color format");const r=parseFloat(s[1]),o=parseFloat(s[2]),i=Math.max(0,parseFloat(s[3])+t);return`hsl(${r} ${o}% ${i}% / ${n})`},Fb=({index:e,viewIndex:t,length:n,itemHeight:s})=>{const r=(e-t+n)%n;let o;r===0?o=0:r===n-1&&n>=2?o=-1:r===n-2&&n>=3?o=-2:r===1?o=1:r===2?o=2:r===n-3&&n>=4?o=-3:o=3;const i=Ob.get(o)||{},u=o>0?s+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":s}}},pn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Wb=({children:e,className:t,header:n,baseColor:s,position:r=0,style:o,...i})=>{const u=r<=0,l=r===0,c={border:l?`4px solid ${ya(s,pn.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:ya(s,r*pn.LIGHTNESS_STEP),fontSize:l?pn.FONT_SIZE_ACTIVE:pn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:r<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:ya(s,45+r*6),height:pn.CONTENT_HEIGHT,position:"relative",bottom:r<0?"4px":"0px"};return a.jsxs("div",{className:p("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})]})},Lb=({children:e,Trigger:t,Header:n,styles:s={},classNames:r={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...s.Trigger};return a.jsxs(ll,{open:o,onOpenChange:i,children:[a.jsx(cl,{className:p("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",r.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(la,{className:p("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",r.Content),hideCloseButton:!0,isStackedCard:!0,style:s.Content,children:[a.jsx(da,{}),a.jsx(qa.DialogClose,{className:p("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",r.CloseButton),style:s.CloseButton,"aria-label":"Close dialog",children:a.jsx(De,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(ca,{className:p("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",r.Header),style:s.Header,children:n}),e]})]})},Ql=0;class va extends Ln{constructor(){super(...arguments);Se(this,"clear",()=>{this.currentId!==Ql&&(clearInterval(this.currentId),this.currentId=Ql)})}static create(){return new va}start(n,s){this.clear(),this.currentId=setInterval(()=>{s()},n)}}function Bb(){const e=Je(va.create).current;return Wn(e.disposeEffect),e}function Rl(e){const t=Je(qb,e).current;return t.next=e,ee(t.effect),t}function qb(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function $b(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}const ec={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Hb={...ec,position:"fixed",top:0,left:0},zb={...ec,position:"absolute"},xa=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(xa.displayName="NumberFieldRootContext");function ds(){const e=x.useContext(xa);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>.":Ut(43));return e}const hn={inputValue:()=>null,value:()=>null,...Us},tc=new Map;function mn(e,t){const n=JSON.stringify({locale:e,options:t}),s=tc.get(n);if(s)return s;const r=new Intl.NumberFormat(e,t);return tc.set(n,r),r}function Lt(e,t,n){return e==null?"":mn(t,n).format(e)}function nc(e,t,n){return Lt(e,t,{...n,maximumFractionDigits:20})}const Ub=["零","〇","一","二","三","四","五","六","七","八","九"],jb={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},sc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],rc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Na=["0","1","2","3","4","5","6","7","8","9"],ac=["%","٪","%","﹪"],oc=["‰","؉"],ic=["−","-","‒","–","—","﹣"],uc=["+","﹢"],Gb=".",Kb=",",Yb=new RegExp(`[${sc.join("")}]`,"g"),Xb=new RegExp(`[${rc.join("")}]`,"g"),Zb=new RegExp(`[${Na.join("")}]`,"g"),Jb=new RegExp(`[${Ub.join("")}]`,"g"),Qb=new RegExp(`[${ac.join("")}]`),Rb=new RegExp(`[${oc.join("")}]`),Sa=/[٠١٢٣٤٥٦٧٨٩]/,lc=/[۰۱۲۳۴۵۶۷۸۹]/,Ca=/[零〇一二三四五六七八九]/,cc=new RegExp(`[${Na.join("")}]`),ey=[".",",",Gb,Kb,"٫","٬"],dc=new RegExp("\\p{Zs}","u"),ty=["+",...uc],ny=["-",...ic],ws=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),sy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),wc=e=>`[${e.map(sy).join("")}]`,fc=wc(["-"].concat(ic)),pc=wc(["+"].concat(uc)),hc=new RegExp(fc,"gu"),mc=new RegExp(pc,"gu"),gn=new RegExp(fc),fs=new RegExp(pc);function Ta(e,t){const n=mn(e,t).formatToParts(11111.1),s={};return n.forEach(r=>{s[r.type]=r.value}),mn(e).formatToParts(.1).forEach(r=>{r.type==="decimal"&&(s[r.type]=r.value)}),s}function bn(e,t,n){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(hc,"-").replace(mc,"+");let r=!1;const o=s.match(/([+-])\s*$/);o&&(o[1]==="-"&&(r=!0),s=s.replace(/([+-])\s*$/,""));const i=s.match(/^\s*([+-])/);i&&(i[1]==="-"&&(r=!0),s=s.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Sa.test(s)||lc.test(s)?u="ar":Ca.test(s)&&(u="zh"));const{group:l,decimal:c,currency:d}=Ta(u,n),w=mn(u,n).formatToParts(1).filter(k=>k.type==="unit").map(k=>ws(k.value)),f=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(ws(l),"g"));let b=[{regex:l?m:null,replacement:""},{regex:c?new RegExp(ws(c),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(ws(d),"g"):null,replacement:""},{regex:f,replacement:""},{regex:Yb,replacement:k=>String(sc.indexOf(k))},{regex:Xb,replacement:k=>String(rc.indexOf(k))},{regex:Zb,replacement:k=>String(Na.indexOf(k))},{regex:Jb,replacement:k=>jb[k]}].reduce((k,{regex:E,replacement:D})=>E?k.replace(E,D):k,s);const v=b.lastIndexOf(".");if(v!==-1&&(b=`${b.slice(0,v).replace(/\./g,"")}.${b.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const y=(r?"-":"")+b;let N=parseFloat(y);const C=n==null?void 0:n.style,S=C==="unit"&&(n==null?void 0:n.unit)==="percent",T=Qb.test(e)||C==="percent";return Rb.test(e)?N/=1e3:!S&&T&&(N/=100),Number.isNaN(N)?null:N}const ry=60,ay=400,oy=50,iy=3,uy=8,ps=1;function ly(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const cy=1e-10;function dy(e){const t=mn("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 wy(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}=dy(t);return wy(e,n)}function fy(e,t,n,s="directional"){if(n===0)return e;const r=Math.abs(n),o=Math.sign(n),i=r*cy*o,u=s==="nearest"?n:r,l=(e-t+i)/u;let c;return s==="nearest"?c=Math.round(l):o>0?c=Math.floor(l):c=Math.ceil(l),t+c*(s==="nearest"?n:r)}function py(e,{step:t,minWithDefault:n,maxWithDefault:s,minWithZeroDefault:r,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const c=l?ly(e,n,s):e;if(t!=null&&i){if(t===0)return Ea(c,o);let d=r;!u&&n!==Number.MIN_SAFE_INTEGER&&(d=n);const w=fy(c,d,t,u?"nearest":"directional");return Ea(w,o)}return Ea(c,o)}const gc=x.forwardRef(function(t,n){const{id:s,min:r,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:c=!1,disabled:d=!1,readOnly:w=!1,name:f,defaultValue:m,value:g,onValueChange:b,onValueCommitted:v,allowWheelScrub:y=!1,snapOnStep:N=!1,allowOutOfRange:C=!1,format:S,locale:T,render:A,className:k,inputRef:E,...D}=t,{setDirty:P,validityData:_,disabled:M,setFilled:F,invalid:B,name:O,state:$,validation:V,shouldValidateOnChange:H}=Vn(),z=M||d,U=O??f,ce=u==="any"?1:u,[se,_e]=x.useState(!1),ge=r??Number.MIN_SAFE_INTEGER,Pe=o??Number.MAX_SAFE_INTEGER,W=r??0,G=S==null?void 0:S.style,K=x.useRef(null),q=Fn(E,V.inputRef),Z=Do({id:s}),[ae,de]=Qs({controlled:g,default:m,name:"NumberField",state:"value"}),J=ae??null,be=Rl(J);ee(()=>{F(J!==null)},[F,J]);const Ne=$b(),He=Rl(S),Ge=x.useRef(!1),vt=he((X,Y)=>{Ge.current=!1,v==null||v(X,Y)}),Cn=xo(),Ns=Bb(),Tn=xo(),En=x.useRef(!1),In=x.useRef(0),Xe=x.useRef(!0),oe=x.useRef(null),at=x.useRef(()=>{}),[xt,Ss]=x.useState(()=>g!==void 0?bc(J,T,S):Lt(J,T,S)),[dd,uv]=x.useState("numeric"),wd=he(()=>{const{decimal:X,group:Y,currency:ue,literal:fe}=Ta(T,S),te=new Set;ey.forEach(ye=>te.add(ye)),X&&te.add(X),Y&&(te.add(Y),dc.test(Y)&&te.add(" "));const Ve=G==="percent"||G==="unit"&&(S==null?void 0:S.unit)==="percent",Oe=G==="percent"||G==="unit"&&(S==null?void 0:S.unit)==="permille";return Ve&&ac.forEach(ye=>te.add(ye)),Oe&&oc.forEach(ye=>te.add(ye)),G==="currency"&&ue&&te.add(ue),fe&&(Array.from(fe).forEach(ye=>te.add(ye)),dc.test(fe)&&te.add(" ")),ty.forEach(ye=>te.add(ye)),ge<0&&ny.forEach(ye=>te.add(ye)),te}),Bt=he(X=>X!=null&&X.altKey?i:X!=null&&X.shiftKey?l:ce),Cs=he((X,Y)=>{const ue=Y.event,fe=Y.direction,te=Y.reason,Ve=!C||!(te===Rs||te===Hn||te===er||te===Xt||te===Yt),Oe=py(X,{step:fe?Bt(ue)*fe:void 0,format:He.current,minWithDefault:ge,maxWithDefault:Pe,minWithZeroDefault:W,snapOnStep:N,small:(ue==null?void 0:ue.altKey)??!1,clamp:Ve}),ye=Y.reason===Rs||Y.reason===Xt||Y.reason===Hn||Y.reason===er||Y.reason===Yt,Wa=Oe!==J||ye&&(X!==J||Xe.current===!1);if(Wa){if(oe.current=Oe,b==null||b(Oe,Y),Y.isCanceled)return Wa;de(Oe),P(Oe!==_.initialValue),Ge.current=!0}return Xe.current&&Ss(Lt(Oe,T,S)),Ne(),Wa}),Mn=he((X,{direction:Y,currentValue:ue,event:fe,reason:te})=>{const Ve=ue??be.current,Oe=typeof Ve=="number"?Ve+X*Y:Math.max(0,r??0);return Cs(Oe,Ie(te,fe,void 0,{direction:Y}))}),ot=he(()=>{Tn.clear(),Cn.clear(),Ns.clear(),at.current(),In.current=0}),fd=he((X,Y)=>{if(ot(),!K.current)return;const ue=Zs(K.current);function fe(Ve){Ve.preventDefault()}ue.addEventListener("contextmenu",fe),at.current=()=>{ue.removeEventListener("contextmenu",fe)},ue.addEventListener("pointerup",Ve=>{En.current=!1,ot();const Oe=oe.current??be.current;vt(Oe,Jt(X?"increment":"decrement",Ve))},{once:!0});function te(){const Ve=Bt(Y)??ps;return Mn(Ve,{direction:X?1:-1,event:Y,reason:X?"increment-press":"decrement-press"})}if(!te()){ot();return}Cn.start(ay,()=>{Ns.start(ry,()=>{te()||ot()})})});ee(function(){if(!Xe.current)return;const Y=g!==void 0?bc(J,T,S):Lt(J,T,S);Y!==xt&&Ss(Y)}),ee(function(){if(!Ww)return;let Y="text";ge>=0&&(Y="decimal"),uv(Y)},[ge,G]),x.useEffect(()=>()=>ot(),[ot]),x.useEffect(function(){const Y=K.current;if(z||w||!y||!Y)return;function ue(fe){if(fe.ctrlKey||Co(K.current).activeElement!==K.current)return;fe.preventDefault();const te=Bt(fe)??ps;Mn(te,{direction:fe.deltaY>0?-1:1,event:fe,reason:"wheel"})}return Y.addEventListener("wheel",ue),()=>{Y.removeEventListener("wheel",ue)}},[y,Mn,z,w,l,ce,Bt]);const Fa=x.useMemo(()=>({...$,disabled:z,readOnly:w,required:c,value:J,inputValue:xt,scrubbing:se}),[$,z,w,c,J,xt,se]),lv=x.useMemo(()=>({inputRef:K,inputValue:xt,value:J,startAutoChange:fd,stopAutoChange:ot,minWithDefault:ge,maxWithDefault:Pe,disabled:z,readOnly:w,id:Z,setValue:Cs,incrementValue:Mn,getStepAmount:Bt,allowInputSyncRef:Xe,formatOptionsRef:He,valueRef:be,lastChangedValueRef:oe,hasPendingCommitRef:Ge,isPressedRef:En,intentionalTouchCheckTimeout:Tn,movesAfterTouchRef:In,name:U,required:c,invalid:B,inputMode:dd,getAllowedNonNumericKeys:wd,min:r,max:o,setInputValue:Ss,locale:T,isScrubbing:se,setIsScrubbing:_e,state:Fa,onValueCommitted:vt}),[K,xt,J,fd,ot,ge,Pe,z,w,Z,Cs,Mn,Bt,He,be,Tn,U,c,B,dd,wd,r,o,Ss,T,se,Fa,vt]),cv=Ke("div",t,{ref:n,state:Fa,props:D,stateAttributesMapping:hn});return a.jsxs(xa.Provider,{value:lv,children:[cv,a.jsx("input",{...V.getInputValidationProps({onFocus(){var X;(X=K.current)==null||X.focus()},onChange(X){if(X.nativeEvent.defaultPrevented)return;const Y=X.currentTarget.valueAsNumber,ue=Number.isNaN(Y)?null:Y,fe=Ie(Yt,X.nativeEvent);P(ue!==_.initialValue),Cs(ue,fe),H()&&V.commit(ue)}}),ref:q,type:"number",name:U,value:J??"",min:r,max:o,step:u,disabled:z,required:c,"aria-hidden":!0,tabIndex:-1,style:U?zb:Hb})]})});process.env.NODE_ENV!=="production"&&(gc.displayName="NumberFieldRoot");function bc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Lt(e,t,n):nc(e,t,n)}const yc=x.forwardRef(function(t,n){const{render:s,className:r,...o}=t,{state:i}=ds();return Ke("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(yc.displayName="NumberFieldGroup");function yn(e){return e==="touch"||e==="pen"}function vc(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:s,getStepAmount:r,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:c,isIncrement:d,isPressedRef:w,locale:f,movesAfterTouchRef:m,readOnly:g,setValue:b,startAutoChange:v,stopAutoChange:y,valueRef:N,lastChangedValueRef:C,onValueCommitted:S}=e,T=x.useRef({x:0,y:0}),A=x.useRef(!1),k=x.useRef(!1),E=x.useRef(""),D=d?"increment-press":"decrement-press";function P(M){t.current=!0;const F=bn(l,f,s.current);F!==null&&(N.current=F,b(F,Ie(D,M,void 0,{direction:d?1:-1})))}return{disabled:n,"aria-readonly":g||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){A.current=!0},onTouchEnd(){A.current=!1},onClick(M){const F=n||g;if(M.defaultPrevented||F||(yn(E.current)?k.current:M.detail!==0))return;P(M.nativeEvent);const B=r(M)??ps,O=N.current;i(B,{direction:d?1:-1,event:M.nativeEvent,reason:D});const $=C.current??N.current;$!==O&&S($,Jt(D,M.nativeEvent))},onPointerDown(M){var O;const F=!M.button||M.button===0;if(M.defaultPrevented||g||!F||n)return;E.current=M.pointerType,k.current=!1,w.current=!0,T.current={x:M.clientX,y:M.clientY},P(M.nativeEvent),yn(M.pointerType)?c.start(oy,()=>{const $=m.current;m.current=0,w.current&&$!=null&&$<iy?(v(d,M),k.current=!0):(k.current=!1,y())}):(M.preventDefault(),(O=u.current)==null||O.focus(),v(d,M))},onPointerUp(M){yn(M.pointerType)&&(w.current=!1)},onPointerMove(M){if(n||g||!yn(M.pointerType)||!w.current)return;m.current!=null&&(m.current+=1);const{x:B,y:O}=T.current,$=B-M.clientX,V=O-M.clientY;$**2+V**2>uy**2&&y()},onMouseEnter(M){const F=n||g;M.defaultPrevented||F||!w.current||A.current||yn(E.current)||v(d,M)},onMouseLeave(){A.current||y()},onMouseUp(){A.current||y()}}}const xc=x.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:f,incrementValue:m,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:y,locale:N,maxWithDefault:C,movesAfterTouchRef:S,readOnly:T,setValue:A,startAutoChange:k,state:E,stopAutoChange:D,value:P,valueRef:_,lastChangedValueRef:M,onValueCommitted:F}=ds(),B=P!=null&&P>=C,O=o||c||B,$=vc({isIncrement:!0,inputRef:g,startAutoChange:k,stopAutoChange:D,inputValue:b,disabled:O,readOnly:T,id:f,setValue:A,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:_,isPressedRef:y,intentionalTouchCheckTimeout:v,movesAfterTouchRef:S,locale:N,lastChangedValueRef:M,onValueCommitted:F}),{getButtonProps:V,buttonRef:H}=ga({disabled:O,native:i,focusableWhenDisabled:!0}),z=x.useMemo(()=>({...E,disabled:O}),[E,O]);return Ke("button",t,{ref:[n,H],state:z,props:[$,u,V],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(xc.displayName="NumberFieldIncrement");const Nc=x.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:f,incrementValue:m,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:y,minWithDefault:N,movesAfterTouchRef:C,readOnly:S,setValue:T,startAutoChange:A,state:k,stopAutoChange:E,value:D,valueRef:P,locale:_,lastChangedValueRef:M,onValueCommitted:F}=ds(),B=D!=null&&D<=N,O=o||c||B,$=vc({isIncrement:!1,inputRef:g,startAutoChange:A,stopAutoChange:E,inputValue:b,disabled:O,readOnly:S,id:f,setValue:T,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:P,isPressedRef:y,intentionalTouchCheckTimeout:v,movesAfterTouchRef:C,locale:_,lastChangedValueRef:M,onValueCommitted:F}),{getButtonProps:V,buttonRef:H}=ga({disabled:O,native:i,focusableWhenDisabled:!0}),z=x.useMemo(()=>({...k,disabled:O}),[k,O]);return Ke("button",t,{ref:[n,H],state:z,props:[$,u,V],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(Nc.displayName="NumberFieldDecrement");function hy(e,t){const n=x.useRef(e),s=he(t);ee(()=>{n.current!==e&&s(n.current)},[e,s]),ee(()=>{n.current=e},[e])}const my={...Us,...hn},gy=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Sc=x.forwardRef(function(t,n){const{render:s,className:r,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:c,getStepAmount:d,id:w,incrementValue:f,inputMode:m,inputValue:g,max:b,min:v,name:y,readOnly:N,required:C,setValue:S,state:T,setInputValue:A,locale:k,inputRef:E,value:D,onValueCommitted:P,lastChangedValueRef:_,hasPendingCommitRef:M,valueRef:F}=ds(),{clearErrors:B}=lo(),{validationMode:O,setTouched:$,setFocused:V,invalid:H,shouldValidateOnChange:z,validation:U}=Vn(),{labelId:ce}=Ys(),se=x.useRef(!1),_e=x.useRef(!1);return Ao({id:w,commit:U.commit,value:D,controlRef:E,name:y,getValue:()=>D??null}),hy(D,W=>{const G=z();if(B(y),G&&U.commit(D),!(W===D||G)){if(_e.current){_e.current=!1;return}U.commit(D,!0)}}),Ke("input",t,{ref:[n,E],state:T,props:[{id:w,required:C,disabled:u,readOnly:N,inputMode:m,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":H||void 0,"aria-labelledby":ce,suppressHydrationWarning:!0,onFocus(W){if(W.defaultPrevented||N||u||(V(!0),se.current))return;se.current=!0;const G=W.currentTarget,K=G.value.length;G.setSelectionRange(K,K)},onBlur(W){if(W.defaultPrevented||N||u)return;$(!0),V(!1);const G=!i.current,K=M.current;if(i.current=!0,g.trim()===""){S(null,Ie(Xt,W.nativeEvent)),O==="onBlur"&&U.commit(null),P(null,Jt(Xt,W.nativeEvent));return}const q=l.current,Z=bn(g,k,q);if(Z===null)return;const ae=(q==null?void 0:q.maximumFractionDigits)!=null||(q==null?void 0:q.minimumFractionDigits)!=null,de=q==null?void 0:q.maximumFractionDigits,J=ae&&typeof de=="number"?Number(Z.toFixed(de)):Z,be=Jt(Hn,W.nativeEvent),Ne=D!==J,He=G||Ne||K;O==="onBlur"&&U.commit(J),Ne&&(_e.current=!0,S(J,Ie(Hn,W.nativeEvent))),He&&P(J,be);const Ge=Lt(J,k,q),vt=nc(Z,k,q);!(!ae&&Z===D&&g===vt)&&g!==Ge&&A(Ge)},onChange(W){if(W.nativeEvent.defaultPrevented)return;i.current=!1;const G=W.target.value;if(G.trim()===""){A(G),S(null,Ie(Xt,W.nativeEvent));return}const K=c();if(!Array.from(G).every(ae=>{const de=ae>="0"&&ae<="9",J=Sa.test(ae),be=Ca.test(ae),Ne=lc.test(ae),He=cc.test(ae),Ge=gn.test(ae);return de||J||be||Ne||He||Ge||K.has(ae)}))return;const Z=bn(G,k,l.current);A(G),Z!==null&&S(Z,Ie(Rs,W.nativeEvent))},onKeyDown(W){if(W.defaultPrevented||N||u)return;const G=W.nativeEvent;i.current=!0;const K=c();let q=K.has(W.key);const{decimal:Z,currency:ae,percentSign:de}=Ta(k,l.current),J=W.currentTarget.selectionStart,be=W.currentTarget.selectionEnd,Ne=J===0&&be===g.length,He=oe=>J!=null&&be!=null&&oe>=J&&oe<be;if(gn.test(W.key)&&Array.from(K).some(oe=>gn.test(oe||""))){const oe=g.search(hc),at=oe!=null&&oe!==-1&&He(oe);q=!(gn.test(g)||fs.test(g))||Ne||at}if(fs.test(W.key)&&Array.from(K).some(oe=>fs.test(oe||""))){const oe=g.search(mc),at=oe!=null&&oe!==-1&&He(oe);q=!(gn.test(g)||fs.test(g))||Ne||at}[Z,ae,de].forEach(oe=>{if(W.key===oe){const at=g.indexOf(oe),xt=He(at);q=!g.includes(oe)||Ne||xt}});const Ge=W.key>="0"&&W.key<="9",vt=Sa.test(W.key),Cn=Ca.test(W.key),Ns=cc.test(W.key),Tn=gy.has(W.key);if(W.which===229||W.altKey||W.ctrlKey||W.metaKey||q||Ge||vt||Ns||Cn||Tn)return;const En=bn(g,k,l.current),In=d(W)??ps;Hw(W);const Xe=Jt(Zt,G);W.key==="ArrowUp"?(f(In,{direction:1,currentValue:En,event:G,reason:Zt}),P(_.current??F.current,Xe)):W.key==="ArrowDown"?(f(In,{direction:-1,currentValue:En,event:G,reason:Zt}),P(_.current??F.current,Xe)):W.key==="Home"&&v!=null?(S(v,Ie(Zt,G)),P(_.current??F.current,Xe)):W.key==="End"&&b!=null&&(S(b,Ie(Zt,G)),P(_.current??F.current,Xe))},onPaste(W){if(W.defaultPrevented||N||u)return;W.preventDefault();const K=(W.clipboardData||window.Clipboard).getData("text/plain"),q=bn(K,k,l.current);q!==null&&(i.current=!1,S(q,Ie(er,W.nativeEvent)),A(K))}},U.getValidationProps(),o],stateAttributesMapping:my})});process.env.NODE_ENV!=="production"&&(Sc.displayName="NumberFieldInput");const by={wuStepper:"_wuStepper_apbnq_1"},yy=({onChange:e,Label:t,defaultValue:n=0,readonly:s,dir:r,step:o=1,min:i,max:u,value:l,className:c,labelPosition:d="left",disabled:w,resetInvalidValueOnBlur:f=!0,...m})=>{const g=x.useId(),[b,v]=x.useState(l!==void 0?Number(l):n||0);x.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const y=k=>{v(k),e==null||e(k)},N=k=>{const E=Number(k.target.value);Number.isNaN(E)||v(E)},C=()=>{f&&(i!==void 0&&b<i?(v(i),e==null||e(i)):u!==void 0&&b>u&&(v(u),e==null||e(u)))};x.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const S={inc:s||u!==void 0&&b>=u||w,dec:s||i!==void 0&&b<=i||w},T=i!==void 0&&b<i||u!==void 0&&b>u,A=p("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(gc,{id:g,value:b,step:o,readOnly:s,onValueChange:k=>typeof k=="number"&&y(k),dir:r,className:p("wu-flex wu-stepper",r==="rtl"&&d!=="top"&&"wu-gap-2",by.wuStepper,vy({labelPosition:d}),c),children:[t&&a.jsx(Ee,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(yc,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Nc,{"aria-label":"decrement",className:p(A,r==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:S.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Sc,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||void 0,dir:r,className:p("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",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:N,onBlur:C,disabled:w,min:i,max:u,step:o,value:b,...m}),a.jsx(xc,{"aria-label":"increment",className:p(A,r==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:S.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},vy=Fe.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"}}}),ke={container:"_container_27gpu_1",sidebar:"_sidebar_27gpu_5",content:"_content_27gpu_13",sourceWrapper:"_sourceWrapper_27gpu_17",list:"_list_27gpu_25",listItem:"_listItem_27gpu_29",listItemActive:"_listItemActive_27gpu_42",label:"_label_27gpu_46",icon:"_icon_27gpu_50",sharedWrapper:"_sharedWrapper_27gpu_54"},Cc=h.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:p(ke.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));Cc.displayName="WuSharedSurvey";const xy=(e,t=!1)=>{if(e)return a.jsx("span",{className:ke.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:p(ke.icon,n),"aria-hidden":"true"})},Tc=h.memo(({children:e,icon:t,isActive:n,isShared:s,className:r,...o})=>a.jsxs("button",{className:p(ke.listItem,n&&ke.listItemActive,r),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[xy(t,s),a.jsx("span",{className:ke.label,children:e})]}));Tc.displayName="WuSurveyItem";const Ec=h.memo(({children:e,className:t,...n})=>a.jsx("div",{className:p(ke.list,t),...n,children:e}));Ec.displayName="WuSurveyList";const Ic=e=>{const{className:t,variant:n="outlined",...s}=e;return a.jsx("div",{className:ke.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(il,{variant:n,showGroupSeparator:!0,className:p(ke.source,t),...s})})};Ic.displayName="WuSurveySource";const Ny=h.memo(Ic),Mc=h.memo(({Sidebar:e,children:t,className:n,...s})=>a.jsxs("div",{className:p(ke.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...s,children:[e&&a.jsx("div",{className:ke.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:ke.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Mc.displayName="WuSurveySelect";const Dc=Fe.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"}}),Sy=x.forwardRef(({className:e,variant:t,size:n,...s},r)=>a.jsx(Ua.Root,{ref:r,className:p(Dc({variant:t,size:n,className:e})),...s}));Sy.displayName=Ua.Root.displayName;const Ac=x.createContext({size:"default",variant:"default"}),hs=x.forwardRef(({className:e,variant:t,size:n,children:s,...r},o)=>a.jsx(Dn.Root,{ref:o,className:p("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...r,children:a.jsx(Ac.Provider,{value:{variant:t,size:n},children:s})}));hs.displayName=Dn.Root.displayName;const bt=x.forwardRef(({className:e,children:t,variant:n,size:s,...r},o)=>{const i=x.useContext(Ac);return a.jsx(Dn.Item,{ref:o,className:p(Dc({variant:i.variant||n,size:i.size||s}),e),...r,children:t})});bt.displayName=Dn.Item.displayName;const kc=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,onChange:i}=e,u=l=>p("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",r&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===s&&"wu-text-white",r&&s===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,onValueChange:i,disabled:r,dir:o,className:p("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",r&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:p("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",r&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(bt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(bt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});kc.displayName="_IconTab";const _c=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,size:i="md",onChange:u}=e,l=c=>p("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",r&&"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===s&&"wu-text-white wu-font-medium",r&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,onValueChange:u,disabled:r,dir:o,className:p("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",r&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:p("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",r&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(bt,{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(bt,{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})})]})})});_c.displayName="_Tab";const Pc=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,onChange:i}=e,u=w=>p("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",r&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===s&&"wu-text-primary wu-font-medium",r&&s===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=p("wu-w-fit wu-gap-2",r&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=p("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",r&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),d=p("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",r&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,disabled:r,dir:o,className:l,onValueChange:i,children:[a.jsx(bt,{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(s==="opt1"?"opt2":"opt1"),className:c,disabled:r,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(bt,{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})})]})})});Pc.displayName="_Toggle";const Vc=h.forwardRef((e,t)=>{const{type:n,options:s,value:r,disabled:o,dir:i,size:u,onChange:l,toggle:c=!0,...d}=e,[w,f]=h.useState(),m=g=>{let b=w;g!==""?b=g:c&&(b=w==="opt1"?"opt2":"opt1");const v=b==="opt1"?s[0].value:s[1].value;l&&l(v),f(b)};if(h.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");f(r===s[0].value?"opt1":"opt2")},[s,r]),!Array.isArray(s)||s.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Pc,{...d,ref:t,options:s,value:w||"opt1",onChange:m,disabled:o,dir:i});case"iconTab":return a.jsx(kc,{ref:t,options:s,value:w||"opt1",onChange:m,disabled:o,dir:i});default:return a.jsx(_c,{ref:t,options:s,value:w||"opt1",onChange:m,disabled:o,dir:i,size:u})}});Vc.displayName="WuSwitcher";const Oc=lt.Root,Ia=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(lt.List,{className:p("wu-relative wu-flex",e),...n,ref:s,children:t}));Ia.displayName=lt.List.displayName;const Ma=x.forwardRef(({className:e,...t},n)=>a.jsx(lt.Trigger,{ref:n,className:p("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}));Ma.displayName=lt.Trigger.displayName;const Fc=x.forwardRef(({className:e,...t},n)=>a.jsx(lt.Content,{ref:n,className:e,...t}));Fc.displayName=lt.Content.displayName;const Wc=({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:p("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(s=>a.jsx(Fc,{value:s.value,forceMount:t||void 0,className:p("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:s.Content},s.value))})},Cy=e=>{const[t,n]=h.useState(!1),[s,r]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),r(u.scrollLeft+u.clientWidth<u.scrollWidth))};return h.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:s,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:c,behavior:"smooth"})}}}},Lc=(e,t)=>{const[n,s]=h.useState({width:0,left:0,height:0,top:0}),r=t==="vertical";return h.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const c={width:r?2:l.offsetWidth,left:r?0:l.offsetLeft,height:r?l.offsetHeight:1,top:r?l.offsetTop:0};s(c)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,r]),n},Ty=({items:e,value:t,defaultValue:n,onValueChange:s,enableAnimation:r=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=h.useRef(null),c=Lc(l,"horizontal"),{showLeftArrow:d,showRightArrow:w,scrollByTab:f}=Cy(l),[m,g]=h.useState(!1),b=()=>f("left"),v=()=>f("right"),y=S=>a.jsx("div",{"data-testid":`gradient-overlay-${S}`,className:p("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",S==="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")}),N=(S,T,A)=>{const k=T==="left";return a.jsx("button",{onClick:S,className:p("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",k?"wu-left-0":"wu-right-0",A&&"wu-translate-x-0 wu-opacity-100",!A&&[k?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":k?"scroll-left":"scroll-right",children:a.jsx("span",{className:p("wu-text-blue-p wu-text-lg",k?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Oc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"horizontal",dir:i,className:p("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:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&m&&y("left"),N(b,"left",d&&m),a.jsxs(Ia,{ref:l,className:p("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(S=>a.jsx(Ma,{value:S.value,children:S.Trigger},S.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&&y("right"),N(v,"right",w&&m)]}),a.jsx(Wc,{items:e,enableAnimation:r})]})},Ey=e=>{const[t,n]=h.useState(!1),[s,r]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),r(u.scrollTop+u.clientHeight<u.scrollHeight))};return h.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:s,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:c,behavior:"smooth"})}}}},Iy=({items:e,value:t,defaultValue:n,onValueChange:s,enableAnimation:r=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=h.useRef(null),c=Lc(l,"vertical"),{showTopArrow:d,showBottomArrow:w,scrollByTab:f}=Ey(l),[m,g]=h.useState(!1),b=()=>f("up"),v=()=>f("down"),y=S=>a.jsx("div",{className:p("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",S==="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")}),N=(S,T,A)=>{const k=T==="up";return a.jsx("button",{onClick:S,className:p("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",k?"-wu-top-1":"-wu-bottom-1",A&&"wu-translate-y-0 wu-opacity-100",!A&&[k?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":k?"scroll-up":"scroll-down",children:a.jsx("span",{className:p("wu-text-blue-p wu-text-lg",k?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Oc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"vertical",dir:i,className:p("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:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&m&&y("top"),N(b,"up",d&&m),a.jsxs(Ia,{ref:l,className:p("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(S=>a.jsx(Ma,{value:S.value,children:S.Trigger},S.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&&y("bottom"),N(v,"down",w&&m)]}),a.jsx(Wc,{items:e,enableAnimation:r})]})},My=({...e})=>e.orientation==="vertical"?a.jsx(Iy,{...e}):a.jsx(Ty,{...e}),Da=x.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:p("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Da.displayName="Table";const Aa=x.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:p("[&_tr]:wu-border-b",e),...t}));Aa.displayName="TableHeader";const vn=x.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:p("",e),...t}));vn.displayName="TableBody";const Dy=x.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:p("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Dy.displayName="TableFooter";const yt=x.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:p("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));yt.displayName="TableRow";const ms=x.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:p("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));ms.displayName="TableHead";const xn=x.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:p("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));xn.displayName="TableCell";const Nn=x.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:p("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Nn.displayName="TableCaption";const Ay=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:r,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=h.useCallback(d=>w=>{r==null||r(w?d:[])},[r]);return{finalColumns:h.useMemo(()=>n?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(m=>m.original).filter(m=>!(i!=null&&i(m))),f=l(w);return u?a.jsx("div",{}):a.jsx(Be,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:m=>{d.toggleAllRowsSelected(!!m),f(!!m)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>{const w=(i==null?void 0:i(d.original))??!1;return a.jsx(Be,{checked:d.getIsSelected(),disabled:w,onChange:f=>{w||d.toggleSelected(!!f)},"aria-label":String(d.original[o])})},filterable:!1,accessorKey:"select",size:s},...e]:e,[e,n,l,i,u])}};function Bc({data:e,columns:t,rowSelection:n}){const{finalColumns:s}=Ay({columns:t,rowSelection:n}),r=h.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:s,rowSelectionState:r}}const qc=(e,t)=>p("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),$c=(e,t="default",n,s=!1)=>p("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left",s&&"wu-overflow-hidden"),ky=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",_y=e=>p({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),Py=e=>p({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),Vy=(e,t)=>p("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),Oy=(e,t)=>p("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),Hc=({table:e,size:t,NoDataContent:n,isLoading:s,CustomLoader:r,isRowDisabled:o})=>{const i=e.getAllColumns().length,u=e.getRowModel().rows;return s?a.jsx(vn,{children:a.jsx(yt,{children:a.jsx(xn,{colSpan:i,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:r??a.jsx(ct,{className:"wu-w-full"})})})}):u!=null&&u.length?a.jsx(vn,{children:u.map((l,c)=>{const d=(o==null?void 0:o(l.original))??!1,w=l.getIsSelected();return a.jsx(yt,{"data-disabled":d,"data-state":w&&"selected",className:qc(w,d),children:l.getVisibleCells().map((f,m)=>{const g=f.column.columnDef;return a.jsx(xn,{className:$c(f.column.id,t,g.cellAlign),children:We.flexRender(g.cell,f.getContext())},`${f.id}-${m}`)})},`${l.id}-${c}`)})}):a.jsx(vn,{children:a.jsx(yt,{children:a.jsx(xn,{colSpan:i,children:n})})})},ka=({table:e,sortableColumns:t,manual:n=!1,onSort:s,size:r,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1})=>{var v;const c=r==="compact"?"wu-h-8":"wu-h-10",d=e.getVisibleLeafColumns(),w=y=>{const{id:N,columnDef:C,getIsSorted:S,toggleSorting:T}=y,A=C.header,k=C.headerAlign;if(!t.includes(N))return A;const E=S(),D=E==="asc",P=E==="desc",_=()=>{n?(T(!P),s==null||s({id:N,desc:P})):T(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:_,"aria-label":`Sort by ${A}`,className:p("wu-flex wu-items-center wu-gap-1 wu-w-full",Py(k)),children:[A,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:Oy(D,!!E)}),a.jsx("span",{className:Vy(P,!!E)})]})]})},f=y=>y.column.id==="actions"?a.jsx(ms,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(ms,{colSpan:y.colSpan,className:p("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",_y(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:We.flexRender(w(y.column),y.getContext())},y.id),m=()=>e.getHeaderGroups().map(y=>a.jsx(yt,{className:"wu-relative",children:y.headers.map(f)},y.id)),g=()=>{var y;return a.jsxs("div",{className:p("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",c),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:(y=d[0])==null?void 0:y.getSize()},children:a.jsx(Be,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:N=>e.toggleAllRowsSelected(!!N),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},b=o&&i;if(l){const y=((v=e.getHeaderGroups()[0])==null?void 0:v.headers)??[];return a.jsxs(yt,{className:"wu-relative",children:[y.map(f),b&&a.jsx(ms,{colSpan:d.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:g()})]})}return a.jsxs(Aa,{className:p("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",c),children:[m(),b&&a.jsx("div",{className:p("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",c),children:g()})]})},zc=h.forwardRef((e,t)=>a.jsx(vn,{...e,ref:t}));zc.displayName="TableBodyComponent";const Uc=({table:e,size:t,isRowDisabled:n,containerHeight:s=600,sortableColumns:r,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l})=>{const c=e.getRowModel().rows,d=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ba.TableVirtuoso,{style:{height:s},totalCount:c.length,fixedHeaderContent:()=>a.jsx(ka,{table:e,sortableColumns:r,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:w=>{const f=c[w];return f?a.jsx(a.Fragment,{children:f.getVisibleCells().map((m,g)=>{const b=m.column.columnDef;return a.jsx(xn,{className:$c(m.column.id,t,b.cellAlign,!0),children:We.flexRender(b.cell,m.getContext())},`${m.id}-${g}`)})}):null},components:{Table:({style:w,...f})=>a.jsxs("table",{...f,style:{...w,width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},className:"wu-table-fixed",children:[a.jsx("colgroup",{children:d.map(m=>a.jsx("col",{style:{width:`${m.getSize()}px`}},m.id))}),f.children]}),TableBody:zc,TableHead:w=>a.jsx(Aa,{...w,className:p("wu-border-t wu-border-black/[12%] wu-bg-gray-20",ky(t),w.className)}),TableRow:({...w})=>{const f=w["data-index"],m=c[f],g=m?(n==null?void 0:n(m.original))??!1:!1,b=(m==null?void 0:m.getIsSelected())??!1;return a.jsx(yt,{...w,"data-disabled":g,"data-state":b&&"selected",className:qc(b,g)})}}})})},gs=Fe.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),Fy=({data:e,columns:t,isLoading:n=!1,variant:s="unstyled",sort:r,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:c=!1,CustomLoader:d,caption:w,virtualization:f,...m})=>{var A,k;const{finalColumns:g,rowSelectionState:b}=Bc({data:e,columns:t,rowSelection:i}),v=h.useMemo(()=>g.filter(E=>E.enableSorting).map(E=>E.accessorKey),[g]),y=((A=i==null?void 0:i.selectedRows)==null?void 0:A.length)??0,N=E=>{const D=typeof E=="function"?E(b):E,P=[],_=i==null?void 0:i.isRowDisabled;for(const M in D){if(!D[M])continue;const F=e[Number(M)];F&&(_!=null&&_(F)||P.push(F))}i==null||i.onRowSelect(P)},C=We.useReactTable({data:e,columns:g,getCoreRowModel:We.getCoreRowModel(),getPaginationRowModel:We.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?E=>!i.isRowDisabled(E.original):!0,state:{...i!=null&&i.isEnabled?{rowSelection:b}:{}},onRowSelectionChange:N}),S=(f==null?void 0:f.enabled)&&(!f.threshold||e.length>f.threshold),T=(f==null?void 0:f.maxHeight)??600;return a.jsx("div",{className:p("wu-text-gray-lead wu-table-container wu-relative"),children:S?a.jsxs("div",{className:p("wu-overflow-hidden wu-w-full",gs({variant:s})),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(ct,{className:"wu-w-full"})}):(k=C.getRowModel().rows)!=null&&k.length?a.jsx(Uc,{table:C,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:T,sortableColumns:v,HeaderAction:u,isRowSelected:y>0,manual:!0,onSort:r==null?void 0:r.onSort}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(Da,{...m,className:p("wu-overflow-x-auto wu-w-full",gs({variant:s}),"wu-table-fixed",m.className),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),a.jsx(ka,{table:C,sortableColumns:v,manual:!0,onSort:r==null?void 0:r.onSort,size:o,HeaderAction:u,isRowSelected:y>0,isStickyHeader:c}),a.jsx(Hc,{table:C,size:o,NoDataContent:l,CustomLoader:d,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled})]})})},Wy=({data:e,columns:t,variant:n="unstyled",size:s="default",sort:r,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:c,NoDataContent:d,isLoading:w,caption:f,rowSelection:m,virtualization:g,...b})=>{var O,$;const[v,y]=h.useState((r==null?void 0:r.initial)||[]),[N,C]=h.useState([]),[S,T]=h.useState((i==null?void 0:i.pageIndex)??0),{finalColumns:A,rowSelectionState:k}=Bc({data:e,columns:t,rowSelection:m}),E=h.useMemo(()=>A.filter(V=>V.enableSorting).map(V=>V.accessorKey),[A]),D=h.useMemo(()=>A.filter(V=>V.filterable).map(V=>V.accessorKey),[A]),P=((O=m==null?void 0:m.selectedRows)==null?void 0:O.length)??0,_=V=>{const H=typeof V=="function"?V(k):V,z=[],U=m==null?void 0:m.isRowDisabled;for(const ce in H){if(!H[ce])continue;const se=e[Number(ce)];se&&(U!=null&&U(se)||z.push(se))}m==null||m.onRowSelect(z)},M=We.useReactTable({data:e,columns:A,getCoreRowModel:We.getCoreRowModel(),getFilteredRowModel:We.getFilteredRowModel(),getSortedRowModel:We.getSortedRowModel(),getPaginationRowModel:i?We.getPaginationRowModel():void 0,enableRowSelection:m!=null&&m.isRowDisabled?V=>!m.isRowDisabled(V.original):!0,state:{sorting:v,columnFilters:N,...i?{pagination:i}:{},...m!=null&&m.isEnabled?{rowSelection:k}:{}},onSortingChange:y,onColumnFiltersChange:C,onRowSelectionChange:_});h.useEffect(()=>{D.forEach(V=>{var H;(H=M.getColumn(V))==null||H.setFilterValue(o)})},[o,D,M]),h.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==S&&(m==null||m.onRowSelect(()=>[]),M.resetRowSelection(),T(i.pageIndex))},[i==null?void 0:i.pageIndex]);const F=(g==null?void 0:g.enabled)&&(!g.threshold||e.length>g.threshold),B=(g==null?void 0:g.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:F?a.jsxs("div",{className:p("wu-overflow-hidden wu-w-full",gs({variant:n})),children:[f&&a.jsx(Nn,{children:f}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(ct,{className:"wu-w-full"})}):($=M.getRowModel().rows)!=null&&$.length?a.jsx(Uc,{table:M,size:s,isRowDisabled:m==null?void 0:m.isRowDisabled,containerHeight:B,sortableColumns:E,HeaderAction:l,isRowSelected:P>0}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:d})]}):a.jsxs(Da,{...b,className:p("wu-overflow-x-auto wu-w-full",gs({variant:n}),"wu-table-fixed",b.className),children:[f&&a.jsx(Nn,{children:f}),a.jsx(ka,{table:M,sortableColumns:E,size:s,HeaderAction:l,isRowSelected:P>0,isStickyHeader:u}),a.jsx(Hc,{table:M,size:s,NoDataContent:d,CustomLoader:c,isLoading:w,isRowDisabled:m==null?void 0:m.isRowDisabled})]})})},jc=x.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:p("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}));jc.displayName="Textarea";const Gc=h.forwardRef((e,t)=>{const{Label:n,id:s=Ds(),variant:r="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,c=w=>{l.onChange&&l.onChange(w)},d=An(u);return a.jsxs("div",{className:p(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(jc,{...l,ref:t,id:s,className:p("wu-peer wu-rounded-t-sm",r==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:c,readOnly:o,maxLength:i}),n&&a.jsx(Ee,{htmlFor:s,className:"wu-textarea-label",children:n})]})});Gc.displayName="WuTextarea";function Ly(e){if(typeof e=="string"&&e.includes("T")){const t=j.parseISO(e);return j.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=j.parse(e,"HH:mm:ss",new Date);return j.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Kc=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Yc=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Xc=["am","pm"],bs=50;function By(e){return Array(bs).fill(e).flat()}function _a(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function qy(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 Zc(e){const t=Number(e),n=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:n}}const $y=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:p("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}),Pa=({values:e,selectedValue:t,scrollRef:n,onSelect:s,repeatItems:r=!0,className:o})=>a.jsx("div",{ref:n,className:p("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:(r?By(e):e).map((i,u)=>a.jsx($y,{value:i,isSelected:i===t,onClick:()=>s(i)},`${i}-${u}`))});function Hy(e,t,n,s){const r=h.useMemo(()=>e?_a(Kc,t.padStart(2,"0")):Kc,[e]),o=h.useMemo(()=>e?_a(Yc,n.padStart(2,"0")):Yc,[e]),i=h.useMemo(()=>e?_a(Xc,s):Xc,[e]);return{rotatedHours:r,rotatedMinutes:o,rotatedMeridiem:i}}function zy(e,t,n){h.useEffect(()=>{function s(i){if(i){const u=i.scrollHeight/bs,l=Math.floor(bs/2);i.scrollTop=l*u;const c=()=>{const{scrollTop:d}=i,w=Math.round(d/u);(w<=1||w>=bs-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",c),()=>{i.removeEventListener("scroll",c)}}}if(!e)return;const r=s(t.current),o=s(n.current);return()=>{r==null||r(),o==null||o()}},[e,t,n])}const Jc=({className:e,time:t,Label:n,labelPosition:s,dir:r,...o})=>{const[i,u]=h.useState(!1),[l,c]=h.useState(""),d=h.useRef(null),w=h.useRef(null),f=h.useRef(null),m=h.useRef(null),[g,b]=h.useState("12"),[v,y]=h.useState("00"),[N,C]=h.useState("am");h.useEffect(()=>{if(!t){c(""),b("12"),y("00"),C("am"),d.current&&(d.current.value="");return}const E=Ly(t);c(E);const[D,P]=E.split(":"),{hour:_,meridiem:M}=Zc(D);b(_),y(P),C(M),d.current&&(d.current.value=E)},[t]),h.useEffect(()=>{const E=D=>{w.current&&!w.current.contains(D.target)&&u(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[]),zy(i,f,m);const{rotatedHours:S,rotatedMinutes:T,rotatedMeridiem:A}=Hy(i,g,v,N),k=h.useCallback((E,D,P)=>{const _=E??g,M=D??v,F=P??N;b(_),y(M),C(F);const B=`${qy(_,F)}:${M}`;c(B)},[g,v,N]);return a.jsxs("div",{className:p("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:r,children:[n&&a.jsx(Ee,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:p("relative inline-block"),ref:w,dir:r,children:[a.jsx(Qe,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:E=>{c(E.target.value);const[D,P]=E.target.value.split(":"),{hour:_,meridiem:M}=Zc(D);b(_),y(P),C(M)},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(De,{icon:"wm-schedule",className:p("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(E=>!E),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:r,...o}),a.jsx("style",{children:`
18
+ )`;c.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",f),()=>{window.removeEventListener("mousemove",f),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(Ug.gradientBackground,"wu-transform-gpu",r),...u,children:s})},ls={wuModalBodyWrapper:"_wuModalBodyWrapper_uaelx_1","wu-modal-footer":"_wu-modal-footer_uaelx_5","wu-modal-content":"_wu-modal-content_uaelx_5","wu-modal-header":"_wu-modal-header_uaelx_9"},hl="calc(100vh - 64px)",jg={sm:"400px",md:"600px",lg:"1200px"},Gg=({Trigger:e,children:t,size:n="md",hideCloseButton:s,preventClickOutside:r,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:c,className:d,style:w,variant:f="action",...p})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(cl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(dl,{asChild:!0,children:e}),a.jsx(la,{style:{width:"calc(100% - 64px)",maxWidth:l||jg[n],maxHeight:c||hl,...w},hideCloseButton:s,onInteractOutside:b=>r&&b.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":f,className:m("wu-group wu-rounded-[.88rem]",ls.wuModalBodyWrapper,d),...p,children:a.jsx(pl,{colors:g[f],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:c||hl},children:t})})]})},Kg=({children:e,className:t,...n})=>a.jsx("div",{className:m("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",ls["wu-modal-content"],t),...n,children:e}),Yg=({children:e,className:t,...n})=>a.jsx(ca,{...n,"data-variant":"action",className:m("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-[.88rem] wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",ls["wu-modal-header"],t),children:a.jsx(da,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),Xg=({children:e,className:t,...n})=>a.jsx(fl,{...n,className:m("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",ls["wu-modal-footer"],t),children:e}),Zg=({children:e,className:t,...n})=>{const s=h.useRef(null);return a.jsx(Hg,{asChild:!0,children:a.jsx(De,{className:t,ref:s,...n,children:e})})},Jg=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:s,variant:r="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,width:w,...f})=>{const[p,g]=h.useState(""),[b,v]=h.useState(e);h.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),g("");return}const y=s.label;if(n&&Array.isArray(t)){const C=t.map(S=>S[y]).join(", ");g(C)}else!n&&!Array.isArray(t)&&g(t[y])},[t,s.label,n,e]);const N=()=>e&&!p?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):a.jsx("span",{className:m("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)??p:p});return a.jsx(jo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...f,disabled:l,className:m("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",r==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",f.className),children:[i??N(),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"})]})})},ml=({option:e,value:t,multiple:n=!1,onSelect:s,accessorKey:r,dir:o="ltr"})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[r.value])):JSON.stringify(t[r.value]))},[t,r.value,n]);const l=n?i.includes(JSON.stringify(e[r.value])):i===JSON.stringify(e[r.value]),c=d=>{e.disabled||(s(e),n&&d.preventDefault())};return a.jsxs(zn,{onClick:c,disabled:e.disabled,className:m("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(qe,{checked:l}),a.jsx(gl,{option:e,accessorKey:r})]})},gl=({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"})]})},bl=e=>{const{option:t,handleSelectAll:n,isCheckedAll:s,isPartialSelected:r,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(zn,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(qe,{"data-partial":r,checked:s||r,partial:r}),a.jsx(gl,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Go,{dir:o.dir,children:[a.jsx(tn,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>h.createElement(ml,{...o,option:u,key:l}))]});case"divider":return a.jsx(Un,{className:"wu-mx-4"});default:return a.jsx(ml,{...o,option:t})}},Qg=e=>{let t=0,n=0;const s=[],r=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(s.push(i),i.disabled||r.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:r,totalData:s.length,cleanData:s}},Rg=100,eb=400,yl=({data:e,onSelect:t,multiple:n=!1,defaultValue:s,value:r,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:c,virtualizedThreshold:d=Rg,maxHeight:w=eb,hasGroup:f=!1,Header:p,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:N="top",onScroll:y,maxContentWidth:C,selectedToTop:S=!1,...T})=>{const[A,D]=h.useState(),k=h.useRef(null),[M,_]=h.useState(!1),[P,E]=h.useState(!1),{cleanData:O,enabledOptions:L}=Qg(e),F=h.useMemo(()=>n&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,n]),B=h.useCallback(U=>{const J=U[o.value];if(n)D((ie=[])=>{const fe=ie,V=fe.some(H=>H[o.value]===J)?fe.filter(H=>H[o.value]!==J):[...fe,U];return t==null||t(V),V});else{const ie=U;D(ie),t==null||t(ie)}},[n,o.value,t]);h.useEffect(()=>{if(s&&r){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!r&&D(void 0),s!==void 0&&D(s),r!==void 0&&D(r)},[s,r]);const W=zo(S,F,A,o),$=W.length>d;h.useEffect(()=>{if(!n)return;const U=b!=null&&b.includeDisabled?(A==null?void 0:A.length)===e.length:(A==null?void 0:A.length)===L.length;_(U);const J=(A==null?void 0:A.length)>0&&!U;E(J)},[A,b]);const G=h.useCallback(()=>{const U=M?[]:b!=null&&b.includeDisabled?f?O:e:L;D(U),t==null||t(U)},[M,n,e,L,t,b]),Z=Dn(N);return a.jsxs("div",{className:m(Z,"wu-flex wu-select-container"),ref:k,dir:u,children:[a.jsxs(Uo,{children:[a.jsx(Jg,{...T,value:A,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:g,id:T.id,disabled:v,selectAll:b,isCheckedAll:M}),a.jsxs(or,{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:T.id,style:{maxWidth:C},children:[p,$?a.jsx(Mt,{list:W,containerHeight:w,callback:(U,J)=>a.jsx(bl,{option:J,accessorKey:o,multiple:n,onSelect:B,value:A,dir:u,handleSelectAll:G,isCheckedAll:M,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:W.map(U=>{const J=U,ie=String(J[o.value]??J.type);return a.jsx(bl,{option:J,accessorKey:o,multiple:n,onSelect:B,value:A,handleSelectAll:G,isCheckedAll:M,dir:u,isPartialSelected:P},ie)})})]})]}),c&&a.jsx(Ae,{htmlFor:T.id,className:"wu-select-label",children:c})]})},cs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tb=({value:e,onChange:t,min:n=z.sub(new Date,{years:5}),max:s=z.add(new Date,{years:1}),placeholder:r="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:c,disabledMonths:d=[],...w})=>{const[f,p]=h.useState(null),[g,b]=h.useState(""),[v,N]=h.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=h.useMemo(()=>{const S=new Date(n).getFullYear(),T=new Date(s).getFullYear();return Array.from({length:T-S+1},(A,D)=>({value:T-D,label:T-D}))},[n,s]);h.useEffect(()=>{if(e){const S=new Date(e),T=S.getFullYear(),A=S.getMonth();p({year:T,month:A}),b(`${cs[A]} ${T}`),N({value:T,label:T})}},[e]);const C=()=>{f&&t&&(t(new Date(f.year,f.month,15)),b(`${cs[f.month]} ${f.year}`))};return a.jsxs("div",{className:m("wu-flex wu-flex-col wu-items-center",Dn(i),i==="top"&&"wu-items-start"),children:[a.jsxs(Ue,{children:[a.jsx($s,{...w,disabled:u||c,id:l,dir:"ltr",placeholder:r,formattedString:g}),a.jsxs(Be,{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(yl,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:S=>N(S),multiple:!1,maxHeight:224})}),a.jsx(nb,{year:v==null?void 0:v.value,selectedMonth:f==null?void 0:f.month,selectedYear:f==null?void 0:f.year,onClick:(S,T)=>p({year:T,month:S}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx($t.PopoverClose,{asChild:!0,children:a.jsx(De,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(Ae,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},nb=({year:e,selectedMonth:t,selectedYear:n,onClick:s,disabledMonths:r=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=h.useMemo(()=>{const c=new Set;return r.forEach(d=>{const w=typeof d=="string"?new Date(d):d;c.add(`${w.getFullYear()}-${w.getMonth()}`)}),c},[r]);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:cs.map((c,d)=>{const w=e===i&&d===u,f=t===d&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${d}`),onClick:()=>s(d,e),className:m("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",f&&"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":`${cs[d]} ${e}`,"data-month":d,"data-year":e,children:c},c)})})},vl=(e,t,n,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,i]=h.useState([]),[u,l]=h.useState([]);return h.useEffect(()=>{const c=()=>{var g,b;const d=((g=t.current)==null?void 0:g.clientWidth)||0,w=((b=n.current)==null?void 0:b.clientWidth)||0,f=d-w,p=Math.floor(f/s);i(e.slice(0,p)),l(e.slice(p))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,s]),[o,u]},xl={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},sb=e=>{const{Links:t,children:n,className:s,...r}=e,o=h.useMemo(()=>t.map((d,w)=>h.cloneElement(d,{className:m(xl.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:w})),[t]),i=h.useRef(null),u=h.useRef(null),[l,c]=vl(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...r,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(Ue,{children:[a.jsx(wt,{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(Be,{className:m(xl.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(Ue,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Be,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},wa={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},rb=e=>{const{Links:t,children:n,className:s,...r}=e,o=h.useMemo(()=>t.map((w,f)=>h.cloneElement(w.link,{key:f,className:m(wa.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[h.cloneElement(w.imgOrIcon,{className:m("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=h.useRef(null),u=h.useRef(null),l=h.useRef(null),[c,d]=vl(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...r,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:m(wa.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(Ue,{children:[a.jsx(wt,{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(Be,{className:m(wa.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(Ue,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Be,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},Nl=h.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:s,className:r,disabled:o=!1,...i},u)=>{const[l,c]=h.useState(t),[d,w]=h.useState(n);h.useEffect(()=>{c(t),w(n)},[t,n]);const f=Math.ceil(e/d),p=l*d+1,g=Math.min((l+1)*d,e),b=Array.from({length:f},(y,C)=>C),v=h.useCallback(y=>{y>=0&&y<f&&(c(y),s==null||s(y))},[f,s]),N=224;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-gap-[2px]",r,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Sl,{label:"Previous page",onClick:()=>v(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(ia,{name:`${p} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Wt,{style:{maxHeight:N+"px"},dir:i.dir,children:b.length>100?a.jsx(Mt,{className:"wu-pagination-list",containerHeight:N,list:b,callback:(y,C)=>a.jsxs(us,{onSelect:()=>v(C),className:m("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*d+1," -"," ",Math.min((C+1)*d,e)]},y)}):b.map(y=>a.jsxs(us,{onSelect:()=>v(y),className:m(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(Sl,{label:"Next page",onClick:()=>v(l+1),disabled:l===f-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Nl.displayName="WuPagination";const Sl=({label:e,onClick:t,disabled:n,icon:s,className:r})=>a.jsx(De,{variant:"iconOnly",onClick:t,disabled:n,className:m("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",r),"aria-label":e,children:a.jsx("span",{className:m("wu-text-sm",s)})}),Cl=x.forwardRef(({className:e,...t},n)=>a.jsx(Ut.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));Cl.displayName=Ut.Root.displayName;const Tl=x.forwardRef(({className:e,...t},n)=>a.jsx(Ut.Item,{ref:n,className:m("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(Ut.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"})})}));Tl.displayName=Ut.Item.displayName;const El=h.forwardRef((e,t)=>{const{options:n,defaultValue:s,onChange:r,label:o,dir:i,...u}=e;return a.jsxs(Cl,{defaultValue:s,required:u.required,disabled:u.disabled,onValueChange:r,id:u.id,dir:i,name:u.name,className:m("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(_n,{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(Tl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(_n,{htmlFor:l.value,className:m(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});El.displayName="WuRadioGroup";const ab=e=>{const{children:t,...n}=e;return a.jsxs(Wt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(oa,{orientation:"horizontal"})]})},Ml=x.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:m("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:s,...n}));Ml.displayName="Input";const Il=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...s},r)=>a.jsx(za.Root,{ref:r,decorative:n,orientation:t,className:m("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...s}));Il.displayName=za.Root.displayName;function Dl({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const fa=768;function pa(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${fa-1}px)`),s=()=>{t(window.innerWidth<fa)};return n.addEventListener("change",s),t(window.innerWidth<fa),()=>n.removeEventListener("change",s)},[]),!!e}const ob="sidebar_state",ib=3600*24*7,ub="256px",lb="256px",cb="3rem",db="b",Al=x.createContext(null);function rt(){const e=x.useContext(Al);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const kl=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:s,style:r,children:o,...i},u)=>{const l=pa(),[c,d]=x.useState(!1),[w,f]=x.useState(l?!0:e),p=t??w,g=x.useCallback(y=>{const C=typeof y=="function"?y(p):y;n?n(C):f(C),document.cookie=`${ob}=${C}; path=/; max-age=${ib}`},[n,p]),b=x.useCallback(()=>l?d(y=>!y):g(y=>!y),[l,g,d]);x.useEffect(()=>{const y=C=>{C.key===db&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=p?"expanded":"collapsed",N=x.useMemo(()=>({state:v,open:p,setOpen:g,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:b}),[v,p,g,l,c,d,b]);return a.jsx(Al.Provider,{value:N,children:a.jsx(Ra,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":ub,"--sidebar-width-icon":cb,...r},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:u,...i,children:o})})})});kl.displayName="SidebarProvider";const _l=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:s,children:r,...o},i)=>{const{isMobile:u,state:l,openMobile:c,setOpenMobile:d}=rt();return n==="none"?a.jsx("div",{className:m("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:i,...o,children:r}):u?a.jsx(Ro,{open:c,onOpenChange:d,...o,children:a.jsx(ir,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":lb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:r})})}):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:m("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:m("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",s),...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:r})})]})});_l.displayName="Sidebar";const Pl=x.forwardRef(({className:e,onClick:t,children:n,...s},r)=>{const{toggleSidebar:o}=rt();return a.jsxs(Tt,{ref:r,"data-sidebar":"trigger",variant:"secondary",className:m("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()},...s,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Pl.displayName="SidebarTrigger";const wb=x.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:s}=rt();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:m("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})});wb.displayName="SidebarRail";const Vl=x.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:m("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}));Vl.displayName="SidebarInset";const fb=x.forwardRef(({className:e,...t},n)=>a.jsx(Ml,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));fb.displayName="SidebarInput";const Ol=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:m("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));Ol.displayName="SidebarHeader";const Fl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:m("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Fl.displayName="SidebarFooter";const pb=x.forwardRef(({className:e,...t},n)=>a.jsx(Il,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));pb.displayName="SidebarSeparator";const Wl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:m("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}));Wl.displayName="SidebarContent";const Ll=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:m("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Ll.displayName="SidebarGroup";const Bl=x.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const r=t?St.Slot:"div";return a.jsx(r,{ref:s,"data-sidebar":"group-label",className:m("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})});Bl.displayName="SidebarGroupLabel";const hb=x.forwardRef(({className:e,asChild:t=!1,...n},s)=>{const r=t?St.Slot:"button";return a.jsx(r,{ref:s,"data-sidebar":"group-action",className:m("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})});hb.displayName="SidebarGroupAction";const ql=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:m("wu-w-full wu-text-sm",e),...t}));ql.displayName="SidebarGroupContent";const ha=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:m("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));ha.displayName="SidebarMenu";const $l=x.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("wu-group/menu-item wu-relative",e),...t}));$l.displayName="SidebarMenuItem";const mb=Le.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"}}),Hl=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:s="default",tooltip:r,className:o,...i},u)=>{const l=e?St.Slot:"button",{isMobile:c,state:d}=rt(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:m(mb({variant:n,size:s}),o),...i});return r?(typeof r=="string"&&(r={children:r}),a.jsxs(eo,{children:[a.jsx(to,{asChild:!0,children:w}),a.jsx(Bs,{side:"right",align:"center",hidden:d!=="collapsed"||c,...r})]})):w});Hl.displayName="SidebarMenuButton";const gb=x.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...s},r)=>{const o=t?St.Slot:"button";return a.jsx(o,{ref:r,"data-sidebar":"menu-action",className:m("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),...s})});gb.displayName="SidebarMenuAction";const bb=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("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}));bb.displayName="SidebarMenuBadge";const yb=x.forwardRef(({className:e,showIcon:t=!1,...n},s)=>{const r=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:m("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Dl,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Dl,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});yb.displayName="SidebarMenuSkeleton";const vb=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("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}));vb.displayName="SidebarMenuSub";const xb=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));xb.displayName="SidebarMenuSubItem";const Nb=x.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:s,...r},o)=>{const i=e?St.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:m("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",s),...r})});Nb.displayName="SidebarMenuSubButton";function Sb(e){const{open:t,defaultOpen:n,onOpenChange:s,disabled:r}=e,o=t!==void 0,[i,u]=Qs({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:d}=Rw(i,!0,!0),[w,f]=x.useState(i),[{height:p,width:g},b]=x.useState({height:void 0,width:void 0}),v=mo(),[N,y]=x.useState(),C=N??v,[S,T]=x.useState(!1),[A,D]=x.useState(!1),k=x.useRef(null),M=x.useRef(null),_=x.useRef(null),P=x.useRef(null),E=Io(P,!1),O=ge(L=>{const F=!i,B=ke(ef,L.nativeEvent);if(s(F,B),B.isCanceled)return;const W=P.current;M.current==="css-animation"&&W!=null&&W.style.removeProperty("animation-name"),!S&&!A&&(M.current!=null&&M.current!=="css-animation"&&!l&&F&&c(!0),M.current==="css-animation"&&(!w&&F&&f(!0),!l&&F&&c(!0))),u(F),M.current==="none"&&l&&!F&&c(!1)});return se(()=>{o&&M.current==="none"&&!A&&!i&&c(!1)},[o,A,i,t,c]),x.useMemo(()=>({abortControllerRef:k,animationTypeRef:M,disabled:r,handleTrigger:O,height:p,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:E,setDimensions:b,setHiddenUntilFound:T,setKeepMounted:D,setMounted:c,setOpen:u,setPanelIdState:y,setVisible:f,transitionDimensionRef:_,transitionStatus:d,visible:w,width:g}),[k,M,r,O,p,l,i,C,P,E,b,T,D,c,u,f,_,d,w,g])}const ma=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(ma.displayName="CollapsibleRootContext");function zl(){const e=x.useContext(ma);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":jt(15));return e}let fn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Yt.startingStyle]="startingStyle",e[e.endingStyle=Yt.endingStyle]="endingStyle",e})({}),Cb=(function(e){return e.panelOpen="data-panel-open",e})({});const Tb={[fn.open]:""},Eb={[fn.closed]:""},Mb={open(e){return e?{[Cb.panelOpen]:""}:null}},Ul={...{open(e){return e?Tb:Eb}},...Mo},jl=x.forwardRef(function(t,n){const{render:s,className:r,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,...c}=t,d=ge(u),w=Sb({open:l,defaultOpen:o,onOpenChange:d,disabled:i}),f=x.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),p=x.useMemo(()=>({...w,onOpenChange:d,state:f}),[w,d,f]),g=Ke("div",t,{state:f,ref:n,props:c,stateAttributesMapping:Ul});return a.jsx(ma.Provider,{value:p,children:g})});process.env.NODE_ENV!=="production"&&(jl.displayName="CollapsibleRoot");const Gl=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Gl.displayName="CompositeRootContext");function Ib(e=!1){const t=x.useContext(Gl);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>.":jt(16));return t}function Db(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:r=0,isNativeButton:o}=e,i=s&&t!==!1,u=s&&t===!1;return{props:x.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(c.tabIndex=r,!o&&n&&(c.tabIndex=t?r:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||u)&&(c.disabled=n),c},[s,n,t,i,u,o,r])}}function ga(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:r=!0}=e,o=x.useRef(null),i=Ib(!0)!==void 0,u=ge(()=>{const f=o.current;return!!((f==null?void 0:f.tagName)==="A"&&(f!=null&&f.href))}),{props:l}=Db({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:s,isNativeButton:r});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{var p,g;if(!o.current)return;const f=o.current.tagName==="BUTTON";if(r){if(!f){const b=((p=ft.captureOwnerStack)==null?void 0:p.call(ft))||"";No(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${b}`)}}else if(f){const b=((g=ft.captureOwnerStack)==null?void 0:g.call(ft))||"";No(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${b}`)}},[r]);const c=x.useCallback(()=>{const f=o.current;Ab(f)&&i&&t&&l.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,l.disabled,i]);se(c,[c]);const d=x.useCallback((f={})=>{const{onClick:p,onMouseDown:g,onKeyUp:b,onKeyDown:v,onPointerDown:N,...y}=f;return co({type:r?"button":void 0,onClick(S){if(t){S.preventDefault();return}p==null||p(S)},onMouseDown(S){t||g==null||g(S)},onKeyDown(S){if(t||(Ks(S),v==null||v(S)),S.baseUIHandlerPrevented)return;const T=S.target===S.currentTarget&&!r&&!u()&&!t,A=S.key==="Enter",D=S.key===" ";T&&((D||A)&&S.preventDefault(),A&&(p==null||p(S)))},onKeyUp(S){t||(Ks(S),b==null||b(S)),!S.baseUIHandlerPrevented&&S.target===S.currentTarget&&!r&&!t&&S.key===" "&&(p==null||p(S))},onPointerDown(S){if(t){S.preventDefault();return}N==null||N(S)}},r?void 0:{role:"button"},l,y)},[t,l,r,u]),w=ge(f=>{o.current=f,c()});return{getButtonProps:d,buttonRef:w}}function Ab(e){return Bw(e)&&e.tagName==="BUTTON"}const kb={...Mb,...Mo},Kl=x.forwardRef(function(t,n){const{panelId:s,open:r,handleTrigger:o,state:i,disabled:u}=zl(),{className:l,disabled:c=u,id:d,render:w,nativeButton:f=!0,...p}=t,{getButtonProps:g,buttonRef:b}=ga({disabled:c,focusableWhenDisabled:!0,native:f}),v=x.useMemo(()=>({"aria-controls":r?s:void 0,"aria-expanded":r,onClick:o}),[s,r,o]);return Ke("button",t,{state:i,ref:[n,b],props:[v,p,g],stateAttributesMapping:kb})});process.env.NODE_ENV!=="production"&&(Kl.displayName="CollapsibleTrigger");let ba;process.env.NODE_ENV!=="production"&&(ba=new Set);function Yl(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ba.has(t)||(ba.add(t),console.warn(`Base UI: ${t}`))}}let _b=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Pb(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:s,height:r,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:c,open:d,panelRef:w,runOnceAnimationsFinish:f,setDimensions:p,setMounted:g,setOpen:b,setVisible:v,transitionDimensionRef:N,visible:y,width:C}=e,S=x.useRef(!1),T=x.useRef(null),A=x.useRef(d),D=x.useRef(d),k=Eo(),M=x.useMemo(()=>n.current==="css-animation"?!y:!d&&!l,[d,l,y,n]),_=ge(E=>{if(!E)return;if(n.current==null||N.current==null){const F=getComputedStyle(E),B=F.animationName!=="none"&&F.animationName!=="",W=F.transitionDuration!=="0s"&&F.transitionDuration!=="";B&&W?process.env.NODE_ENV!=="production"&&Yl("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):F.animationName==="none"&&F.transitionDuration!=="0s"?n.current="css-transition":F.animationName!=="none"&&F.transitionDuration==="0s"?n.current="css-animation":n.current="none",E.getAttribute(_b.orientation)==="horizontal"||F.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(n.current!=="css-transition")return;(r===void 0||C===void 0)&&(p({height:E.scrollHeight,width:E.scrollWidth}),D.current&&E.style.setProperty("transition-duration","0s"));let O=-1,L=-1;return O=le.request(()=>{D.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{le.cancel(O),le.cancel(L)}}),P=On(s,w,_);return se(()=>{if(n.current!=="css-transition")return;const E=w.current;if(!E)return;let O=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const L={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};Object.keys(L).forEach(F=>{E.style.setProperty(F,"initial","important")}),!D.current&&!i&&E.setAttribute(fn.startingStyle,""),p({height:E.scrollHeight,width:E.scrollWidth}),O=le.request(()=>{Object.entries(L).forEach(([F,B])=>{B===""?E.style.removeProperty(F):E.style.setProperty(F,B)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;p({height:E.scrollHeight,width:E.scrollWidth});const L=new AbortController;t.current=L;const F=L.signal;let B=null;const W=fn.endingStyle;return B=new MutationObserver($=>{$.some(Z=>Z.type==="attributes"&&Z.attributeName===W)&&(B==null||B.disconnect(),B=null,f(()=>{p({height:0,width:0}),E.style.removeProperty("content-visibility"),g(!1),t.current===L&&(t.current=null)},F))}),B.observe(E,{attributes:!0,attributeFilter:[W]}),()=>{B==null||B.disconnect(),k.cancel(),t.current===L&&(L.abort(),t.current=null)}}return()=>{le.cancel(O)}},[t,n,k,o,i,l,d,w,f,p,g]),se(()=>{if(n.current!=="css-animation")return;const E=w.current;E&&(T.current=E.style.animationName||T.current,E.style.setProperty("animation-name","none"),p({height:E.scrollHeight,width:E.scrollWidth}),!A.current&&!S.current&&E.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,f(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,d,w,f,p,g,v,y]),Fn(()=>{const E=le.request(()=>{A.current=!1});return()=>le.cancel(E)}),se(()=>{if(!o)return;const E=w.current;if(!E)return;let O=-1,L=-1;return d&&S.current&&(E.style.transitionDuration="0s",p({height:E.scrollHeight,width:E.scrollWidth}),O=le.request(()=>{S.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})})),()=>{le.cancel(O),le.cancel(L)}},[o,d,w,p]),se(()=>{const E=w.current;E&&o&&M&&(E.setAttribute("hidden","until-found"),n.current==="css-transition"&&E.setAttribute(fn.startingStyle,""))},[o,M,n,w]),x.useEffect(function(){const O=w.current;if(!O)return;function L(F){S.current=!0,b(!0),c(!0,ke(Xt,F))}return O.addEventListener("beforematch",L),()=>{O.removeEventListener("beforematch",L)}},[c,w,b]),x.useMemo(()=>({props:{hidden:M,id:u,ref:P}}),[M,u,P])}let Xl=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const Zl=x.forwardRef(function(t,n){const{className:s,hiddenUntilFound:r,keepMounted:o,render:i,id:u,...l}=t;process.env.NODE_ENV!=="production"&&se(()=>{r&&o===!1&&Yl("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[r,o]);const{abortControllerRef:c,animationTypeRef:d,height:w,mounted:f,onOpenChange:p,open:g,panelId:b,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setHiddenUntilFound:C,setKeepMounted:S,setMounted:T,setPanelIdState:A,setOpen:D,setVisible:k,state:M,transitionDimensionRef:_,visible:P,width:E,transitionStatus:O}=zl(),L=r??!1,F=o??!1;se(()=>{if(u)return A(u),()=>{A(void 0)}},[u,A]),se(()=>{C(L)},[C,L]),se(()=>{S(F)},[S,F]);const{props:B}=Pb({abortControllerRef:c,animationTypeRef:d,externalRef:n,height:w,hiddenUntilFound:L,id:b,keepMounted:F,mounted:f,onOpenChange:p,open:g,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setMounted:T,setOpen:D,setVisible:k,transitionDimensionRef:_,visible:P,width:E});Qw({open:g&&O==="idle",ref:v,onComplete(){g&&y({height:void 0,width:void 0})}});const W=x.useMemo(()=>({...M,transitionStatus:O}),[M,O]),$=Ke("div",t,{state:W,ref:[n,v],props:[B,{style:{[Xl.collapsiblePanelHeight]:w===void 0?"auto":`${w}px`,[Xl.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},l],stateAttributesMapping:Ul});return F||L||!F&&f?$:null});process.env.NODE_ENV!=="production"&&(Zl.displayName="CollapsiblePanel");const Vb=({children:e,Sidebar:t,className:n,defaultOpen:s=!0,open:r,onOpenChange:o,style:i})=>a.jsxs(kl,{defaultOpen:s,open:r,onOpenChange:o,children:[a.jsxs(_l,{variant:"sidebar",collapsible:"icon",className:m("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(Ol,{className:"wu-py-2",children:a.jsx(Jl,{})}),t]}),a.jsx(Vl,{className:"wu-contain-inline-size",children:e})]}),Jl=e=>{const{state:t,isMobile:n,openMobile:s}=rt();return a.jsx(Pl,{...e,children:a.jsx(ua,{showMenu:n?s:t==="expanded"})})},Ob=({className:e,children:t,...n})=>{const s=h.useRef(null),r=h.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:c,scrollHeight:d}=u;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l!==0),r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l+c!==d)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Wl,{...n,className:m("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:s}),a.jsx(Wt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:r})]})},Fb=e=>a.jsx(Fl,{...e,children:e.children}),Wb=({label:e,children:t,...n})=>a.jsxs(Ll,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Bl,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(ql,{children:a.jsx(ha,{children:t})})]}),Lb=e=>a.jsx(ha,{...e}),Ql=({Icon:e,children:t,className:n,isActive:s,...r})=>{var w;const{state:o}=rt(),[i,u]=h.useState(),l=pa(),c=h.isValidElement(t)?h.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),d=h.useRef(null);return h.useEffect(()=>{var f;u(((f=d.current)==null?void 0:f.textContent)||"")},[]),a.jsx($l,{...r,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Hl,{className:m("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,s&&"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:s,tooltip:i,asChild:h.isValidElement(t),ref:d,children:c})})},Bb=({Title:e,Icon:t,children:n,className:s,...r})=>{const{state:o}=rt(),i=pa();return a.jsxs(jl,{children:[a.jsx(Kl,{render:u=>{const l="data-panel-open"in u;return a.jsxs(Ql,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Pe,{icon:"wm-arrow-forward-ios",className:m("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(Zl,{className:m(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',s),...r,children:n})]})},qb=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"}]]),ya=(e,t,n=1)=>{const s=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!s)throw new Error("Invalid HSL color format");const r=parseFloat(s[1]),o=parseFloat(s[2]),i=Math.max(0,parseFloat(s[3])+t);return`hsl(${r} ${o}% ${i}% / ${n})`},$b=({index:e,viewIndex:t,length:n,itemHeight:s})=>{const r=(e-t+n)%n;let o;r===0?o=0:r===n-1&&n>=2?o=-1:r===n-2&&n>=3?o=-2:r===1?o=1:r===2?o=2:r===n-3&&n>=4?o=-3:o=3;const i=qb.get(o)||{},u=o>0?s+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":s}}},pn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Hb=({children:e,className:t,header:n,baseColor:s,position:r=0,style:o,...i})=>{const u=r<=0,l=r===0,c={border:l?`4px solid ${ya(s,pn.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:ya(s,r*pn.LIGHTNESS_STEP),fontSize:l?pn.FONT_SIZE_ACTIVE:pn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:r<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:ya(s,45+r*6),height:pn.CONTENT_HEIGHT,position:"relative",bottom:r<0?"4px":"0px"};return a.jsxs("div",{className:m("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})]})},zb=({children:e,Trigger:t,Header:n,styles:s={},classNames:r={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...s.Trigger};return a.jsxs(cl,{open:o,onOpenChange:i,children:[a.jsx(dl,{className:m("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",r.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(la,{className:m("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",r.Content),hideCloseButton:!0,isStackedCard:!0,style:s.Content,children:[a.jsx(da,{}),a.jsx(qa.DialogClose,{className:m("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",r.CloseButton),style:s.CloseButton,"aria-label":"Close dialog",children:a.jsx(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(ca,{className:m("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",r.Header),style:s.Header,children:n}),e]})]})},Rl=0;class va extends Wn{constructor(){super(...arguments);Ee(this,"clear",()=>{this.currentId!==Rl&&(clearInterval(this.currentId),this.currentId=Rl)})}static create(){return new va}start(n,s){this.clear(),this.currentId=setInterval(()=>{s()},n)}}function Ub(){const e=Je(va.create).current;return Fn(e.disposeEffect),e}function ec(e){const t=Je(jb,e).current;return t.next=e,se(t.effect),t}function jb(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Gb(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}const tc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Kb={...tc,position:"fixed",top:0,left:0},Yb={...tc,position:"absolute"},xa=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(xa.displayName="NumberFieldRootContext");function ds(){const e=x.useContext(xa);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>.":jt(43));return e}const hn={inputValue:()=>null,value:()=>null,...Us},nc=new Map;function mn(e,t){const n=JSON.stringify({locale:e,options:t}),s=nc.get(n);if(s)return s;const r=new Intl.NumberFormat(e,t);return nc.set(n,r),r}function Lt(e,t,n){return e==null?"":mn(t,n).format(e)}function sc(e,t,n){return Lt(e,t,{...n,maximumFractionDigits:20})}const Xb=["零","〇","一","二","三","四","五","六","七","八","九"],Zb={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},rc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],ac=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Na=["0","1","2","3","4","5","6","7","8","9"],oc=["%","٪","%","﹪"],ic=["‰","؉"],uc=["−","-","‒","–","—","﹣"],lc=["+","﹢"],Jb=".",Qb=",",Rb=new RegExp(`[${rc.join("")}]`,"g"),ey=new RegExp(`[${ac.join("")}]`,"g"),ty=new RegExp(`[${Na.join("")}]`,"g"),ny=new RegExp(`[${Xb.join("")}]`,"g"),sy=new RegExp(`[${oc.join("")}]`),ry=new RegExp(`[${ic.join("")}]`),Sa=/[٠١٢٣٤٥٦٧٨٩]/,cc=/[۰۱۲۳۴۵۶۷۸۹]/,Ca=/[零〇一二三四五六七八九]/,dc=new RegExp(`[${Na.join("")}]`),ay=[".",",",Jb,Qb,"٫","٬"],wc=new RegExp("\\p{Zs}","u"),oy=["+",...lc],iy=["-",...uc],ws=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),uy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),fc=e=>`[${e.map(uy).join("")}]`,pc=fc(["-"].concat(uc)),hc=fc(["+"].concat(lc)),mc=new RegExp(pc,"gu"),gc=new RegExp(hc,"gu"),gn=new RegExp(pc),fs=new RegExp(hc);function Ta(e,t){const n=mn(e,t).formatToParts(11111.1),s={};return n.forEach(r=>{s[r.type]=r.value}),mn(e).formatToParts(.1).forEach(r=>{r.type==="decimal"&&(s[r.type]=r.value)}),s}function bn(e,t,n){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(mc,"-").replace(gc,"+");let r=!1;const o=s.match(/([+-])\s*$/);o&&(o[1]==="-"&&(r=!0),s=s.replace(/([+-])\s*$/,""));const i=s.match(/^\s*([+-])/);i&&(i[1]==="-"&&(r=!0),s=s.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Sa.test(s)||cc.test(s)?u="ar":Ca.test(s)&&(u="zh"));const{group:l,decimal:c,currency:d}=Ta(u,n),w=mn(u,n).formatToParts(1).filter(D=>D.type==="unit").map(D=>ws(D.value)),f=w.length?new RegExp(w.join("|"),"g"):null;let p=null;l&&(new RegExp("\\p{Zs}","u").test(l)?p=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?p=/['’]/g:p=new RegExp(ws(l),"g"));let b=[{regex:l?p:null,replacement:""},{regex:c?new RegExp(ws(c),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(ws(d),"g"):null,replacement:""},{regex:f,replacement:""},{regex:Rb,replacement:D=>String(rc.indexOf(D))},{regex:ey,replacement:D=>String(ac.indexOf(D))},{regex:ty,replacement:D=>String(Na.indexOf(D))},{regex:ny,replacement:D=>Zb[D]}].reduce((D,{regex:k,replacement:M})=>k?D.replace(k,M):D,s);const v=b.lastIndexOf(".");if(v!==-1&&(b=`${b.slice(0,v).replace(/\./g,"")}.${b.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const N=(r?"-":"")+b;let y=parseFloat(N);const C=n==null?void 0:n.style,S=C==="unit"&&(n==null?void 0:n.unit)==="percent",T=sy.test(e)||C==="percent";return ry.test(e)?y/=1e3:!S&&T&&(y/=100),Number.isNaN(y)?null:y}const ly=60,cy=400,dy=50,wy=3,fy=8,ps=1;function py(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const hy=1e-10;function my(e){const t=mn("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 gy(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}=my(t);return gy(e,n)}function by(e,t,n,s="directional"){if(n===0)return e;const r=Math.abs(n),o=Math.sign(n),i=r*hy*o,u=s==="nearest"?n:r,l=(e-t+i)/u;let c;return s==="nearest"?c=Math.round(l):o>0?c=Math.floor(l):c=Math.ceil(l),t+c*(s==="nearest"?n:r)}function yy(e,{step:t,minWithDefault:n,maxWithDefault:s,minWithZeroDefault:r,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const c=l?py(e,n,s):e;if(t!=null&&i){if(t===0)return Ea(c,o);let d=r;!u&&n!==Number.MIN_SAFE_INTEGER&&(d=n);const w=by(c,d,t,u?"nearest":"directional");return Ea(w,o)}return Ea(c,o)}const bc=x.forwardRef(function(t,n){const{id:s,min:r,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:c=!1,disabled:d=!1,readOnly:w=!1,name:f,defaultValue:p,value:g,onValueChange:b,onValueCommitted:v,allowWheelScrub:N=!1,snapOnStep:y=!1,allowOutOfRange:C=!1,format:S,locale:T,render:A,className:D,inputRef:k,...M}=t,{setDirty:_,validityData:P,disabled:E,setFilled:O,invalid:L,name:F,state:B,validation:W,shouldValidateOnChange:$}=Pn(),G=E||d,Z=F??f,U=u==="any"?1:u,[J,ie]=x.useState(!1),fe=r??Number.MIN_SAFE_INTEGER,Se=o??Number.MAX_SAFE_INTEGER,V=r??0,H=S==null?void 0:S.style,Y=x.useRef(null),K=On(k,W.inputRef),me=Do({id:s}),[j,ee]=Qs({controlled:g,default:p,name:"NumberField",state:"value"}),Q=j??null,be=ec(Q);se(()=>{O(Q!==null)},[O,Q]);const ze=Gb(),Ce=ec(S),Te=x.useRef(!1),vt=ge((R,X)=>{Te.current=!1,v==null||v(R,X)}),Sn=xo(),Ns=Ub(),Cn=xo(),Tn=x.useRef(!1),En=x.useRef(0),Xe=x.useRef(!0),ue=x.useRef(null),ot=x.useRef(()=>{}),[xt,Ss]=x.useState(()=>g!==void 0?yc(Q,T,S):Lt(Q,T,S)),[md,pv]=x.useState("numeric"),gd=ge(()=>{const{decimal:R,group:X,currency:ce,literal:pe}=Ta(T,S),re=new Set;ay.forEach(ve=>re.add(ve)),R&&re.add(R),X&&(re.add(X),wc.test(X)&&re.add(" "));const Fe=H==="percent"||H==="unit"&&(S==null?void 0:S.unit)==="percent",We=H==="percent"||H==="unit"&&(S==null?void 0:S.unit)==="permille";return Fe&&oc.forEach(ve=>re.add(ve)),We&&ic.forEach(ve=>re.add(ve)),H==="currency"&&ce&&re.add(ce),pe&&(Array.from(pe).forEach(ve=>re.add(ve)),wc.test(pe)&&re.add(" ")),oy.forEach(ve=>re.add(ve)),fe<0&&iy.forEach(ve=>re.add(ve)),re}),qt=ge(R=>R!=null&&R.altKey?i:R!=null&&R.shiftKey?l:U),Cs=ge((R,X)=>{const ce=X.event,pe=X.direction,re=X.reason,Fe=!C||!(re===Rs||re===$n||re===er||re===Zt||re===Xt),We=yy(R,{step:pe?qt(ce)*pe:void 0,format:Ce.current,minWithDefault:fe,maxWithDefault:Se,minWithZeroDefault:V,snapOnStep:y,small:(ce==null?void 0:ce.altKey)??!1,clamp:Fe}),ve=X.reason===Rs||X.reason===Zt||X.reason===$n||X.reason===er||X.reason===Xt,Wa=We!==Q||ve&&(R!==Q||Xe.current===!1);if(Wa){if(ue.current=We,b==null||b(We,X),X.isCanceled)return Wa;ee(We),_(We!==P.initialValue),Te.current=!0}return Xe.current&&Ss(Lt(We,T,S)),ze(),Wa}),Mn=ge((R,{direction:X,currentValue:ce,event:pe,reason:re})=>{const Fe=ce??be.current,We=typeof Fe=="number"?Fe+R*X:Math.max(0,r??0);return Cs(We,ke(re,pe,void 0,{direction:X}))}),it=ge(()=>{Cn.clear(),Sn.clear(),Ns.clear(),ot.current(),En.current=0}),bd=ge((R,X)=>{if(it(),!Y.current)return;const ce=Zs(Y.current);function pe(Fe){Fe.preventDefault()}ce.addEventListener("contextmenu",pe),ot.current=()=>{ce.removeEventListener("contextmenu",pe)},ce.addEventListener("pointerup",Fe=>{Tn.current=!1,it();const We=ue.current??be.current;vt(We,Qt(R?"increment":"decrement",Fe))},{once:!0});function re(){const Fe=qt(X)??ps;return Mn(Fe,{direction:R?1:-1,event:X,reason:R?"increment-press":"decrement-press"})}if(!re()){it();return}Sn.start(cy,()=>{Ns.start(ly,()=>{re()||it()})})});se(function(){if(!Xe.current)return;const X=g!==void 0?yc(Q,T,S):Lt(Q,T,S);X!==xt&&Ss(X)}),se(function(){if(!Hw)return;let X="text";fe>=0&&(X="decimal"),pv(X)},[fe,H]),x.useEffect(()=>()=>it(),[it]),x.useEffect(function(){const X=Y.current;if(G||w||!N||!X)return;function ce(pe){if(pe.ctrlKey||Co(Y.current).activeElement!==Y.current)return;pe.preventDefault();const re=qt(pe)??ps;Mn(re,{direction:pe.deltaY>0?-1:1,event:pe,reason:"wheel"})}return X.addEventListener("wheel",ce),()=>{X.removeEventListener("wheel",ce)}},[N,Mn,G,w,l,U,qt]);const Fa=x.useMemo(()=>({...B,disabled:G,readOnly:w,required:c,value:Q,inputValue:xt,scrubbing:J}),[B,G,w,c,Q,xt,J]),hv=x.useMemo(()=>({inputRef:Y,inputValue:xt,value:Q,startAutoChange:bd,stopAutoChange:it,minWithDefault:fe,maxWithDefault:Se,disabled:G,readOnly:w,id:me,setValue:Cs,incrementValue:Mn,getStepAmount:qt,allowInputSyncRef:Xe,formatOptionsRef:Ce,valueRef:be,lastChangedValueRef:ue,hasPendingCommitRef:Te,isPressedRef:Tn,intentionalTouchCheckTimeout:Cn,movesAfterTouchRef:En,name:Z,required:c,invalid:L,inputMode:md,getAllowedNonNumericKeys:gd,min:r,max:o,setInputValue:Ss,locale:T,isScrubbing:J,setIsScrubbing:ie,state:Fa,onValueCommitted:vt}),[Y,xt,Q,bd,it,fe,Se,G,w,me,Cs,Mn,qt,Ce,be,Cn,Z,c,L,md,gd,r,o,Ss,T,J,Fa,vt]),mv=Ke("div",t,{ref:n,state:Fa,props:M,stateAttributesMapping:hn});return a.jsxs(xa.Provider,{value:hv,children:[mv,a.jsx("input",{...W.getInputValidationProps({onFocus(){var R;(R=Y.current)==null||R.focus()},onChange(R){if(R.nativeEvent.defaultPrevented)return;const X=R.currentTarget.valueAsNumber,ce=Number.isNaN(X)?null:X,pe=ke(Xt,R.nativeEvent);_(ce!==P.initialValue),Cs(ce,pe),$()&&W.commit(ce)}}),ref:K,type:"number",name:Z,value:Q??"",min:r,max:o,step:u,disabled:G,required:c,"aria-hidden":!0,tabIndex:-1,style:Z?Yb:Kb})]})});process.env.NODE_ENV!=="production"&&(bc.displayName="NumberFieldRoot");function yc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Lt(e,t,n):sc(e,t,n)}const vc=x.forwardRef(function(t,n){const{render:s,className:r,...o}=t,{state:i}=ds();return Ke("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(vc.displayName="NumberFieldGroup");function yn(e){return e==="touch"||e==="pen"}function xc(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:s,getStepAmount:r,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:c,isIncrement:d,isPressedRef:w,locale:f,movesAfterTouchRef:p,readOnly:g,setValue:b,startAutoChange:v,stopAutoChange:N,valueRef:y,lastChangedValueRef:C,onValueCommitted:S}=e,T=x.useRef({x:0,y:0}),A=x.useRef(!1),D=x.useRef(!1),k=x.useRef(""),M=d?"increment-press":"decrement-press";function _(E){t.current=!0;const O=bn(l,f,s.current);O!==null&&(y.current=O,b(O,ke(M,E,void 0,{direction:d?1:-1})))}return{disabled:n,"aria-readonly":g||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){A.current=!0},onTouchEnd(){A.current=!1},onClick(E){const O=n||g;if(E.defaultPrevented||O||(yn(k.current)?D.current:E.detail!==0))return;_(E.nativeEvent);const L=r(E)??ps,F=y.current;i(L,{direction:d?1:-1,event:E.nativeEvent,reason:M});const B=C.current??y.current;B!==F&&S(B,Qt(M,E.nativeEvent))},onPointerDown(E){var F;const O=!E.button||E.button===0;if(E.defaultPrevented||g||!O||n)return;k.current=E.pointerType,D.current=!1,w.current=!0,T.current={x:E.clientX,y:E.clientY},_(E.nativeEvent),yn(E.pointerType)?c.start(dy,()=>{const B=p.current;p.current=0,w.current&&B!=null&&B<wy?(v(d,E),D.current=!0):(D.current=!1,N())}):(E.preventDefault(),(F=u.current)==null||F.focus(),v(d,E))},onPointerUp(E){yn(E.pointerType)&&(w.current=!1)},onPointerMove(E){if(n||g||!yn(E.pointerType)||!w.current)return;p.current!=null&&(p.current+=1);const{x:L,y:F}=T.current,B=L-E.clientX,W=F-E.clientY;B**2+W**2>fy**2&&N()},onMouseEnter(E){const O=n||g;E.defaultPrevented||O||!w.current||A.current||yn(k.current)||v(d,E)},onMouseLeave(){A.current||N()},onMouseUp(){A.current||N()}}}const Nc=x.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:f,incrementValue:p,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,locale:y,maxWithDefault:C,movesAfterTouchRef:S,readOnly:T,setValue:A,startAutoChange:D,state:k,stopAutoChange:M,value:_,valueRef:P,lastChangedValueRef:E,onValueCommitted:O}=ds(),L=_!=null&&_>=C,F=o||c||L,B=xc({isIncrement:!0,inputRef:g,startAutoChange:D,stopAutoChange:M,inputValue:b,disabled:F,readOnly:T,id:f,setValue:A,getStepAmount:w,incrementValue:p,allowInputSyncRef:l,formatOptionsRef:d,valueRef:P,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:S,locale:y,lastChangedValueRef:E,onValueCommitted:O}),{getButtonProps:W,buttonRef:$}=ga({disabled:F,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...k,disabled:F}),[k,F]);return Ke("button",t,{ref:[n,$],state:G,props:[B,u,W],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(Nc.displayName="NumberFieldIncrement");const Sc=x.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:f,incrementValue:p,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,minWithDefault:y,movesAfterTouchRef:C,readOnly:S,setValue:T,startAutoChange:A,state:D,stopAutoChange:k,value:M,valueRef:_,locale:P,lastChangedValueRef:E,onValueCommitted:O}=ds(),L=M!=null&&M<=y,F=o||c||L,B=xc({isIncrement:!1,inputRef:g,startAutoChange:A,stopAutoChange:k,inputValue:b,disabled:F,readOnly:S,id:f,setValue:T,getStepAmount:w,incrementValue:p,allowInputSyncRef:l,formatOptionsRef:d,valueRef:_,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:C,locale:P,lastChangedValueRef:E,onValueCommitted:O}),{getButtonProps:W,buttonRef:$}=ga({disabled:F,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...D,disabled:F}),[D,F]);return Ke("button",t,{ref:[n,$],state:G,props:[B,u,W],stateAttributesMapping:hn})});process.env.NODE_ENV!=="production"&&(Sc.displayName="NumberFieldDecrement");function vy(e,t){const n=x.useRef(e),s=ge(t);se(()=>{n.current!==e&&s(n.current)},[e,s]),se(()=>{n.current=e},[e])}const xy={...Us,...hn},Ny=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Cc=x.forwardRef(function(t,n){const{render:s,className:r,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:c,getStepAmount:d,id:w,incrementValue:f,inputMode:p,inputValue:g,max:b,min:v,name:N,readOnly:y,required:C,setValue:S,state:T,setInputValue:A,locale:D,inputRef:k,value:M,onValueCommitted:_,lastChangedValueRef:P,hasPendingCommitRef:E,valueRef:O}=ds(),{clearErrors:L}=lo(),{validationMode:F,setTouched:B,setFocused:W,invalid:$,shouldValidateOnChange:G,validation:Z}=Pn(),{labelId:U}=Ys(),J=x.useRef(!1),ie=x.useRef(!1);return Ao({id:w,commit:Z.commit,value:M,controlRef:k,name:N,getValue:()=>M??null}),vy(M,V=>{const H=G();if(L(N),H&&Z.commit(M),!(V===M||H)){if(ie.current){ie.current=!1;return}Z.commit(M,!0)}}),Ke("input",t,{ref:[n,k],state:T,props:[{id:w,required:C,disabled:u,readOnly:y,inputMode:p,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":$||void 0,"aria-labelledby":U,suppressHydrationWarning:!0,onFocus(V){if(V.defaultPrevented||y||u||(W(!0),J.current))return;J.current=!0;const H=V.currentTarget,Y=H.value.length;H.setSelectionRange(Y,Y)},onBlur(V){if(V.defaultPrevented||y||u)return;B(!0),W(!1);const H=!i.current,Y=E.current;if(i.current=!0,g.trim()===""){S(null,ke(Zt,V.nativeEvent)),F==="onBlur"&&Z.commit(null),_(null,Qt(Zt,V.nativeEvent));return}const K=l.current,me=bn(g,D,K);if(me===null)return;const j=(K==null?void 0:K.maximumFractionDigits)!=null||(K==null?void 0:K.minimumFractionDigits)!=null,ee=K==null?void 0:K.maximumFractionDigits,Q=j&&typeof ee=="number"?Number(me.toFixed(ee)):me,be=Qt($n,V.nativeEvent),ze=M!==Q,Ce=H||ze||Y;F==="onBlur"&&Z.commit(Q),ze&&(ie.current=!0,S(Q,ke($n,V.nativeEvent))),Ce&&_(Q,be);const Te=Lt(Q,D,K),vt=sc(me,D,K);!(!j&&me===M&&g===vt)&&g!==Te&&A(Te)},onChange(V){if(V.nativeEvent.defaultPrevented)return;i.current=!1;const H=V.target.value;if(H.trim()===""){A(H),S(null,ke(Zt,V.nativeEvent));return}const Y=c();if(!Array.from(H).every(j=>{const ee=j>="0"&&j<="9",Q=Sa.test(j),be=Ca.test(j),ze=cc.test(j),Ce=dc.test(j),Te=gn.test(j);return ee||Q||be||ze||Ce||Te||Y.has(j)}))return;const me=bn(H,D,l.current);A(H),me!==null&&S(me,ke(Rs,V.nativeEvent))},onKeyDown(V){if(V.defaultPrevented||y||u)return;const H=V.nativeEvent;i.current=!0;const Y=c();let K=Y.has(V.key);const{decimal:me,currency:j,percentSign:ee}=Ta(D,l.current),Q=V.currentTarget.selectionStart,be=V.currentTarget.selectionEnd,ze=Q===0&&be===g.length,Ce=ue=>Q!=null&&be!=null&&ue>=Q&&ue<be;if(gn.test(V.key)&&Array.from(Y).some(ue=>gn.test(ue||""))){const ue=g.search(mc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(gn.test(g)||fs.test(g))||ze||ot}if(fs.test(V.key)&&Array.from(Y).some(ue=>fs.test(ue||""))){const ue=g.search(gc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(gn.test(g)||fs.test(g))||ze||ot}[me,j,ee].forEach(ue=>{if(V.key===ue){const ot=g.indexOf(ue),xt=Ce(ot);K=!g.includes(ue)||ze||xt}});const Te=V.key>="0"&&V.key<="9",vt=Sa.test(V.key),Sn=Ca.test(V.key),Ns=dc.test(V.key),Cn=Ny.has(V.key);if(V.which===229||V.altKey||V.ctrlKey||V.metaKey||K||Te||vt||Ns||Sn||Cn)return;const Tn=bn(g,D,l.current),En=d(V)??ps;Kw(V);const Xe=Qt(Jt,H);V.key==="ArrowUp"?(f(En,{direction:1,currentValue:Tn,event:H,reason:Jt}),_(P.current??O.current,Xe)):V.key==="ArrowDown"?(f(En,{direction:-1,currentValue:Tn,event:H,reason:Jt}),_(P.current??O.current,Xe)):V.key==="Home"&&v!=null?(S(v,ke(Jt,H)),_(P.current??O.current,Xe)):V.key==="End"&&b!=null&&(S(b,ke(Jt,H)),_(P.current??O.current,Xe))},onPaste(V){if(V.defaultPrevented||y||u)return;V.preventDefault();const Y=(V.clipboardData||window.Clipboard).getData("text/plain"),K=bn(Y,D,l.current);K!==null&&(i.current=!1,S(K,ke(er,V.nativeEvent)),A(Y))}},Z.getValidationProps(),o],stateAttributesMapping:xy})});process.env.NODE_ENV!=="production"&&(Cc.displayName="NumberFieldInput");const Sy={wuStepper:"_wuStepper_apbnq_1"},Cy=({onChange:e,Label:t,defaultValue:n=0,readonly:s,dir:r,step:o=1,min:i,max:u,value:l,className:c,labelPosition:d="left",disabled:w,resetInvalidValueOnBlur:f=!0,...p})=>{const g=x.useId(),[b,v]=x.useState(l!==void 0?Number(l):n||0);x.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const N=D=>{v(D),e==null||e(D)},y=D=>{const k=Number(D.target.value);Number.isNaN(k)||v(k)},C=()=>{f&&(i!==void 0&&b<i?(v(i),e==null||e(i)):u!==void 0&&b>u&&(v(u),e==null||e(u)))};x.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const S={inc:s||u!==void 0&&b>=u||w,dec:s||i!==void 0&&b<=i||w},T=i!==void 0&&b<i||u!==void 0&&b>u,A=m("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(bc,{id:g,value:b,step:o,readOnly:s,onValueChange:D=>typeof D=="number"&&N(D),dir:r,className:m("wu-flex wu-stepper",r==="rtl"&&d!=="top"&&"wu-gap-2",Sy.wuStepper,Ty({labelPosition:d}),c),children:[t&&a.jsx(Ae,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(vc,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Sc,{"aria-label":"decrement",className:m(A,r==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:S.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Cc,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||void 0,dir:r,className:m("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",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:C,disabled:w,min:i,max:u,step:o,value:b,...p}),a.jsx(Nc,{"aria-label":"increment",className:m(A,r==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:S.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Ty=Le.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"}}}),Oe={container:"_container_1cpdq_1",sidebar:"_sidebar_1cpdq_5",content:"_content_1cpdq_13",sourceWrapper:"_sourceWrapper_1cpdq_17",list:"_list_1cpdq_25",listItem:"_listItem_1cpdq_29",listItemActive:"_listItemActive_1cpdq_42",label:"_label_1cpdq_46",icon:"_icon_1cpdq_50",sharedWrapper:"_sharedWrapper_1cpdq_54"},Tc=h.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Oe.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));Tc.displayName="WuSharedSurvey";const Ey=(e,t=!1)=>{if(e)return a.jsx("span",{className:Oe.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Oe.icon,n),"aria-hidden":"true"})},Ec=h.memo(({children:e,icon:t,isActive:n,isShared:s,className:r,...o})=>a.jsxs("button",{className:m(Oe.listItem,n&&Oe.listItemActive,r),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Ey(t,s),a.jsx("span",{className:Oe.label,children:e})]}));Ec.displayName="WuSurveyItem";const Mc=h.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Oe.list,t),...n,children:e}));Mc.displayName="WuSurveyList";const Ic=e=>{const{className:t,variant:n="outlined",...s}=e;return a.jsx("div",{className:Oe.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(ul,{variant:n,showGroupSeparator:!0,className:m(Oe.source,t),...s})})};Ic.displayName="WuSurveySource";const My=h.memo(Ic),Dc=h.memo(({Sidebar:e,children:t,className:n,...s})=>a.jsxs("div",{className:m(Oe.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...s,children:[e&&a.jsx("div",{className:Oe.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Oe.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Dc.displayName="WuSurveySelect";const Ac=Le.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"}}),Iy=x.forwardRef(({className:e,variant:t,size:n,...s},r)=>a.jsx(Ua.Root,{ref:r,className:m(Ac({variant:t,size:n,className:e})),...s}));Iy.displayName=Ua.Root.displayName;const kc=x.createContext({size:"default",variant:"default"}),hs=x.forwardRef(({className:e,variant:t,size:n,children:s,...r},o)=>a.jsx(In.Root,{ref:o,className:m("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...r,children:a.jsx(kc.Provider,{value:{variant:t,size:n},children:s})}));hs.displayName=In.Root.displayName;const yt=x.forwardRef(({className:e,children:t,variant:n,size:s,...r},o)=>{const i=x.useContext(kc);return a.jsx(In.Item,{ref:o,className:m(Ac({variant:i.variant||n,size:i.size||s}),e),...r,children:t})});yt.displayName=In.Item.displayName;const _c=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,onChange:i}=e,u=l=>m("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",r&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===s&&"wu-text-white",r&&s===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,onValueChange:i,disabled:r,dir:o,className:m("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",r&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:m("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",r&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(yt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(yt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});_c.displayName="_IconTab";const Pc=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,size:i="md",onChange:u}=e,l=c=>m("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",r&&"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===s&&"wu-text-white wu-font-medium",r&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,onValueChange:u,disabled:r,dir:o,className:m("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",r&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:m("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",r&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(yt,{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(yt,{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})})]})})});Pc.displayName="_Tab";const Vc=h.forwardRef((e,t)=>{const{options:n,value:s,disabled:r,dir:o,onChange:i}=e,u=w=>m("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",r&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===s&&"wu-text-primary wu-font-medium",r&&s===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=m("wu-w-fit wu-gap-2",r&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=m("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",r&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),d=m("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",r&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(hs,{ref:t,type:"single",value:s,disabled:r,dir:o,className:l,onValueChange:i,children:[a.jsx(yt,{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(s==="opt1"?"opt2":"opt1"),className:c,disabled:r,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(yt,{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})})]})})});Vc.displayName="_Toggle";const Oc=h.forwardRef((e,t)=>{const{type:n,options:s,value:r,disabled:o,dir:i,size:u,onChange:l,toggle:c=!0,...d}=e,[w,f]=h.useState(),p=g=>{let b=w;g!==""?b=g:c&&(b=w==="opt1"?"opt2":"opt1");const v=b==="opt1"?s[0].value:s[1].value;l&&l(v),f(b)};if(h.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");f(r===s[0].value?"opt1":"opt2")},[s,r]),!Array.isArray(s)||s.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Vc,{...d,ref:t,options:s,value:w||"opt1",onChange:p,disabled:o,dir:i});case"iconTab":return a.jsx(_c,{ref:t,options:s,value:w||"opt1",onChange:p,disabled:o,dir:i});default:return a.jsx(Pc,{ref:t,options:s,value:w||"opt1",onChange:p,disabled:o,dir:i,size:u})}});Oc.displayName="WuSwitcher";const Fc=ct.Root,Ma=x.forwardRef(({className:e,children:t,...n},s)=>a.jsx(ct.List,{className:m("wu-relative wu-flex",e),...n,ref:s,children:t}));Ma.displayName=ct.List.displayName;const Ia=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Trigger,{ref:n,className:m("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}));Ia.displayName=ct.Trigger.displayName;const Wc=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Content,{ref:n,className:e,...t}));Wc.displayName=ct.Content.displayName;const Lc=({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:m("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(s=>a.jsx(Wc,{value:s.value,forceMount:t||void 0,className:m("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:s.Content},s.value))})},Dy=e=>{const[t,n]=h.useState(!1),[s,r]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),r(u.scrollLeft+u.clientWidth<u.scrollWidth))};return h.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:s,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:c,behavior:"smooth"})}}}},Bc=(e,t)=>{const[n,s]=h.useState({width:0,left:0,height:0,top:0}),r=t==="vertical";return h.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const c={width:r?2:l.offsetWidth,left:r?0:l.offsetLeft,height:r?l.offsetHeight:1,top:r?l.offsetTop:0};s(c)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,r]),n},Ay=({items:e,value:t,defaultValue:n,onValueChange:s,enableAnimation:r=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=h.useRef(null),c=Bc(l,"horizontal"),{showLeftArrow:d,showRightArrow:w,scrollByTab:f}=Dy(l),[p,g]=h.useState(!1),b=()=>f("left"),v=()=>f("right"),N=S=>a.jsx("div",{"data-testid":`gradient-overlay-${S}`,className:m("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",S==="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=(S,T,A)=>{const D=T==="left";return a.jsx("button",{onClick:S,className:m("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",D?"wu-left-0":"wu-right-0",A&&"wu-translate-x-0 wu-opacity-100",!A&&[D?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":D?"scroll-left":"scroll-right",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",D?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Fc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"horizontal",dir:i,className:m("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:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&p&&N("left"),y(b,"left",d&&p),a.jsxs(Ma,{ref:l,className:m("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(S=>a.jsx(Ia,{value:S.value,children:S.Trigger},S.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&&p&&N("right"),y(v,"right",w&&p)]}),a.jsx(Lc,{items:e,enableAnimation:r})]})},ky=e=>{const[t,n]=h.useState(!1),[s,r]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),r(u.scrollTop+u.clientHeight<u.scrollHeight))};return h.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:s,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:c,behavior:"smooth"})}}}},_y=({items:e,value:t,defaultValue:n,onValueChange:s,enableAnimation:r=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=h.useRef(null),c=Bc(l,"vertical"),{showTopArrow:d,showBottomArrow:w,scrollByTab:f}=ky(l),[p,g]=h.useState(!1),b=()=>f("up"),v=()=>f("down"),N=S=>a.jsx("div",{className:m("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",S==="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=(S,T,A)=>{const D=T==="up";return a.jsx("button",{onClick:S,className:m("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",D?"-wu-top-1":"-wu-bottom-1",A&&"wu-translate-y-0 wu-opacity-100",!A&&[D?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":D?"scroll-up":"scroll-down",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",D?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Fc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"vertical",dir:i,className:m("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:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&p&&N("top"),y(b,"up",d&&p),a.jsxs(Ma,{ref:l,className:m("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(S=>a.jsx(Ia,{value:S.value,children:S.Trigger},S.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&&p&&N("bottom"),y(v,"down",w&&p)]}),a.jsx(Lc,{items:e,enableAnimation:r})]})},Py=({...e})=>e.orientation==="vertical"?a.jsx(_y,{...e}):a.jsx(Ay,{...e}),Da=x.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Da.displayName="Table";const Aa=x.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));Aa.displayName="TableHeader";const vn=x.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));vn.displayName="TableBody";const Vy=x.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:m("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Vy.displayName="TableFooter";const at=x.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:m("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));at.displayName="TableRow";const ms=x.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:m("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));ms.displayName="TableHead";const Bt=x.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:m("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));Bt.displayName="TableCell";const xn=x.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:m("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));xn.displayName="TableCaption";const Oy=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:r,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=h.useCallback(d=>w=>{r==null||r(w?d:[])},[r]);return{finalColumns:h.useMemo(()=>n?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(p=>p.original).filter(p=>!(i!=null&&i(p))),f=l(w);return u?a.jsx("div",{}):a.jsx(qe,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:p=>{d.toggleAllRowsSelected(!!p),f(!!p)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>{const w=(i==null?void 0:i(d.original))??!1;return a.jsx(qe,{checked:d.getIsSelected(),disabled:w,onChange:f=>{w||d.toggleSelected(!!f)},"aria-label":String(d.original[o])})},filterable:!1,accessorKey:"select",size:s},...e]:e,[e,n,l,i,u])}};function qc({data:e,columns:t,rowSelection:n}){const{finalColumns:s}=Oy({columns:t,rowSelection:n}),r=h.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:s,rowSelectionState:r}}const $c=48,Hc="expander";function zc(e,t){return e?[{id:Hc,accessorKey:Hc,header:"",cell:({row:n})=>{const s=n.getIsExpanded();return a.jsx("button",{type:"button",className:"wu-inline-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-text-[10px]",onClick:()=>n.toggleExpanded(),"aria-label":s?"Collapse row":"Expand row",children:a.jsx("span",{className:m("wm-arrow-forward-ios wu-transition-all",s?"wu-rotate-90":"")})})},enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,enableHiding:!1,size:$c},...t]:t}function Fy(e,t){const n=t.map(s=>{var r;return(r=s.columnDef)==null?void 0:r.expandableRowContent}).find(s=>s);return n==null?void 0:n.call(null,e)}function Uc(e,t,n){return e===!0&&(!t||n>t)}const jc=(e,t)=>m("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),Gc=(e,t="default",n,s=!1)=>m("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left",s&&"wu-overflow-hidden"),Wy=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",Ly=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),By=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),qy=(e,t)=>m("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),$y=(e,t)=>m("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),Kc=({table:e,size:t,NoDataContent:n,isLoading:s,CustomLoader:r,isRowDisabled:o,isRowExpandable:i})=>{const u=e.getVisibleLeafColumns().length,l=e.getRowModel().rows;return s?a.jsx(vn,{children:a.jsx(at,{children:a.jsx(Bt,{colSpan:u,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:r??a.jsx(dt,{className:"wu-w-full"})})})}):l!=null&&l.length?a.jsx(vn,{children:l.flatMap((c,d)=>{const w=(o==null?void 0:o(c.original))??!1,f=c.getIsSelected(),p=c.getIsExpanded(),g=a.jsx(at,{"data-disabled":w,"data-state":f&&"selected",className:jc(f,w),"data-expanded":p,children:c.getVisibleCells().map((N,y)=>{const C=N.column.columnDef;return a.jsx(Bt,{className:Gc(N.column.id,t,C.cellAlign),children:Me.flexRender(C.cell,N.getContext())},`${N.id}-${y}`)})},`${c.id}-${d}`),b=i&&p?Fy(c,e.getVisibleLeafColumns()):null,v=b?a.jsx(at,{"data-expanded":"true","data-state":f&&"selected",children:a.jsx(Bt,{colSpan:u,children:b})},`${c.id}-expanded-${d}`):null;return v?[g,v]:[g]})}):a.jsx(vn,{children:a.jsx(at,{children:a.jsx(Bt,{colSpan:u,children:n})})})},ka=({table:e,sortableColumns:t,manual:n=!1,onSort:s,size:r,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:c})=>{var N;const d=r==="compact"?"wu-h-8":"wu-h-10",w=e.getVisibleLeafColumns(),f=y=>{const{id:C,columnDef:S,getIsSorted:T,toggleSorting:A}=y,D=S.header,k=S.headerAlign;if(!t.includes(C))return D;const M=T(),_=M==="asc",P=M==="desc",E=()=>{n?(A(!P),s==null||s({id:C,desc:P})):A(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:E,"aria-label":`Sort by ${D}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",By(k)),children:[D,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:$y(_,!!M)}),a.jsx("span",{className:qy(P,!!M)})]})]})},p=y=>y.column.id==="actions"?a.jsx(ms,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(ms,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",Ly(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:Me.flexRender(f(y.column),y.getContext())},y.id),g=()=>e.getHeaderGroups().map(y=>a.jsx(at,{className:"wu-relative",children:y.headers.map(p)},y.id)),b=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",d),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=w[0])==null?void 0:y.getSize(),marginLeft:c?$c:void 0},children:a.jsx(qe,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:C=>e.toggleAllRowsSelected(!!C),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},v=o&&i;if(l){const y=((N=e.getHeaderGroups()[0])==null?void 0:N.headers)??[];return a.jsxs(at,{className:"wu-relative",children:[y.map(p),v&&a.jsx(ms,{colSpan:w.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:b()})]})}return a.jsxs(Aa,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",d),children:[g(),v&&a.jsx("div",{className:m("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",d),children:b()})]})},Yc=h.forwardRef((e,t)=>a.jsx(vn,{...e,ref:t}));Yc.displayName="TableBodyComponent";const Xc=({table:e,size:t,isRowDisabled:n,containerHeight:s=600,sortableColumns:r,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l})=>{const c=e.getRowModel().rows,d=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ba.TableVirtuoso,{style:{height:s},totalCount:c.length,fixedHeaderContent:()=>a.jsx(ka,{table:e,sortableColumns:r,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:w=>{const f=c[w];return f?a.jsx(a.Fragment,{children:f.getVisibleCells().map((p,g)=>{const b=p.column.columnDef;return a.jsx(Bt,{className:Gc(p.column.id,t,b.cellAlign,!0),children:Me.flexRender(b.cell,p.getContext())},`${p.id}-${g}`)})}):null},components:{Table:({style:w,...f})=>a.jsxs("table",{...f,style:{...w,width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},className:"wu-table-fixed",children:[a.jsx("colgroup",{children:d.map(p=>a.jsx("col",{style:{width:`${p.getSize()}px`}},p.id))}),f.children]}),TableBody:Yc,TableHead:w=>a.jsx(Aa,{...w,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",Wy(t),w.className)}),TableRow:({...w})=>{const f=w["data-index"],p=c[f],g=p?(n==null?void 0:n(p.original))??!1:!1,b=(p==null?void 0:p.getIsSelected())??!1;return a.jsx(at,{...w,"data-disabled":g,"data-state":b&&"selected",className:jc(b,g)})}}})})},gs=Le.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),Hy=({data:e,columns:t,isLoading:n=!1,variant:s="unstyled",sort:r,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:c=!1,CustomLoader:d,caption:w,virtualization:f,isRowExpandable:p,...g})=>{var _,P;const[b,v]=h.useState({}),{finalColumns:N,rowSelectionState:y}=qc({data:e,columns:t,rowSelection:i}),C=h.useMemo(()=>N.filter(E=>E.enableSorting).map(E=>E.accessorKey),[N]),S=h.useMemo(()=>zc(p,N),[N,p]),T=((_=i==null?void 0:i.selectedRows)==null?void 0:_.length)??0,A=E=>{const O=typeof E=="function"?E(y):E,L=[],F=i==null?void 0:i.isRowDisabled;for(const B in O){if(!O[B])continue;const W=e[Number(B)];W&&(F!=null&&F(W)||L.push(W))}i==null||i.onRowSelect(L)},D=Me.useReactTable({data:e,columns:S,getCoreRowModel:Me.getCoreRowModel(),getPaginationRowModel:Me.getPaginationRowModel(),getExpandedRowModel:p?Me.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?E=>!i.isRowDisabled(E.original):!0,enableExpanding:!!p,state:{...i!=null&&i.isEnabled?{rowSelection:y}:{},...p?{expanded:b}:{}},onRowSelectionChange:A,...p?{onExpandedChange:v}:{}}),k=Uc(f==null?void 0:f.enabled,f==null?void 0:f.threshold,e.length),M=(f==null?void 0:f.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative"),children:k?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",gs({variant:s})),children:[w&&a.jsx(xn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(dt,{className:"wu-w-full"})}):(P=D.getRowModel().rows)!=null&&P.length?a.jsx(Xc,{table:D,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:M,sortableColumns:C,HeaderAction:u,isRowSelected:T>0,manual:!0,onSort:r==null?void 0:r.onSort}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(Da,{...g,className:m("wu-overflow-x-auto wu-w-full",gs({variant:s}),"wu-table-fixed",g.className),children:[w&&a.jsx(xn,{className:"wu-font-light",children:w}),a.jsx(ka,{table:D,sortableColumns:C,manual:!0,onSort:r==null?void 0:r.onSort,size:o,HeaderAction:u,isRowSelected:T>0,isStickyHeader:c,isRowExpandable:p}),a.jsx(Kc,{table:D,size:o,NoDataContent:l,CustomLoader:d,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:p})]})})},zy=({data:e,columns:t,variant:n="unstyled",size:s="default",sort:r,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:c,NoDataContent:d,isLoading:w,caption:f,rowSelection:p,isRowExpandable:g,virtualization:b,...v})=>{var G,Z;const[N,y]=h.useState((r==null?void 0:r.initial)||[]),[C,S]=h.useState([]),[T,A]=h.useState((i==null?void 0:i.pageIndex)??0),[D,k]=h.useState({}),{finalColumns:M,rowSelectionState:_}=qc({data:e,columns:t,rowSelection:p}),P=h.useMemo(()=>M.filter(U=>U.enableSorting).map(U=>U.accessorKey),[M]),E=h.useMemo(()=>M.filter(U=>U.filterable).map(U=>U.accessorKey),[M]),O=((G=p==null?void 0:p.selectedRows)==null?void 0:G.length)??0,L=h.useMemo(()=>zc(g,M),[M,g]),F=U=>{const J=typeof U=="function"?U(_):U,ie=[],fe=p==null?void 0:p.isRowDisabled;for(const Se in J){if(!J[Se])continue;const V=e[Number(Se)];V&&(fe!=null&&fe(V)||ie.push(V))}p==null||p.onRowSelect(ie)},B=Me.useReactTable({data:e,columns:L,getCoreRowModel:Me.getCoreRowModel(),getFilteredRowModel:Me.getFilteredRowModel(),getSortedRowModel:Me.getSortedRowModel(),getPaginationRowModel:i?Me.getPaginationRowModel():void 0,getExpandedRowModel:g?Me.getExpandedRowModel():void 0,enableRowSelection:p!=null&&p.isRowDisabled?U=>!p.isRowDisabled(U.original):!0,enableExpanding:!!g,state:{sorting:N,columnFilters:C,...i?{pagination:i}:{},...p!=null&&p.isEnabled?{rowSelection:_}:{},...g?{expanded:D}:{}},onSortingChange:y,onColumnFiltersChange:S,onRowSelectionChange:F,...g?{onExpandedChange:k}:{}});h.useEffect(()=>{E.forEach(U=>{var J;(J=B.getColumn(U))==null||J.setFilterValue(o)})},[o,E,B]),h.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==T&&(p==null||p.onRowSelect(()=>[]),B.resetRowSelection(),A(i.pageIndex))},[i==null?void 0:i.pageIndex]);const W=Uc(b==null?void 0:b.enabled,b==null?void 0:b.threshold,e.length),$=(b==null?void 0:b.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:W?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",gs({variant:n})),children:[f&&a.jsx(xn,{children:f}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(dt,{className:"wu-w-full"})}):(Z=B.getRowModel().rows)!=null&&Z.length?a.jsx(Xc,{table:B,size:s,isRowDisabled:p==null?void 0:p.isRowDisabled,containerHeight:$,sortableColumns:P,HeaderAction:l,isRowSelected:O>0}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:d})]}):a.jsxs(Da,{...v,className:m("wu-overflow-x-auto wu-w-full",gs({variant:n}),"wu-table-fixed",v.className),children:[f&&a.jsx(xn,{children:f}),a.jsx(ka,{table:B,sortableColumns:P,size:s,HeaderAction:l,isRowSelected:O>0,isStickyHeader:u,isRowExpandable:g}),a.jsx(Kc,{table:B,size:s,NoDataContent:d,CustomLoader:c,isLoading:w,isRowDisabled:p==null?void 0:p.isRowDisabled,isRowExpandable:g})]})})},Zc=x.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:m("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}));Zc.displayName="Textarea";const Jc=h.forwardRef((e,t)=>{const{Label:n,id:s=Ds(),variant:r="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,c=w=>{l.onChange&&l.onChange(w)},d=Dn(u);return a.jsxs("div",{className:m(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(Zc,{...l,ref:t,id:s,className:m("wu-peer wu-rounded-t-sm",r==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:c,readOnly:o,maxLength:i}),n&&a.jsx(Ae,{htmlFor:s,className:"wu-textarea-label",children:n})]})});Jc.displayName="WuTextarea";function Uy(e){if(typeof e=="string"&&e.includes("T")){const t=z.parseISO(e);return z.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=z.parse(e,"HH:mm:ss",new Date);return z.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Qc=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Rc=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),ed=["am","pm"],bs=50;function jy(e){return Array(bs).fill(e).flat()}function _a(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function Gy(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 td(e){const t=Number(e),n=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:n}}const Ky=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:m("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}),Pa=({values:e,selectedValue:t,scrollRef:n,onSelect:s,repeatItems:r=!0,className:o})=>a.jsx("div",{ref:n,className:m("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:(r?jy(e):e).map((i,u)=>a.jsx(Ky,{value:i,isSelected:i===t,onClick:()=>s(i)},`${i}-${u}`))});function Yy(e,t,n,s){const r=h.useMemo(()=>e?_a(Qc,t.padStart(2,"0")):Qc,[e]),o=h.useMemo(()=>e?_a(Rc,n.padStart(2,"0")):Rc,[e]),i=h.useMemo(()=>e?_a(ed,s):ed,[e]);return{rotatedHours:r,rotatedMinutes:o,rotatedMeridiem:i}}function Xy(e,t,n){h.useEffect(()=>{function s(i){if(i){const u=i.scrollHeight/bs,l=Math.floor(bs/2);i.scrollTop=l*u;const c=()=>{const{scrollTop:d}=i,w=Math.round(d/u);(w<=1||w>=bs-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",c),()=>{i.removeEventListener("scroll",c)}}}if(!e)return;const r=s(t.current),o=s(n.current);return()=>{r==null||r(),o==null||o()}},[e,t,n])}const nd=({className:e,time:t,Label:n,labelPosition:s,dir:r,...o})=>{const[i,u]=h.useState(!1),[l,c]=h.useState(""),d=h.useRef(null),w=h.useRef(null),f=h.useRef(null),p=h.useRef(null),[g,b]=h.useState("12"),[v,N]=h.useState("00"),[y,C]=h.useState("am");h.useEffect(()=>{if(!t){c(""),b("12"),N("00"),C("am"),d.current&&(d.current.value="");return}const k=Uy(t);c(k);const[M,_]=k.split(":"),{hour:P,meridiem:E}=td(M);b(P),N(_),C(E),d.current&&(d.current.value=k)},[t]),h.useEffect(()=>{const k=M=>{w.current&&!w.current.contains(M.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),Xy(i,f,p);const{rotatedHours:S,rotatedMinutes:T,rotatedMeridiem:A}=Yy(i,g,v,y),D=h.useCallback((k,M,_)=>{const P=k??g,E=M??v,O=_??y;b(P),N(E),C(O);const L=`${Gy(P,O)}:${E}`;c(L)},[g,v,y]);return a.jsxs("div",{className:m("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:r,children:[n&&a.jsx(Ae,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:m("relative inline-block"),ref:w,dir:r,children:[a.jsx(Qe,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{c(k.target.value);const[M,_]=k.target.value.split(":"),{hour:P,meridiem:E}=td(M);b(P),N(_),C(E)},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(Pe,{icon:"wm-schedule",className:m("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:r,...o}),a.jsx("style",{children:`
19
19
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
20
- `}),i&&a.jsxs("div",{className:p("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(Pa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:f,onSelect:E=>k(E,v),className:"wu-time-hour-picker"}),a.jsx(Pa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:m,onSelect:E=>k(g,E),className:"wu-time-minute-picker"}),a.jsx(Pa,{values:A,selectedValue:N,onSelect:E=>k(void 0,void 0,E),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Jc.displayName="WuTimePicker";const Uy=1,jy=1e6;let Va=0;function Gy(){return Va=(Va+1)%Number.MAX_SAFE_INTEGER,Va.toString()}const Oa=new Map,Qc=e=>{if(Oa.has(e))return;const t=setTimeout(()=>{Oa.delete(e),Sn({type:"REMOVE_TOAST",toastId:e})},jy);Oa.set(e,t)},Ky=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Uy)};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?Qc(n):e.toasts.forEach(s=>{Qc(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ys=[];let vs={toasts:[]};function Sn(e){vs=Ky(vs,e),ys.forEach(t=>{t(vs)})}function Rc({...e}){const t=Gy(),n=r=>Sn({type:"UPDATE_TOAST",toast:{...r,id:t}}),s=()=>Sn({type:"DISMISS_TOAST",toastId:t});return Sn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||s()}}}),{id:t,dismiss:s,update:n}}function Yy(){const[e,t]=h.useState(vs);return h.useEffect(()=>(ys.push(t),()=>{const n=ys.indexOf(t);n>-1&&ys.splice(n,1)}),[e]),{...e,toast:Rc,dismiss:n=>Sn({type:"DISMISS_TOAST",toastId:n})}}const Xy=()=>({showToast:({message:t,variant:n,duration:s,position:r})=>Rc({description:t,variant:n,duration:s,position:r})}),Zy=Ce.Provider,Jy=Fe.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"}}),ed=x.forwardRef(({className:e,position:t,...n},s)=>a.jsx(Ce.Viewport,{ref:s,className:p(Jy({position:t}),e),...n}));ed.displayName=Ce.Viewport.displayName;const Qy=Fe.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"}}),td=x.forwardRef(({className:e,variant:t,position:n,...s},r)=>a.jsx(Ce.Root,{ref:r,className:p(Qy({variant:t,position:n}),e),...s}));td.displayName=Ce.Root.displayName;const Ry=x.forwardRef(({className:e,...t},n)=>a.jsx(Ce.Action,{ref:n,className:p("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}));Ry.displayName=Ce.Action.displayName;const nd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ce.Close,{ref:n,className:p("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"})}));nd.displayName=Ce.Close.displayName;const sd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ce.Title,{ref:n,className:p("wu-text-sm wu-font-semibold",e),...t}));sd.displayName=Ce.Title.displayName;const rd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ce.Description,{ref:n,className:p("wu-text-sm wu-opacity-90",e),...t}));rd.displayName=Ce.Description.displayName;function ev(){const{toasts:e}=Yy(),t=e.reduce((n,s)=>{const r=s.position||"top";return n[r]||(n[r]=[]),n[r].push(s),n},{});return a.jsx(Zy,{children:Object.entries(t).map(([n,s])=>a.jsx(ed,{position:n,children:s.map(function({id:r,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(td,{variant:l||"success",position:c,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(sd,{children:o}),i&&a.jsxs(rd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(De,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(nd,{})]},r)})},n))})}const tv=()=>a.jsx(ev,{}),ad=x.forwardRef(({className:e,dir:t,...n},s)=>a.jsx(Is.Root,{className:p("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:s,children:a.jsx(Is.Thumb,{className:p("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")})}));ad.displayName=Is.Root.displayName;const od=h.forwardRef((e,t)=>{const{Label:n,labelPosition:s="right",onChange:r,className:o,dir:i,disabled:u,id:l=Ds(),...c}=e;return h.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:p(nv({labelPosition:s}),"wu-toggle-container"),dir:i,children:[a.jsx(ad,{...c,id:l,disabled:u,ref:t,onCheckedChange:r,className:p("wu-peer",o),dir:i}),a.jsx(Ee,{htmlFor:l,className:"wu-toggle-label",children:n})]})});od.displayName="WuToggle";const nv=Fe.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"}}}),xs=h.createContext(null),sv=()=>{const e=h.useContext(xs);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},rv=()=>{const e=h.useContext(xs);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},av=({children:e})=>{const[t,n]=h.useState({}),[s,r]=h.useState({}),o=h.useCallback(async(c,d)=>{try{const f=await(await fetch(c)).json();n(f)}catch(w){console.error("Failed to load translations:",w),d&&n(d)}d&&r(d)},[]),i=h.useCallback(c=>{r(c)},[]),u=h.useCallback(()=>({t:(d,w)=>t[d]?t[d]:s[d]?s[d]:w||d}),[t,s]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(xs.Provider,{value:l,children:e})},ov={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"}},id=h.createContext({dictionary:{},setDictionary:()=>{}}),ud=()=>{const e=h.useContext(id);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},iv=({children:e,dictionary:t={}})=>{const[n,s]=h.useState(t),r=h.useMemo(()=>({dictionary:n,setDictionary:s}),[n]);return a.jsx(id.Provider,{value:r,children:e})},ld=h.memo(({__i18nKey:e,children:t})=>{const{dictionary:n}=ud();return a.jsx(a.Fragment,{children:n[e]??t??e})});ld.displayName="WuTranslate",window&&(window.wickUiVersion="1.33.0",window.wickUiIcon="9.0.0",window.wickUiEditor="0.12.1"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=ov,I.WuAccordion=kd,I.WuActivityLog=Vd,I.WuAppHeader=tw,I.WuAppHeaderAccount=Ka,I.WuAppHeaderBar=Qa,I.WuAppHeaderHelp=Ya,I.WuAppHeaderMenu=Ja,I.WuAppHeaderSearch=Rd,I.WuButton=Te,I.WuCalender=qs,I.WuCard=Lo,I.WuCardFooter=qo,I.WuCardHeader=Bo,I.WuCheckbox=Be,I.WuChip=rf,I.WuCombobox=pf,I.WuCopyToClipboard=hf,I.WuDataTable=Fy,I.WuDatePicker=iw,I.WuDateRangePicker=nf,I.WuDisplay=jd,I.WuDrawer=Nf,I.WuDrawerClose=Sf,I.WuDrilldown=Cg,I.WuFooter=rl,I.WuFormGroup=ow,I.WuHeading=zd,I.WuHelpButton=al,I.WuIcon=De,I.WuInput=Qe,I.WuInputError=sw,I.WuInputHint=rw,I.WuLabel=Ee,I.WuListbox=il,I.WuLoader=ct,I.WuMenu=ia,I.WuMenuCheckboxItem=pg,I.WuMenuIcon=ua,I.WuMenuItem=us,I.WuMenuItemGroup=hg,I.WuMenuRadioItem=mg,I.WuMenuSeparatorItem=gg,I.WuModal=$g,I.WuModalClose=jg,I.WuModalContent=Hg,I.WuModalFooter=Ug,I.WuModalHeader=zg,I.WuMonthPicker=Zg,I.WuPagination=xl,I.WuPopover=Qw,I.WuPopoverClose=tr,I.WuPrimaryNavbar=Qg,I.WuRadioGroup=Tl,I.WuScrollArea=eb,I.WuSecondaryNavbar=Rg,I.WuSelect=bl,I.WuSharedSurvey=Cc,I.WuSidebar=Db,I.WuSidebarCollapsibleMenu=Vb,I.WuSidebarContent=Ab,I.WuSidebarFooter=kb,I.WuSidebarGroup=_b,I.WuSidebarItem=Jl,I.WuSidebarMenu=Pb,I.WuSidebarTrigger=Zl,I.WuSpotlight=fl,I.WuStackedCard=Wb,I.WuStackedCardOverlay=Lb,I.WuStepper=yy,I.WuSubMenu=bg,I.WuSubtext=Ud,I.WuSurveyItem=Tc,I.WuSurveyList=Ec,I.WuSurveySelect=Mc,I.WuSurveySource=Ny,I.WuSwitcher=Vc,I.WuTab=My,I.WuTable=Wy,I.WuText=Hd,I.WuTextarea=Gc,I.WuTimePicker=Jc,I.WuToast=tv,I.WuToggle=od,I.WuTooltip=kn,I.WuTranslate=ld,I.WuTranslateProvider=iv,I.WuTranslationContext=xs,I.WuTranslationProvider=av,I.WuTruncatedLabel=ew,I.WuVirtualScroll=It,I.calculatePosition=Fb,I.useTranslation=sv,I.useTranslationsContext=rv,I.useWickuiTranslate=ud,I.useWuShowToast=Xy,I.useWuSidebar=rt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
20
+ `}),i&&a.jsxs("div",{className:m("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(Pa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:f,onSelect:k=>D(k,v),className:"wu-time-hour-picker"}),a.jsx(Pa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:p,onSelect:k=>D(g,k),className:"wu-time-minute-picker"}),a.jsx(Pa,{values:A,selectedValue:y,onSelect:k=>D(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};nd.displayName="WuTimePicker";const Zy=1,Jy=1e6;let Va=0;function Qy(){return Va=(Va+1)%Number.MAX_SAFE_INTEGER,Va.toString()}const Oa=new Map,sd=e=>{if(Oa.has(e))return;const t=setTimeout(()=>{Oa.delete(e),Nn({type:"REMOVE_TOAST",toastId:e})},Jy);Oa.set(e,t)},Ry=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Zy)};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?sd(n):e.toasts.forEach(s=>{sd(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ys=[];let vs={toasts:[]};function Nn(e){vs=Ry(vs,e),ys.forEach(t=>{t(vs)})}function rd({...e}){const t=Qy(),n=r=>Nn({type:"UPDATE_TOAST",toast:{...r,id:t}}),s=()=>Nn({type:"DISMISS_TOAST",toastId:t});return Nn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||s()}}}),{id:t,dismiss:s,update:n}}function ev(){const[e,t]=h.useState(vs);return h.useEffect(()=>(ys.push(t),()=>{const n=ys.indexOf(t);n>-1&&ys.splice(n,1)}),[e]),{...e,toast:rd,dismiss:n=>Nn({type:"DISMISS_TOAST",toastId:n})}}const tv=()=>({showToast:({message:t,variant:n,duration:s,position:r})=>rd({description:t,variant:n,duration:s,position:r})}),nv=Ie.Provider,sv=Le.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"}}),ad=x.forwardRef(({className:e,position:t,...n},s)=>a.jsx(Ie.Viewport,{ref:s,className:m(sv({position:t}),e),...n}));ad.displayName=Ie.Viewport.displayName;const rv=Le.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"}}),od=x.forwardRef(({className:e,variant:t,position:n,...s},r)=>a.jsx(Ie.Root,{ref:r,className:m(rv({variant:t,position:n}),e),...s}));od.displayName=Ie.Root.displayName;const av=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Action,{ref:n,className:m("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}));av.displayName=Ie.Action.displayName;const id=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Close,{ref:n,className:m("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"})}));id.displayName=Ie.Close.displayName;const ud=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));ud.displayName=Ie.Title.displayName;const ld=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));ld.displayName=Ie.Description.displayName;function ov(){const{toasts:e}=ev(),t=e.reduce((n,s)=>{const r=s.position||"top";return n[r]||(n[r]=[]),n[r].push(s),n},{});return a.jsx(nv,{children:Object.entries(t).map(([n,s])=>a.jsx(ad,{position:n,children:s.map(function({id:r,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(od,{variant:l||"success",position:c,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(ud,{children:o}),i&&a.jsxs(ld,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(id,{})]},r)})},n))})}const iv=()=>a.jsx(ov,{}),cd=x.forwardRef(({className:e,dir:t,...n},s)=>a.jsx(Ms.Root,{className:m("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:s,children:a.jsx(Ms.Thumb,{className:m("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")})}));cd.displayName=Ms.Root.displayName;const dd=h.forwardRef((e,t)=>{const{Label:n,labelPosition:s="right",onChange:r,className:o,dir:i,disabled:u,id:l=Ds(),...c}=e;return h.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:m(uv({labelPosition:s}),"wu-toggle-container"),dir:i,children:[a.jsx(cd,{...c,id:l,disabled:u,ref:t,onCheckedChange:r,className:m("wu-peer",o),dir:i}),a.jsx(Ae,{htmlFor:l,className:"wu-toggle-label",children:n})]})});dd.displayName="WuToggle";const uv=Le.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"}}}),xs=h.createContext(null),lv=()=>{const e=h.useContext(xs);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},cv=()=>{const e=h.useContext(xs);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},dv=({children:e})=>{const[t,n]=h.useState({}),[s,r]=h.useState({}),o=h.useCallback(async(c,d)=>{try{const f=await(await fetch(c)).json();n(f)}catch(w){console.error("Failed to load translations:",w),d&&n(d)}d&&r(d)},[]),i=h.useCallback(c=>{r(c)},[]),u=h.useCallback(()=>({t:(d,w)=>t[d]?t[d]:s[d]?s[d]:w||d}),[t,s]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(xs.Provider,{value:l,children:e})},wv={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"}},wd=h.createContext(null),fd=()=>{const e=h.useContext(wd);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},fv=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:s="./wick-ui-i18n.json"})=>{const[r,o]=h.useState(t),[i,u]=h.useState({}),[l,c]=h.useState(!0);h.useEffect(()=>{const w=new AbortController;return(async()=>{c(!0);try{const p=await fetch(s,{signal:w.signal});if(!p.ok)throw new Error("Failed to fetch translation keys");const g=await p.json(),b=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:g,code:r}),signal:w.signal});if(!b.ok)throw new Error("Failed to fetch dictionary");const v=await b.json();u(v)}catch(p){p.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",p),u({}))}finally{c(!1)}})(),()=>{w.abort()}},[r,n,s]);const d=h.useMemo(()=>({dictionary:i,locale:r,setLocale:o,isLoading:l}),[i,r,l]);return a.jsx(wd.Provider,{value:d,children:e})},pd=h.memo(({__i18nKey:e})=>{const{dictionary:t}=fd();return a.jsx(a.Fragment,{children:t[e]??e})});pd.displayName="WuTranslate",window&&(window.wickUiVersion="1.34.0",window.wickUiIcon="9.0.0",window.wickUiEditor="0.12.1"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=wv,I.WuAccordion=Fd,I.WuActivityLog=Bd,I.WuAppHeader=ow,I.WuAppHeaderAccount=Ka,I.WuAppHeaderBar=Qa,I.WuAppHeaderHelp=Ya,I.WuAppHeaderMenu=Ja,I.WuAppHeaderSearch=rw,I.WuButton=De,I.WuCalender=qs,I.WuCard=Lo,I.WuCardFooter=qo,I.WuCardHeader=Bo,I.WuCheckbox=qe,I.WuChip=cf,I.WuCombobox=yf,I.WuCopyToClipboard=vf,I.WuDataTable=Hy,I.WuDatePicker=ww,I.WuDateRangePicker=uf,I.WuDisplay=Zd,I.WuDrawer=Mf,I.WuDrawerClose=If,I.WuDrilldown=Dg,I.WuFooter=al,I.WuFormGroup=dw,I.WuHeading=Yd,I.WuHelpButton=ol,I.WuIcon=Pe,I.WuInput=Qe,I.WuInputError=uw,I.WuInputHint=lw,I.WuLabel=Ae,I.WuListbox=ul,I.WuLoader=dt,I.WuMenu=ia,I.WuMenuCheckboxItem=yg,I.WuMenuIcon=ua,I.WuMenuItem=us,I.WuMenuItemGroup=vg,I.WuMenuRadioItem=xg,I.WuMenuSeparatorItem=Ng,I.WuModal=Gg,I.WuModalClose=Zg,I.WuModalContent=Kg,I.WuModalFooter=Xg,I.WuModalHeader=Yg,I.WuMonthPicker=tb,I.WuPagination=Nl,I.WuPopover=sf,I.WuPopoverClose=tr,I.WuPrimaryNavbar=sb,I.WuRadioGroup=El,I.WuScrollArea=ab,I.WuSecondaryNavbar=rb,I.WuSelect=yl,I.WuSharedSurvey=Tc,I.WuSidebar=Vb,I.WuSidebarCollapsibleMenu=Bb,I.WuSidebarContent=Ob,I.WuSidebarFooter=Fb,I.WuSidebarGroup=Wb,I.WuSidebarItem=Ql,I.WuSidebarMenu=Lb,I.WuSidebarTrigger=Jl,I.WuSpotlight=pl,I.WuStackedCard=Hb,I.WuStackedCardOverlay=zb,I.WuStepper=Cy,I.WuSubMenu=Sg,I.WuSubtext=Xd,I.WuSurveyItem=Ec,I.WuSurveyList=Mc,I.WuSurveySelect=Dc,I.WuSurveySource=My,I.WuSwitcher=Oc,I.WuTab=Py,I.WuTable=zy,I.WuText=Kd,I.WuTextarea=Jc,I.WuTimePicker=nd,I.WuToast=iv,I.WuToggle=dd,I.WuTooltip=An,I.WuTranslate=pd,I.WuTranslateProvider=fv,I.WuTranslationContext=xs,I.WuTranslationProvider=dv,I.WuTruncatedLabel=aw,I.WuVirtualScroll=Mt,I.calculatePosition=$b,I.useTranslation=lv,I.useTranslationsContext=cv,I.useWickuiTranslate=fd,I.useWuShowToast=tv,I.useWuSidebar=rt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
21
21
  //# sourceMappingURL=index.js.map